Source_Code
stringlengths 69
484k
| IR_Original
stringlengths 2.05k
17.9M
|
---|---|
#include <stdio.h>
int main(void) {
char grid[52][52];
int h, w, i, j, cnt=0;
scanf("%d %d", &h, &w);
for(i=1; i<=h; i++)
scanf("%s", &grid[i]);
for(i=1; i<=h; i++) {
for(j=1; j<=w; j++) {
if(grid[i][j]=='#') {
if(grid[i][j]!=grid[i][j-1] && grid[i][j]!=grid[i-1][j] && grid[i][j]!=grid[i][j+1] && grid[i][j]!=grid[i+1][j])
cnt++;
}
}
}
if(cnt>0)
printf("No");
else
printf("Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336428/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336428/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%grid = alloca [52 x [52 x i8]], align 16
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2704, ptr nonnull %grid) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = 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
%cmp.not105 = icmp slt i32 %0, 1
br i1 %cmp.not105, label %if.else, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not111 = icmp slt i32 %4, 1
br i1 %cmp3.not111, label %if.else, label %for.cond5.preheader.lr.ph
for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp6.not107 = icmp slt i32 %1, 1
br i1 %cmp6.not107, label %if.else, label %for.cond5.preheader.preheader
for.cond5.preheader.preheader: ; preds = %for.cond5.preheader.lr.ph
%2 = add nuw i32 %1, 1
%3 = add nuw i32 %4, 1
%wide.trip.count127 = zext i32 %3 to i64
%wide.trip.count = zext i32 %2 to i64
br label %for.cond5.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [52 x [52 x i8]], ptr %grid, 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
%4 = load i32, ptr %h, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %5
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.cond5.for.inc72_crit_edge
%indvars.iv123 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next124, %for.cond5.for.inc72_crit_edge ]
%cnt.0113 = phi i32 [ 0, %for.cond5.preheader.preheader ], [ %cnt.2, %for.cond5.for.inc72_crit_edge ]
%6 = add nsw i64 %indvars.iv123, -1
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%idxprom59 = and i64 %indvars.iv.next124, 4294967295
br label %for.body7
for.body7: ; preds = %for.cond5.preheader, %for.inc69
%indvars.iv118 = phi i64 [ 1, %for.cond5.preheader ], [ %indvars.iv.next119, %for.inc69 ]
%cnt.1109 = phi i32 [ %cnt.0113, %for.cond5.preheader ], [ %cnt.2, %for.inc69 ]
%arrayidx11 = getelementptr inbounds [52 x [52 x i8]], ptr %grid, i64 0, i64 %indvars.iv123, i64 %indvars.iv118
%7 = load i8, ptr %arrayidx11, align 1, !tbaa !11
%cmp12 = icmp eq i8 %7, 35
br i1 %cmp12, label %if.then, label %for.inc69
if.then: ; preds = %for.body7
%8 = add nsw i64 %indvars.iv118, -1
%arrayidx22 = getelementptr inbounds [52 x [52 x i8]], ptr %grid, i64 0, i64 %indvars.iv123, i64 %8
%9 = load i8, ptr %arrayidx22, align 1, !tbaa !11
%cmp24.not = icmp eq i8 %9, 35
br i1 %cmp24.not, label %for.inc69, label %land.lhs.true
land.lhs.true: ; preds = %if.then
%arrayidx35 = getelementptr inbounds [52 x [52 x i8]], ptr %grid, i64 0, i64 %6, i64 %indvars.iv118
%10 = load i8, ptr %arrayidx35, align 1, !tbaa !11
%cmp37.not = icmp eq i8 %10, 35
br i1 %cmp37.not, label %for.inc69, label %land.lhs.true39
land.lhs.true39: ; preds = %land.lhs.true
%11 = add nuw i64 %indvars.iv118, 1
%idxprom47 = and i64 %11, 4294967295
%arrayidx48 = getelementptr inbounds [52 x [52 x i8]], ptr %grid, i64 0, i64 %indvars.iv123, i64 %idxprom47
%12 = load i8, ptr %arrayidx48, align 1, !tbaa !11
%cmp50.not = icmp eq i8 %12, 35
br i1 %cmp50.not, label %for.inc69, label %land.lhs.true52
land.lhs.true52: ; preds = %land.lhs.true39
%arrayidx62 = getelementptr inbounds [52 x [52 x i8]], ptr %grid, i64 0, i64 %idxprom59, i64 %indvars.iv118
%13 = load i8, ptr %arrayidx62, align 1, !tbaa !11
%cmp64.not = icmp ne i8 %13, 35
%inc67 = zext i1 %cmp64.not to i32
%spec.select = add nsw i32 %cnt.1109, %inc67
br label %for.inc69
for.inc69: ; preds = %land.lhs.true52, %for.body7, %land.lhs.true39, %land.lhs.true, %if.then
%cnt.2 = phi i32 [ %cnt.1109, %land.lhs.true39 ], [ %cnt.1109, %land.lhs.true ], [ %cnt.1109, %if.then ], [ %cnt.1109, %for.body7 ], [ %spec.select, %land.lhs.true52 ]
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%exitcond.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count
br i1 %exitcond.not, label %for.cond5.for.inc72_crit_edge, label %for.body7, !llvm.loop !12
for.cond5.for.inc72_crit_edge: ; preds = %for.inc69
%exitcond128.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count127
br i1 %exitcond128.not, label %for.end74, label %for.cond5.preheader, !llvm.loop !13
for.end74: ; preds = %for.cond5.for.inc72_crit_edge
%14 = icmp sgt i32 %cnt.2, 0
br i1 %14, label %if.end80, label %if.else
if.else: ; preds = %entry, %for.cond5.preheader.lr.ph, %for.cond2.preheader, %for.end74
br label %if.end80
if.end80: ; preds = %for.end74, %if.else
%.str.3.sink = phi ptr [ @.str.3, %if.else ], [ @.str.2, %for.end74 ]
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 2704, ptr nonnull %grid) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define MAX_HW 50
int main(void)
{
int h, w;
char s[MAX_HW][MAX_HW+1];
int i, j;
scanf("%d %d", &h, &w);
for(i=0; i<h; i++)
scanf("%s", s[i]);
for(i=0; i<h; i++)
for(j=0; j<w; j++){
if(s[i][j] == '.')
continue;
else if( s[i-1][j] == '#' && (i-1)>=0 )
continue;
else if( s[i][j+1] == '#' && (j+1)<w )
continue;
else if( s[i+1][j] == '#' && (i+1)<h )
continue;
else if( s[i][j-1] == '#' && (j-1)>=0 )
continue;
printf("No");
return 0;
}
printf("Yes");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336471/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336471/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%s = alloca [50 x [51 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 2550, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4
%cmp104 = icmp sgt i32 %0, 0
br i1 %cmp104, label %for.body, label %cleanup
for.cond2.preheader: ; preds = %for.body
%cmp3108 = icmp sgt i32 %17, 0
br i1 %cmp3108, label %for.cond5.preheader.lr.ph, label %cleanup
for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %w, align 4
%cmp6106 = icmp sgt i32 %1, 0
br i1 %cmp6106, label %for.cond5.preheader.us.preheader, label %cleanup
for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph
%2 = zext i32 %1 to i64
%3 = zext i32 %17 to i64
%wide.trip.count159 = zext i32 %17 to i64
%wide.trip.count = zext i32 %1 to i64
%wide.trip.count153 = zext i32 %1 to i64
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc74_crit_edge.us
%indvars.iv155 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next156, %for.cond5.for.inc74_crit_edge.us ]
%4 = add nsw i64 %indvars.iv155, -1
%cmp22.not.us = icmp eq i64 %indvars.iv155, 0
%indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
%cmp49.us = icmp ult i64 %indvars.iv.next156, %3
br i1 %cmp22.not.us, label %for.body7.us.us, label %for.body7.us110
for.body7.us110: ; preds = %for.cond5.preheader.us, %for.inc71.us133
%indvars.iv143 = phi i64 [ %indvars.iv.next144, %for.inc71.us133 ], [ 0, %for.cond5.preheader.us ]
%arrayidx11.us113 = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %indvars.iv155, i64 %indvars.iv143
%5 = load i8, ptr %arrayidx11.us113, align 1, !tbaa !5
%cmp12.us114 = icmp eq i8 %5, 46
br i1 %cmp12.us114, label %for.inc71.us133, label %if.else.us115
if.else.us115: ; preds = %for.body7.us110
%arrayidx17.us = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %4, i64 %indvars.iv143
%6 = load i8, ptr %arrayidx17.us, align 1, !tbaa !5
%cmp19.us.not = icmp eq i8 %6, 35
br i1 %cmp19.us.not, label %for.inc71.us133, label %if.else25.us
if.else25.us: ; preds = %if.else.us115
%7 = add nuw nsw i64 %indvars.iv143, 1
%arrayidx29.us118 = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %indvars.iv155, i64 %7
%8 = load i8, ptr %arrayidx29.us118, align 1, !tbaa !5
%cmp31.us119 = icmp eq i8 %8, 35
%cmp35.us120 = icmp ult i64 %7, %2
%or.cond101.us121 = and i1 %cmp35.us120, %cmp31.us119
br i1 %or.cond101.us121, label %for.inc71.us133, label %if.else38.us122
if.else38.us122: ; preds = %if.else25.us
%arrayidx43.us123 = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %indvars.iv.next156, i64 %indvars.iv143
%9 = load i8, ptr %arrayidx43.us123, align 1, !tbaa !5
%cmp45.us124 = icmp eq i8 %9, 35
%or.cond102.us125 = and i1 %cmp49.us, %cmp45.us124
br i1 %or.cond102.us125, label %for.inc71.us133, label %if.else52.us126
if.else52.us126: ; preds = %if.else38.us122
%10 = add nsw i64 %indvars.iv143, -1
%arrayidx57.us129 = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %indvars.iv155, i64 %10
%11 = load i8, ptr %arrayidx57.us129, align 1, !tbaa !5
%cmp59.us130 = icmp ne i8 %11, 35
%cmp63.not.us131 = icmp eq i64 %indvars.iv143, 0
%or.cond103.us132 = or i1 %cmp63.not.us131, %cmp59.us130
br i1 %or.cond103.us132, label %cleanup, label %for.inc71.us133
for.inc71.us133: ; preds = %if.else52.us126, %if.else38.us122, %if.else25.us, %if.else.us115, %for.body7.us110
%indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
%exitcond.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count
br i1 %exitcond.not, label %for.cond5.for.inc74_crit_edge.us, label %for.body7.us110, !llvm.loop !8
for.cond5.for.inc74_crit_edge.us: ; preds = %for.inc71.us133, %for.inc71.us.us
%exitcond160.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count159
br i1 %exitcond160.not, label %cleanup, label %for.cond5.preheader.us, !llvm.loop !10
for.body7.us.us: ; preds = %for.cond5.preheader.us, %for.inc71.us.us
%indvars.iv148 = phi i64 [ %.pre, %for.inc71.us.us ], [ 0, %for.cond5.preheader.us ]
%arrayidx11.us.us = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 0, i64 %indvars.iv148
%12 = load i8, ptr %arrayidx11.us.us, align 1, !tbaa !5
%cmp12.us.us = icmp eq i8 %12, 46
%.pre = add nuw nsw i64 %indvars.iv148, 1
br i1 %cmp12.us.us, label %for.inc71.us.us, label %if.else.us.us
if.else.us.us: ; preds = %for.body7.us.us
%arrayidx29.us.us = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 0, i64 %.pre
%13 = load i8, ptr %arrayidx29.us.us, align 1, !tbaa !5
%cmp31.us.us = icmp eq i8 %13, 35
%cmp35.us.us = icmp ult i64 %.pre, %2
%or.cond101.us.us = and i1 %cmp35.us.us, %cmp31.us.us
br i1 %or.cond101.us.us, label %for.inc71.us.us, label %if.else38.us.us
if.else38.us.us: ; preds = %if.else.us.us
%arrayidx43.us.us = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 %indvars.iv.next156, i64 %indvars.iv148
%14 = load i8, ptr %arrayidx43.us.us, align 1, !tbaa !5
%cmp45.us.us = icmp eq i8 %14, 35
%or.cond102.us.us = and i1 %cmp49.us, %cmp45.us.us
br i1 %or.cond102.us.us, label %for.inc71.us.us, label %if.else52.us.us
if.else52.us.us: ; preds = %if.else38.us.us
%15 = add nsw i64 %indvars.iv148, -1
%arrayidx57.us.us = getelementptr inbounds [50 x [51 x i8]], ptr %s, i64 0, i64 0, i64 %15
%16 = load i8, ptr %arrayidx57.us.us, align 1, !tbaa !5
%cmp59.us.us = icmp ne i8 %16, 35
%cmp63.not.us.us = icmp eq i64 %indvars.iv148, 0
%or.cond103.us.us = or i1 %cmp63.not.us.us, %cmp59.us.us
br i1 %or.cond103.us.us, label %cleanup, label %for.inc71.us.us
for.inc71.us.us: ; preds = %for.body7.us.us, %if.else52.us.us, %if.else38.us.us, %if.else.us.us
%exitcond154.not = icmp eq i64 %.pre, %wide.trip.count153
br i1 %exitcond154.not, label %for.cond5.for.inc74_crit_edge.us, label %for.body7.us.us, !llvm.loop !8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x [51 x i8]], ptr %s, 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
%17 = load i32, ptr %h, align 4
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11
cleanup: ; preds = %for.cond5.for.inc74_crit_edge.us, %if.else52.us126, %if.else52.us.us, %for.cond2.preheader, %for.cond5.preheader.lr.ph, %entry
%.str.3.sink = phi ptr [ @.str.3, %entry ], [ @.str.3, %for.cond5.preheader.lr.ph ], [ @.str.3, %for.cond2.preheader ], [ @.str.2, %if.else52.us.us ], [ @.str.2, %if.else52.us126 ], [ @.str.3, %for.cond5.for.inc74_crit_edge.us ]
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 2550, ptr nonnull %s) #3
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
|
#include <stdio.h>
int main() {
int n,i,s,e,j;
while(1) {
scanf("%d",&n);
if(n==0) break;
for(i=0;i<n;i++) {
scanf("%d %d %d",&s,&e,&j);
if(s == 100 || e == 100 || j == 100) printf("A\n");
else if((s+e)/2 >= 90) printf("A\n");
else if((s+e+j)/3 >=80) printf("A\n");
else if((s+e+j)/3 >= 70) printf("B\n");
else if((s+e+j)/3 >=50 && s >= 80 || e >= 80) printf("B\n");
else printf("C\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336514/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336514/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d\00", align 1
@str = private unnamed_addr constant [2 x i8] c"C\00", align 1
@str.6 = private unnamed_addr constant [2 x i8] c"B\00", align 1
@str.9 = private unnamed_addr constant [2 x i8] c"A\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 i32, align 4
%e = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4
%call56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp57 = icmp eq i32 %0, 0
br i1 %cmp57, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.inc, %for.cond.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ]
%cmp154 = icmp sgt i32 %2, 0
br i1 %cmp154, label %for.body, label %while.cond.loopexit
for.body: ; preds = %for.cond.preheader, %for.inc
%i.055 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %e, ptr noundef nonnull %j)
%3 = load i32, ptr %s, align 4
%cmp3 = icmp eq i32 %3, 100
%4 = load i32, ptr %e, align 4
%cmp4 = icmp eq i32 %4, 100
%or.cond = select i1 %cmp3, i1 true, i1 %cmp4
%5 = load i32, ptr %j, align 4
%cmp6 = icmp eq i32 %5, 100
%or.cond43 = select i1 %or.cond, i1 true, i1 %cmp6
br i1 %or.cond43, label %for.inc, label %if.else
if.else: ; preds = %for.body
%add = add nsw i32 %4, %3
%cmp9 = icmp sgt i32 %add, 179
br i1 %cmp9, label %for.inc, label %if.else12
if.else12: ; preds = %if.else
%add14 = add nsw i32 %add, %5
%cmp16 = icmp sgt i32 %add14, 239
br i1 %cmp16, label %for.inc, label %if.else19
if.else19: ; preds = %if.else12
%cmp23 = icmp sgt i32 %add14, 209
br i1 %cmp23, label %for.inc, label %if.else26
if.else26: ; preds = %if.else19
%cmp30 = icmp sgt i32 %add14, 149
%cmp31 = icmp sgt i32 %3, 79
%or.cond44 = and i1 %cmp31, %cmp30
%cmp33 = icmp sgt i32 %4, 79
%or.cond45 = select i1 %or.cond44, i1 true, i1 %cmp33
%str.5.str = select i1 %or.cond45, ptr @str.6, ptr @str
br label %for.inc
for.inc: ; preds = %if.else26, %if.else19, %if.else12, %if.else, %for.body
%str.9.sink = phi ptr [ @str.9, %for.body ], [ @str.9, %if.else ], [ @str.9, %if.else12 ], [ @str.6, %if.else19 ], [ %str.5.str, %if.else26 ]
%puts53 = call i32 @puts(ptr nonnull dereferenceable(1) %str.9.sink)
%inc = add nuw nsw i32 %i.055, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %6
br i1 %cmp1, label %for.body, label %while.cond.loopexit, !llvm.loop !9
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int student_num;
int i;
int m,e,j;
while(1) {
scanf("%d",&student_num);
if(student_num==0)break;
for(i=0;i<student_num;i++) {
scanf("%d%d%d",&m,&e,&j);
if(m==100 || e==100 || j==100) {
puts("A");
continue;
}
if((m+e)/2>=90) {
puts("A");
continue;
}
if((m+e+j)/3>=80) {
puts("A");
continue;
}
if((m+e+j)/3>=70) {
puts("B");
continue;
}
if((m+e+j)/3>=50 && (m>=80 || e>=80)) {
puts("B");
continue;
}
puts("C");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"B\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c"C\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%student_num = alloca i32, align 4
%m = alloca i32, align 4
%e = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %student_num) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3
%call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %student_num)
%0 = load i32, ptr %student_num, align 4, !tbaa !5
%cmp47 = icmp eq i32 %0, 0
br i1 %cmp47, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.inc, %for.cond.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %student_num)
%1 = load i32, ptr %student_num, align 4, !tbaa !5
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ]
%cmp144 = icmp sgt i32 %2, 0
br i1 %cmp144, label %for.body, label %while.cond.loopexit
for.body: ; preds = %for.cond.preheader, %for.inc
%i.045 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %e, ptr noundef nonnull %j)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp3 = icmp eq i32 %3, 100
%4 = load i32, ptr %e, align 4
%cmp4 = icmp eq i32 %4, 100
%or.cond = select i1 %cmp3, i1 true, i1 %cmp4
%5 = load i32, ptr %j, align 4
%cmp6 = icmp eq i32 %5, 100
%or.cond39 = select i1 %or.cond, i1 true, i1 %cmp6
br i1 %or.cond39, label %for.inc, label %if.end9
if.end9: ; preds = %for.body
%add = add nsw i32 %4, %3
%cmp10 = icmp sgt i32 %add, 179
br i1 %cmp10, label %for.inc, label %if.end13
if.end13: ; preds = %if.end9
%add15 = add nsw i32 %add, %5
%cmp17 = icmp sgt i32 %add15, 239
br i1 %cmp17, label %for.inc, label %if.end20
if.end20: ; preds = %if.end13
%cmp24 = icmp sgt i32 %add15, 209
br i1 %cmp24, label %for.inc, label %if.end27
if.end27: ; preds = %if.end20
%cmp31 = icmp sgt i32 %add15, 149
br i1 %cmp31, label %land.lhs.true, label %if.end37
land.lhs.true: ; preds = %if.end27
%cmp32 = icmp sgt i32 %3, 79
%cmp34 = icmp sgt i32 %4, 79
%or.cond40 = select i1 %cmp32, i1 true, i1 %cmp34
br i1 %or.cond40, label %for.inc, label %if.end37
if.end37: ; preds = %land.lhs.true, %if.end27
br label %for.inc
for.inc: ; preds = %land.lhs.true, %if.end20, %if.end13, %if.end9, %for.body, %if.end37
%.str.4.sink = phi ptr [ @.str.4, %if.end37 ], [ @.str.2, %for.body ], [ @.str.2, %if.end9 ], [ @.str.2, %if.end13 ], [ @.str.3, %if.end20 ], [ @.str.3, %land.lhs.true ]
%call38 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink)
%inc = add nuw nsw i32 %i.045, 1
%6 = load i32, ptr %student_num, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %6
br i1 %cmp1, label %for.body, label %while.cond.loopexit, !llvm.loop !9
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %student_num) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int comparador(const void *a, const void *b){
return (*(int*)a - *(int*)b);
}
int main(){
int n;
scanf("%d", &n);
int vetor[n];
int vetor2[1000001] = {0};
int multi, cont = 0, maior = 0, igual = 0;
for(int i = 0; i < n; ++i){
scanf("%d", &vetor[i]);
if(vetor[i] > maior)
maior = vetor[i];
}
qsort(vetor, n, sizeof(int), comparador);
for(int i = 0; i < n; ++i){
if(vetor2[vetor[i]] == 0){
if(vetor[i] != vetor[i + 1])
cont++;
for(int j = 1;; ++j){
multi = vetor[i]*j;
if(multi > maior)
break;
vetor2[multi] = 1;
}
}
}
printf("%d ", cont);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336615/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336615/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comparador(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%vetor2 = alloca [1000001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
call void @llvm.lifetime.start.p0(i64 4000004, ptr nonnull %vetor2) #8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) %vetor2, i8 0, i64 4000004, i1 false)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %3, 0
br i1 %cmp61, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %8, %for.body ]
%maior.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %spec.select, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comparador) #8
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp968 = icmp sgt i32 %4, 0
br i1 %cmp968, label %for.body12.preheader, label %for.cond.cleanup11
for.body12.preheader: ; preds = %for.cond.cleanup
%5 = zext i32 %maior.0.lcssa to i64
%wide.trip.count = zext i32 %4 to i64
br label %for.body12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%maior.062 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %6, i32 %maior.062)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup11: ; preds = %for.inc42, %for.cond.cleanup
%cont.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %cont.2, %for.inc42 ]
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cont.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000004, ptr nonnull %vetor2) #8
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body12: ; preds = %for.body12.preheader, %for.inc42
%indvars.iv78 = phi i64 [ 0, %for.body12.preheader ], [ %11, %for.inc42 ]
%cont.069 = phi i32 [ 0, %for.body12.preheader ], [ %cont.2, %for.inc42 ]
%arrayidx14 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv78
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%idxprom15 = sext i32 %9 to i64
%arrayidx16 = getelementptr inbounds [1000001 x i32], ptr %vetor2, i64 0, i64 %idxprom15
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp eq i32 %10, 0
%11 = add nuw nsw i64 %indvars.iv78, 1
br i1 %cmp17, label %if.then19, label %for.inc42
if.then19: ; preds = %for.body12
%arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %11
%12 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24.not = icmp ne i32 %9, %12
%inc27 = zext i1 %cmp24.not to i32
%spec.select60 = add nsw i32 %cont.069, %inc27
%cmp3265 = icmp sgt i32 %9, %maior.0.lcssa
br i1 %cmp3265, label %for.inc42, label %if.end35
if.end35: ; preds = %if.then19, %if.end35
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %if.end35 ], [ 1, %if.then19 ]
%mul67 = phi i32 [ %14, %if.end35 ], [ %9, %if.then19 ]
%idxprom36 = sext i32 %mul67 to i64
%arrayidx37 = getelementptr inbounds [1000001 x i32], ptr %vetor2, i64 0, i64 %idxprom36
store i32 1, ptr %arrayidx37, align 4, !tbaa !5
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%13 = mul nsw i64 %indvars.iv.next75, %idxprom15
%cmp32 = icmp sgt i64 %13, %5
%14 = trunc i64 %13 to i32
br i1 %cmp32, label %for.inc42, label %if.end35
for.inc42: ; preds = %if.end35, %for.body12, %if.then19
%cont.2 = phi i32 [ %spec.select60, %if.then19 ], [ %cont.069, %for.body12 ], [ %spec.select60, %if.end35 ]
%exitcond.not = icmp eq i64 %11, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup11, label %for.body12, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; 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
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 #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int notomamiko(const void* x, const void* y) {
int a = *(const int*)x, b = *(const int*)y;
return a < b ? -1 : a > b;
}
int N;
int A[271828];
char era[1234567];
int main(void) {
int i;
int miyukiti = 0;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
if (scanf("%d", &A[i]) != 1) return 1;
}
qsort(A, N, sizeof(*A), notomamiko);
for (i = 0; i < N; i++) {
if (!era[A[i]]) {
int j;
if (!(i + 1 < N && A[i + 1] == A[i])) miyukiti++;
for (j = A[i]; j <= A[N - 1]; j += A[i]) era[j] = 1;
}
}
printf("%d\n", miyukiti);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336666/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336666/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@A = dso_local global [271828 x i32] zeroinitializer, align 16
@era = dso_local local_unnamed_addr global [1234567 x i8] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @notomamiko(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%conv = zext i1 %cmp1 to i32
%cond = select i1 %cmp, i32 -1, i32 %conv
ret i32 %cond
}
; 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)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp163 = icmp sgt i32 %0, 0
br i1 %cmp163, label %for.body, label %for.cond.preheader.for.end_crit_edge
for.cond.preheader.for.end_crit_edge: ; preds = %for.cond.preheader
%.pre = sext i32 %0 to i64
br label %for.end
for.cond: ; preds = %for.body
%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
%cmp1 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [271828 x i32], ptr @A, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp3.not = icmp eq i32 %call2, 1
br i1 %cmp3.not, label %for.cond, label %cleanup
for.end: ; preds = %for.cond, %for.cond.preheader.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %for.cond.preheader.for.end_crit_edge ], [ %2, %for.cond ]
tail call void @qsort(ptr noundef nonnull @A, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @notomamiko) #4
%3 = load i32, ptr @N, align 4, !tbaa !5
%cmp767 = icmp sgt i32 %3, 0
br i1 %cmp767, label %for.body9.lr.ph, label %for.end45
for.body9.lr.ph: ; preds = %for.end
%sub = add nsw i32 %3, -1
%idxprom30 = zext i32 %sub to i64
%arrayidx31 = getelementptr inbounds [271828 x i32], ptr @A, i64 0, i64 %idxprom30
%4 = zext i32 %3 to i64
%wide.trip.count = zext i32 %3 to i64
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.inc43
%indvars.iv76 = phi i64 [ 0, %for.body9.lr.ph ], [ %7, %for.inc43 ]
%miyukiti.069 = phi i32 [ 0, %for.body9.lr.ph ], [ %miyukiti.2, %for.inc43 ]
%arrayidx11 = getelementptr inbounds [271828 x i32], ptr @A, i64 0, i64 %indvars.iv76
%5 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%idxprom12 = sext i32 %5 to i64
%arrayidx13 = getelementptr inbounds [1234567 x i8], ptr @era, i64 0, i64 %idxprom12
%6 = load i8, ptr %arrayidx13, align 1, !tbaa !11
%tobool.not = icmp eq i8 %6, 0
%7 = add nuw nsw i64 %indvars.iv76, 1
br i1 %tobool.not, label %if.then14, label %for.inc43
if.then14: ; preds = %for.body9
%cmp15 = icmp ult i64 %7, %4
br i1 %cmp15, label %land.lhs.true, label %if.then24
land.lhs.true: ; preds = %if.then14
%arrayidx19 = getelementptr inbounds [271828 x i32], ptr @A, i64 0, i64 %7
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp22 = icmp eq i32 %8, %5
br i1 %cmp22, label %if.end26, label %if.then24
if.then24: ; preds = %land.lhs.true, %if.then14
%inc25 = add nsw i32 %miyukiti.069, 1
br label %if.end26
if.end26: ; preds = %if.then24, %land.lhs.true
%miyukiti.1 = phi i32 [ %miyukiti.069, %land.lhs.true ], [ %inc25, %if.then24 ]
%9 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32.not65 = icmp sgt i32 %5, %9
br i1 %cmp32.not65, label %for.inc43, label %for.body34.preheader
for.body34.preheader: ; preds = %if.end26
%10 = sext i32 %9 to i64
br label %for.body34
for.body34: ; preds = %for.body34.preheader, %for.body34
%indvars.iv73 = phi i64 [ %idxprom12, %for.body34.preheader ], [ %indvars.iv.next74, %for.body34 ]
%arrayidx36 = getelementptr inbounds [1234567 x i8], ptr @era, i64 0, i64 %indvars.iv73
store i8 1, ptr %arrayidx36, align 1, !tbaa !11
%indvars.iv.next74 = add i64 %indvars.iv73, %idxprom12
%cmp32.not = icmp sgt i64 %indvars.iv.next74, %10
br i1 %cmp32.not, label %for.inc43, label %for.body34, !llvm.loop !12
for.inc43: ; preds = %for.body34, %for.body9, %if.end26
%miyukiti.2 = phi i32 [ %miyukiti.1, %if.end26 ], [ %miyukiti.069, %for.body9 ], [ %miyukiti.1, %for.body34 ]
%exitcond.not = icmp eq i64 %7, %wide.trip.count
br i1 %exitcond.not, label %for.end45, label %for.body9, !llvm.loop !13
for.end45: ; preds = %for.inc43, %for.end
%miyukiti.0.lcssa = phi i32 [ 0, %for.end ], [ %miyukiti.2, %for.inc43 ]
%call46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %miyukiti.0.lcssa)
br label %cleanup
cleanup: ; preds = %for.body, %entry, %for.end45
%retval.0 = phi i32 [ 0, %for.end45 ], [ 1, %entry ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int N,p[10000],max,T,i,j,k;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%d\n",&p[i]);
max=p[0];
for (i=1;i<N;i++)
if(max<p[i])
max=p[i];
T=0;
for(i=0;i<N;i++)
T=T+p[i];
T=T-0.5*max;
printf("%d\n",T);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%p = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %p) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end21
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %p, align 16, !tbaa !5
%cmp439 = icmp sgt i32 %1, 1
br i1 %cmp439, label %for.body5.preheader, label %for.cond14.preheader
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %1 to i64
%3 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %1, 9
br i1 %min.iters.check, label %for.body5.preheader85, label %vector.ph
vector.ph: ; preds = %for.body5.preheader
%n.vec = and i64 %3, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %6, %vector.body ]
%vec.phi64 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %7, %vector.body ]
%offset.idx = or i64 %index, 1
%4 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load65 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi64, <4 x i32> %wide.load65)
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %6, <4 x i32> %7)
%9 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %for.cond14.preheader, label %for.body5.preheader85
for.body5.preheader85: ; preds = %for.body5.preheader, %middle.block
%indvars.iv49.ph = phi i64 [ 1, %for.body5.preheader ], [ %ind.end, %middle.block ]
%max.041.ph = phi i32 [ %.pre, %for.body5.preheader ], [ %9, %middle.block ]
br label %for.body5
for.cond14.preheader: ; preds = %for.body5, %middle.block, %for.end
%max.0.lcssa = phi i32 [ %.pre, %for.end ], [ %9, %middle.block ], [ %spec.select, %for.body5 ]
%cmp1543 = icmp sgt i32 %1, 0
br i1 %cmp1543, label %for.body16.preheader, label %for.end21
for.body16.preheader: ; preds = %for.cond14.preheader
%wide.trip.count55 = zext i32 %1 to i64
%min.iters.check68 = icmp ult i32 %1, 8
br i1 %min.iters.check68, label %for.body16.preheader82, label %vector.ph69
vector.ph69: ; preds = %for.body16.preheader
%n.vec71 = and i64 %wide.trip.count55, 4294967288
br label %vector.body74
vector.body74: ; preds = %vector.body74, %vector.ph69
%index75 = phi i64 [ 0, %vector.ph69 ], [ %index.next80, %vector.body74 ]
%vec.phi76 = phi <4 x i32> [ zeroinitializer, %vector.ph69 ], [ %12, %vector.body74 ]
%vec.phi77 = phi <4 x i32> [ zeroinitializer, %vector.ph69 ], [ %13, %vector.body74 ]
%10 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %index75
%wide.load78 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load79 = load <4 x i32>, ptr %11, align 16, !tbaa !5
%12 = add <4 x i32> %wide.load78, %vec.phi76
%13 = add <4 x i32> %wide.load79, %vec.phi77
%index.next80 = add nuw i64 %index75, 8
%14 = icmp eq i64 %index.next80, %n.vec71
br i1 %14, label %middle.block66, label %vector.body74, !llvm.loop !14
middle.block66: ; preds = %vector.body74
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n73 = icmp eq i64 %n.vec71, %wide.trip.count55
br i1 %cmp.n73, label %for.end21.loopexit, label %for.body16.preheader82
for.body16.preheader82: ; preds = %for.body16.preheader, %middle.block66
%indvars.iv52.ph = phi i64 [ 0, %for.body16.preheader ], [ %n.vec71, %middle.block66 ]
%T.045.ph = phi i32 [ 0, %for.body16.preheader ], [ %15, %middle.block66 ]
br label %for.body16
for.body5: ; preds = %for.body5.preheader85, %for.body5
%indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body5 ], [ %indvars.iv49.ph, %for.body5.preheader85 ]
%max.041 = phi i32 [ %spec.select, %for.body5 ], [ %max.041.ph, %for.body5.preheader85 ]
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %indvars.iv49
%16 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max.041, i32 %16)
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%exitcond.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count
br i1 %exitcond.not, label %for.cond14.preheader, label %for.body5, !llvm.loop !15
for.body16: ; preds = %for.body16.preheader82, %for.body16
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body16 ], [ %indvars.iv52.ph, %for.body16.preheader82 ]
%T.045 = phi i32 [ %add, %for.body16 ], [ %T.045.ph, %for.body16.preheader82 ]
%arrayidx18 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %indvars.iv52
%17 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%add = add nsw i32 %17, %T.045
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count55
br i1 %exitcond56.not, label %for.end21.loopexit, label %for.body16, !llvm.loop !16
for.end21.loopexit: ; preds = %for.body16, %middle.block66
%add.lcssa = phi i32 [ %15, %middle.block66 ], [ %add, %for.body16 ]
%18 = sitofp i32 %add.lcssa to double
br label %for.end21
for.end21: ; preds = %entry, %for.end21.loopexit, %for.cond14.preheader
%max.0.lcssa63 = phi i32 [ %max.0.lcssa, %for.cond14.preheader ], [ %max.0.lcssa, %for.end21.loopexit ], [ undef, %entry ]
%T.0.lcssa = phi double [ 0.000000e+00, %for.cond14.preheader ], [ %18, %for.end21.loopexit ], [ 0.000000e+00, %entry ]
%conv22 = sitofp i32 %max.0.lcssa63 to double
%19 = call double @llvm.fmuladd.f64(double %conv22, double -5.000000e-01, double %T.0.lcssa)
%conv23 = fptosi double %19 to i32
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !13, !12}
|
#include<stdio.h>
int max(int *N,int size){
int max=N[0],i;
for(i=1;i<size;i++){
if(max<N[i]){
max=N[i];
}
}
return max;
}
int main(void){
int N,i,Max,ans=0;
scanf("%d",&N);
int p[N];
for(i=0;i<N;i++){
scanf("%d",&p[i]);
}
Max=max(p,N);
for(i=0;i<N;i++){
ans=ans+p[i];
}
ans=ans-Max/2;
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @max(ptr nocapture noundef readonly %N, i32 noundef %size) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %size, 1
br i1 %cmp11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %size to i64
%1 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %size, 9
br i1 %min.iters.check, label %for.body.preheader17, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %1, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%vec.phi15 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ]
%offset.idx = or i64 %index, 1
%2 = getelementptr inbounds i32, ptr %N, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load16 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi15, <4 x i32> %wide.load16)
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5)
%7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %1, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader17
for.body.preheader17: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%max.012.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader17, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader17 ]
%max.012 = phi i32 [ %spec.select, %for.body ], [ %max.012.ph, %for.body.preheader17 ]
%arrayidx1 = getelementptr inbounds i32, ptr %N, i64 %indvars.iv
%8 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%spec.select = tail call i32 @llvm.smax.i32(i32 %max.012, i32 %8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%max.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select, %for.body ]
ret i32 %max.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %3, 0
br i1 %cmp19, label %for.body, label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%cmp11.i = icmp sgt i32 %4, 1
br i1 %cmp11.i, label %for.body.preheader.i, label %max.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %4 to i64
%6 = add nsw i64 %wide.trip.count.i, -1
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %6, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %9, %vector.body ]
%vec.phi37 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %10, %vector.body ]
%offset.idx = or i64 %index, 1
%7 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load38 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%10 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi37, <4 x i32> %wide.load38)
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %10)
%12 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %6, %n.vec
br i1 %cmp.n, label %max.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 1, %for.body.preheader.i ], [ %ind.end, %middle.block ]
%max.012.i.ph = phi i32 [ %.pre, %for.body.preheader.i ], [ %12, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%max.012.i = phi i32 [ %spec.select.i, %for.body.i ], [ %max.012.i.ph, %for.body.i.preheader ]
%arrayidx1.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%13 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smax.i32(i32 %max.012.i, i32 %13)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %max.exit, label %for.body.i, !llvm.loop !16
max.exit: ; preds = %for.body.i, %middle.block, %for.end
%max.0.lcssa.i = phi i32 [ %.pre, %for.end ], [ %12, %middle.block ], [ %spec.select.i, %for.body.i ]
%cmp421 = icmp sgt i32 %4, 0
br i1 %cmp421, label %for.body5.preheader, label %for.end10
for.body5.preheader: ; preds = %max.exit
%wide.trip.count = zext i32 %4 to i64
%min.iters.check41 = icmp ult i32 %4, 8
br i1 %min.iters.check41, label %for.body5.preheader55, label %vector.ph42
vector.ph42: ; preds = %for.body5.preheader
%n.vec44 = and i64 %wide.trip.count, 4294967288
br label %vector.body47
vector.body47: ; preds = %vector.body47, %vector.ph42
%index48 = phi i64 [ 0, %vector.ph42 ], [ %index.next53, %vector.body47 ]
%vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph42 ], [ %16, %vector.body47 ]
%vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph42 ], [ %17, %vector.body47 ]
%14 = getelementptr inbounds i32, ptr %vla, i64 %index48
%wide.load51 = load <4 x i32>, ptr %14, align 16, !tbaa !5
%15 = getelementptr inbounds i32, ptr %14, i64 4
%wide.load52 = load <4 x i32>, ptr %15, align 16, !tbaa !5
%16 = add <4 x i32> %wide.load51, %vec.phi49
%17 = add <4 x i32> %wide.load52, %vec.phi50
%index.next53 = add nuw i64 %index48, 8
%18 = icmp eq i64 %index.next53, %n.vec44
br i1 %18, label %middle.block39, label %vector.body47, !llvm.loop !17
middle.block39: ; preds = %vector.body47
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n46 = icmp eq i64 %n.vec44, %wide.trip.count
br i1 %cmp.n46, label %for.end10, label %for.body5.preheader55
for.body5.preheader55: ; preds = %for.body5.preheader, %middle.block39
%indvars.iv27.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec44, %middle.block39 ]
%ans.022.ph = phi i32 [ 0, %for.body5.preheader ], [ %19, %middle.block39 ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader55, %for.body5
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body5 ], [ %indvars.iv27.ph, %for.body5.preheader55 ]
%ans.022 = phi i32 [ %add, %for.body5 ], [ %ans.022.ph, %for.body5.preheader55 ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv27
%20 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %20, %ans.022
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
%exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count
br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !18
for.end10: ; preds = %for.body5, %middle.block39, %entry, %max.exit
%max.0.lcssa.i36 = phi i32 [ %max.0.lcssa.i, %max.exit ], [ undef, %entry ], [ %max.0.lcssa.i, %middle.block39 ], [ %max.0.lcssa.i, %for.body5 ]
%ans.0.lcssa = phi i32 [ 0, %max.exit ], [ 0, %entry ], [ %19, %middle.block39 ], [ %add, %for.body5 ]
%div.neg = sdiv i32 %max.0.lcssa.i36, -2
%sub = add i32 %ans.0.lcssa, %div.neg
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10, !12, !11}
|
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<string.h>
int main(){
int N,max=0,ans=0,p;
scanf("%d",&N);
int i;
for(i=0;i<N;i++){
scanf("%d",&p);
ans += p;
max = max>p? max:p;
}
printf("%d",ans-max/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%ans.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.09 = phi i32 [ %cond, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%1 = load i32, ptr %p, align 4
%add = add nsw i32 %1, %ans.010
%cond = call i32 @llvm.smax.i32(i32 %max.09, i32 %1)
%inc = add nuw nsw i32 %i.011, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%3 = sdiv i32 %cond, -2
%4 = add i32 %3, %add
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub = phi i32 [ 0, %entry ], [ %4, %for.end.loopexit ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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"}
|
#include <stdio.h>
#include <math.h>
int main(){
int n;
scanf("%d",&n);
int p[n];
int max = 0;
int sum = 0;
for(int i = 0;i < n; i++){
scanf("%d",p+i);
if(p[i]>max) {
max = p[i];
}
sum = sum + p[i];
}
sum = sum - max/2;
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %3, 0
br i1 %cmp17, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%4 = lshr i32 %spec.select, 1
%5 = sub nsw i32 %add, %4
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ 0, %entry ], [ %5, %for.cond.cleanup.loopexit ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.019 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.018 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%6 = load i32, ptr %add.ptr, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %6, i32 %max.018)
%add = add nsw i32 %6, %sum.019
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int N;
int *p;
p = (int *)malloc(sizeof(int) * N);
scanf("%d" , &N);
int max , max_ind , sum;
max = max_ind = sum = 0;
for( int i = 0; i < N; i++ ){
scanf("%d" , &p[i]);
if( max < p[i] ){
max = p[i];
max_ind = i;
}
sum += p[i];
}
sum -= p[max_ind];
sum += max/2;
printf("%d\n",sum);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = tail call noalias ptr @malloc(i64 noundef 0) #7
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp32)
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%idxprom12.phi.trans.insert = sext i32 %spec.select31 to i64
%arrayidx13.phi.trans.insert = getelementptr inbounds i32, ptr %call, i64 %idxprom12.phi.trans.insert
%.pre = load i32, ptr %arrayidx13.phi.trans.insert, align 4, !tbaa !5
%1 = lshr i32 %spec.select, 1
%2 = add i32 %add, %1
%3 = sub i32 %2, %.pre
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.035 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max_ind.034 = phi i32 [ %spec.select31, %for.body ], [ 0, %entry ]
%max.033 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp6 = icmp slt i32 %max.033, %4
%spec.select = call i32 @llvm.smax.i32(i32 %max.033, i32 %4)
%5 = trunc i64 %indvars.iv to i32
%spec.select31 = select i1 %cmp6, i32 %5, i32 %max_ind.034
%add = add nsw i32 %4, %sum.035
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !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: 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: 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) #1
; 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.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 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 nounwind "no-trapping-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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n, i, q;
int p[11];
int t, m;
q=0;
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d", &p[i]);
q+=p[i];
}
t=p[1];
for(i=1; i<n; i++){
if(t<p[i])
t=p[i];
}
m=t/2;
q=q-m;
printf("%d\n", q);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336947/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336947/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%p = alloca [11 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end15
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%q.028 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %q.028
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%arrayidx4.phi.trans.insert = getelementptr inbounds [11 x i32], ptr %p, i64 0, i64 1
%.pre = load i32, ptr %arrayidx4.phi.trans.insert, align 4, !tbaa !5
%cmp631 = icmp sgt i32 %2, 1
br i1 %cmp631, label %for.body7.preheader, label %for.end15
for.body7.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %2 to i64
%4 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %2, 9
br i1 %min.iters.check, label %for.body7.preheader46, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %4, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %7, %vector.body ]
%vec.phi44 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %8, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds [11 x i32], ptr %p, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load45 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%8 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi44, <4 x i32> %wide.load45)
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %7, <4 x i32> %8)
%10 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end15, label %for.body7.preheader46
for.body7.preheader46: ; preds = %for.body7.preheader, %middle.block
%indvars.iv37.ph = phi i64 [ 1, %for.body7.preheader ], [ %ind.end, %middle.block ]
%t.032.ph = phi i32 [ %.pre, %for.body7.preheader ], [ %10, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader46, %for.body7
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body7 ], [ %indvars.iv37.ph, %for.body7.preheader46 ]
%t.032 = phi i32 [ %spec.select, %for.body7 ], [ %t.032.ph, %for.body7.preheader46 ]
%arrayidx9 = getelementptr inbounds [11 x i32], ptr %p, i64 0, i64 %indvars.iv37
%11 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %t.032, i32 %11)
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body7, !llvm.loop !14
for.end15: ; preds = %for.body7, %middle.block, %entry, %for.end
%q.0.lcssa43 = phi i32 [ %add, %for.end ], [ 0, %entry ], [ %add, %middle.block ], [ %add, %for.body7 ]
%t.0.lcssa = phi i32 [ %.pre, %for.end ], [ undef, %entry ], [ %10, %middle.block ], [ %spec.select, %for.body7 ]
%div.neg = sdiv i32 %t.0.lcssa, -2
%sub = add i32 %div.neg, %q.0.lcssa43
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %p) #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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main(void){
// Your code here!
int N, max = 0,sum = 0;
int p[10];
scanf("%d",&N);
for(int i = 0; i < N; i++)
{
scanf("%d\n",&p[i]);
sum += p[i];
if(max < p[i]) max = p[i];
}
printf("%d\n",sum-max/2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336990/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336990/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%p = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = lshr i32 %spec.select, 1
%2 = sub nsw i32 %add, %1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ 0, %entry ], [ %2, %for.cond.cleanup.loopexit ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.020 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.019 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %3, %sum.020
%spec.select = call i32 @llvm.smax.i32(i32 %max.019, i32 %3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int i, j;
scanf("%d %d", &i, &j);
printf("%d %d\n", i*j, i*2 + j*2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337047/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337047/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j)
%0 = load i32, ptr %i, align 4, !tbaa !5
%1 = load i32, ptr %j, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%mul14 = add i32 %1, %0
%add = shl i32 %mul14, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d %d\n", x*y, 2 * x + 2 * y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%mul14 = add i32 %1, %0
%add = shl i32 %mul14, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main( void )
{
int a = 0;
int b = 0;
scanf("%d %d",&a ,&b);
printf("%d %d\n", a*b, 2*(a+b));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337133/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337133/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, const char * argv[]){
int a, b;
scanf("%d %d", &a, &b);
printf("%d %d\n", a*b, (a+b)*2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337177/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337177/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a, b;
scanf("%d %d",&a, &b);
printf("%d ",a*b);
printf("%d\n",(2*a)+(2*b));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337227/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337227/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul25 = add i32 %3, %2
%add = shl i32 %mul25, 1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,s,l;
scanf("%d %d", &a,&b);
s = a * b;
l = (a + b) * 2;
printf("%d %d\n", s,l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337270/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337270/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int no1,no2;
scanf("%d",&no1);
scanf("%d",&no2);
printf("%d %d\n",no1*no2,2*(no1+no2));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337320/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337320/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%no1 = alloca i32, align 4
%no2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no1)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no2)
%0 = load i32, ptr %no1, align 4, !tbaa !5
%1 = load i32, ptr %no2, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul2 = shl nsw i32 %add, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,d;
scanf("%d %d",&a, &b);
c = a * b;
d = (a + b) * 2;
printf("%d %d\n",c,d);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337379/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337379/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int x, y;
int area, circumference;
scanf("%d %d", &x, &y);
area = x * y;
circumference = x * 2 + y * 2;
printf("%d %d\n", area, circumference);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337421/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337421/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%mul14 = add i32 %1, %0
%add = shl i32 %mul14, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int x, y;
scanf("%d %d",&x,&y);
printf("%d %d\n",x*y ,2*(x + y));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337465/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337465/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a, b;
scanf("%d %d", &a,&b);
printf("%d %d\n", (a*b),(2*a+2*b));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337522/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337522/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%mul14 = add i32 %1, %0
%add = shl i32 %mul14, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a, b, x, y;
scanf("%d %d", &a, &b);
printf("%d %d\n", a*b, 2*(a+b));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int n, m;
scanf("%d %d", &n, &m);
printf("%d %d\n", n * m, 2 * (n + m));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337616/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337616/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
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 = 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
%1 = load i32, ptr %m, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%add = add nsw i32 %1, %0
%mul1 = shl nsw i32 %add, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul, i32 noundef %mul1)
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"}
|
#include <stdio.h>
#include <stdlib.h>
#define False 0x00000
#define True 0x00001
#define dat_found 0x00002
#define dat_nt_found 0x00003
#define failed 0x00004
#define success 0x00005
#define invalid 0x00005
#define _left 0x00006
#define _right 0x00007
#define ref_error 0x00008
#define node_right_full 0x00009
#define node_left_full 0x0000A
#define tree_is_empty 0x0000B
#define dat_exist 0x0000C
#define matched 0x0000D
#define not_matched 0x0000E
#define equal_c 0x00010
#define less_c 0x00011
#define greater_c 0x00012
#define top_heavy_heap 0x00013
#define botom_heavy_heap 0x00014
typedef struct ListElmt_{
void* data;
struct ListElmt_* next;
}ListElement;
typedef struct List_{
ListElement* head;
ListElement* tail;
int (*match)(void* dat1,void* dat2);
void (*FreeData)(void* lstel);
int _size;
}List;
void list_init(List *_list,void (*freeDat)(void* lstel));
int AddElement_nxt(List* lst,ListElement* _reference,void *dat);
#define list_size(list)((list)->_size)
#define list_head(list)((list)->head)
#define list_tail(list)((list)->tail)
#define list_is_head(list, element)((element) == (list)->head ? 1 : 0)
#define list_is_tail(element)((element)->next == NULL ? 1 : 0)
#define list_data(element)((element)->data)
#define list_next(element)((element)->next)
void list_init(List *_list,void (*freeDat)(void* lstel)){
_list->head=NULL;
_list->tail=NULL;
_list->_size=0;
_list->FreeData=freeDat;
}
int AddElement_nxt(List* lst,ListElement* _reference,void *dat){
ListElement* new_element;
if((new_element=(ListElement*)malloc(sizeof(ListElement)))==NULL){
return failed;
}
new_element->data=(void*)dat;
if(_reference==NULL){
if(list_size(lst)==0){
lst->tail=new_element;
}
new_element->next=lst->head;
lst->head=new_element;
}
else{
if(_reference->next==NULL){
lst->tail=new_element;
}
new_element->next=_reference->next;
_reference->next=new_element;
}
lst->_size++;
return success;
}
typedef struct _chtbl{
int buckets;
int (*h)(void* key);
int (*match)(void* dat1,void* dat2);
void (*FreeData)(void* data);
int _size;
List* table;
}chtbl;
#define chtbl_size(chtbl)((chtbl)->_size)
int chtbl_init(chtbl* htbl,int bucket,int (*_hash)(void* key),int (*mtch)(void* dat1,void* dat2),void (*destroy)(void* data));
int chtbl_init(chtbl* htbl,int bucket,int (*_hash)(void* key),int (*mtch)(void* dat1,void* dat2),void (*destroy)(void* data)){
htbl->buckets=bucket;
htbl->_size=0;
htbl->h=_hash;
htbl->match=mtch;
htbl->FreeData=destroy;
if((htbl->table=(List*)malloc(bucket*sizeof(List)))==NULL){
return failed;
}
int i;
for(i=0;i<bucket;i++){
list_init((htbl->table+i),destroy);
}
return success;
}
typedef struct _htbl_el{
int lan;
int num_sc;
}Htbl_el;
typedef struct _movie{
int audio;
int sub;
}Movie;
int match__(void* key1,void* key2){
Htbl_el *a,*b;
a=(Htbl_el*)key1;
b=(Htbl_el*)key2;
if(a->lan==b->lan){
return 1;
}
return 0;
}
int hash_func(void* key){
Htbl_el* a;
a=(Htbl_el*)key;
return (a->lan)%200000;
}
void look_up_and_insert(Htbl_el* data,chtbl* htbl){
int bucket=(data->lan)%200000;
List* lst=htbl->table+bucket;
Htbl_el* tmp;
int i,k=0;
ListElement* element=lst->head;
while(element!=NULL){
if(htbl->match((void*)data,list_data(element))==1){
tmp=(Htbl_el*)list_data(element);
tmp->num_sc=(tmp->num_sc)+1;
k=1;
break;
}
element=list_next(element);
}
if(k==0){
tmp=(Htbl_el*)malloc(sizeof(Htbl_el));
tmp->lan=data->lan;
tmp->num_sc=1;
AddElement_nxt((htbl->table+bucket),NULL,(void*)tmp);
}
return;
}
int look_up_r_num_s(chtbl* htbl,int sc_lan){
Htbl_el tmp;
Htbl_el* t2;
int bucket=sc_lan%200000;
tmp.lan=sc_lan;
List* lst=htbl->table+bucket;
int i;
ListElement* element=lst->head;
while(element!=NULL){
if(htbl->match((void*)&tmp,list_data(element))==1){
t2=(Htbl_el*)list_data(element);
return t2->num_sc;
}
element=list_next(element);
}
return 0;
}
int main(){
int n,m,v_p_max=0,al_sat_max=0,tvp,tas,mi,i;
Htbl_el tmp;
chtbl htbl;
Movie* movie;
scanf("%d",&n);
chtbl_init(&htbl,200000,hash_func,match__,NULL);
for(i=0;i<n;i++){
scanf("%d",&tmp.lan);
look_up_and_insert(&tmp,&htbl);
}
scanf("%d",&m);
movie=(Movie*)malloc(sizeof(Movie)*m);
for(i=0;i<m;i++){
scanf("%d",&movie[i].audio);
}
for(i=0;i<m;i++){
scanf("%d",&movie[i].sub);
}
for(i=0;i<m;i++){
tvp=look_up_r_num_s(&htbl,movie[i].audio);
if(tvp>v_p_max){
mi=i;
v_p_max=tvp;
al_sat_max=look_up_r_num_s(&htbl,movie[i].sub);
}
else if(tvp==v_p_max){
tas=look_up_r_num_s(&htbl,movie[i].sub);
if(tas>al_sat_max){
al_sat_max=tas;
mi=i;
}
}
}
printf("%d\n",mi+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33766/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33766/source.c"
target datalayout = "e-m:e-p270: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.List_ = type { ptr, ptr, ptr, ptr, i32 }
%struct.ListElmt_ = type { ptr, ptr }
%struct._chtbl = type { i32, ptr, ptr, ptr, i32, ptr }
%struct._htbl_el = type { i32, i32 }
%struct._movie = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @list_init(ptr nocapture noundef writeonly %_list, ptr noundef %freeDat) local_unnamed_addr #0 {
entry:
%_size = getelementptr inbounds %struct.List_, ptr %_list, i64 0, i32 4
store i32 0, ptr %_size, align 8, !tbaa !5
%FreeData = getelementptr inbounds %struct.List_, ptr %_list, i64 0, i32 3
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %_list, i8 0, i64 16, i1 false)
store ptr %freeDat, ptr %FreeData, align 8, !tbaa !11
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local i32 @AddElement_nxt(ptr nocapture noundef %lst, ptr noundef %_reference, ptr noundef %dat) local_unnamed_addr #1 {
entry:
%call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #12
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
store ptr %dat, ptr %call, align 8, !tbaa !12
%cmp1 = icmp eq ptr %_reference, null
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.end
%_size = getelementptr inbounds %struct.List_, ptr %lst, i64 0, i32 4
%0 = load i32, ptr %_size, align 8, !tbaa !5
%cmp3 = icmp eq i32 %0, 0
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.then2
%tail = getelementptr inbounds %struct.List_, ptr %lst, i64 0, i32 1
store ptr %call, ptr %tail, align 8, !tbaa !14
br label %if.end5
if.end5: ; preds = %if.then4, %if.then2
%1 = load ptr, ptr %lst, align 8, !tbaa !15
%next = getelementptr inbounds %struct.ListElmt_, ptr %call, i64 0, i32 1
store ptr %1, ptr %next, align 8, !tbaa !16
store ptr %call, ptr %lst, align 8, !tbaa !15
br label %if.end15
if.else: ; preds = %if.end
%next7 = getelementptr inbounds %struct.ListElmt_, ptr %_reference, i64 0, i32 1
%2 = load ptr, ptr %next7, align 8, !tbaa !16
%cmp8 = icmp eq ptr %2, null
br i1 %cmp8, label %if.then9, label %if.end11
if.then9: ; preds = %if.else
%tail10 = getelementptr inbounds %struct.List_, ptr %lst, i64 0, i32 1
store ptr %call, ptr %tail10, align 8, !tbaa !14
br label %if.end11
if.end11: ; preds = %if.then9, %if.else
%next13 = getelementptr inbounds %struct.ListElmt_, ptr %call, i64 0, i32 1
store ptr %2, ptr %next13, align 8, !tbaa !16
store ptr %call, ptr %next7, align 8, !tbaa !16
%_size16.phi.trans.insert = getelementptr inbounds %struct.List_, ptr %lst, i64 0, i32 4
%.pre = load i32, ptr %_size16.phi.trans.insert, align 8, !tbaa !5
br label %if.end15
if.end15: ; preds = %if.end11, %if.end5
%3 = phi i32 [ %.pre, %if.end11 ], [ %0, %if.end5 ]
%_size16 = getelementptr inbounds %struct.List_, ptr %lst, i64 0, i32 4
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %_size16, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %entry, %if.end15
%retval.0 = phi i32 [ 5, %if.end15 ], [ 4, %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) #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 memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local i32 @chtbl_init(ptr nocapture noundef %htbl, i32 noundef %bucket, ptr noundef %_hash, ptr noundef %mtch, ptr noundef %destroy) local_unnamed_addr #4 {
entry:
store i32 %bucket, ptr %htbl, align 8, !tbaa !17
%_size = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 4
store i32 0, ptr %_size, align 8, !tbaa !19
%h = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 1
store ptr %_hash, ptr %h, align 8, !tbaa !20
%match = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 2
store ptr %mtch, ptr %match, align 8, !tbaa !21
%FreeData = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 3
store ptr %destroy, ptr %FreeData, align 8, !tbaa !22
%conv = sext i32 %bucket to i64
%mul = mul nsw i64 %conv, 40
%call = tail call noalias ptr @malloc(i64 noundef %mul) #12
%table = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 5
store ptr %call, ptr %table, align 8, !tbaa !23
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %return, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp216 = icmp sgt i32 %bucket, 0
br i1 %cmp216, label %for.body.preheader, label %return
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %bucket to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %bucket, 1
br i1 %0, label %return.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%1 = load ptr, ptr %table, align 8, !tbaa !23
%add.ptr = getelementptr inbounds %struct.List_, ptr %1, i64 %indvars.iv
%_size.i = getelementptr inbounds %struct.List_, ptr %1, i64 %indvars.iv, i32 4
store i32 0, ptr %_size.i, align 8, !tbaa !5
%FreeData.i = getelementptr inbounds %struct.List_, ptr %1, i64 %indvars.iv, i32 3
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr, i8 0, i64 16, i1 false)
store ptr %destroy, ptr %FreeData.i, align 8, !tbaa !11
%indvars.iv.next = or i64 %indvars.iv, 1
%2 = load ptr, ptr %table, align 8, !tbaa !23
%add.ptr.1 = getelementptr inbounds %struct.List_, ptr %2, i64 %indvars.iv.next
%_size.i.1 = getelementptr inbounds %struct.List_, ptr %2, i64 %indvars.iv.next, i32 4
store i32 0, ptr %_size.i.1, align 8, !tbaa !5
%FreeData.i.1 = getelementptr inbounds %struct.List_, ptr %2, i64 %indvars.iv.next, i32 3
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.1, i8 0, i64 16, i1 false)
store ptr %destroy, ptr %FreeData.i.1, align 8, !tbaa !11
%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 %return.loopexit.unr-lcssa, label %for.body, !llvm.loop !24
return.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %return, label %for.body.epil
for.body.epil: ; preds = %return.loopexit.unr-lcssa
%3 = load ptr, ptr %table, align 8, !tbaa !23
%add.ptr.epil = getelementptr inbounds %struct.List_, ptr %3, i64 %indvars.iv.unr
%_size.i.epil = getelementptr inbounds %struct.List_, ptr %3, i64 %indvars.iv.unr, i32 4
store i32 0, ptr %_size.i.epil, align 8, !tbaa !5
%FreeData.i.epil = getelementptr inbounds %struct.List_, ptr %3, i64 %indvars.iv.unr, i32 3
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.epil, i8 0, i64 16, i1 false)
store ptr %destroy, ptr %FreeData.i.epil, align 8, !tbaa !11
br label %return
return: ; preds = %for.body.epil, %return.loopexit.unr-lcssa, %for.cond.preheader, %entry
%retval.0 = phi i32 [ 4, %entry ], [ 5, %for.cond.preheader ], [ 5, %return.loopexit.unr-lcssa ], [ 5, %for.body.epil ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @match__(ptr nocapture noundef readonly %key1, ptr nocapture noundef readonly %key2) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %key1, align 4, !tbaa !26
%1 = load i32, ptr %key2, align 4, !tbaa !26
%cmp = icmp eq i32 %0, %1
%. = zext i1 %cmp to i32
ret i32 %.
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hash_func(ptr nocapture noundef readonly %key) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %key, align 4, !tbaa !26
%rem = srem i32 %0, 200000
ret i32 %rem
}
; Function Attrs: nounwind uwtable
define dso_local void @look_up_and_insert(ptr noundef %data, ptr nocapture noundef readonly %htbl) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr %data, align 4, !tbaa !26
%rem = srem i32 %0, 200000
%table = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 5
%1 = load ptr, ptr %table, align 8, !tbaa !23
%idx.ext = sext i32 %rem to i64
%add.ptr = getelementptr inbounds %struct.List_, ptr %1, i64 %idx.ext
%element.029 = load ptr, ptr %add.ptr, align 8, !tbaa !28
%cmp.not30 = icmp eq ptr %element.029, null
br i1 %cmp.not30, label %if.then6, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%match = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%element.031 = phi ptr [ %element.029, %while.body.lr.ph ], [ %element.0, %if.end ]
%2 = load ptr, ptr %match, align 8, !tbaa !21
%3 = load ptr, ptr %element.031, align 8, !tbaa !12
%call = tail call i32 %2(ptr noundef nonnull %data, ptr noundef %3) #13
%cmp2 = icmp eq i32 %call, 1
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %while.body
%4 = load ptr, ptr %element.031, align 8, !tbaa !12
%num_sc = getelementptr inbounds %struct._htbl_el, ptr %4, i64 0, i32 1
%5 = load i32, ptr %num_sc, align 4, !tbaa !29
%add = add nsw i32 %5, 1
store i32 %add, ptr %num_sc, align 4, !tbaa !29
br label %if.end15
if.end: ; preds = %while.body
%next = getelementptr inbounds %struct.ListElmt_, ptr %element.031, i64 0, i32 1
%element.0 = load ptr, ptr %next, align 8, !tbaa !28
%cmp.not = icmp eq ptr %element.0, null
br i1 %cmp.not, label %if.then6.loopexit, label %while.body, !llvm.loop !30
if.then6.loopexit: ; preds = %if.end
%.pre = load i32, ptr %data, align 4, !tbaa !26
%.pre33 = load ptr, ptr %table, align 8, !tbaa !23
br label %if.then6
if.then6: ; preds = %if.then6.loopexit, %entry
%6 = phi ptr [ %.pre33, %if.then6.loopexit ], [ %1, %entry ]
%7 = phi i32 [ %.pre, %if.then6.loopexit ], [ %0, %entry ]
%call7 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #12
store i32 %7, ptr %call7, align 4, !tbaa !26
%num_sc10 = getelementptr inbounds %struct._htbl_el, ptr %call7, i64 0, i32 1
store i32 1, ptr %num_sc10, align 4, !tbaa !29
%add.ptr13 = getelementptr inbounds %struct.List_, ptr %6, i64 %idx.ext
%call.i = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #12
%cmp.i = icmp eq ptr %call.i, null
br i1 %cmp.i, label %if.end15, label %if.end.i
if.end.i: ; preds = %if.then6
store ptr %call7, ptr %call.i, align 8, !tbaa !12
%_size.i = getelementptr inbounds %struct.List_, ptr %6, i64 %idx.ext, i32 4
%8 = load i32, ptr %_size.i, align 8, !tbaa !5
%cmp3.i = icmp eq i32 %8, 0
br i1 %cmp3.i, label %if.then4.i, label %if.end5.i
if.then4.i: ; preds = %if.end.i
%tail.i = getelementptr inbounds %struct.List_, ptr %6, i64 %idx.ext, i32 1
store ptr %call.i, ptr %tail.i, align 8, !tbaa !14
br label %if.end5.i
if.end5.i: ; preds = %if.then4.i, %if.end.i
%9 = load ptr, ptr %add.ptr13, align 8, !tbaa !15
%next.i = getelementptr inbounds %struct.ListElmt_, ptr %call.i, i64 0, i32 1
store ptr %9, ptr %next.i, align 8, !tbaa !16
store ptr %call.i, ptr %add.ptr13, align 8, !tbaa !15
%inc.i = add nsw i32 %8, 1
store i32 %inc.i, ptr %_size.i, align 8, !tbaa !5
br label %if.end15
if.end15: ; preds = %if.end5.i, %if.then6, %if.then
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @look_up_r_num_s(ptr nocapture noundef readonly %htbl, i32 noundef %sc_lan) local_unnamed_addr #6 {
entry:
%tmp = alloca %struct._htbl_el, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tmp) #13
%rem = srem i32 %sc_lan, 200000
store i32 %sc_lan, ptr %tmp, align 4, !tbaa !26
%table = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 5
%0 = load ptr, ptr %table, align 8, !tbaa !23
%idx.ext = sext i32 %rem to i64
%add.ptr = getelementptr inbounds %struct.List_, ptr %0, i64 %idx.ext
%element.014 = load ptr, ptr %add.ptr, align 8, !tbaa !28
%cmp.not15 = icmp eq ptr %element.014, null
br i1 %cmp.not15, label %cleanup, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%match = getelementptr inbounds %struct._chtbl, ptr %htbl, i64 0, i32 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%element.016 = phi ptr [ %element.014, %while.body.lr.ph ], [ %element.0, %if.end ]
%1 = load ptr, ptr %match, align 8, !tbaa !21
%2 = load ptr, ptr %element.016, align 8, !tbaa !12
%call = call i32 %1(ptr noundef nonnull %tmp, ptr noundef %2) #13
%cmp1 = icmp eq i32 %call, 1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
%3 = load ptr, ptr %element.016, align 8, !tbaa !12
%num_sc = getelementptr inbounds %struct._htbl_el, ptr %3, i64 0, i32 1
%4 = load i32, ptr %num_sc, align 4, !tbaa !29
br label %cleanup
if.end: ; preds = %while.body
%next = getelementptr inbounds %struct.ListElmt_, ptr %element.016, i64 0, i32 1
%element.0 = load ptr, ptr %next, align 8, !tbaa !28
%cmp.not = icmp eq ptr %element.0, null
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !31
cleanup: ; preds = %if.end, %entry, %if.then
%retval.0 = phi i32 [ %4, %if.then ], [ 0, %entry ], [ 0, %if.end ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tmp) #13
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%tmp = alloca %struct._htbl_el, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tmp) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call.i = call noalias dereferenceable_or_null(8000000) ptr @malloc(i64 noundef 8000000) #12
%cmp.i = icmp eq ptr %call.i, null
br i1 %cmp.i, label %chtbl_init.exit, label %for.body.i
for.body.i: ; preds = %entry, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ 0, %entry ]
%add.ptr.i = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.i
%_size.i.i = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.i, i32 4
store i32 0, ptr %_size.i.i, align 8, !tbaa !5
%FreeData.i.i = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.i, i32 3
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.i, i8 0, i64 16, i1 false)
store ptr null, ptr %FreeData.i.i, align 8, !tbaa !11
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%add.ptr.i.1 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.next.i
%_size.i.i.1 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.next.i, i32 4
store i32 0, ptr %_size.i.i.1, align 8, !tbaa !5
%FreeData.i.i.1 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %indvars.iv.next.i, i32 3
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %add.ptr.i.1, i8 0, i64 16, i1 false)
store ptr null, ptr %FreeData.i.i.1, align 8, !tbaa !11
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, 200000
br i1 %exitcond.not.i.1, label %chtbl_init.exit, label %for.body.i, !llvm.loop !24
chtbl_init.exit: ; preds = %for.body.i, %entry
%0 = load i32, ptr %n, align 4, !tbaa !32
%cmp155 = icmp sgt i32 %0, 0
br i1 %cmp155, label %for.body, label %for.end
for.body: ; preds = %chtbl_init.exit, %look_up_and_insert.exit
%i.0156 = phi i32 [ %inc, %look_up_and_insert.exit ], [ 0, %chtbl_init.exit ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !26
%rem.i = srem i32 %1, 200000
%idx.ext.i = sext i32 %rem.i to i64
%add.ptr.i77 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i
%element.029.i = load ptr, ptr %add.ptr.i77, align 8, !tbaa !28
%cmp.not30.i = icmp eq ptr %element.029.i, null
br i1 %cmp.not30.i, label %if.then6.i, label %while.body.i
while.body.i: ; preds = %for.body, %if.end.i
%element.031.i = phi ptr [ %element.0.i, %if.end.i ], [ %element.029.i, %for.body ]
%2 = load ptr, ptr %element.031.i, align 8, !tbaa !12
%3 = load i32, ptr %2, align 4, !tbaa !26
%cmp.i194 = icmp eq i32 %1, %3
br i1 %cmp.i194, label %if.then.i, label %if.end.i
if.then.i: ; preds = %while.body.i
%num_sc.i = getelementptr inbounds %struct._htbl_el, ptr %2, i64 0, i32 1
%4 = load i32, ptr %num_sc.i, align 4, !tbaa !29
%add.i = add nsw i32 %4, 1
store i32 %add.i, ptr %num_sc.i, align 4, !tbaa !29
br label %look_up_and_insert.exit
if.end.i: ; preds = %while.body.i
%next.i = getelementptr inbounds %struct.ListElmt_, ptr %element.031.i, i64 0, i32 1
%element.0.i = load ptr, ptr %next.i, align 8, !tbaa !28
%cmp.not.i = icmp eq ptr %element.0.i, null
br i1 %cmp.not.i, label %if.then6.i, label %while.body.i, !llvm.loop !30
if.then6.i: ; preds = %if.end.i, %for.body
%call7.i = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #12
store i32 %1, ptr %call7.i, align 4, !tbaa !26
%num_sc10.i = getelementptr inbounds %struct._htbl_el, ptr %call7.i, i64 0, i32 1
store i32 1, ptr %num_sc10.i, align 4, !tbaa !29
%call.i.i = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #12
%cmp.i.i = icmp eq ptr %call.i.i, null
br i1 %cmp.i.i, label %look_up_and_insert.exit, label %if.end.i.i
if.end.i.i: ; preds = %if.then6.i
store ptr %call7.i, ptr %call.i.i, align 8, !tbaa !12
%_size.i.i80 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i, i32 4
%5 = load i32, ptr %_size.i.i80, align 8, !tbaa !5
%cmp3.i.i = icmp eq i32 %5, 0
br i1 %cmp3.i.i, label %if.then4.i.i, label %if.end5.i.i
if.then4.i.i: ; preds = %if.end.i.i
%tail.i.i = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i, i32 1
store ptr %call.i.i, ptr %tail.i.i, align 8, !tbaa !14
br label %if.end5.i.i
if.end5.i.i: ; preds = %if.then4.i.i, %if.end.i.i
%next.i.i = getelementptr inbounds %struct.ListElmt_, ptr %call.i.i, i64 0, i32 1
store ptr %element.029.i, ptr %next.i.i, align 8, !tbaa !16
store ptr %call.i.i, ptr %add.ptr.i77, align 8, !tbaa !15
%inc.i.i = add nsw i32 %5, 1
store i32 %inc.i.i, ptr %_size.i.i80, align 8, !tbaa !5
br label %look_up_and_insert.exit
look_up_and_insert.exit: ; preds = %if.then.i, %if.then6.i, %if.end5.i.i
%inc = add nuw nsw i32 %i.0156, 1
%6 = load i32, ptr %n, align 4, !tbaa !32
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !33
for.end: ; preds = %look_up_and_insert.exit, %chtbl_init.exit
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%7 = load i32, ptr %m, align 4, !tbaa !32
%conv = zext i32 %7 to i64
%mul = shl nuw nsw i64 %conv, 3
%call4 = call noalias ptr @malloc(i64 noundef %mul) #12
%cmp6157 = icmp sgt i32 %7, 0
call void @llvm.assume(i1 %cmp6157)
br label %for.body8
for.cond13.preheader: ; preds = %for.body8
%cmp14159 = icmp sgt i32 %8, 0
call void @llvm.assume(i1 %cmp14159)
br label %for.body16
for.body8: ; preds = %for.end, %for.body8
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 0, %for.end ]
%arrayidx = getelementptr inbounds %struct._movie, ptr %call4, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !32
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp6, label %for.body8, label %for.cond13.preheader, !llvm.loop !34
for.cond23.preheader: ; preds = %for.body16
%cmp24161 = icmp sgt i32 %10, 0
call void @llvm.assume(i1 %cmp24161)
%wide.trip.count = zext i32 %10 to i64
br label %for.body26
for.body16: ; preds = %for.cond13.preheader, %for.body16
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body16 ], [ 0, %for.cond13.preheader ]
%sub = getelementptr inbounds %struct._movie, ptr %call4, i64 %indvars.iv176, i32 1
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sub)
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%10 = load i32, ptr %m, align 4, !tbaa !32
%11 = sext i32 %10 to i64
%cmp14 = icmp slt i64 %indvars.iv.next177, %11
br i1 %cmp14, label %for.body16, label %for.cond23.preheader, !llvm.loop !35
for.body26: ; preds = %for.cond23.preheader, %for.inc49
%indvars.iv179 = phi i64 [ 0, %for.cond23.preheader ], [ %indvars.iv.next180, %for.inc49 ]
%v_p_max.0165 = phi i32 [ 0, %for.cond23.preheader ], [ %v_p_max.1, %for.inc49 ]
%mi.0163 = phi i32 [ undef, %for.cond23.preheader ], [ %mi.1, %for.inc49 ]
%al_sat_max.0162 = phi i32 [ 0, %for.cond23.preheader ], [ %al_sat_max.1, %for.inc49 ]
%arrayidx28 = getelementptr inbounds %struct._movie, ptr %call4, i64 %indvars.iv179
%12 = load i32, ptr %arrayidx28, align 4, !tbaa !36
%rem.i81 = srem i32 %12, 200000
%idx.ext.i83 = sext i32 %rem.i81 to i64
%add.ptr.i84 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i83
%element.014.i = load ptr, ptr %add.ptr.i84, align 8, !tbaa !28
%cmp.not15.i = icmp eq ptr %element.014.i, null
br i1 %cmp.not15.i, label %look_up_r_num_s.exit, label %while.body.i87
while.body.i87: ; preds = %for.body26, %if.end.i89
%element.016.i = phi ptr [ %element.0.i91, %if.end.i89 ], [ %element.014.i, %for.body26 ]
%13 = load ptr, ptr %element.016.i, align 8, !tbaa !12
%14 = load i32, ptr %13, align 4, !tbaa !26
%cmp.i195 = icmp eq i32 %12, %14
br i1 %cmp.i195, label %if.then.i94, label %if.end.i89
if.then.i94: ; preds = %while.body.i87
%num_sc.i95 = getelementptr inbounds %struct._htbl_el, ptr %13, i64 0, i32 1
%15 = load i32, ptr %num_sc.i95, align 4, !tbaa !29
br label %look_up_r_num_s.exit
if.end.i89: ; preds = %while.body.i87
%next.i90 = getelementptr inbounds %struct.ListElmt_, ptr %element.016.i, i64 0, i32 1
%element.0.i91 = load ptr, ptr %next.i90, align 8, !tbaa !28
%cmp.not.i92 = icmp eq ptr %element.0.i91, null
br i1 %cmp.not.i92, label %look_up_r_num_s.exit, label %while.body.i87, !llvm.loop !31
look_up_r_num_s.exit: ; preds = %if.end.i89, %for.body26, %if.then.i94
%retval.0.i93 = phi i32 [ %15, %if.then.i94 ], [ 0, %for.body26 ], [ 0, %if.end.i89 ]
%cmp31 = icmp sgt i32 %retval.0.i93, %v_p_max.0165
br i1 %cmp31, label %if.then, label %if.else
if.then: ; preds = %look_up_r_num_s.exit
%sub35 = getelementptr inbounds %struct._movie, ptr %call4, i64 %indvars.iv179, i32 1
%16 = load i32, ptr %sub35, align 4, !tbaa !38
%rem.i97 = srem i32 %16, 200000
%idx.ext.i99 = sext i32 %rem.i97 to i64
%add.ptr.i100 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i99
%element.014.i101 = load ptr, ptr %add.ptr.i100, align 8, !tbaa !28
%cmp.not15.i102 = icmp eq ptr %element.014.i101, null
br i1 %cmp.not15.i102, label %look_up_r_num_s.exit116, label %while.body.i105
while.body.i105: ; preds = %if.then, %if.end.i109
%element.016.i106 = phi ptr [ %element.0.i111, %if.end.i109 ], [ %element.014.i101, %if.then ]
%17 = load ptr, ptr %element.016.i106, align 8, !tbaa !12
%18 = load i32, ptr %17, align 4, !tbaa !26
%cmp.i197 = icmp eq i32 %16, %18
br i1 %cmp.i197, label %if.then.i114, label %if.end.i109
if.then.i114: ; preds = %while.body.i105
%num_sc.i115 = getelementptr inbounds %struct._htbl_el, ptr %17, i64 0, i32 1
%19 = load i32, ptr %num_sc.i115, align 4, !tbaa !29
br label %look_up_r_num_s.exit116
if.end.i109: ; preds = %while.body.i105
%next.i110 = getelementptr inbounds %struct.ListElmt_, ptr %element.016.i106, i64 0, i32 1
%element.0.i111 = load ptr, ptr %next.i110, align 8, !tbaa !28
%cmp.not.i112 = icmp eq ptr %element.0.i111, null
br i1 %cmp.not.i112, label %look_up_r_num_s.exit116, label %while.body.i105, !llvm.loop !31
look_up_r_num_s.exit116: ; preds = %if.end.i109, %if.then, %if.then.i114
%retval.0.i113 = phi i32 [ %19, %if.then.i114 ], [ 0, %if.then ], [ 0, %if.end.i109 ]
%20 = trunc i64 %indvars.iv179 to i32
br label %for.inc49
if.else: ; preds = %look_up_r_num_s.exit
%cmp37 = icmp eq i32 %retval.0.i93, %v_p_max.0165
br i1 %cmp37, label %if.then39, label %for.inc49
if.then39: ; preds = %if.else
%sub42 = getelementptr inbounds %struct._movie, ptr %call4, i64 %indvars.iv179, i32 1
%21 = load i32, ptr %sub42, align 4, !tbaa !38
%rem.i118 = srem i32 %21, 200000
%idx.ext.i120 = sext i32 %rem.i118 to i64
%add.ptr.i121 = getelementptr inbounds %struct.List_, ptr %call.i, i64 %idx.ext.i120
%element.014.i122 = load ptr, ptr %add.ptr.i121, align 8, !tbaa !28
%cmp.not15.i123 = icmp eq ptr %element.014.i122, null
br i1 %cmp.not15.i123, label %look_up_r_num_s.exit137, label %while.body.i126
while.body.i126: ; preds = %if.then39, %if.end.i130
%element.016.i127 = phi ptr [ %element.0.i132, %if.end.i130 ], [ %element.014.i122, %if.then39 ]
%22 = load ptr, ptr %element.016.i127, align 8, !tbaa !12
%23 = load i32, ptr %22, align 4, !tbaa !26
%cmp.i199 = icmp eq i32 %21, %23
br i1 %cmp.i199, label %if.then.i135, label %if.end.i130
if.then.i135: ; preds = %while.body.i126
%num_sc.i136 = getelementptr inbounds %struct._htbl_el, ptr %22, i64 0, i32 1
%24 = load i32, ptr %num_sc.i136, align 4, !tbaa !29
br label %look_up_r_num_s.exit137
if.end.i130: ; preds = %while.body.i126
%next.i131 = getelementptr inbounds %struct.ListElmt_, ptr %element.016.i127, i64 0, i32 1
%element.0.i132 = load ptr, ptr %next.i131, align 8, !tbaa !28
%cmp.not.i133 = icmp eq ptr %element.0.i132, null
br i1 %cmp.not.i133, label %look_up_r_num_s.exit137, label %while.body.i126, !llvm.loop !31
look_up_r_num_s.exit137: ; preds = %if.end.i130, %if.then39, %if.then.i135
%retval.0.i134 = phi i32 [ %24, %if.then.i135 ], [ 0, %if.then39 ], [ 0, %if.end.i130 ]
%cmp44 = icmp sgt i32 %retval.0.i134, %al_sat_max.0162
%spec.select = call i32 @llvm.smax.i32(i32 %retval.0.i134, i32 %al_sat_max.0162)
%25 = trunc i64 %indvars.iv179 to i32
%spec.select75 = select i1 %cmp44, i32 %25, i32 %mi.0163
br label %for.inc49
for.inc49: ; preds = %look_up_r_num_s.exit137, %look_up_r_num_s.exit116, %if.else
%al_sat_max.1 = phi i32 [ %retval.0.i113, %look_up_r_num_s.exit116 ], [ %al_sat_max.0162, %if.else ], [ %spec.select, %look_up_r_num_s.exit137 ]
%mi.1 = phi i32 [ %20, %look_up_r_num_s.exit116 ], [ %mi.0163, %if.else ], [ %spec.select75, %look_up_r_num_s.exit137 ]
%v_p_max.1 = phi i32 [ %retval.0.i93, %look_up_r_num_s.exit116 ], [ %v_p_max.0165, %if.else ], [ %v_p_max.0165, %look_up_r_num_s.exit137 ]
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%exitcond.not = icmp eq i64 %indvars.iv.next180, %wide.trip.count
br i1 %exitcond.not, label %for.end51.loopexit, label %for.body26, !llvm.loop !39
for.end51.loopexit: ; preds = %for.inc49
%26 = add nsw i32 %mi.1, 1
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %26)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tmp) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #13
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #10
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #11
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 memory(write, argmem: readwrite, inaccessiblemem: 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #12 = { nounwind allocsize(0) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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 32}
!6 = !{!"List_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 24}
!12 = !{!13, !7, i64 0}
!13 = !{!"ListElmt_", !7, i64 0, !7, i64 8}
!14 = !{!6, !7, i64 8}
!15 = !{!6, !7, i64 0}
!16 = !{!13, !7, i64 8}
!17 = !{!18, !10, i64 0}
!18 = !{!"_chtbl", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40}
!19 = !{!18, !10, i64 32}
!20 = !{!18, !7, i64 8}
!21 = !{!18, !7, i64 16}
!22 = !{!18, !7, i64 24}
!23 = !{!18, !7, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 0}
!27 = !{!"_htbl_el", !10, i64 0, !10, i64 4}
!28 = !{!7, !7, i64 0}
!29 = !{!27, !10, i64 4}
!30 = distinct !{!30, !25}
!31 = distinct !{!31, !25}
!32 = !{!10, !10, i64 0}
!33 = distinct !{!33, !25}
!34 = distinct !{!34, !25}
!35 = distinct !{!35, !25}
!36 = !{!37, !10, i64 0}
!37 = !{!"_movie", !10, i64 0, !10, i64 4}
!38 = !{!37, !10, i64 4}
!39 = distinct !{!39, !25}
|
#include<stdio.h>
int main(){
int A,B;
int x;
scanf("%d", &A);
scanf("%d", &B);
x = A+B;
if (x > 23){
x = x-24;
printf("%d", x);
} else {
printf("%d",x);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337702/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337702/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 23
%sub = add nsw i32 %add, -24
%add.sink = select i1 %cmp, i32 %sub, i32 %add
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, t;
scanf("%d %d", &a, &t);
printf("%d\n", (a + t) % 24);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337768/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337768/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%t = 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 %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %t)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %t, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%rem = srem i32 %add, 24
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,d;
scanf("%d %d",&a,&b);
c=a+b;
d=c%24;
printf("%d\n",d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337810/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337810/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%rem = srem i32 %add, 24
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf( "%d %d",&a,&b );
if( a + b < 24 ){
printf( "%d",a+b );
}
else if( a + b >= 24 ){
printf( "%d",a+b-24 );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337854/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337854/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp slt i32 %add, 24
%sub = add nsw i32 %add, -24
%sub.sink = select i1 %cmp, i32 %add, i32 %sub
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int A,B;
scanf("%d%d",&A,&B);
int sum=A+B;
if(sum>=24)
{
sum=sum-24;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337898/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337898/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 23
%sub = add nsw i32 %add, -24
%spec.select = select i1 %cmp, i32 %sub, i32 %add
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(int argc, char const *argv[]){
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%24);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337940/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337940/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%rem = srem i32 %add, 24
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define _USE_MATH_DEFINES
int main()
{
int n=0,best_n=0;
float T=0.0,A=0.0,height_i[1001]={0.0},temp_average=0.0,temp_diff_from_a=0.0,new_temp_diff_from_a=0.0;
scanf("%d",&n);
scanf("%f %f",&T,&A);
for(int i=0;i<n;i++)
scanf("%f",&height_i[i]);
temp_average=T-height_i[0]*0.006;
temp_diff_from_a=fabsf(A-temp_average);
for(int i=1;i<n;i++){
temp_average=T-height_i[i]*0.006;
new_temp_diff_from_a=fabsf(A-temp_average);
if(new_temp_diff_from_a<temp_diff_from_a){
temp_diff_from_a=new_temp_diff_from_a;
best_n=i;
}
}
printf("%d",best_n+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_337984/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_337984/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%f\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 float, align 4
%A = alloca float, align 4
%height_i = alloca [1001 x float], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
store i32 0, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #5
store float 0.000000e+00, ptr %T, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
store float 0.000000e+00, ptr %A, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %height_i) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %height_i, i8 0, i64 4004, 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 %T, ptr noundef nonnull %A)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %for.cond.cleanup10
for.cond.cleanup: ; preds = %for.body
%1 = load float, ptr %T, align 4, !tbaa !9
%conv = fpext float %1 to double
%2 = load float, ptr %A, align 4, !tbaa !9
%cmp834 = icmp sgt i32 %6, 1
br i1 %cmp834, label %for.body11.preheader, label %for.cond.cleanup10
for.body11.preheader: ; preds = %for.cond.cleanup
%.pre = load float, ptr %height_i, align 16, !tbaa !9
%3 = fpext float %.pre to double
%neg = fneg double %3
%4 = call double @llvm.fmuladd.f64(double %neg, double 6.000000e-03, double %conv)
%conv5 = fptrunc double %4 to float
%sub = fsub float %2, %conv5
%5 = call float @llvm.fabs.f32(float %sub)
%wide.trip.count = zext i32 %6 to i64
br label %for.body11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x float], ptr %height_i, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
for.cond.cleanup10.loopexit: ; preds = %for.body11
%8 = add nsw i32 %best_n.1, 1
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %entry, %for.cond.cleanup10.loopexit, %for.cond.cleanup
%best_n.0.lcssa = phi i32 [ 1, %for.cond.cleanup ], [ %8, %for.cond.cleanup10.loopexit ], [ 1, %entry ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %best_n.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %height_i) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body11: ; preds = %for.body11.preheader, %for.body11
%indvars.iv41 = phi i64 [ 1, %for.body11.preheader ], [ %indvars.iv.next42, %for.body11 ]
%temp_diff_from_a.036 = phi float [ %5, %for.body11.preheader ], [ %temp_diff_from_a.1, %for.body11 ]
%best_n.035 = phi i32 [ 0, %for.body11.preheader ], [ %best_n.1, %for.body11 ]
%arrayidx14 = getelementptr inbounds [1001 x float], ptr %height_i, i64 0, i64 %indvars.iv41
%9 = load float, ptr %arrayidx14, align 4, !tbaa !9
%conv15 = fpext float %9 to double
%neg16 = fneg double %conv15
%10 = call double @llvm.fmuladd.f64(double %neg16, double 6.000000e-03, double %conv)
%conv17 = fptrunc double %10 to float
%sub18 = fsub float %2, %conv17
%11 = call float @llvm.fabs.f32(float %sub18)
%cmp19 = fcmp olt float %11, %temp_diff_from_a.036
%12 = trunc i64 %indvars.iv41 to i32
%best_n.1 = select i1 %cmp19, i32 %12, i32 %best_n.035
%temp_diff_from_a.1 = select i1 %cmp19, float %11, float %temp_diff_from_a.036
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%exitcond.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup10.loopexit, label %for.body11, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
double fabs(double a){return (a<0)?-a:a;}
double a,t,h;
int n;
void Main(){
scanf("%d",&n);
scanf("%lf%lf",&t,&a);
double d = 1e10;
int Ans = 0;
for(int i = 1;i<=n;i++){
scanf("%lf",&h);
double tp = t-(h*0.006);
// printf("%lf ",tp);
if(d>fabs(a-tp)){
Ans = i;
d = fabs(a-tp);
}
}
printf("%d\n",Ans);
}
int main(){
Main();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338026/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338026/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%lf%lf\00", align 1
@t = dso_local global double 0.000000e+00, align 8
@a = dso_local global double 0.000000e+00, align 8
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@h = dso_local global double 0.000000e+00, align 8
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @fabs(double noundef %a) local_unnamed_addr #0 {
entry:
%cmp = fcmp olt double %a, 0.000000e+00
%fneg = fneg double %a
%cond = select i1 %cmp, double %fneg, double %a
ret double %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @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 @t, ptr noundef nonnull @a)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not9 = icmp slt i32 %0, 1
br i1 %cmp.not9, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%Ans.0.lcssa = phi i32 [ 0, %entry ], [ %Ans.1, %for.body ]
%call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %Ans.0.lcssa)
ret void
for.body: ; preds = %entry, %for.body
%d.012 = phi double [ %d.1, %for.body ], [ 1.000000e+10, %entry ]
%i.011 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%Ans.010 = phi i32 [ %Ans.1, %for.body ], [ 0, %entry ]
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @h)
%1 = load double, ptr @t, align 8, !tbaa !9
%2 = load double, ptr @h, align 8, !tbaa !9
%neg = fneg double %2
%3 = tail call double @llvm.fmuladd.f64(double %neg, double 6.000000e-03, double %1)
%4 = load double, ptr @a, align 8, !tbaa !9
%sub = fsub double %4, %3
%5 = tail call double @llvm.fabs.f64(double %sub)
%cmp3 = fcmp ogt double %d.012, %5
%Ans.1 = select i1 %cmp3, i32 %i.011, i32 %Ans.010
%d.1 = select i1 %cmp3, double %5, double %d.012
%inc = add nuw nsw i32 %i.011, 1
%6 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.011, %6
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%call1.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t, ptr noundef nonnull @a)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not9.i = icmp slt i32 %0, 1
br i1 %cmp.not9.i, label %Main.exit, label %for.body.i
for.body.i: ; preds = %entry, %for.body.i
%d.012.i = phi double [ %d.1.i, %for.body.i ], [ 1.000000e+10, %entry ]
%i.011.i = phi i32 [ %inc.i, %for.body.i ], [ 1, %entry ]
%Ans.010.i = phi i32 [ %Ans.1.i, %for.body.i ], [ 0, %entry ]
%call2.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @h)
%1 = load double, ptr @t, align 8, !tbaa !9
%2 = load double, ptr @h, align 8, !tbaa !9
%neg.i = fneg double %2
%3 = tail call double @llvm.fmuladd.f64(double %neg.i, double 6.000000e-03, double %1)
%4 = load double, ptr @a, align 8, !tbaa !9
%sub.i = fsub double %4, %3
%5 = tail call double @llvm.fabs.f64(double %sub.i)
%cmp3.i = fcmp ogt double %d.012.i, %5
%Ans.1.i = select i1 %cmp3.i, i32 %i.011.i, i32 %Ans.010.i
%d.1.i = select i1 %cmp3.i, double %5, double %d.012.i
%inc.i = add nuw nsw i32 %i.011.i, 1
%6 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not.i = icmp slt i32 %i.011.i, %6
br i1 %cmp.not.not.i, label %for.body.i, label %Main.exit, !llvm.loop !11
Main.exit: ; preds = %for.body.i, %entry
%Ans.0.lcssa.i = phi i32 [ 0, %entry ], [ %Ans.1.i, %for.body.i ]
%call5.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %Ans.0.lcssa.i)
ret i32 0
}
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int N;
int T , A;
int H[1000];
if(scanf("%d %d %d",&N ,&T ,&A));
for(int i=0;i<N;i++){
if(scanf("%d",&H[i]));
}
int x[N];
for(int j=0;j<N;j++){
x[j] = 1000*A - (1000*T - 6*H[j]);
if(x[j]<0){
x[j] *= -1;
}
}
int min = 0;
for(int k=1;k<N;k++){
if(x[k] < x[min]){
min = k;
}
}
printf("%d\n",min+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338077/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338077/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%T = alloca i32, align 4
%A = alloca i32, align 4
%H = 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 %T) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %H) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa54 = phi i32 [ %0, %entry ], [ %17, %for.body ]
%1 = zext i32 %.lcssa54 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp657 = icmp sgt i32 %3, 0
br i1 %cmp657, label %for.body8.lr.ph, label %for.cond.cleanup29
for.body8.lr.ph: ; preds = %for.cond.cleanup
%4 = load i32, ptr %A, align 4, !tbaa !5
%5 = load i32, ptr %T, align 4, !tbaa !5
%reass.add = sub i32 %4, %5
%reass.mul = mul i32 %reass.add, 1000
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %reass.mul, 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 i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%6 = getelementptr inbounds [1000 x i32], ptr %H, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load74 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = mul <4 x i32> %wide.load, <i32 6, i32 6, i32 6, i32 6>
%9 = mul <4 x i32> %wide.load74, <i32 6, i32 6, i32 6, i32 6>
%10 = add <4 x i32> %broadcast.splat, %8
%11 = add <4 x i32> %broadcast.splat, %9
%12 = getelementptr inbounds i32, ptr %vla, i64 %index
%13 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %10, i1 true)
%14 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %11, i1 true)
store <4 x i32> %13, ptr %12, align 16, !tbaa !5
%15 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %14, ptr %15, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond27.preheader, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%indvars.iv65.ph = phi i64 [ 0, %for.body8.lr.ph ], [ %n.vec, %middle.block ]
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %H, 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
%17 = load i32, ptr %N, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond27.preheader: ; preds = %for.body8, %middle.block
%cmp2860 = icmp sgt i32 %3, 1
br i1 %cmp2860, label %for.body30.preheader, label %for.cond.cleanup29
for.body30.preheader: ; preds = %for.cond27.preheader
%wide.trip.count71 = zext i32 %3 to i64
%19 = add nsw i64 %wide.trip.count71, -1
%20 = add nsw i64 %wide.trip.count71, -2
%xtraiter = and i64 %19, 3
%21 = icmp ult i64 %20, 3
br i1 %21, label %for.cond.cleanup29.loopexit.unr-lcssa, label %for.body30.preheader.new
for.body30.preheader.new: ; preds = %for.body30.preheader
%unroll_iter = and i64 %19, -4
br label %for.body30
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body8 ], [ %indvars.iv65.ph, %for.body8.preheader ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %H, i64 0, i64 %indvars.iv65
%22 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%mul12.neg.neg = mul i32 %22, 6
%sub13 = add i32 %reass.mul, %mul12.neg.neg
%arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv65
%spec.select = call i32 @llvm.abs.i32(i32 %sub13, i1 true)
store i32 %spec.select, ptr %arrayidx15, align 4, !tbaa !5
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
br i1 %exitcond.not, label %for.cond27.preheader, label %for.body8, !llvm.loop !14
for.cond.cleanup29.loopexit.unr-lcssa: ; preds = %for.body30, %for.body30.preheader
%spec.select53.lcssa.ph = phi i32 [ undef, %for.body30.preheader ], [ %spec.select53.3, %for.body30 ]
%indvars.iv68.unr = phi i64 [ 1, %for.body30.preheader ], [ %indvars.iv.next69.3, %for.body30 ]
%min.061.unr = phi i32 [ 0, %for.body30.preheader ], [ %spec.select53.3, %for.body30 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup29.loopexit, label %for.body30.epil
for.body30.epil: ; preds = %for.cond.cleanup29.loopexit.unr-lcssa, %for.body30.epil
%indvars.iv68.epil = phi i64 [ %indvars.iv.next69.epil, %for.body30.epil ], [ %indvars.iv68.unr, %for.cond.cleanup29.loopexit.unr-lcssa ]
%min.061.epil = phi i32 [ %spec.select53.epil, %for.body30.epil ], [ %min.061.unr, %for.cond.cleanup29.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body30.epil ], [ 0, %for.cond.cleanup29.loopexit.unr-lcssa ]
%arrayidx32.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68.epil
%23 = load i32, ptr %arrayidx32.epil, align 4, !tbaa !5
%idxprom33.epil = sext i32 %min.061.epil to i64
%arrayidx34.epil = getelementptr inbounds i32, ptr %vla, i64 %idxprom33.epil
%24 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5
%cmp35.epil = icmp slt i32 %23, %24
%25 = trunc i64 %indvars.iv68.epil to i32
%spec.select53.epil = select i1 %cmp35.epil, i32 %25, i32 %min.061.epil
%indvars.iv.next69.epil = add nuw nsw i64 %indvars.iv68.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.cond.cleanup29.loopexit, label %for.body30.epil, !llvm.loop !15
for.cond.cleanup29.loopexit: ; preds = %for.body30.epil, %for.cond.cleanup29.loopexit.unr-lcssa
%spec.select53.lcssa = phi i32 [ %spec.select53.lcssa.ph, %for.cond.cleanup29.loopexit.unr-lcssa ], [ %spec.select53.epil, %for.body30.epil ]
%26 = add nsw i32 %spec.select53.lcssa, 1
br label %for.cond.cleanup29
for.cond.cleanup29: ; preds = %for.cond.cleanup, %for.cond.cleanup29.loopexit, %for.cond27.preheader
%min.0.lcssa = phi i32 [ 1, %for.cond27.preheader ], [ %26, %for.cond.cleanup29.loopexit ], [ 1, %for.cond.cleanup ]
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %H) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body30: ; preds = %for.body30, %for.body30.preheader.new
%indvars.iv68 = phi i64 [ 1, %for.body30.preheader.new ], [ %indvars.iv.next69.3, %for.body30 ]
%min.061 = phi i32 [ 0, %for.body30.preheader.new ], [ %spec.select53.3, %for.body30 ]
%niter = phi i64 [ 0, %for.body30.preheader.new ], [ %niter.next.3, %for.body30 ]
%arrayidx32 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68
%27 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%idxprom33 = sext i32 %min.061 to i64
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33
%28 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35 = icmp slt i32 %27, %28
%29 = trunc i64 %indvars.iv68 to i32
%spec.select53 = select i1 %cmp35, i32 %29, i32 %min.061
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%arrayidx32.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next69
%30 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5
%idxprom33.1 = sext i32 %spec.select53 to i64
%arrayidx34.1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33.1
%31 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5
%cmp35.1 = icmp slt i32 %30, %31
%32 = trunc i64 %indvars.iv.next69 to i32
%spec.select53.1 = select i1 %cmp35.1, i32 %32, i32 %spec.select53
%indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
%arrayidx32.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next69.1
%33 = load i32, ptr %arrayidx32.2, align 4, !tbaa !5
%idxprom33.2 = sext i32 %spec.select53.1 to i64
%arrayidx34.2 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33.2
%34 = load i32, ptr %arrayidx34.2, align 4, !tbaa !5
%cmp35.2 = icmp slt i32 %33, %34
%35 = trunc i64 %indvars.iv.next69.1 to i32
%spec.select53.2 = select i1 %cmp35.2, i32 %35, i32 %spec.select53.1
%indvars.iv.next69.2 = add nuw nsw i64 %indvars.iv68, 3
%arrayidx32.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next69.2
%36 = load i32, ptr %arrayidx32.3, align 4, !tbaa !5
%idxprom33.3 = sext i32 %spec.select53.2 to i64
%arrayidx34.3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33.3
%37 = load i32, ptr %arrayidx34.3, align 4, !tbaa !5
%cmp35.3 = icmp slt i32 %36, %37
%38 = trunc i64 %indvars.iv.next69.2 to i32
%spec.select53.3 = select i1 %cmp35.3, i32 %38, i32 %spec.select53.2
%indvars.iv.next69.3 = add nuw nsw i64 %indvars.iv68, 4
%niter.next.3 = add nuw i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup29.loopexit.unr-lcssa, label %for.body30, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(){
int a;
int boolx=1;
scanf("%d",&a);
int cnt=0;
int temp=a;
if(a==1){
printf("0 1");
return 0;
}
if(a==2){
printf("0 2");
return 0;
}
if(a==3){
printf("0 2");
return 0;
}
if(a==4){
printf("0 2");
return 0;
}
if(a==5){
printf("0 2");
return 0;
}
while(a>0){
if(boolx){
a-=5;
boolx=0;
}
else{
if(a-2>=0){
a-=2;
cnt+=2;
}
else {a--; cnt++;}
boolx=1;
}
}
printf("%d ",cnt);
a=temp;
boolx=1;
cnt=0;
while(a>0){
if(boolx){
if(a-2>=0){
a-=2;
cnt+=2;
}
else {a--; cnt++;}
boolx=0;
}
else{
a-=5;
boolx=1;
}
}
printf("%d",cnt);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33812/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33812/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"0 1\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"0 2\00", align 1
@.str.3 = 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:
%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
switch i32 %0, label %while.cond.preheader [
i32 1, label %if.then
i32 2, label %if.then3
i32 3, label %if.then7
i32 4, label %if.then11
i32 5, label %if.then15
]
while.cond.preheader: ; preds = %entry
%cmp1860 = icmp sgt i32 %0, 0
br i1 %cmp1860, label %while.body, label %while.end.thread
while.end.thread: ; preds = %while.cond.preheader
%call2774 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0)
store i32 %0, ptr %a, align 4, !tbaa !5
br label %while.end45
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
if.then3: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
if.then7: ; preds = %entry
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
if.then11: ; preds = %entry
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
if.then15: ; preds = %entry
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
while.body: ; preds = %while.cond.preheader, %if.end26
%cnt.062 = phi i32 [ %cnt.2, %if.end26 ], [ 0, %while.cond.preheader ]
%boolx.061 = phi i32 [ %boolx.1, %if.end26 ], [ 1, %while.cond.preheader ]
%1 = phi i32 [ %.pr59, %if.end26 ], [ %0, %while.cond.preheader ]
%tobool.not = icmp eq i32 %boolx.061, 0
br i1 %tobool.not, label %if.else, label %if.then19
if.then19: ; preds = %while.body
%sub = add nsw i32 %1, -5
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %if.end26
if.else: ; preds = %while.body
%cmp21 = icmp ugt i32 %1, 1
br i1 %cmp21, label %if.then22, label %if.end26.thread
if.then22: ; preds = %if.else
%sub20 = add nsw i32 %1, -2
store i32 %sub20, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %cnt.062, 2
br label %if.end26
if.end26.thread: ; preds = %if.else
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%inc = add nsw i32 %cnt.062, 1
br label %while.end
if.end26: ; preds = %if.then22, %if.then19
%.pr59 = phi i32 [ %sub, %if.then19 ], [ %sub20, %if.then22 ]
%boolx.1 = phi i32 [ 0, %if.then19 ], [ 1, %if.then22 ]
%cnt.2 = phi i32 [ %cnt.062, %if.then19 ], [ %add, %if.then22 ]
%cmp18 = icmp sgt i32 %.pr59, 0
br i1 %cmp18, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end26, %if.end26.thread
%cnt.0.lcssa = phi i32 [ %inc, %if.end26.thread ], [ %cnt.2, %if.end26 ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cnt.0.lcssa)
store i32 %0, ptr %a, align 4, !tbaa !5
br i1 %cmp1860, label %while.body30, label %while.end45
while.body30: ; preds = %while.end, %if.end44
%cnt.366 = phi i32 [ %cnt.5, %if.end44 ], [ 0, %while.end ]
%boolx.265 = phi i32 [ %boolx.3, %if.end44 ], [ 1, %while.end ]
%2 = phi i32 [ %.pr5863, %if.end44 ], [ %0, %while.end ]
%tobool31.not = icmp eq i32 %boolx.265, 0
br i1 %tobool31.not, label %if.else42, label %if.then32
if.then32: ; preds = %while.body30
%cmp34 = icmp ugt i32 %2, 1
br i1 %cmp34, label %if.then35, label %if.end44.thread
if.then35: ; preds = %if.then32
%sub33 = add nsw i32 %2, -2
store i32 %sub33, ptr %a, align 4, !tbaa !5
%add37 = add nsw i32 %cnt.366, 2
br label %if.end44
if.end44.thread: ; preds = %if.then32
%dec39 = add nsw i32 %2, -1
store i32 %dec39, ptr %a, align 4, !tbaa !5
%inc40 = add nsw i32 %cnt.366, 1
br label %while.end45
if.else42: ; preds = %while.body30
%sub43 = add nsw i32 %2, -5
store i32 %sub43, ptr %a, align 4, !tbaa !5
br label %if.end44
if.end44: ; preds = %if.then35, %if.else42
%.pr5863 = phi i32 [ %sub43, %if.else42 ], [ %sub33, %if.then35 ]
%boolx.3 = phi i32 [ 1, %if.else42 ], [ 0, %if.then35 ]
%cnt.5 = phi i32 [ %cnt.366, %if.else42 ], [ %add37, %if.then35 ]
%cmp29 = icmp sgt i32 %.pr5863, 0
br i1 %cmp29, label %while.body30, label %while.end45, !llvm.loop !11
while.end45: ; preds = %if.end44, %if.end44.thread, %while.end.thread, %while.end
%cnt.3.lcssa = phi i32 [ 0, %while.end ], [ 0, %while.end.thread ], [ %inc40, %if.end44.thread ], [ %cnt.5, %if.end44 ]
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cnt.3.lcssa)
br label %cleanup
cleanup: ; preds = %while.end45, %if.then15, %if.then11, %if.then7, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<math.h>
int main(void){
int N;
float T,A;
//int H[1001];
int H;
int i,num;
float diff,diffabs,mindiff;
float temp;
scanf("%d",&N);
scanf("%f %f",&T,&A);
mindiff = 100000.0;
num = 0;
/*for(i=0;i<1001;i++){
H[i]=0;
}*/
for(i=1;i<=N;i++){
scanf("%d",&H);
temp = T - 0.006 * H;
diff = A - temp;
diffabs = fabsf(diff);
if(diffabs<mindiff){
num = i;
mindiff = diffabs;
}
temp=0;
}
//printf("%f\n",mindiff);
printf("%d\n",num);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338163/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338163/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%T = alloca float, align 4
%A = alloca float, align 4
%H = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 i32, ptr %N, align 4, !tbaa !5
%cmp.not11 = icmp slt i32 %0, 1
br i1 %cmp.not11, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%mindiff.014 = phi float [ %mindiff.1, %for.body ], [ 1.000000e+05, %entry ]
%i.013 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%num.012 = phi i32 [ %num.1, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H)
%1 = load float, ptr %T, align 4, !tbaa !9
%conv = fpext float %1 to double
%2 = load i32, ptr %H, align 4, !tbaa !5
%conv3 = sitofp i32 %2 to double
%3 = call double @llvm.fmuladd.f64(double %conv3, double -6.000000e-03, double %conv)
%conv4 = fptrunc double %3 to float
%4 = load float, ptr %A, align 4, !tbaa !9
%sub = fsub float %4, %conv4
%5 = call float @llvm.fabs.f32(float %sub)
%cmp5 = fcmp olt float %5, %mindiff.014
%num.1 = select i1 %cmp5, i32 %i.013, i32 %num.012
%mindiff.1 = select i1 %cmp5, float %5, float %mindiff.014
%inc = add nuw nsw i32 %i.013, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.013, %6
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%num.0.lcssa = phi i32 [ 0, %entry ], [ %num.1, %for.body ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n,t,a,i,h[1000],ans=0;
float kion[1000];
scanf("%d%d%d",&n,&t,&a);
for(i=0;i<n;i++){
scanf("%d",&h[i]);
kion[i]=t-h[i]*0.006f;
float b=(a-kion[ans]);
float c=a-kion[i];
if(b<0)b=-b;
if(c<0)c=-c;
if(b>c){
ans=i;
}
}
printf("%d\n",ans+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
%a = alloca i32, align 4
%h = alloca [1000 x i32], align 16
%kion = alloca [1000 x float], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %kion) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ans.039 = phi i32 [ %ans.1, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %h, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %t, align 4, !tbaa !5
%conv = sitofp i32 %1 to float
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv4 = sitofp i32 %2 to float
%neg = fneg float %conv4
%3 = call float @llvm.fmuladd.f32(float %neg, float 0x3F789374C0000000, float %conv)
%arrayidx6 = getelementptr inbounds [1000 x float], ptr %kion, i64 0, i64 %indvars.iv
store float %3, ptr %arrayidx6, align 4, !tbaa !9
%4 = load i32, ptr %a, align 4, !tbaa !5
%conv7 = sitofp i32 %4 to float
%idxprom8 = sext i32 %ans.039 to i64
%arrayidx9 = getelementptr inbounds [1000 x float], ptr %kion, i64 0, i64 %idxprom8
%5 = load float, ptr %arrayidx9, align 4, !tbaa !9
%6 = insertelement <2 x float> poison, float %conv7, i64 0
%7 = shufflevector <2 x float> %6, <2 x float> poison, <2 x i32> zeroinitializer
%8 = insertelement <2 x float> poison, float %5, i64 0
%9 = insertelement <2 x float> %8, float %3, i64 1
%10 = fsub <2 x float> %7, %9
%11 = fcmp olt <2 x float> %10, zeroinitializer
%12 = fneg <2 x float> %10
%13 = select <2 x i1> %11, <2 x float> %12, <2 x float> %10
%14 = extractelement <2 x float> %13, i64 0
%15 = extractelement <2 x float> %13, i64 1
%cmp21 = fcmp ogt float %14, %15
%16 = trunc i64 %indvars.iv to i32
%ans.1 = select i1 %cmp21, i32 %16, i32 %ans.039
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !11
for.end.loopexit: ; preds = %for.body
%19 = add nsw i32 %ans.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%ans.0.lcssa = phi i32 [ 1, %entry ], [ %19, %for.end.loopexit ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %kion) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
typedef struct {
int left;
int right;
} pool;
int main(void)
{
int i, j, len, k, kl, kr, le, ri, he, flag, h[20001], area[10000], areasum;
char ch;
pool pleft[10000], pright[10000], p[10000];
h[0] = 0;
i = 0;
while(1) {
scanf("%c",&ch);
if( ch == '\n' ) break;
switch (ch) {
case '/':
h[i+1] = h[i] + 1;
break;
case '\\':
h[i+1] = h[i] - 1;
break;
case '_':
h[i+1] = h[i];
break;
}
i++;
}
len = i;
kl = 0;
flag = 1;
for (i=0; i<=len-1; i++) {
if( h[i] < h[i+1] ) {
flag = 1;
} else if( flag == 1 && h[i] > h[i+1] ) {
flag = 0;
for (j=i+1; j<=len; j++) {
if( h[i] == h[j] ) {
pleft[kl].left = i;
pleft[kl].right = j;
kl++;
i = j - 1;
flag = 1;
break;
}
}
}
}
kr = 0;
flag = 1;
for (i=len; i>=1; i--) {
if( h[i] < h[i-1] ) {
flag = 1;
} else if( flag == 1 && h[i] > h[i-1] ) {
flag = 0;
for (j=i-1; j>=0; j--) {
if( h[i] == h[j] ) {
pright[kr].left = j;
pright[kr].right = i;
kr++;
i = j + 1;
flag = 1;
break;
}
}
}
}
k = 0;
le = 0;
ri = kr - 1;
for (i=0; i<len; i++) {
if( le == kl && ri == -1 ) {
break;
} else if(le==kl) {
while ( ri != -1 ) {
p[k].left = pright[ri].left;
p[k].right = pright[ri].right;
k++;
ri--;
}
} else if(ri==-1) {
while ( le != kl ) {
p[k].left = pleft[le].left;
p[k].right = pleft[le].right;
k++;
le++;
}
} else {
if( i == pleft[le].left ) {
p[k].left = pleft[le].left;
p[k].right = pleft[le].right;
i = pleft[le].right - 1;
k++;
le++;
while ( i >= pright[ri].left ) {
ri--;
if(ri==-1) break;
}
} else if( i == pright[ri].left ) {
p[k].left = pright[ri].left;
p[k].right = pright[ri].right;
i = pright[ri].right - 1;
k++;
ri--;
while ( i >= pleft[le].left ) {
le++;
if(le==kl) break;
}
}
}
}
areasum = 0;
for (i=0; i<k; i++) {
le = p[i].left;
ri = p[i].right;
area[i] = 0;
he = h[le];
for (j=le; j<ri; j++) {
area[i] += ( he - h[j] ) + ( he - h[j+1] );
}
area[i] /= 2;
areasum += area[i];
}
if( k == 0 ) {
printf("0\n0\n");
} else {
printf("%d\n",areasum);
printf("%d ",k);
for (i=0; i<k-1; i++) {
printf("%d ",area[i]);
}
printf("%d\n",area[k-1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338257/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338257/source.c"
target datalayout = "e-m:e-p270: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.pool = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@str = private unnamed_addr constant [4 x i8] c"0\0A0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca [20001 x i32], align 16
%area = alloca [10000 x i32], align 16
%ch = alloca i8, align 1
%pleft = alloca [10000 x %struct.pool], align 16
%pright = alloca [10000 x %struct.pool], align 16
%p = alloca [10000 x %struct.pool], align 16
call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %area) #5
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %pleft) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %pright) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %p) #5
store i32 0, ptr %h, align 16, !tbaa !5
%call447 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 1, !tbaa !9
%cmp448 = icmp eq i8 %0, 10
br i1 %cmp448, label %if.then300, label %if.end
for.cond.preheader: ; preds = %sw.epilog
%1 = trunc i64 %indvars.iv.next.pre-phi to i32
%cmp20.not.not452 = icmp sgt i32 %1, 0
br i1 %cmp20.not.not452, label %for.body.preheader, label %if.then300
for.body.preheader: ; preds = %for.cond.preheader
%2 = add nuw i32 %1, 1
br label %for.body
if.end: ; preds = %entry, %sw.epilog
%indvars.iv = phi i64 [ %indvars.iv.next.pre-phi, %sw.epilog ], [ 0, %entry ]
%3 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %3 to i32
switch i32 %conv, label %if.end.sw.epilog_crit_edge [
i32 47, label %sw.bb
i32 92, label %sw.bb7
i32 95, label %sw.bb13
]
if.end.sw.epilog_crit_edge: ; preds = %if.end
%.pre535 = add nuw i64 %indvars.iv, 1
br label %sw.epilog
sw.bb: ; preds = %if.end
%arrayidx3 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %4, 1
%5 = add nuw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %5
store i32 %add, ptr %arrayidx6, align 4, !tbaa !5
br label %sw.epilog
sw.bb7: ; preds = %if.end
%arrayidx9 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%7 = add nuw i64 %indvars.iv, 1
%arrayidx12 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %7
store i32 %sub, ptr %arrayidx12, align 4, !tbaa !5
br label %sw.epilog
sw.bb13: ; preds = %if.end
%arrayidx15 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%9 = add nuw i64 %indvars.iv, 1
%arrayidx18 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %9
store i32 %8, ptr %arrayidx18, align 4, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %if.end.sw.epilog_crit_edge, %sw.bb13, %sw.bb7, %sw.bb
%indvars.iv.next.pre-phi = phi i64 [ %.pre535, %if.end.sw.epilog_crit_edge ], [ %9, %sw.bb13 ], [ %7, %sw.bb7 ], [ %5, %sw.bb ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%10 = load i8, ptr %ch, align 1, !tbaa !9
%cmp = icmp eq i8 %10, 10
br i1 %cmp, label %for.cond.preheader, label %if.end
for.cond65.preheader: ; preds = %for.inc62
br i1 %cmp20.not.not452, label %for.body68, label %if.then300
for.body: ; preds = %for.body.preheader, %for.inc62
%flag.0455 = phi i32 [ %flag.1, %for.inc62 ], [ 1, %for.body.preheader ]
%i.1454 = phi i32 [ %inc63.pre-phi, %for.inc62 ], [ 0, %for.body.preheader ]
%kl.0453 = phi i32 [ %kl.1, %for.inc62 ], [ 0, %for.body.preheader ]
%idxprom22 = sext i32 %i.1454 to i64
%arrayidx23 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom22
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%add24 = add nsw i32 %i.1454, 1
%idxprom25 = sext i32 %add24 to i64
%arrayidx26 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom25
%12 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27 = icmp slt i32 %11, %12
br i1 %cmp27, label %for.inc62, label %if.else
if.else: ; preds = %for.body
%cmp30 = icmp eq i32 %flag.0455, 1
br i1 %cmp30, label %land.lhs.true, label %for.inc62
land.lhs.true: ; preds = %if.else
%cmp37 = icmp sgt i32 %11, %12
br i1 %cmp37, label %for.cond41.preheader, label %for.inc62
for.cond41.preheader: ; preds = %land.lhs.true
%cmp42.not450.not = icmp slt i32 %i.1454, %1
br i1 %cmp42.not450.not, label %for.body44.preheader, label %for.inc62
for.body44.preheader: ; preds = %for.cond41.preheader
%13 = add nsw i64 %idxprom22, 1
br label %for.body44
for.body44: ; preds = %for.body44.preheader, %for.inc
%indvars.iv497 = phi i64 [ %13, %for.body44.preheader ], [ %indvars.iv.next498, %for.inc ]
%arrayidx48 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %indvars.iv497
%14 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%cmp49 = icmp eq i32 %11, %14
br i1 %cmp49, label %if.then51, label %for.inc
if.then51: ; preds = %for.body44
%15 = trunc i64 %indvars.iv497 to i32
%idxprom52 = sext i32 %kl.0453 to i64
%arrayidx53 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %idxprom52
store i32 %i.1454, ptr %arrayidx53, align 8, !tbaa !10
%right = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %idxprom52, i32 1
store i32 %15, ptr %right, align 4, !tbaa !12
%inc56 = add nsw i32 %kl.0453, 1
br label %for.inc62
for.inc: ; preds = %for.body44
%indvars.iv.next498 = add nsw i64 %indvars.iv497, 1
%lftr.wideiv = trunc i64 %indvars.iv.next498 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.inc62, label %for.body44, !llvm.loop !13
for.inc62: ; preds = %for.inc, %for.cond41.preheader, %for.body, %if.then51, %land.lhs.true, %if.else
%inc63.pre-phi = phi i32 [ %add24, %for.cond41.preheader ], [ %add24, %for.body ], [ %15, %if.then51 ], [ %add24, %land.lhs.true ], [ %add24, %if.else ], [ %add24, %for.inc ]
%kl.1 = phi i32 [ %kl.0453, %for.cond41.preheader ], [ %kl.0453, %for.body ], [ %inc56, %if.then51 ], [ %kl.0453, %land.lhs.true ], [ %kl.0453, %if.else ], [ %kl.0453, %for.inc ]
%flag.1 = phi i32 [ 0, %for.cond41.preheader ], [ 1, %for.body ], [ 1, %if.then51 ], [ 1, %land.lhs.true ], [ 0, %if.else ], [ 0, %for.inc ]
%cmp20.not.not = icmp slt i32 %inc63.pre-phi, %1
br i1 %cmp20.not.not, label %for.body, label %for.cond65.preheader, !llvm.loop !15
for.body68: ; preds = %for.cond65.preheader, %for.inc114
%flag.2462 = phi i32 [ %flag.3, %for.inc114 ], [ 1, %for.cond65.preheader ]
%i.3461 = phi i32 [ %dec115, %for.inc114 ], [ %1, %for.cond65.preheader ]
%kr.0460 = phi i32 [ %kr.1, %for.inc114 ], [ 0, %for.cond65.preheader ]
%idxprom69 = zext i32 %i.3461 to i64
%arrayidx70 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom69
%16 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%sub71 = add nsw i32 %i.3461, -1
%idxprom72 = zext i32 %sub71 to i64
%arrayidx73 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom72
%17 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%cmp74 = icmp slt i32 %16, %17
br i1 %cmp74, label %for.inc114, label %if.else77
if.else77: ; preds = %for.body68
%cmp78 = icmp eq i32 %flag.2462, 1
br i1 %cmp78, label %land.lhs.true80, label %for.inc114
land.lhs.true80: ; preds = %if.else77
%cmp86 = icmp sgt i32 %16, %17
br i1 %cmp86, label %for.body93, label %for.inc114
for.body93: ; preds = %land.lhs.true80, %for.inc110
%j.1458 = phi i32 [ %dec, %for.inc110 ], [ %sub71, %land.lhs.true80 ]
%idxprom96 = zext i32 %j.1458 to i64
%arrayidx97 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom96
%18 = load i32, ptr %arrayidx97, align 4, !tbaa !5
%cmp98 = icmp eq i32 %16, %18
br i1 %cmp98, label %if.then100, label %for.inc110
if.then100: ; preds = %for.body93
%idxprom101 = sext i32 %kr.0460 to i64
%arrayidx102 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %idxprom101
store i32 %j.1458, ptr %arrayidx102, align 8, !tbaa !10
%right106 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %idxprom101, i32 1
store i32 %i.3461, ptr %right106, align 4, !tbaa !12
%inc107 = add nsw i32 %kr.0460, 1
%add108 = add nuw nsw i32 %j.1458, 1
br label %for.inc114
for.inc110: ; preds = %for.body93
%dec = add nsw i32 %j.1458, -1
%cmp91 = icmp sgt i32 %j.1458, 0
br i1 %cmp91, label %for.body93, label %for.inc114, !llvm.loop !16
for.inc114: ; preds = %for.inc110, %for.body68, %if.then100, %land.lhs.true80, %if.else77
%kr.1 = phi i32 [ %inc107, %if.then100 ], [ %kr.0460, %land.lhs.true80 ], [ %kr.0460, %if.else77 ], [ %kr.0460, %for.body68 ], [ %kr.0460, %for.inc110 ]
%i.4 = phi i32 [ %add108, %if.then100 ], [ %i.3461, %land.lhs.true80 ], [ %i.3461, %if.else77 ], [ %i.3461, %for.body68 ], [ %i.3461, %for.inc110 ]
%flag.3 = phi i32 [ 1, %if.then100 ], [ 1, %land.lhs.true80 ], [ 0, %if.else77 ], [ 1, %for.body68 ], [ 0, %for.inc110 ]
%dec115 = add nsw i32 %i.4, -1
%cmp66 = icmp sgt i32 %i.4, 1
br i1 %cmp66, label %for.body68, label %for.end116, !llvm.loop !17
for.end116: ; preds = %for.inc114
br i1 %cmp20.not.not452, label %for.body121.preheader, label %if.then300
for.body121.preheader: ; preds = %for.end116
%sub117 = add nsw i32 %kr.1, -1
%invariant.gep = getelementptr i32, ptr %pright, i64 -2
%invariant.gep638 = getelementptr i32, ptr %pright, i64 -2
br label %for.body121
for.body121: ; preds = %for.body121.preheader, %for.inc255
%i.5477 = phi i32 [ %inc256, %for.inc255 ], [ 0, %for.body121.preheader ]
%ri.0476 = phi i32 [ %ri.3, %for.inc255 ], [ %sub117, %for.body121.preheader ]
%le.0475 = phi i32 [ %le.3, %for.inc255 ], [ 0, %for.body121.preheader ]
%k.0474 = phi i32 [ %k.3, %for.inc255 ], [ 0, %for.body121.preheader ]
%cmp122 = icmp eq i32 %le.0475, %kl.1
%cmp125 = icmp eq i32 %ri.0476, -1
%or.cond = select i1 %cmp122, i1 %cmp125, i1 false
br i1 %or.cond, label %for.end257, label %if.else128
if.else128: ; preds = %for.body121
br i1 %cmp122, label %while.cond132.preheader, label %if.else151
while.cond132.preheader: ; preds = %if.else128
br i1 %cmp125, label %for.inc255, label %while.body135.preheader
while.body135.preheader: ; preds = %while.cond132.preheader
%19 = sext i32 %ri.0476 to i64
%20 = sext i32 %k.0474 to i64
%21 = add nsw i64 %19, 1
%min.iters.check = icmp ult i64 %21, 4
br i1 %min.iters.check, label %while.body135.preheader621, label %vector.ph
vector.ph: ; preds = %while.body135.preheader
%n.vec = and i64 %21, -4
%ind.end = add nsw i64 %n.vec, %20
%ind.end570 = sub nsw i64 %19, %n.vec
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = sub i64 %19, %index
%22 = add i64 %offset.idx, -2
%offset.idx572 = add i64 %index, %20
%23 = add i64 %offset.idx572, 2
%gep = getelementptr [10000 x %struct.pool], ptr %invariant.gep, i64 0, i64 %offset.idx
%gep639 = getelementptr [10000 x %struct.pool], ptr %invariant.gep638, i64 0, i64 %22
%wide.vec = load <4 x i32>, ptr %gep, align 8, !tbaa !5
%wide.vec573 = load <4 x i32>, ptr %gep639, align 8, !tbaa !5
%strided.vec = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%reverse = shufflevector <2 x i32> %strided.vec, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%strided.vec574 = shufflevector <4 x i32> %wide.vec573, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%reverse575 = shufflevector <2 x i32> %strided.vec574, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%strided.vec576 = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%reverse577 = shufflevector <2 x i32> %strided.vec576, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%strided.vec578 = shufflevector <4 x i32> %wide.vec573, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%reverse579 = shufflevector <2 x i32> %strided.vec578, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%24 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %offset.idx572
%25 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %23
%interleaved.vec = shufflevector <2 x i32> %reverse, <2 x i32> %reverse577, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %24, align 8, !tbaa !5
%interleaved.vec580 = shufflevector <2 x i32> %reverse575, <2 x i32> %reverse579, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec580, ptr %25, align 8, !tbaa !5
%index.next = add nuw i64 %index, 4
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %21, %n.vec
br i1 %cmp.n, label %for.inc255.loopexit, label %while.body135.preheader621
while.body135.preheader621: ; preds = %while.body135.preheader, %middle.block
%indvars.iv515.ph = phi i64 [ %20, %while.body135.preheader ], [ %ind.end, %middle.block ]
%indvars.iv513.ph = phi i64 [ %19, %while.body135.preheader ], [ %ind.end570, %middle.block ]
br label %while.body135
while.body135: ; preds = %while.body135.preheader621, %while.body135
%indvars.iv515 = phi i64 [ %indvars.iv.next516, %while.body135 ], [ %indvars.iv515.ph, %while.body135.preheader621 ]
%indvars.iv513 = phi i64 [ %indvars.iv.next514, %while.body135 ], [ %indvars.iv513.ph, %while.body135.preheader621 ]
%arrayidx137 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %indvars.iv513
%arrayidx140 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %indvars.iv515
%27 = load <2 x i32>, ptr %arrayidx137, align 8, !tbaa !5
store <2 x i32> %27, ptr %arrayidx140, align 8, !tbaa !5
%indvars.iv.next516 = add nsw i64 %indvars.iv515, 1
%indvars.iv.next514 = add nsw i64 %indvars.iv513, -1
%28 = icmp eq i64 %indvars.iv513, 0
br i1 %28, label %for.inc255.loopexit, label %while.body135, !llvm.loop !21
if.else151: ; preds = %if.else128
%29 = sext i32 %le.0475 to i64
br i1 %cmp125, label %while.body158.preheader, label %if.else174
while.body158.preheader: ; preds = %if.else151
%30 = sext i32 %k.0474 to i64
%31 = xor i32 %le.0475, -1
%32 = add i32 %kl.1, %31
%33 = zext i32 %32 to i64
%34 = add nuw nsw i64 %33, 1
%min.iters.check583 = icmp ult i32 %32, 3
br i1 %min.iters.check583, label %while.body158.preheader622, label %vector.ph584
vector.ph584: ; preds = %while.body158.preheader
%n.vec586 = and i64 %34, 8589934588
%ind.end587 = add nsw i64 %n.vec586, %30
%ind.end589 = add nsw i64 %n.vec586, %29
br label %vector.body592
vector.body592: ; preds = %vector.body592, %vector.ph584
%index593 = phi i64 [ 0, %vector.ph584 ], [ %index.next604, %vector.body592 ]
%offset.idx594 = add i64 %index593, %29
%35 = add i64 %offset.idx594, 2
%offset.idx595 = add i64 %index593, %30
%36 = add i64 %offset.idx595, 2
%37 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %offset.idx594
%38 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %35
%wide.vec596 = load <4 x i32>, ptr %37, align 8, !tbaa !5
%wide.vec597 = load <4 x i32>, ptr %38, align 8, !tbaa !5
%39 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %offset.idx595
%40 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %36
store <4 x i32> %wide.vec596, ptr %39, align 8, !tbaa !5
store <4 x i32> %wide.vec597, ptr %40, align 8, !tbaa !5
%index.next604 = add nuw i64 %index593, 4
%41 = icmp eq i64 %index.next604, %n.vec586
br i1 %41, label %middle.block581, label %vector.body592, !llvm.loop !22
middle.block581: ; preds = %vector.body592
%cmp.n591 = icmp eq i64 %34, %n.vec586
br i1 %cmp.n591, label %for.inc255.loopexit489, label %while.body158.preheader622
while.body158.preheader622: ; preds = %while.body158.preheader, %middle.block581
%indvars.iv508.ph = phi i64 [ %30, %while.body158.preheader ], [ %ind.end587, %middle.block581 ]
%indvars.iv506.ph = phi i64 [ %29, %while.body158.preheader ], [ %ind.end589, %middle.block581 ]
br label %while.body158
while.body158: ; preds = %while.body158.preheader622, %while.body158
%indvars.iv508 = phi i64 [ %indvars.iv.next509, %while.body158 ], [ %indvars.iv508.ph, %while.body158.preheader622 ]
%indvars.iv506 = phi i64 [ %indvars.iv.next507, %while.body158 ], [ %indvars.iv506.ph, %while.body158.preheader622 ]
%arrayidx160 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %indvars.iv506
%arrayidx163 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %indvars.iv508
%42 = load <2 x i32>, ptr %arrayidx160, align 8, !tbaa !5
store <2 x i32> %42, ptr %arrayidx163, align 8, !tbaa !5
%indvars.iv.next509 = add nsw i64 %indvars.iv508, 1
%indvars.iv.next507 = add nsw i64 %indvars.iv506, 1
%43 = trunc i64 %indvars.iv.next507 to i32
%cmp156.not = icmp eq i32 %kl.1, %43
br i1 %cmp156.not, label %for.inc255.loopexit489, label %while.body158, !llvm.loop !23
if.else174: ; preds = %if.else151
%arrayidx176 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %29
%44 = load i32, ptr %arrayidx176, align 8, !tbaa !10
%cmp178 = icmp eq i32 %i.5477, %44
br i1 %cmp178, label %if.then180, label %if.else212
if.then180: ; preds = %if.else174
%idxprom184 = sext i32 %k.0474 to i64
%arrayidx185 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %idxprom184
store i32 %i.5477, ptr %arrayidx185, align 8, !tbaa !10
%right189 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %29, i32 1
%45 = load i32, ptr %right189, align 4, !tbaa !12
%right192 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %idxprom184, i32 1
store i32 %45, ptr %right192, align 4, !tbaa !12
%sub196 = add nsw i32 %45, -1
%inc197 = add nsw i32 %k.0474, 1
%inc198 = add nsw i32 %le.0475, 1
%46 = sext i32 %ri.0476 to i64
br label %while.cond199
while.cond199: ; preds = %while.body205, %if.then180
%indvars.iv503 = phi i64 [ %indvars.iv.next504, %while.body205 ], [ %46, %if.then180 ]
%arrayidx201 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %indvars.iv503
%47 = load i32, ptr %arrayidx201, align 8, !tbaa !10
%cmp203.not.not = icmp sgt i32 %45, %47
br i1 %cmp203.not.not, label %while.body205, label %for.inc255.loopexit556.split.loop.exit562
while.body205: ; preds = %while.cond199
%indvars.iv.next504 = add nsw i64 %indvars.iv503, -1
%48 = icmp eq i64 %indvars.iv503, 0
br i1 %48, label %for.inc255, label %while.cond199, !llvm.loop !24
if.else212: ; preds = %if.else174
%idxprom213 = sext i32 %ri.0476 to i64
%arrayidx214 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %idxprom213
%49 = load i32, ptr %arrayidx214, align 8, !tbaa !10
%cmp216 = icmp eq i32 %i.5477, %49
br i1 %cmp216, label %if.then218, label %for.inc255
if.then218: ; preds = %if.else212
%idxprom222 = sext i32 %k.0474 to i64
%arrayidx223 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %idxprom222
store i32 %i.5477, ptr %arrayidx223, align 8, !tbaa !10
%right227 = getelementptr inbounds [10000 x %struct.pool], ptr %pright, i64 0, i64 %idxprom213, i32 1
%50 = load i32, ptr %right227, align 4, !tbaa !12
%right230 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %idxprom222, i32 1
store i32 %50, ptr %right230, align 4, !tbaa !12
%sub234 = add nsw i32 %50, -1
%inc235 = add nsw i32 %k.0474, 1
%dec236 = add nsw i32 %ri.0476, -1
br label %while.cond237
while.cond237: ; preds = %while.body243, %if.then218
%indvars.iv500 = phi i64 [ %indvars.iv.next501, %while.body243 ], [ %29, %if.then218 ]
%arrayidx239 = getelementptr inbounds [10000 x %struct.pool], ptr %pleft, i64 0, i64 %indvars.iv500
%51 = load i32, ptr %arrayidx239, align 8, !tbaa !10
%cmp241.not.not = icmp sgt i32 %50, %51
br i1 %cmp241.not.not, label %while.body243, label %for.inc255.loopexit557.split.loop.exit
while.body243: ; preds = %while.cond237
%indvars.iv.next501 = add nsw i64 %indvars.iv500, 1
%52 = trunc i64 %indvars.iv.next501 to i32
%cmp245 = icmp eq i32 %kl.1, %52
br i1 %cmp245, label %for.inc255, label %while.cond237, !llvm.loop !25
for.inc255.loopexit: ; preds = %while.body135, %middle.block
%indvars.iv.next516.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next516, %while.body135 ]
%53 = trunc i64 %indvars.iv.next516.lcssa to i32
br label %for.inc255
for.inc255.loopexit489: ; preds = %while.body158, %middle.block581
%indvars.iv.next509.lcssa = phi i64 [ %ind.end587, %middle.block581 ], [ %indvars.iv.next509, %while.body158 ]
%54 = trunc i64 %indvars.iv.next509.lcssa to i32
br label %for.inc255
for.inc255.loopexit556.split.loop.exit562: ; preds = %while.cond199
%55 = trunc i64 %indvars.iv503 to i32
br label %for.inc255
for.inc255.loopexit557.split.loop.exit: ; preds = %while.cond237
%56 = trunc i64 %indvars.iv500 to i32
br label %for.inc255
for.inc255: ; preds = %while.body243, %while.body205, %for.inc255.loopexit557.split.loop.exit, %for.inc255.loopexit556.split.loop.exit562, %for.inc255.loopexit489, %for.inc255.loopexit, %while.cond132.preheader, %if.else212
%k.3 = phi i32 [ %k.0474, %if.else212 ], [ %k.0474, %while.cond132.preheader ], [ %53, %for.inc255.loopexit ], [ %54, %for.inc255.loopexit489 ], [ %inc197, %for.inc255.loopexit556.split.loop.exit562 ], [ %inc235, %for.inc255.loopexit557.split.loop.exit ], [ %inc197, %while.body205 ], [ %inc235, %while.body243 ]
%le.3 = phi i32 [ %le.0475, %if.else212 ], [ %kl.1, %while.cond132.preheader ], [ %kl.1, %for.inc255.loopexit ], [ %kl.1, %for.inc255.loopexit489 ], [ %inc198, %for.inc255.loopexit556.split.loop.exit562 ], [ %56, %for.inc255.loopexit557.split.loop.exit ], [ %inc198, %while.body205 ], [ %kl.1, %while.body243 ]
%ri.3 = phi i32 [ %ri.0476, %if.else212 ], [ -1, %while.cond132.preheader ], [ -1, %for.inc255.loopexit ], [ -1, %for.inc255.loopexit489 ], [ %55, %for.inc255.loopexit556.split.loop.exit562 ], [ %dec236, %for.inc255.loopexit557.split.loop.exit ], [ -1, %while.body205 ], [ %dec236, %while.body243 ]
%i.6 = phi i32 [ %i.5477, %if.else212 ], [ %i.5477, %while.cond132.preheader ], [ %i.5477, %for.inc255.loopexit ], [ %i.5477, %for.inc255.loopexit489 ], [ %sub196, %for.inc255.loopexit556.split.loop.exit562 ], [ %sub234, %for.inc255.loopexit557.split.loop.exit ], [ %sub196, %while.body205 ], [ %sub234, %while.body243 ]
%inc256 = add nsw i32 %i.6, 1
%cmp119 = icmp slt i32 %inc256, %1
br i1 %cmp119, label %for.body121, label %for.end257, !llvm.loop !26
for.end257: ; preds = %for.inc255, %for.body121
%k.0.lcssa = phi i32 [ %k.3, %for.inc255 ], [ %k.0474, %for.body121 ]
%cmp259482 = icmp sgt i32 %k.0.lcssa, 0
br i1 %cmp259482, label %for.body261.preheader, label %for.end297
for.body261.preheader: ; preds = %for.end257
%wide.trip.count528 = zext i32 %k.0.lcssa to i64
br label %for.body261
for.body261: ; preds = %for.body261.preheader, %for.end289
%indvars.iv525 = phi i64 [ 0, %for.body261.preheader ], [ %indvars.iv.next526, %for.end289 ]
%areasum.0484 = phi i32 [ 0, %for.body261.preheader ], [ %add294, %for.end289 ]
%arrayidx263 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %indvars.iv525
%57 = load i32, ptr %arrayidx263, align 8, !tbaa !10
%right267 = getelementptr inbounds [10000 x %struct.pool], ptr %p, i64 0, i64 %indvars.iv525, i32 1
%58 = load i32, ptr %right267, align 4, !tbaa !12
%arrayidx269 = getelementptr inbounds [10000 x i32], ptr %area, i64 0, i64 %indvars.iv525
%cmp273480 = icmp slt i32 %57, %58
br i1 %cmp273480, label %for.body275.lr.ph, label %for.end289
for.body275.lr.ph: ; preds = %for.body261
%idxprom270 = sext i32 %57 to i64
%arrayidx271 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %idxprom270
%59 = load i32, ptr %arrayidx271, align 4, !tbaa !5
%factor = shl i32 %59, 1
%wide.trip.count = sext i32 %58 to i64
%60 = sub nsw i64 %wide.trip.count, %idxprom270
%min.iters.check607 = icmp ult i64 %60, 8
br i1 %min.iters.check607, label %for.body275.preheader, label %vector.ph608
vector.ph608: ; preds = %for.body275.lr.ph
%n.vec610 = and i64 %60, -8
%ind.end611 = add nsw i64 %n.vec610, %idxprom270
%vector.recur.init = insertelement <4 x i32> poison, i32 %59, i64 3
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %factor, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body614
vector.body614: ; preds = %vector.body614, %vector.ph608
%index615 = phi i64 [ 0, %vector.ph608 ], [ %index.next619, %vector.body614 ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph608 ], [ %wide.load618, %vector.body614 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph608 ], [ %70, %vector.body614 ]
%vec.phi616 = phi <4 x i32> [ zeroinitializer, %vector.ph608 ], [ %71, %vector.body614 ]
%offset.idx617 = add i64 %index615, %idxprom270
%61 = add nsw i64 %offset.idx617, 1
%62 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %61
%wide.load = load <4 x i32>, ptr %62, align 4, !tbaa !5
%63 = getelementptr inbounds i32, ptr %62, i64 4
%wide.load618 = load <4 x i32>, ptr %63, align 4, !tbaa !5
%64 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%65 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load618, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%66 = add <4 x i32> %64, %wide.load
%67 = add <4 x i32> %65, %wide.load618
%68 = sub <4 x i32> %broadcast.splat, %66
%69 = sub <4 x i32> %broadcast.splat, %67
%70 = add <4 x i32> %68, %vec.phi
%71 = add <4 x i32> %69, %vec.phi616
%index.next619 = add nuw i64 %index615, 8
%72 = icmp eq i64 %index.next619, %n.vec610
br i1 %72, label %middle.block605, label %vector.body614, !llvm.loop !27
middle.block605: ; preds = %vector.body614
%bin.rdx = add <4 x i32> %71, %70
%73 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n613 = icmp eq i64 %60, %n.vec610
%vector.recur.extract = extractelement <4 x i32> %wide.load618, i64 3
br i1 %cmp.n613, label %for.end289, label %for.body275.preheader
for.body275.preheader: ; preds = %for.body275.lr.ph, %middle.block605
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block605 ], [ %59, %for.body275.lr.ph ]
%indvars.iv521.ph = phi i64 [ %ind.end611, %middle.block605 ], [ %idxprom270, %for.body275.lr.ph ]
%.ph = phi i32 [ %73, %middle.block605 ], [ 0, %for.body275.lr.ph ]
br label %for.body275
for.body275: ; preds = %for.body275.preheader, %for.body275
%scalar.recur = phi i32 [ %75, %for.body275 ], [ %scalar.recur.ph, %for.body275.preheader ]
%indvars.iv521 = phi i64 [ %indvars.iv.next522, %for.body275 ], [ %indvars.iv521.ph, %for.body275.preheader ]
%74 = phi i32 [ %add286, %for.body275 ], [ %.ph, %for.body275.preheader ]
%indvars.iv.next522 = add nsw i64 %indvars.iv521, 1
%arrayidx281 = getelementptr inbounds [20001 x i32], ptr %h, i64 0, i64 %indvars.iv.next522
%75 = load i32, ptr %arrayidx281, align 4, !tbaa !5
%76 = add i32 %scalar.recur, %75
%add283 = sub i32 %factor, %76
%add286 = add i32 %add283, %74
%exitcond524.not = icmp eq i64 %indvars.iv.next522, %wide.trip.count
br i1 %exitcond524.not, label %for.end289, label %for.body275, !llvm.loop !28
for.end289: ; preds = %for.body275, %middle.block605, %for.body261
%77 = phi i32 [ 0, %for.body261 ], [ %73, %middle.block605 ], [ %add286, %for.body275 ]
%div = sdiv i32 %77, 2
store i32 %div, ptr %arrayidx269, align 4, !tbaa !5
%add294 = add nsw i32 %div, %areasum.0484
%indvars.iv.next526 = add nuw nsw i64 %indvars.iv525, 1
%exitcond529.not = icmp eq i64 %indvars.iv.next526, %wide.trip.count528
br i1 %exitcond529.not, label %for.end297, label %for.body261, !llvm.loop !29
for.end297: ; preds = %for.end289, %for.end257
%areasum.0.lcssa = phi i32 [ 0, %for.end257 ], [ %add294, %for.end289 ]
%cmp298 = icmp eq i32 %k.0.lcssa, 0
br i1 %cmp298, label %if.then300, label %if.else302
if.then300: ; preds = %for.end116, %for.cond65.preheader, %for.cond.preheader, %entry, %for.end297
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end320
if.else302: ; preds = %for.end297
%call303 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %areasum.0.lcssa)
%call304 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %k.0.lcssa)
%sub306 = add i32 %k.0.lcssa, -1
%cmp307486 = icmp sgt i32 %k.0.lcssa, 1
br i1 %cmp307486, label %for.body309.preheader, label %for.end315
for.body309.preheader: ; preds = %if.else302
%wide.trip.count533 = zext i32 %sub306 to i64
br label %for.body309
for.body309: ; preds = %for.body309.preheader, %for.body309
%indvars.iv530 = phi i64 [ 0, %for.body309.preheader ], [ %indvars.iv.next531, %for.body309 ]
%arrayidx311 = getelementptr inbounds [10000 x i32], ptr %area, i64 0, i64 %indvars.iv530
%78 = load i32, ptr %arrayidx311, align 4, !tbaa !5
%call312 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %78)
%indvars.iv.next531 = add nuw nsw i64 %indvars.iv530, 1
%exitcond534.not = icmp eq i64 %indvars.iv.next531, %wide.trip.count533
br i1 %exitcond534.not, label %for.end315, label %for.body309, !llvm.loop !30
for.end315: ; preds = %for.body309, %if.else302
%idxprom317 = sext i32 %sub306 to i64
%arrayidx318 = getelementptr inbounds [10000 x i32], ptr %area, i64 0, i64 %idxprom317
%79 = load i32, ptr %arrayidx318, align 4, !tbaa !5
%call319 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79)
br label %if.end320
if.end320: ; preds = %for.end315, %if.then300
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %pright) #5
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %pleft) #5
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %area) #5
call void @llvm.lifetime.end.p0(i64 80004, ptr nonnull %h) #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 nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"", !6, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !14, !20, !19}
!22 = distinct !{!22, !14, !19, !20}
!23 = distinct !{!23, !14, !20, !19}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14, !19, !20}
!28 = distinct !{!28, !14, !20, !19}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
int n=0;
char c[20002];
int height[20002];//i番目のマスの左の高さは、height[i-1]。右の高さはheight[i]。height[0]=0
height[0]=0;//基準の高さ
int flood[20002];//水の体積。1オリジン
int floodnum=0;//池の数
int sum=0;
while(1){
scanf("%c",&c[n+1]);
if(c[n+1]=='\n') break;
if(c[n+1]=='\\') height[n+1]=height[n]-1;
else if(c[n+1]=='/') height[n+1]=height[n]+1;
else height[n+1]=height[n];
n+=1;
}//読み込み。nが文字の数を表す。cは1オリジン。
int i;//処理中のマスを表す。
i=1;
int j,k;//繰り返し用
int max;//右の壁となるマス目の番号
while(1){
if(c[i]=='\\'){
j=i+1;
while(j<=n){
if(height[i-1]==height[j]) break;
j+=1;
}
if(j<=n){
floodnum+=1;
flood[floodnum]=0;
for(k=i;k<=j;k++) flood[floodnum]+=height[i-1]-height[k];
i=j+1;//次に調べるマスの更新
}//左側の壁のほうが低い池
else{
max=-1;
for(j=i+1;j<=n;j++){
if(c[j]=='/'){
if(max==-1) max=j;
else if(height[max]< height[j]) max=j;
}
}
if(max==-1) i=n+1;
else{
floodnum+=1;
flood[floodnum]=0;
for(j=i;j<=max;j++){
if(height[max]-height[j]>0) flood[floodnum]+=height[max]-height[j];
}
i=max+1;
}
}//右側の壁のほうが低い池
}
else i+=1;
if(i>n) break;
}
for(i=1;i<=floodnum;i++) sum+=flood[i];
printf("%d\n",sum);
printf("%d",floodnum);
for(i=1;i<=floodnum;i++) printf(" %d",flood[i]);
printf("\n");
return 0;
}
// \を出力、入力したい場合は\\で表す
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca [20002 x i8], align 16
%height = alloca [20002 x i32], align 16
%flood = alloca [20002 x i32], align 16
call void @llvm.lifetime.start.p0(i64 20002, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 80008, ptr nonnull %height) #5
store i32 0, ptr %height, align 16, !tbaa !5
call void @llvm.lifetime.start.p0(i64 80008, ptr nonnull %flood) #5
br label %while.cond
while.cond: ; preds = %if.end38, %entry
%indvars.iv259 = phi i32 [ %indvars.iv.next260, %if.end38 ], [ 1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end38 ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx1 = getelementptr inbounds [20002 x i8], ptr %c, i64 0, i64 %indvars.iv.next
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%0 = load i8, ptr %arrayidx1, align 1, !tbaa !9
switch i8 %0, label %if.else31 [
i8 10, label %while.cond40.preheader
i8 92, label %if.then12
i8 47, label %if.then24
]
while.cond40.preheader: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%2 = trunc i64 %indvars.iv.next to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 0, %3
br label %while.cond40
if.then12: ; preds = %while.cond
%arrayidx14 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
br label %if.end38
if.then24: ; preds = %while.cond
%arrayidx26 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%add27 = add nsw i32 %6, 1
br label %if.end38
if.else31: ; preds = %while.cond
%arrayidx33 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx33, align 4, !tbaa !5
br label %if.end38
if.end38: ; preds = %if.then24, %if.else31, %if.then12
%add27.sink = phi i32 [ %add27, %if.then24 ], [ %7, %if.else31 ], [ %sub, %if.then12 ]
%arrayidx30 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv.next
store i32 %add27.sink, ptr %arrayidx30, align 4, !tbaa !5
%indvars.iv.next260 = add nuw i32 %indvars.iv259, 1
br label %while.cond
while.cond40: ; preds = %while.cond40.preheader, %if.end148
%floodnum.0 = phi i32 [ %floodnum.1, %if.end148 ], [ 0, %while.cond40.preheader ]
%i.0 = phi i32 [ %i.1, %if.end148 ], [ 1, %while.cond40.preheader ]
%idxprom42 = sext i32 %i.0 to i64
%arrayidx43 = getelementptr inbounds [20002 x i8], ptr %c, i64 0, i64 %idxprom42
%8 = load i8, ptr %arrayidx43, align 1, !tbaa !9
%cmp45 = icmp eq i8 %8, 92
br i1 %cmp45, label %if.then47, label %if.else146
if.then47: ; preds = %while.cond40
%cmp50.not239.not = icmp slt i32 %i.0, %1
br i1 %cmp50.not239.not, label %while.body52.lr.ph, label %if.end148
while.body52.lr.ph: ; preds = %if.then47
%sub53 = add nsw i32 %i.0, -1
%idxprom54 = sext i32 %sub53 to i64
%arrayidx55 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %idxprom54
%9 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%10 = add nsw i64 %idxprom42, 1
%11 = add i32 %i.0, 2
br label %while.body52
for.cond84.preheader: ; preds = %if.end61
br i1 %cmp50.not239.not, label %for.body87.preheader, label %if.end148
for.body87.preheader: ; preds = %for.cond84.preheader
%12 = add nsw i64 %idxprom42, 1
%13 = sub i32 %1, %i.0
%xtraiter = and i32 %13, 1
%14 = xor i32 %i.0, %4
%15 = icmp eq i32 %14, -1
br i1 %15, label %for.end110.unr-lcssa, label %for.body87.preheader.new
for.body87.preheader.new: ; preds = %for.body87.preheader
%unroll_iter = and i32 %13, -2
br label %for.body87
while.body52: ; preds = %while.body52.lr.ph, %if.end61
%indvar = phi i64 [ 0, %while.body52.lr.ph ], [ %indvar.next, %if.end61 ]
%indvars.iv275 = phi i32 [ %11, %while.body52.lr.ph ], [ %indvars.iv.next276, %if.end61 ]
%indvars.iv256 = phi i64 [ %10, %while.body52.lr.ph ], [ %indvars.iv.next257, %if.end61 ]
%arrayidx57 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv256
%16 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%cmp58 = icmp eq i32 %9, %16
br i1 %cmp58, label %if.then66, label %if.end61
if.end61: ; preds = %while.body52
%indvars.iv.next257 = add nsw i64 %indvars.iv256, 1
%lftr.wideiv = trunc i64 %indvars.iv.next257 to i32
%exitcond.not = icmp eq i32 %indvars.iv259, %lftr.wideiv
%indvars.iv.next276 = add i32 %indvars.iv275, 1
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.cond84.preheader, label %while.body52, !llvm.loop !10
if.then66: ; preds = %while.body52
%17 = trunc i64 %indvars.iv256 to i32
%add67 = add nsw i32 %floodnum.0, 1
%idxprom68 = sext i32 %add67 to i64
%arrayidx69 = getelementptr inbounds [20002 x i32], ptr %flood, i64 0, i64 %idxprom68
store i32 0, ptr %arrayidx69, align 4, !tbaa !5
%cmp70.not241 = icmp sgt i32 %i.0, %17
br i1 %cmp70.not241, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %if.then66
%18 = add i64 %indvar, 2
%min.iters.check = icmp ult i64 %18, 8
br i1 %min.iters.check, label %for.body.preheader320, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %18, -8
%ind.end = add i64 %n.vec, %idxprom42
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %9, 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 i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
%vec.phi296 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%offset.idx = add i64 %index, %idxprom42
%19 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %19, align 4, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
%wide.load297 = load <4 x i32>, ptr %20, align 4, !tbaa !5
%21 = sub <4 x i32> %broadcast.splat, %wide.load
%22 = sub <4 x i32> %broadcast.splat, %wide.load297
%23 = add <4 x i32> %21, %vec.phi
%24 = add <4 x i32> %22, %vec.phi296
%index.next = add nuw i64 %index, 8
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %24, %23
%26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %18, %n.vec
br i1 %cmp.n, label %for.cond.for.end_crit_edge, label %for.body.preheader320
for.body.preheader320: ; preds = %for.body.preheader, %middle.block
%indvars.iv272.ph = phi i64 [ %idxprom42, %for.body.preheader ], [ %ind.end, %middle.block ]
%.ph = phi i32 [ 0, %for.body.preheader ], [ %26, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader320, %for.body
%indvars.iv272 = phi i64 [ %indvars.iv.next273, %for.body ], [ %indvars.iv272.ph, %for.body.preheader320 ]
%27 = phi i32 [ %add80, %for.body ], [ %.ph, %for.body.preheader320 ]
%arrayidx76 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv272
%28 = load i32, ptr %arrayidx76, align 4, !tbaa !5
%sub77 = sub i32 %9, %28
%add80 = add nsw i32 %sub77, %27
%indvars.iv.next273 = add nsw i64 %indvars.iv272, 1
%lftr.wideiv278 = trunc i64 %indvars.iv.next273 to i32
%exitcond279.not = icmp eq i32 %indvars.iv275, %lftr.wideiv278
br i1 %exitcond279.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !15
for.cond.for.end_crit_edge: ; preds = %for.body, %middle.block
%add80.lcssa = phi i32 [ %26, %middle.block ], [ %add80, %for.body ]
store i32 %add80.lcssa, ptr %arrayidx69, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %if.then66
%add81 = add nsw i32 %17, 1
br label %if.end148
for.body87: ; preds = %for.inc108.1, %for.body87.preheader.new
%indvars.iv261 = phi i64 [ %12, %for.body87.preheader.new ], [ %indvars.iv.next262.1, %for.inc108.1 ]
%max.0245 = phi i32 [ -1, %for.body87.preheader.new ], [ %max.1.1, %for.inc108.1 ]
%niter = phi i32 [ 0, %for.body87.preheader.new ], [ %niter.next.1, %for.inc108.1 ]
%arrayidx89 = getelementptr inbounds [20002 x i8], ptr %c, i64 0, i64 %indvars.iv261
%29 = load i8, ptr %arrayidx89, align 1, !tbaa !9
%cmp91 = icmp eq i8 %29, 47
br i1 %cmp91, label %if.then93, label %for.inc108
if.then93: ; preds = %for.body87
%cmp94 = icmp eq i32 %max.0245, -1
%30 = trunc i64 %indvars.iv261 to i32
br i1 %cmp94, label %for.inc108, label %if.else97
if.else97: ; preds = %if.then93
%idxprom98 = sext i32 %max.0245 to i64
%arrayidx99 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %idxprom98
%31 = load i32, ptr %arrayidx99, align 4, !tbaa !5
%arrayidx101 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv261
%32 = load i32, ptr %arrayidx101, align 4, !tbaa !5
%cmp102 = icmp slt i32 %31, %32
%spec.select = select i1 %cmp102, i32 %30, i32 %max.0245
br label %for.inc108
for.inc108: ; preds = %if.else97, %if.then93, %for.body87
%max.1 = phi i32 [ %max.0245, %for.body87 ], [ %30, %if.then93 ], [ %spec.select, %if.else97 ]
%indvars.iv.next262 = add nsw i64 %indvars.iv261, 1
%arrayidx89.1 = getelementptr inbounds [20002 x i8], ptr %c, i64 0, i64 %indvars.iv.next262
%33 = load i8, ptr %arrayidx89.1, align 1, !tbaa !9
%cmp91.1 = icmp eq i8 %33, 47
br i1 %cmp91.1, label %if.then93.1, label %for.inc108.1
if.then93.1: ; preds = %for.inc108
%cmp94.1 = icmp eq i32 %max.1, -1
%34 = trunc i64 %indvars.iv.next262 to i32
br i1 %cmp94.1, label %for.inc108.1, label %if.else97.1
if.else97.1: ; preds = %if.then93.1
%idxprom98.1 = sext i32 %max.1 to i64
%arrayidx99.1 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %idxprom98.1
%35 = load i32, ptr %arrayidx99.1, align 4, !tbaa !5
%arrayidx101.1 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv.next262
%36 = load i32, ptr %arrayidx101.1, align 4, !tbaa !5
%cmp102.1 = icmp slt i32 %35, %36
%spec.select.1 = select i1 %cmp102.1, i32 %34, i32 %max.1
br label %for.inc108.1
for.inc108.1: ; preds = %if.else97.1, %if.then93.1, %for.inc108
%max.1.1 = phi i32 [ %max.1, %for.inc108 ], [ %34, %if.then93.1 ], [ %spec.select.1, %if.else97.1 ]
%indvars.iv.next262.1 = add nsw i64 %indvars.iv261, 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.end110.unr-lcssa, label %for.body87, !llvm.loop !16
for.end110.unr-lcssa: ; preds = %for.inc108.1, %for.body87.preheader
%max.1.lcssa.ph = phi i32 [ undef, %for.body87.preheader ], [ %max.1.1, %for.inc108.1 ]
%indvars.iv261.unr = phi i64 [ %12, %for.body87.preheader ], [ %indvars.iv.next262.1, %for.inc108.1 ]
%max.0245.unr = phi i32 [ -1, %for.body87.preheader ], [ %max.1.1, %for.inc108.1 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end110, label %for.body87.epil
for.body87.epil: ; preds = %for.end110.unr-lcssa
%arrayidx89.epil = getelementptr inbounds [20002 x i8], ptr %c, i64 0, i64 %indvars.iv261.unr
%37 = load i8, ptr %arrayidx89.epil, align 1, !tbaa !9
%cmp91.epil = icmp eq i8 %37, 47
br i1 %cmp91.epil, label %if.then93.epil, label %for.end110
if.then93.epil: ; preds = %for.body87.epil
%cmp94.epil = icmp eq i32 %max.0245.unr, -1
%38 = trunc i64 %indvars.iv261.unr to i32
br i1 %cmp94.epil, label %for.end110, label %if.else97.epil
if.else97.epil: ; preds = %if.then93.epil
%idxprom98.epil = sext i32 %max.0245.unr to i64
%arrayidx99.epil = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %idxprom98.epil
%39 = load i32, ptr %arrayidx99.epil, align 4, !tbaa !5
%arrayidx101.epil = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv261.unr
%40 = load i32, ptr %arrayidx101.epil, align 4, !tbaa !5
%cmp102.epil = icmp slt i32 %39, %40
%spec.select.epil = select i1 %cmp102.epil, i32 %38, i32 %max.0245.unr
br label %for.end110
for.end110: ; preds = %for.body87.epil, %if.then93.epil, %if.else97.epil, %for.end110.unr-lcssa
%max.1.lcssa = phi i32 [ %max.1.lcssa.ph, %for.end110.unr-lcssa ], [ %max.0245.unr, %for.body87.epil ], [ %38, %if.then93.epil ], [ %spec.select.epil, %if.else97.epil ]
%cmp111 = icmp eq i32 %max.1.lcssa, -1
br i1 %cmp111, label %if.end148, label %if.else115
if.else115: ; preds = %for.end110
%add116 = add nsw i32 %floodnum.0, 1
%idxprom117 = sext i32 %add116 to i64
%arrayidx118 = getelementptr inbounds [20002 x i32], ptr %flood, i64 0, i64 %idxprom117
store i32 0, ptr %arrayidx118, align 4, !tbaa !5
%cmp120.not246 = icmp sgt i32 %i.0, %max.1.lcssa
br i1 %cmp120.not246, label %if.else115.for.end142_crit_edge, label %for.body122.lr.ph
if.else115.for.end142_crit_edge: ; preds = %if.else115
%.pre = add nuw nsw i32 %max.1.lcssa, 1
br label %if.end148
for.body122.lr.ph: ; preds = %if.else115
%idxprom123 = sext i32 %max.1.lcssa to i64
%arrayidx124 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %idxprom123
%41 = load i32, ptr %arrayidx124, align 4, !tbaa !5
%42 = add nuw i32 %max.1.lcssa, 1
%43 = add i32 %max.1.lcssa, 1
%44 = sub i32 %43, %i.0
%xtraiter328 = and i32 %44, 1
%45 = icmp eq i32 %max.1.lcssa, %i.0
br i1 %45, label %if.end148.loopexit.unr-lcssa, label %for.body122.lr.ph.new
for.body122.lr.ph.new: ; preds = %for.body122.lr.ph
%unroll_iter330 = and i32 %44, -2
br label %for.body122
for.body122: ; preds = %for.inc140.1, %for.body122.lr.ph.new
%46 = phi i32 [ 0, %for.body122.lr.ph.new ], [ %50, %for.inc140.1 ]
%indvars.iv267 = phi i64 [ %idxprom42, %for.body122.lr.ph.new ], [ %indvars.iv.next268.1, %for.inc140.1 ]
%niter331 = phi i32 [ 0, %for.body122.lr.ph.new ], [ %niter331.next.1, %for.inc140.1 ]
%arrayidx126 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv267
%47 = load i32, ptr %arrayidx126, align 4, !tbaa !5
%sub127 = sub nsw i32 %41, %47
%cmp128 = icmp sgt i32 %sub127, 0
br i1 %cmp128, label %if.then130, label %for.inc140
if.then130: ; preds = %for.body122
%add138 = add nsw i32 %46, %sub127
store i32 %add138, ptr %arrayidx118, align 4, !tbaa !5
br label %for.inc140
for.inc140: ; preds = %for.body122, %if.then130
%48 = phi i32 [ %46, %for.body122 ], [ %add138, %if.then130 ]
%indvars.iv.next268 = add nsw i64 %indvars.iv267, 1
%arrayidx126.1 = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv.next268
%49 = load i32, ptr %arrayidx126.1, align 4, !tbaa !5
%sub127.1 = sub nsw i32 %41, %49
%cmp128.1 = icmp sgt i32 %sub127.1, 0
br i1 %cmp128.1, label %if.then130.1, label %for.inc140.1
if.then130.1: ; preds = %for.inc140
%add138.1 = add nsw i32 %48, %sub127.1
store i32 %add138.1, ptr %arrayidx118, align 4, !tbaa !5
br label %for.inc140.1
for.inc140.1: ; preds = %if.then130.1, %for.inc140
%50 = phi i32 [ %48, %for.inc140 ], [ %add138.1, %if.then130.1 ]
%indvars.iv.next268.1 = add nsw i64 %indvars.iv267, 2
%niter331.next.1 = add i32 %niter331, 2
%niter331.ncmp.1 = icmp eq i32 %niter331.next.1, %unroll_iter330
br i1 %niter331.ncmp.1, label %if.end148.loopexit.unr-lcssa, label %for.body122, !llvm.loop !17
if.else146: ; preds = %while.cond40
%add147 = add nsw i32 %i.0, 1
br label %if.end148
if.end148.loopexit.unr-lcssa: ; preds = %for.inc140.1, %for.body122.lr.ph
%.unr = phi i32 [ 0, %for.body122.lr.ph ], [ %50, %for.inc140.1 ]
%indvars.iv267.unr = phi i64 [ %idxprom42, %for.body122.lr.ph ], [ %indvars.iv.next268.1, %for.inc140.1 ]
%lcmp.mod329.not = icmp eq i32 %xtraiter328, 0
br i1 %lcmp.mod329.not, label %if.end148, label %for.body122.epil
for.body122.epil: ; preds = %if.end148.loopexit.unr-lcssa
%arrayidx126.epil = getelementptr inbounds [20002 x i32], ptr %height, i64 0, i64 %indvars.iv267.unr
%51 = load i32, ptr %arrayidx126.epil, align 4, !tbaa !5
%sub127.epil = sub nsw i32 %41, %51
%cmp128.epil = icmp sgt i32 %sub127.epil, 0
br i1 %cmp128.epil, label %if.then130.epil, label %if.end148
if.then130.epil: ; preds = %for.body122.epil
%add138.epil = add nsw i32 %.unr, %sub127.epil
store i32 %add138.epil, ptr %arrayidx118, align 4, !tbaa !5
br label %if.end148
if.end148: ; preds = %if.end148.loopexit.unr-lcssa, %if.then130.epil, %for.body122.epil, %if.then47, %for.cond84.preheader, %if.else115.for.end142_crit_edge, %for.end110, %for.end, %if.else146
%floodnum.1 = phi i32 [ %add67, %for.end ], [ %floodnum.0, %if.else146 ], [ %floodnum.0, %for.end110 ], [ %add116, %if.else115.for.end142_crit_edge ], [ %floodnum.0, %for.cond84.preheader ], [ %floodnum.0, %if.then47 ], [ %add116, %for.body122.epil ], [ %add116, %if.then130.epil ], [ %add116, %if.end148.loopexit.unr-lcssa ]
%i.1 = phi i32 [ %add81, %for.end ], [ %add147, %if.else146 ], [ %2, %for.end110 ], [ %.pre, %if.else115.for.end142_crit_edge ], [ %2, %for.cond84.preheader ], [ %2, %if.then47 ], [ %42, %for.body122.epil ], [ %42, %if.then130.epil ], [ %42, %if.end148.loopexit.unr-lcssa ]
%cmp149 = icmp sgt i32 %i.1, %1
br i1 %cmp149, label %for.cond154.preheader, label %while.cond40
for.cond154.preheader: ; preds = %if.end148
%cmp155.not248 = icmp slt i32 %floodnum.1, 1
br i1 %cmp155.not248, label %for.end175.critedge, label %for.body157.preheader
for.body157.preheader: ; preds = %for.cond154.preheader
%52 = add nuw i32 %floodnum.1, 1
%wide.trip.count = zext i32 %52 to i64
%53 = add nsw i64 %wide.trip.count, -1
%min.iters.check300 = icmp ult i32 %floodnum.1, 8
br i1 %min.iters.check300, label %for.body157.preheader317, label %vector.ph301
vector.ph301: ; preds = %for.body157.preheader
%n.vec303 = and i64 %53, -8
%ind.end304 = or i64 %n.vec303, 1
br label %vector.body307
vector.body307: ; preds = %vector.body307, %vector.ph301
%index308 = phi i64 [ 0, %vector.ph301 ], [ %index.next314, %vector.body307 ]
%vec.phi309 = phi <4 x i32> [ zeroinitializer, %vector.ph301 ], [ %56, %vector.body307 ]
%vec.phi310 = phi <4 x i32> [ zeroinitializer, %vector.ph301 ], [ %57, %vector.body307 ]
%offset.idx311 = or i64 %index308, 1
%54 = getelementptr inbounds [20002 x i32], ptr %flood, i64 0, i64 %offset.idx311
%wide.load312 = load <4 x i32>, ptr %54, align 4, !tbaa !5
%55 = getelementptr inbounds i32, ptr %54, i64 4
%wide.load313 = load <4 x i32>, ptr %55, align 4, !tbaa !5
%56 = add <4 x i32> %wide.load312, %vec.phi309
%57 = add <4 x i32> %wide.load313, %vec.phi310
%index.next314 = add nuw i64 %index308, 8
%58 = icmp eq i64 %index.next314, %n.vec303
br i1 %58, label %middle.block298, label %vector.body307, !llvm.loop !18
middle.block298: ; preds = %vector.body307
%bin.rdx315 = add <4 x i32> %57, %56
%59 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx315)
%cmp.n306 = icmp eq i64 %53, %n.vec303
br i1 %cmp.n306, label %for.end163, label %for.body157.preheader317
for.body157.preheader317: ; preds = %for.body157.preheader, %middle.block298
%indvars.iv280.ph = phi i64 [ 1, %for.body157.preheader ], [ %ind.end304, %middle.block298 ]
%sum.0249.ph = phi i32 [ 0, %for.body157.preheader ], [ %59, %middle.block298 ]
br label %for.body157
for.body157: ; preds = %for.body157.preheader317, %for.body157
%indvars.iv280 = phi i64 [ %indvars.iv.next281, %for.body157 ], [ %indvars.iv280.ph, %for.body157.preheader317 ]
%sum.0249 = phi i32 [ %add160, %for.body157 ], [ %sum.0249.ph, %for.body157.preheader317 ]
%arrayidx159 = getelementptr inbounds [20002 x i32], ptr %flood, i64 0, i64 %indvars.iv280
%60 = load i32, ptr %arrayidx159, align 4, !tbaa !5
%add160 = add nsw i32 %60, %sum.0249
%indvars.iv.next281 = add nuw nsw i64 %indvars.iv280, 1
%exitcond283.not = icmp eq i64 %indvars.iv.next281, %wide.trip.count
br i1 %exitcond283.not, label %for.end163, label %for.body157, !llvm.loop !19
for.end163: ; preds = %for.body157, %middle.block298
%add160.lcssa = phi i32 [ %59, %middle.block298 ], [ %add160, %for.body157 ]
%call164 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add160.lcssa)
%call165 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %floodnum.1)
br i1 %cmp155.not248, label %for.end175, label %for.body169.preheader
for.body169.preheader: ; preds = %for.end163
%61 = add nuw i32 %floodnum.1, 1
%wide.trip.count287 = zext i32 %61 to i64
br label %for.body169
for.body169: ; preds = %for.body169.preheader, %for.body169
%indvars.iv284 = phi i64 [ 1, %for.body169.preheader ], [ %indvars.iv.next285, %for.body169 ]
%arrayidx171 = getelementptr inbounds [20002 x i32], ptr %flood, i64 0, i64 %indvars.iv284
%62 = load i32, ptr %arrayidx171, align 4, !tbaa !5
%call172 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %62)
%indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1
%exitcond288.not = icmp eq i64 %indvars.iv.next285, %wide.trip.count287
br i1 %exitcond288.not, label %for.end175, label %for.body169, !llvm.loop !20
for.end175.critedge: ; preds = %for.cond154.preheader
%call164.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
%call165.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %floodnum.1)
br label %for.end175
for.end175: ; preds = %for.body169, %for.end175.critedge, %for.end163
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 80008, ptr nonnull %flood) #5
call void @llvm.lifetime.end.p0(i64 80008, ptr nonnull %height) #5
call void @llvm.lifetime.end.p0(i64 20002, ptr nonnull %c) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !11, !14, !13}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !13, !14}
!19 = distinct !{!19, !11, !14, !13}
!20 = distinct !{!20, !11}
|
#include <stdio.h>
typedef struct{
int index;
int s;
}STACK_T;
int main()
{
char c;
char figure[20000];
int stack[20000];
STACK_T stack2[20000];
int sp, sp2;
int index;
int count, sum;
int i;
// データを入力
i = count = 0;
while( (c = fgetc(stdin)) != '\n'){
figure[i++] = c;
count++;
}
// 面積の計算
sp = sp2 = sum = 0;
for(i = 0; i < count; i++){
// スタックに積んでいく
if(figure[i] == '\\')
stack[sp++] = i;
// スタックから取り出す&面積の計算
else if(figure[i] == '/' && sp >= 1){
index = stack2[sp2].index = stack[--sp];
sum += stack2[sp2].s = i - stack[sp];
// 結合
while(sp2 >= 1 && index < stack2[sp2 - 1].index){
stack2[--sp2].index = index;
stack2[sp2].s += stack2[sp2 + 1].s;
}
sp2++;
}
}
// 表示
printf("%d\n", sum);
printf("%d", sp2);
for(i = 0; i < sp2; i++){
if(i == 0)
printf(" ");
printf("%d", stack2[i].s);
if(i != sp2 - 1)
printf(" ");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338350/source.c"
target datalayout = "e-m:e-p270: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.STACK_T = type { i32, i32 }
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%figure = alloca [20000 x i8], align 16
%stack = alloca [20000 x i32], align 16
%stack2 = alloca [20000 x %struct.STACK_T], align 16
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %figure) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %stack) #4
call void @llvm.lifetime.start.p0(i64 160000, ptr nonnull %stack2) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call111 = tail call i32 @fgetc(ptr noundef %0)
%sext.mask112 = and i32 %call111, 255
%cmp.not113 = icmp eq i32 %sext.mask112, 10
br i1 %cmp.not113, label %for.end, label %while.body
for.cond.preheader: ; preds = %while.body
%1 = and i64 %indvars.iv.next, 4294967295
%cmp4121.not = icmp eq i64 %1, 0
br i1 %cmp4121.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = and i64 %indvars.iv.next, 4294967295
br label %for.body
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%call116 = phi i32 [ %call, %while.body ], [ %call111, %entry ]
%conv = trunc i32 %call116 to i8
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [20000 x i8], ptr %figure, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx, align 1, !tbaa !9
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call i32 @fgetc(ptr noundef %2)
%sext.mask = and i32 %call, 255
%cmp.not = icmp eq i32 %sext.mask, 10
br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !10
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv136 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next137, %for.inc ]
%sum.0124 = phi i32 [ 0, %for.body.preheader ], [ %sum.1, %for.inc ]
%sp.0123 = phi i32 [ 0, %for.body.preheader ], [ %sp.1, %for.inc ]
%sp2.0122 = phi i32 [ 0, %for.body.preheader ], [ %sp2.2, %for.inc ]
%arrayidx7 = getelementptr inbounds [20000 x i8], ptr %figure, i64 0, i64 %indvars.iv136
%3 = load i8, ptr %arrayidx7, align 1, !tbaa !9
%cmp9 = icmp eq i8 %3, 92
br i1 %cmp9, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc11 = add nsw i32 %sp.0123, 1
%idxprom12 = sext i32 %sp.0123 to i64
%arrayidx13 = getelementptr inbounds [20000 x i32], ptr %stack, i64 0, i64 %idxprom12
%4 = trunc i64 %indvars.iv136 to i32
store i32 %4, ptr %arrayidx13, align 4, !tbaa !12
br label %for.inc
if.else: ; preds = %for.body
%cmp17 = icmp eq i8 %3, 47
%cmp19 = icmp sgt i32 %sp.0123, 0
%or.cond = select i1 %cmp17, i1 %cmp19, i1 false
br i1 %or.cond, label %if.then21, label %for.inc
if.then21: ; preds = %if.else
%dec = add nsw i32 %sp.0123, -1
%idxprom22 = zext i32 %dec to i64
%arrayidx23 = getelementptr inbounds [20000 x i32], ptr %stack, i64 0, i64 %idxprom22
%5 = load i32, ptr %arrayidx23, align 4, !tbaa !12
%idxprom24 = sext i32 %sp2.0122 to i64
%arrayidx25 = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %idxprom24
store i32 %5, ptr %arrayidx25, align 8, !tbaa !14
%6 = trunc i64 %indvars.iv136 to i32
%sub = sub nsw i32 %6, %5
%s = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %idxprom24, i32 1
store i32 %sub, ptr %s, align 4, !tbaa !16
%add = add nsw i32 %sub, %sum.0124
%cmp32117 = icmp sgt i32 %sp2.0122, 0
br i1 %cmp32117, label %land.rhs.preheader, label %while.end53
land.rhs.preheader: ; preds = %if.then21
%7 = zext i32 %sp2.0122 to i64
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body40
%indvars.iv133 = phi i64 [ %7, %land.rhs.preheader ], [ %indvars.iv.next134, %while.body40 ]
%indvars.iv.next134 = add nsw i64 %indvars.iv133, -1
%idxprom35 = and i64 %indvars.iv.next134, 4294967295
%arrayidx36 = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %idxprom35
%8 = load i32, ptr %arrayidx36, align 8, !tbaa !14
%cmp38 = icmp slt i32 %5, %8
br i1 %cmp38, label %while.body40, label %while.end53.loopexit.split.loop.exit150
while.body40: ; preds = %land.rhs
store i32 %5, ptr %arrayidx36, align 8, !tbaa !14
%s48 = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %indvars.iv133, i32 1
%9 = load i32, ptr %s48, align 4, !tbaa !16
%s51 = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %idxprom35, i32 1
%10 = load i32, ptr %s51, align 4, !tbaa !16
%add52 = add nsw i32 %10, %9
store i32 %add52, ptr %s51, align 4, !tbaa !16
%cmp32 = icmp ugt i64 %indvars.iv133, 1
br i1 %cmp32, label %land.rhs, label %while.end53, !llvm.loop !17
while.end53.loopexit.split.loop.exit150: ; preds = %land.rhs
%11 = trunc i64 %indvars.iv133 to i32
br label %while.end53
while.end53: ; preds = %while.body40, %while.end53.loopexit.split.loop.exit150, %if.then21
%sp2.1.lcssa = phi i32 [ %sp2.0122, %if.then21 ], [ %11, %while.end53.loopexit.split.loop.exit150 ], [ 0, %while.body40 ]
%inc54 = add nsw i32 %sp2.1.lcssa, 1
br label %for.inc
for.inc: ; preds = %if.then, %while.end53, %if.else
%sp2.2 = phi i32 [ %sp2.0122, %if.then ], [ %inc54, %while.end53 ], [ %sp2.0122, %if.else ]
%sp.1 = phi i32 [ %inc11, %if.then ], [ %dec, %while.end53 ], [ %sp.0123, %if.else ]
%sum.1 = phi i32 [ %sum.0124, %if.then ], [ %add, %while.end53 ], [ %sum.0124, %if.else ]
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%exitcond.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !18
for.end: ; preds = %for.inc, %entry, %for.cond.preheader
%sp2.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ 0, %entry ], [ %sp2.2, %for.inc ]
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ 0, %entry ], [ %sum.1, %for.inc ]
%call57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
%call58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sp2.0.lcssa)
%cmp60128 = icmp sgt i32 %sp2.0.lcssa, 0
br i1 %cmp60128, label %if.end67.peel, label %for.end80
if.end67.peel: ; preds = %for.end
%sub72 = add nsw i32 %sp2.0.lcssa, -1
%12 = zext i32 %sub72 to i64
%wide.trip.count144 = zext i32 %sp2.0.lcssa to i64
%putchar109.peel = tail call i32 @putchar(i32 32)
%s70.peel = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 0, i32 1
%13 = load i32, ptr %s70.peel, align 4, !tbaa !16
%call71.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13)
%cmp73.not.peel = icmp eq i32 %sub72, 0
br i1 %cmp73.not.peel, label %for.end80, label %for.body62.peel.next
for.body62.peel.next: ; preds = %if.end67.peel
%putchar110.peel = tail call i32 @putchar(i32 32)
br label %if.end67
if.end67: ; preds = %for.inc78, %for.body62.peel.next
%indvars.iv140 = phi i64 [ 1, %for.body62.peel.next ], [ %indvars.iv.next141, %for.inc78 ]
%s70 = getelementptr inbounds [20000 x %struct.STACK_T], ptr %stack2, i64 0, i64 %indvars.iv140, i32 1
%14 = load i32, ptr %s70, align 4, !tbaa !16
%call71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%cmp73.not = icmp eq i64 %indvars.iv140, %12
br i1 %cmp73.not, label %for.inc78, label %if.then75
if.then75: ; preds = %if.end67
%putchar110 = tail call i32 @putchar(i32 32)
br label %for.inc78
for.inc78: ; preds = %if.end67, %if.then75
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%exitcond145.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count144
br i1 %exitcond145.not, label %for.end80, label %if.end67, !llvm.loop !19
for.end80: ; preds = %for.inc78, %if.end67.peel, %for.end
%putchar = tail call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %stack2) #4
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %stack) #4
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %figure) #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 @fgetc(ptr nocapture noundef) 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 = !{!"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 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0, !13, i64 4}
!16 = !{!15, !13, i64 4}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11, !20}
!20 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <stdlib.h>
int top1=0, top2=0, top3=0;
int S1[20000], S2[20000], S3[20000];
void push1(int x){top1++;S1[top1] = x;}
int pop1(){top1--;return S1[top1+1];}
void push2(int x){top2++;S2[top2] = x;}
int pop2(){top2--;return S2[top2+1];}
void push3(int x){top3++;S3[top3] = x;}
int pop3(){top3--;return S3[top3+1];}
int main(void)
{
char s[20000];
int i=0, j=0, sum=0;
int k=0;
scanf("%s", s);
while(s[i] == '\\' || s[i] == '_' || s[i] == '/'){
if(s[i] == '\\' ) push1(i);
else if(s[i] == '/' && top1 != 0){
j = pop1();
k = i - j;
sum += k;
while(top2 != 0 && j < S2[top2]){
pop2();
k += pop3();
}
push2(j);
push3(k);
}
i++;
}
printf("%d\n", sum);
printf("%d", top3);
for(i = 1; top3 != 0; i++){
pop3();
printf(" %d", S3[i]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338394/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338394/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@top1 = dso_local local_unnamed_addr global i32 0, align 4
@top2 = dso_local local_unnamed_addr global i32 0, align 4
@top3 = dso_local local_unnamed_addr global i32 0, align 4
@S1 = dso_local local_unnamed_addr global [20000 x i32] zeroinitializer, align 16
@S2 = dso_local local_unnamed_addr global [20000 x i32] zeroinitializer, align 16
@S3 = dso_local local_unnamed_addr global [20000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push1(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top1, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @top1, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S1, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop1() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top1, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @top1, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S1, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push2(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top2, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @top2, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S2, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop2() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top2, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @top2, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S2, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push3(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top3, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @top3, align 4, !tbaa !5
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S3, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop3() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @top3, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @top3, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [20000 x i32], ptr @S3, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
ret i32 %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%s = alloca [20000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%top1.promoted = load i32, ptr @top1, align 4
%top2.promoted91 = load i32, ptr @top2, align 4, !tbaa !5
%top3.promoted94 = load i32, ptr @top3, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %if.end37, %entry
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %if.end37 ], [ 0, %entry ]
%top3.promoted96 = phi i32 [ %top3.promoted95, %if.end37 ], [ %top3.promoted94, %entry ]
%top2.promoted93 = phi i32 [ %top2.promoted92, %if.end37 ], [ %top2.promoted91, %entry ]
%dec.i90 = phi i32 [ %dec.i89, %if.end37 ], [ %top1.promoted, %entry ]
%sum.0 = phi i32 [ %sum.1, %if.end37 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20000 x i8], ptr %s, i64 0, i64 %indvars.iv106
%0 = load i8, ptr %arrayidx, align 1, !tbaa !9
switch i8 %0, label %while.end38 [
i8 92, label %if.then
i8 47, label %if.else
i8 95, label %if.else
]
if.then: ; preds = %while.cond
%inc.i = add nsw i32 %dec.i90, 1
store i32 %inc.i, ptr @top1, align 4, !tbaa !5
%idxprom.i = sext i32 %inc.i to i64
%arrayidx.i = getelementptr inbounds [20000 x i32], ptr @S1, i64 0, i64 %idxprom.i
%1 = trunc i64 %indvars.iv106 to i32
store i32 %1, ptr %arrayidx.i, align 4, !tbaa !5
br label %if.end37
if.else: ; preds = %while.cond, %while.cond
%cmp20 = icmp eq i8 %0, 47
%cmp22 = icmp ne i32 %dec.i90, 0
%or.cond = select i1 %cmp20, i1 %cmp22, i1 false
br i1 %or.cond, label %if.then24, label %if.end37
if.then24: ; preds = %if.else
%dec.i = add nsw i32 %dec.i90, -1
store i32 %dec.i, ptr @top1, align 4, !tbaa !5
%idxprom.i63 = sext i32 %dec.i90 to i64
%arrayidx.i64 = getelementptr inbounds [20000 x i32], ptr @S1, i64 0, i64 %idxprom.i63
%2 = load i32, ptr %arrayidx.i64, align 4, !tbaa !5
%3 = trunc i64 %indvars.iv106 to i32
%sub = sub nsw i32 %3, %2
%add = add nsw i32 %sub, %sum.0
%cmp27.not82 = icmp eq i32 %top2.promoted93, 0
br i1 %cmp27.not82, label %while.end, label %land.rhs.preheader
land.rhs.preheader: ; preds = %if.then24
%4 = sext i32 %top2.promoted93 to i64
%5 = sext i32 %top3.promoted96 to i64
%6 = sub i32 %top3.promoted96, %top2.promoted93
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body33
%indvars.iv101 = phi i64 [ %5, %land.rhs.preheader ], [ %indvars.iv.next102, %while.body33 ]
%indvars.iv = phi i64 [ %4, %land.rhs.preheader ], [ %indvars.iv.next, %while.body33 ]
%k.085 = phi i32 [ %sub, %land.rhs.preheader ], [ %add36, %while.body33 ]
%arrayidx30 = getelementptr inbounds [20000 x i32], ptr @S2, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31 = icmp slt i32 %2, %7
br i1 %cmp31, label %while.body33, label %while.end.loopexit.split.loop.exit112
while.body33: ; preds = %land.rhs
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%indvars.iv.next102 = add nsw i64 %indvars.iv101, -1
%arrayidx.i70 = getelementptr inbounds [20000 x i32], ptr @S3, i64 0, i64 %indvars.iv101
%8 = load i32, ptr %arrayidx.i70, align 4, !tbaa !5
%add36 = add nsw i32 %8, %k.085
%9 = and i64 %indvars.iv.next, 4294967295
%cmp27.not = icmp eq i64 %9, 0
br i1 %cmp27.not, label %while.end, label %land.rhs, !llvm.loop !10
while.end.loopexit.split.loop.exit112: ; preds = %land.rhs
%10 = trunc i64 %indvars.iv to i32
%11 = trunc i64 %indvars.iv101 to i32
br label %while.end
while.end: ; preds = %while.body33, %while.end.loopexit.split.loop.exit112, %if.then24
%top3.promoted97 = phi i32 [ %top3.promoted96, %if.then24 ], [ %11, %while.end.loopexit.split.loop.exit112 ], [ %6, %while.body33 ]
%k.0.lcssa = phi i32 [ %sub, %if.then24 ], [ %k.085, %while.end.loopexit.split.loop.exit112 ], [ %add36, %while.body33 ]
%.lcssa = phi i32 [ 0, %if.then24 ], [ %10, %while.end.loopexit.split.loop.exit112 ], [ 0, %while.body33 ]
%inc.i71 = add nsw i32 %.lcssa, 1
store i32 %inc.i71, ptr @top2, align 4, !tbaa !5
%idxprom.i72 = sext i32 %inc.i71 to i64
%arrayidx.i73 = getelementptr inbounds [20000 x i32], ptr @S2, i64 0, i64 %idxprom.i72
store i32 %2, ptr %arrayidx.i73, align 4, !tbaa !5
%inc.i74 = add nsw i32 %top3.promoted97, 1
store i32 %inc.i74, ptr @top3, align 4, !tbaa !5
%idxprom.i75 = sext i32 %inc.i74 to i64
%arrayidx.i76 = getelementptr inbounds [20000 x i32], ptr @S3, i64 0, i64 %idxprom.i75
store i32 %k.0.lcssa, ptr %arrayidx.i76, align 4, !tbaa !5
br label %if.end37
if.end37: ; preds = %if.else, %while.end, %if.then
%top3.promoted95 = phi i32 [ %top3.promoted96, %if.then ], [ %inc.i74, %while.end ], [ %top3.promoted96, %if.else ]
%top2.promoted92 = phi i32 [ %top2.promoted93, %if.then ], [ %inc.i71, %while.end ], [ %top2.promoted93, %if.else ]
%dec.i89 = phi i32 [ %inc.i, %if.then ], [ %dec.i, %while.end ], [ %dec.i90, %if.else ]
%sum.1 = phi i32 [ %sum.0, %if.then ], [ %add, %while.end ], [ %sum.0, %if.else ]
%indvars.iv.next107 = add nuw i64 %indvars.iv106, 1
br label %while.cond, !llvm.loop !12
while.end38: ; preds = %while.cond
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0)
%12 = load i32, ptr @top3, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%13 = load i32, ptr @top3, align 4, !tbaa !5
%cmp41.not99 = icmp eq i32 %13, 0
br i1 %cmp41.not99, label %for.end, label %for.body
for.body: ; preds = %while.end38, %for.body
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body ], [ 1, %while.end38 ]
%14 = phi i32 [ %16, %for.body ], [ %13, %while.end38 ]
%dec.i77 = add nsw i32 %14, -1
store i32 %dec.i77, ptr @top3, align 4, !tbaa !5
%arrayidx45 = getelementptr inbounds [20000 x i32], ptr @S3, i64 0, i64 %indvars.iv109
%15 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %15)
%indvars.iv.next110 = add nuw i64 %indvars.iv109, 1
%16 = load i32, ptr @top3, align 4, !tbaa !5
%cmp41.not = icmp eq i32 %16, 0
br i1 %cmp41.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %while.end38
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
int s[30000],t[30000],r[30000];
int p,q,qq;
void push(int x) {
s[p]=x;
p++;
}
void push2(int x) {
t[q]=x;
q++;
}
void push3(int x) {
r[qq]=x;
qq++;
}
int pop() {
if(p==0) return -1;
p--;
return s[p];
}
int pop2() {
if(q==0) return 0;
q--;
return t[q];
}
int pop3() {
if(qq==0) return -1;
qq--;
return r[qq];
}
int main() {
p=q=qq=0;
char c[30000];
scanf("%s",c);
int i=0,sum=0,j=0,n=0,a[30000];
while(c[i]=='\\' || c[i]=='/' || c[i]=='_') {
if(c[i]=='\\') push(i);
if(c[i]=='/') {
int x=pop();
if(x>=0) {
int d=0;
while(1) {
int y=pop3();
if(y<x) {
if(y!=-1) push3(y);
break;
}
d+=pop2();
}
d+=i-x;
push2(d);
push3(x);
}
}
i++;
}
while(1) {
int x=pop2();
if(x==0) break;
sum+=x;
a[n]=x;
n++;
}
printf("%d\n%d",sum,n);
for(j=n-1; j>=0; j--) printf(" %d",a[j]);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338444/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338444/source.c"
target datalayout = "e-m:e-p270: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 local_unnamed_addr global [30000 x i32] zeroinitializer, align 16
@p = dso_local local_unnamed_addr global i32 0, align 4
@t = dso_local local_unnamed_addr global [30000 x i32] zeroinitializer, align 16
@q = dso_local local_unnamed_addr global i32 0, align 4
@r = dso_local local_unnamed_addr global [30000 x i32] zeroinitializer, align 16
@qq = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d\0A%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @p, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @s, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @p, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push2(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @t, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @q, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push3(i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qq, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @r, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qq, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @p, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @p, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @s, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop2() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @q, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @t, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop3() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qq, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @qq, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [30000 x i32], ptr @r, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%c = alloca [30000 x i8], align 16
%a = alloca [30000 x i32], align 16
store i32 0, ptr @qq, align 4, !tbaa !5
store i32 0, ptr @q, align 4, !tbaa !5
store i32 0, ptr @p, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 30000, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
call void @llvm.lifetime.start.p0(i64 120000, ptr nonnull %a) #5
%p.promoted = load i32, ptr @p, align 4, !tbaa !5
%qq.promoted155 = load i32, ptr @qq, align 4, !tbaa !5
%q.promoted159 = load i32, ptr @q, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %if.end41, %entry
%indvars.iv185 = phi i64 [ %indvars.iv.next186, %if.end41 ], [ 0, %entry ]
%q.promoted = phi i32 [ %q.promoted160, %if.end41 ], [ %q.promoted159, %entry ]
%qq.promoted157 = phi i32 [ %qq.promoted156, %if.end41 ], [ %qq.promoted155, %entry ]
%dec.i154 = phi i32 [ %dec.i153, %if.end41 ], [ %p.promoted, %entry ]
%arrayidx = getelementptr inbounds [30000 x i8], ptr %c, i64 0, i64 %indvars.iv185
%0 = load i8, ptr %arrayidx, align 1, !tbaa !9
switch i8 %0, label %while.cond43.preheader [
i8 92, label %if.end.thread
i8 47, label %if.then22
i8 95, label %if.end41
]
while.cond43.preheader: ; preds = %while.cond
%cmp.i120166 = icmp eq i32 %q.promoted, 0
br i1 %cmp.i120166, label %while.end58.thread, label %pop2.exit126.preheader
while.end58.thread: ; preds = %while.cond43.preheader
%call59200 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0, i32 noundef 0)
br label %for.end
pop2.exit126.preheader: ; preds = %while.cond43.preheader
%1 = sext i32 %q.promoted to i64
%wide.trip.count = zext i32 %q.promoted to i64
br label %pop2.exit126
if.end.thread: ; preds = %while.cond
%idxprom.i = sext i32 %dec.i154 to i64
%arrayidx.i = getelementptr inbounds [30000 x i32], ptr @s, i64 0, i64 %idxprom.i
%2 = trunc i64 %indvars.iv185 to i32
store i32 %2, ptr %arrayidx.i, align 4, !tbaa !5
%inc.i = add nsw i32 %dec.i154, 1
store i32 %inc.i, ptr @p, align 4, !tbaa !5
br label %if.end41
if.then22: ; preds = %while.cond
%cmp.i = icmp eq i32 %dec.i154, 0
br i1 %cmp.i, label %if.end41, label %pop.exit
pop.exit: ; preds = %if.then22
%dec.i = add nsw i32 %dec.i154, -1
store i32 %dec.i, ptr @p, align 4, !tbaa !5
%idxprom.i97 = sext i32 %dec.i to i64
%arrayidx.i98 = getelementptr inbounds [30000 x i32], ptr @s, i64 0, i64 %idxprom.i97
%3 = load i32, ptr %arrayidx.i98, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %3, -1
br i1 %cmp24, label %while.cond27.preheader, label %if.end41
while.cond27.preheader: ; preds = %pop.exit
%4 = icmp eq i32 %qq.promoted157, 0
br i1 %4, label %while.end, label %pop3.exit.lr.ph
pop3.exit.lr.ph: ; preds = %while.cond27.preheader
%5 = sext i32 %qq.promoted157 to i64
br label %pop3.exit
pop3.exit: ; preds = %pop3.exit.lr.ph, %cleanup
%d.0223 = phi i32 [ 0, %pop3.exit.lr.ph ], [ %add, %cleanup ]
%dec.i110152222 = phi i32 [ %q.promoted, %pop3.exit.lr.ph ], [ %dec.i110151, %cleanup ]
%indvars.iv221 = phi i64 [ %5, %pop3.exit.lr.ph ], [ %indvars.iv.next, %cleanup ]
%indvars.iv.next = add nsw i64 %indvars.iv221, -1
%arrayidx.i103 = getelementptr inbounds [30000 x i32], ptr @r, i64 0, i64 %indvars.iv.next
%6 = load i32, ptr %arrayidx.i103, align 4, !tbaa !5
%cmp30 = icmp slt i32 %6, %3
br i1 %cmp30, label %if.then32, label %if.end37
if.then32: ; preds = %pop3.exit
%7 = trunc i64 %indvars.iv.next to i32
%cmp33.not = icmp eq i32 %6, -1
br i1 %cmp33.not, label %while.end, label %if.then35
if.then35: ; preds = %if.then32
%8 = trunc i64 %indvars.iv221 to i32
%sext = shl i64 %indvars.iv.next, 32
%idxprom.i105 = ashr exact i64 %sext, 32
%arrayidx.i106 = getelementptr inbounds [30000 x i32], ptr @r, i64 0, i64 %idxprom.i105
store i32 %6, ptr %arrayidx.i106, align 4, !tbaa !5
br label %while.end
if.end37: ; preds = %pop3.exit
%cmp.i108 = icmp eq i32 %dec.i110152222, 0
br i1 %cmp.i108, label %cleanup, label %if.end.i109
if.end.i109: ; preds = %if.end37
%dec.i110 = add nsw i32 %dec.i110152222, -1
store i32 %dec.i110, ptr @q, align 4, !tbaa !5
%idxprom.i111 = sext i32 %dec.i110 to i64
%arrayidx.i112 = getelementptr inbounds [30000 x i32], ptr @t, i64 0, i64 %idxprom.i111
%9 = load i32, ptr %arrayidx.i112, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %if.end.i109, %if.end37
%dec.i110151 = phi i32 [ %dec.i110, %if.end.i109 ], [ 0, %if.end37 ]
%retval.0.i113 = phi i32 [ %9, %if.end.i109 ], [ 0, %if.end37 ]
%add = add nsw i32 %retval.0.i113, %d.0223
%10 = icmp eq i64 %indvars.iv.next, 0
br i1 %10, label %while.end, label %pop3.exit
while.end: ; preds = %cleanup, %while.cond27.preheader, %if.then35, %if.then32
%dec.i110152219 = phi i32 [ %dec.i110152222, %if.then35 ], [ %dec.i110152222, %if.then32 ], [ %q.promoted, %while.cond27.preheader ], [ %dec.i110151, %cleanup ]
%d.0217 = phi i32 [ %d.0223, %if.then35 ], [ %d.0223, %if.then32 ], [ 0, %while.cond27.preheader ], [ %add, %cleanup ]
%qq.promoted158 = phi i32 [ %8, %if.then35 ], [ %7, %if.then32 ], [ 0, %while.cond27.preheader ], [ 0, %cleanup ]
%11 = trunc i64 %indvars.iv185 to i32
%sub = sub i32 %11, %3
%add39 = add nsw i32 %sub, %d.0217
%idxprom.i114 = sext i32 %dec.i110152219 to i64
%arrayidx.i115 = getelementptr inbounds [30000 x i32], ptr @t, i64 0, i64 %idxprom.i114
store i32 %add39, ptr %arrayidx.i115, align 4, !tbaa !5
%inc.i116 = add nsw i32 %dec.i110152219, 1
store i32 %inc.i116, ptr @q, align 4, !tbaa !5
%idxprom.i117 = sext i32 %qq.promoted158 to i64
%arrayidx.i118 = getelementptr inbounds [30000 x i32], ptr @r, i64 0, i64 %idxprom.i117
store i32 %3, ptr %arrayidx.i118, align 4, !tbaa !5
%inc.i119 = add nsw i32 %qq.promoted158, 1
store i32 %inc.i119, ptr @qq, align 4, !tbaa !5
br label %if.end41
if.end41: ; preds = %while.cond, %if.then22, %if.end.thread, %pop.exit, %while.end
%q.promoted160 = phi i32 [ %q.promoted, %while.cond ], [ %q.promoted, %if.then22 ], [ %q.promoted, %if.end.thread ], [ %q.promoted, %pop.exit ], [ %inc.i116, %while.end ]
%qq.promoted156 = phi i32 [ %qq.promoted157, %while.cond ], [ %qq.promoted157, %if.then22 ], [ %qq.promoted157, %if.end.thread ], [ %qq.promoted157, %pop.exit ], [ %inc.i119, %while.end ]
%dec.i153 = phi i32 [ %dec.i154, %while.cond ], [ 0, %if.then22 ], [ %inc.i, %if.end.thread ], [ %dec.i, %pop.exit ], [ %dec.i, %while.end ]
%indvars.iv.next186 = add nuw i64 %indvars.iv185, 1
br label %while.cond, !llvm.loop !10
pop2.exit126: ; preds = %pop2.exit126.preheader, %cleanup55
%indvars.iv190 = phi i64 [ %1, %pop2.exit126.preheader ], [ %indvars.iv.next191, %cleanup55 ]
%indvars.iv188 = phi i64 [ 0, %pop2.exit126.preheader ], [ %indvars.iv.next189, %cleanup55 ]
%sum.0169 = phi i32 [ 0, %pop2.exit126.preheader ], [ %add51, %cleanup55 ]
%indvars.iv.next191 = add nsw i64 %indvars.iv190, -1
%arrayidx.i124 = getelementptr inbounds [30000 x i32], ptr @t, i64 0, i64 %indvars.iv.next191
%12 = load i32, ptr %arrayidx.i124, align 4, !tbaa !5
%cmp47 = icmp eq i32 %12, 0
br i1 %cmp47, label %pop2.exit126.while.end58_crit_edge, label %cleanup55
cleanup55: ; preds = %pop2.exit126
%add51 = add nsw i32 %12, %sum.0169
%arrayidx53 = getelementptr inbounds [30000 x i32], ptr %a, i64 0, i64 %indvars.iv188
store i32 %12, ptr %arrayidx53, align 4, !tbaa !5
%indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
%exitcond = icmp eq i64 %indvars.iv.next189, %wide.trip.count
br i1 %exitcond, label %while.end58, label %pop2.exit126
pop2.exit126.while.end58_crit_edge: ; preds = %pop2.exit126
%13 = trunc i64 %indvars.iv188 to i32
br label %while.end58
while.end58: ; preds = %cleanup55, %pop2.exit126.while.end58_crit_edge
%n.0.lcssa = phi i32 [ %13, %pop2.exit126.while.end58_crit_edge ], [ %q.promoted, %cleanup55 ]
%sum.0.lcssa = phi i32 [ %sum.0169, %pop2.exit126.while.end58_crit_edge ], [ %add51, %cleanup55 ]
%.sink = trunc i64 %indvars.iv.next191 to i32
store i32 %.sink, ptr @q, align 4, !tbaa !5
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa, i32 noundef %n.0.lcssa)
%cmp61174 = icmp sgt i32 %n.0.lcssa, 0
br i1 %cmp61174, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.end58
%14 = zext i32 %n.0.lcssa to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv195 = phi i64 [ %14, %for.body.preheader ], [ %indvars.iv.next196, %for.body ]
%indvars.iv.next196 = add nsw i64 %indvars.iv195, -1
%idxprom63 = and i64 %indvars.iv.next196, 4294967295
%arrayidx64 = getelementptr inbounds [30000 x i32], ptr %a, i64 0, i64 %idxprom63
%15 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%cmp61 = icmp ugt i64 %indvars.iv195, 1
br i1 %cmp61, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %while.end58.thread, %while.end58
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 120000, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 30000, ptr nonnull %c) #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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
#include<string.h>
char memory[64][8];
int judge_repeat(char str[], int counter) {
int i;
for(i = 0; strcmp(memory[i], str); i++);
if(i == counter)
return 0;
return 1;
}
int judge(char str[], int counter) {
int i = 0;
while(memory[counter][i])
i++;
if(memory[counter][i - 1] == str[0])
return 0;
return 1;
}
int main() {
char prog[8] = "aaa";
char ai[8];
int i = -1;
int j;
int flag = 0;
while(1) {
printf("?%s\n", prog);
fflush(stdout);
scanf("%s", ai);
i++;
strcpy(memory[i], prog);
i++;
strcpy(memory[i], ai);
if(judge_repeat(ai, i) || judge(ai, i - 1))
break;
if(!strcmp(ai, "aa")) prog[1] = 'b';
else if(!strcmp(ai, "a")) prog[1] = 'c';
j = 0;
while(ai[j]) j++;
prog[0] = ai[j - 1];
}
printf("!OUT\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@memory = dso_local global [64 x [8 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"?%s\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"aa\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"a\00", align 1
@str = private unnamed_addr constant [5 x i8] c"!OUT\00", align 1
; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @judge_repeat(ptr nocapture noundef readonly %str, i32 noundef %counter) local_unnamed_addr #0 {
entry:
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %indvars.iv
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #9
%tobool.not = icmp eq i32 %call, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %tobool.not, label %for.end, label %for.cond, !llvm.loop !5
for.end: ; preds = %for.cond
%0 = trunc i64 %indvars.iv to i32
%cmp = icmp ne i32 %0, %counter
%. = zext i1 %cmp to i32
ret i32 %.
}
; 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 i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @judge(ptr nocapture noundef readonly %str, i32 noundef %counter) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %counter to i64
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %idxprom, i64 %indvars.iv
%0 = load i8, ptr %arrayidx2, align 1, !tbaa !7
%tobool.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %tobool.not, label %while.end, label %while.cond, !llvm.loop !10
while.end: ; preds = %while.cond
%sub = shl i64 %indvars.iv, 32
%sext = add i64 %sub, -4294967296
%idxprom5 = ashr exact i64 %sext, 32
%arrayidx6 = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %idxprom, i64 %idxprom5
%1 = load i8, ptr %arrayidx6, align 1, !tbaa !7
%2 = load i8, ptr %str, align 1, !tbaa !7
%cmp = icmp ne i8 %1, %2
%. = zext i1 %cmp to i32
ret i32 %.
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%prog = alloca [8 x i8], align 8
%ai = alloca [8 x i8], align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %prog) #10
store i64 6381921, ptr %prog, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ai) #10
%arrayidx27 = getelementptr inbounds [8 x i8], ptr %prog, i64 0, i64 1
br label %while.cond
while.cond: ; preds = %while.end, %entry
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %while.end ], [ -1, %entry ]
%call = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %prog)
%0 = load ptr, ptr @stdout, align 8, !tbaa !11
%call1 = call i32 @fflush(ptr noundef %0)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ai)
%1 = add nsw i64 %indvars.iv56, 1
%arrayidx = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %1
%call6 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %prog) #10
%indvars.iv.next57 = add i64 %indvars.iv56, 2
%arrayidx9 = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %indvars.iv.next57
%call12 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx9, ptr noundef nonnull dereferenceable(1) %ai) #10
br label %for.cond.i
for.cond.i: ; preds = %for.cond.i, %while.cond
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond.i ], [ 0, %while.cond ]
%arrayidx.i = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %indvars.iv.i
%call.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %ai) #9
%tobool.not.i = icmp eq i32 %call.i, 0
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %tobool.not.i, label %judge_repeat.exit, label %for.cond.i, !llvm.loop !5
judge_repeat.exit: ; preds = %for.cond.i
%2 = trunc i64 %indvars.iv.i to i32
%3 = trunc i64 %indvars.iv.next57 to i32
%cmp.i.not = icmp eq i32 %3, %2
br i1 %cmp.i.not, label %while.cond.i, label %while.end40
while.cond.i: ; preds = %judge_repeat.exit, %while.cond.i
%indvars.iv.i50 = phi i64 [ %indvars.iv.next.i52, %while.cond.i ], [ 0, %judge_repeat.exit ]
%arrayidx2.i = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %1, i64 %indvars.iv.i50
%4 = load i8, ptr %arrayidx2.i, align 1, !tbaa !7
%tobool.not.i51 = icmp eq i8 %4, 0
%indvars.iv.next.i52 = add nuw i64 %indvars.iv.i50, 1
br i1 %tobool.not.i51, label %judge.exit, label %while.cond.i, !llvm.loop !10
judge.exit: ; preds = %while.cond.i
%sub.i = shl i64 %indvars.iv.i50, 32
%sext.i = add i64 %sub.i, -4294967296
%idxprom5.i = ashr exact i64 %sext.i, 32
%arrayidx6.i = getelementptr inbounds [64 x [8 x i8]], ptr @memory, i64 0, i64 %1, i64 %idxprom5.i
%5 = load i8, ptr %arrayidx6.i, align 1, !tbaa !7
%6 = load i8, ptr %ai, align 1, !tbaa !7
%cmp.i53.not = icmp eq i8 %5, %6
br i1 %cmp.i53.not, label %if.end, label %while.end40
if.end: ; preds = %judge.exit
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %ai, ptr noundef nonnull dereferenceable(3) @.str.2, i64 3)
%tobool20.not = icmp eq i32 %bcmp, 0
br i1 %tobool20.not, label %if.end29.sink.split, label %if.else
if.else: ; preds = %if.end
%bcmp49 = call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %ai, ptr noundef nonnull dereferenceable(2) @.str.3, i64 2)
%tobool25.not = icmp eq i32 %bcmp49, 0
br i1 %tobool25.not, label %if.end29.sink.split, label %while.cond30.preheader
if.end29.sink.split: ; preds = %if.else, %if.end
%.sink = phi i8 [ 98, %if.end ], [ 99, %if.else ]
store i8 %.sink, ptr %arrayidx27, align 1, !tbaa !7
br label %while.cond30.preheader
while.cond30.preheader: ; preds = %if.end29.sink.split, %if.else
br label %while.cond30
while.cond30: ; preds = %while.cond30.preheader, %while.cond30
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond30 ], [ 0, %while.cond30.preheader ]
%arrayidx32 = getelementptr inbounds [8 x i8], ptr %ai, i64 0, i64 %indvars.iv
%7 = load i8, ptr %arrayidx32, align 1, !tbaa !7
%tobool33.not = icmp eq i8 %7, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %tobool33.not, label %while.end, label %while.cond30, !llvm.loop !13
while.end: ; preds = %while.cond30
%sub36 = shl i64 %indvars.iv, 32
%sext = add i64 %sub36, -4294967296
%idxprom37 = ashr exact i64 %sext, 32
%arrayidx38 = getelementptr inbounds [8 x i8], ptr %ai, i64 0, i64 %idxprom37
%8 = load i8, ptr %arrayidx38, align 1, !tbaa !7
store i8 %8, ptr %prog, align 8, !tbaa !7
br label %while.cond
while.end40: ; preds = %judge_repeat.exit, %judge.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ai) #10
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %prog) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn 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 #7 = { nofree nounwind willreturn memory(argmem: read) }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind willreturn memory(read) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = distinct !{!13, !6}
|
#include<stdio.h>
int main()
{
long long x,max,min,r;
scanf("%I64d",&x);
max=(x/7)*2;
r=x%7;
if(r>=2)
max=max+2;
else if(r==1)
max=max+1;
min=(x/7)*2;
if(r==6)
min=min+1;
printf("%I64d %I64d",min,max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33856/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33856/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%div = sdiv i64 %0, 7
%mul = shl nsw i64 %div, 1
%rem = srem i64 %0, 7
%cmp = icmp sgt i64 %rem, 1
%add = add nsw i64 %mul, 2
%cmp1 = icmp eq i64 %rem, 1
%add3 = or i64 %mul, 1
%spec.select = select i1 %cmp1, i64 %add3, i64 %mul
%max.0 = select i1 %cmp, i64 %add, i64 %spec.select
%cmp7 = icmp eq i64 %rem, 6
%spec.select17 = select i1 %cmp7, i64 %add3, i64 %mul
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select17, i64 noundef %max.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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 MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\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 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;}
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 aa;
ll bb;
}frequent;
int main(void){
// char ;
ll n,ans=1;
scanf("%lld",&n);
ll a[n];
rep(i,0,n){
scanf("%lld",&a[i]);
}
ll cnt[n];
rep(i,0,n){
cnt[i]=0;
}
rep(i,0,n){
if(a[i]>i){
printf("0\n");
return 0;
}
if(a[i]==0){
if(cnt[0]+1>3){
printf("0\n");
return 0;
}
if(cnt[0]==0){
ans*=3;
}
if(cnt[0]==1){
ans*=2;
}
}else{
if( cnt[a[i]]+1>3 || cnt[a[i]]+1>cnt[a[i]-1] ){
printf("0\n");
return 0;
}
if(cnt[a[i]]==0){
ans*=cnt[a[i]-1];
}
if(cnt[a[i]]==1){
ans*=cnt[a[i]-1]-1;
}
}
// printf("%lld ",ans);
ans%=MOD1;
cnt[a[i]]++;
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338624/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338624/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
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 #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; 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 #3 {
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 #3 {
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 #2 {
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 #4 {
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 #4 {
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 #4 {
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(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) #13
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) #13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp110 = icmp sgt i64 %2, 0
br i1 %cmp110, label %for.body, label %for.end75
for.cond.cleanup: ; preds = %for.body
%vla2 = alloca i64, i64 %3, align 16
%cmp5112 = icmp sgt i64 %3, 0
br i1 %cmp5112, label %for.body16.preheader, label %for.end75
for.body: ; preds = %entry, %for.body
%i.0111 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0111
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.0111, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19
for.body16.preheader: ; preds = %for.cond.cleanup
%4 = shl nuw i64 %3, 3
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %4, i1 false), !tbaa !5
br label %for.body16
for.body16: ; preds = %for.body16.preheader, %if.end69
%i12.0116 = phi i64 [ %inc74, %if.end69 ], [ 0, %for.body16.preheader ]
%ans.0115 = phi i64 [ %rem, %if.end69 ], [ 1, %for.body16.preheader ]
%arrayidx17 = getelementptr inbounds i64, ptr %vla, i64 %i12.0116
%5 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%cmp18 = icmp sgt i64 %5, %i12.0116
br i1 %cmp18, label %if.then, label %if.end
if.then: ; preds = %for.body16
%puts104 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup77
if.end: ; preds = %for.body16
%cmp21 = icmp eq i64 %5, 0
br i1 %cmp21, label %if.then22, label %if.else
if.then22: ; preds = %if.end
%6 = load i64, ptr %vla2, align 16, !tbaa !5
%cmp24 = icmp sgt i64 %6, 2
br i1 %cmp24, label %if.then25, label %if.end27
if.then25: ; preds = %if.then22
%puts103 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup77
if.end27: ; preds = %if.then22
%cmp29 = icmp eq i64 %6, 0
%mul = mul nsw i64 %ans.0115, 3
%spec.select = select i1 %cmp29, i64 %mul, i64 %ans.0115
%cmp33 = icmp eq i64 %6, 1
%mul35 = zext i1 %cmp33 to i64
%spec.select106 = shl nsw i64 %spec.select, %mul35
br label %if.end69
if.else: ; preds = %if.end
%arrayidx38 = getelementptr inbounds i64, ptr %vla2, i64 %5
%7 = load i64, ptr %arrayidx38, align 8, !tbaa !5
%cmp40 = icmp sgt i64 %7, 2
br i1 %cmp40, label %if.then47, label %lor.lhs.false
lor.lhs.false: ; preds = %if.else
%arrayidx45 = getelementptr i64, ptr %arrayidx38, i64 -1
%8 = load i64, ptr %arrayidx45, align 8, !tbaa !5
%cmp46.not = icmp slt i64 %7, %8
br i1 %cmp46.not, label %if.end49, label %if.then47
if.then47: ; preds = %lor.lhs.false, %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup77
if.end49: ; preds = %lor.lhs.false
%cmp52 = icmp eq i64 %7, 0
%mul57 = select i1 %cmp52, i64 %8, i64 1
%spec.select105 = mul nsw i64 %mul57, %ans.0115
%cmp61 = icmp eq i64 %7, 1
br i1 %cmp61, label %if.then62, label %if.end69
if.then62: ; preds = %if.end49
%sub66 = add nsw i64 %8, -1
%mul67 = mul nsw i64 %spec.select105, %sub66
br label %if.end69
if.end69: ; preds = %if.end27, %if.end49, %if.then62
%9 = phi i64 [ 1, %if.then62 ], [ %7, %if.end49 ], [ %6, %if.end27 ]
%ans.3 = phi i64 [ %mul67, %if.then62 ], [ %spec.select105, %if.end49 ], [ %spec.select106, %if.end27 ]
%rem = srem i64 %ans.3, 1000000007
%arrayidx71 = getelementptr inbounds i64, ptr %vla2, i64 %5
%inc72 = add nsw i64 %9, 1
store i64 %inc72, ptr %arrayidx71, align 8, !tbaa !5
%inc74 = add nuw nsw i64 %i12.0116, 1
%exitcond.not = icmp eq i64 %inc74, %3
br i1 %exitcond.not, label %for.end75, label %for.body16, !llvm.loop !20
for.end75: ; preds = %if.end69, %entry, %for.cond.cleanup
%ans.0.lcssa = phi i64 [ 1, %for.cond.cleanup ], [ 1, %entry ], [ %rem, %if.end69 ]
%call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
br label %cleanup77
cleanup77: ; preds = %if.then, %if.then25, %if.then47, %for.end75
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #13
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #9
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #11
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
; 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 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 nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree 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 #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 nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nofree nounwind }
attributes #12 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include<stdio.h>
int main(){
int n,i,j,l[200],ans=0;
scanf("%d",&n);
for(i=0;i<2*n;i++)scanf("%d",&l[i]);
for(i=0;i<2*n;i++){
for(j=0;j<2*n;j++){
if(l[i]<l[j]){
int tmp=l[i];
l[i]=l[j];
l[j]=tmp;
}
}
}
for(i=0;i<2*n;i+=2)ans+=l[i];
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%l = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %l) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul55 = shl nsw i32 %0, 1
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%mul.lcssa = phi i32 [ %mul55, %entry ], [ %mul, %for.body ]
%cmp460 = icmp sgt i32 %mul.lcssa, 0
br i1 %cmp460, label %for.cond6.preheader.us.preheader, label %for.end37
for.cond6.preheader.us.preheader: ; preds = %for.cond2.preheader
%wide.trip.count74 = zext i32 %mul.lcssa to i64
br label %for.cond6.preheader.us
for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.inc26_crit_edge.us
%indvars.iv71 = phi i64 [ 0, %for.cond6.preheader.us.preheader ], [ %indvars.iv.next72, %for.cond6.for.inc26_crit_edge.us ]
%arrayidx11.us = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %indvars.iv71
br label %for.body9.us
for.body9.us: ; preds = %for.inc23.us.1, %for.cond6.preheader.us
%indvars.iv68 = phi i64 [ 0, %for.cond6.preheader.us ], [ %indvars.iv.next69.1, %for.inc23.us.1 ]
%niter = phi i64 [ 0, %for.cond6.preheader.us ], [ %niter.next.1, %for.inc23.us.1 ]
%1 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5
%arrayidx13.us = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %indvars.iv68
%2 = load i32, ptr %arrayidx13.us, align 8, !tbaa !5
%cmp14.us = icmp slt i32 %1, %2
br i1 %cmp14.us, label %if.then.us, label %for.inc23.us
if.then.us: ; preds = %for.body9.us
store i32 %2, ptr %arrayidx11.us, align 4, !tbaa !5
store i32 %1, ptr %arrayidx13.us, align 8, !tbaa !5
br label %for.inc23.us
for.inc23.us: ; preds = %if.then.us, %for.body9.us
%indvars.iv.next69 = or i64 %indvars.iv68, 1
%3 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5
%arrayidx13.us.1 = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %indvars.iv.next69
%4 = load i32, ptr %arrayidx13.us.1, align 4, !tbaa !5
%cmp14.us.1 = icmp slt i32 %3, %4
br i1 %cmp14.us.1, label %if.then.us.1, label %for.inc23.us.1
if.then.us.1: ; preds = %for.inc23.us
store i32 %4, ptr %arrayidx11.us, align 4, !tbaa !5
store i32 %3, ptr %arrayidx13.us.1, align 4, !tbaa !5
br label %for.inc23.us.1
for.inc23.us.1: ; preds = %if.then.us.1, %for.inc23.us
%indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %wide.trip.count74
br i1 %niter.ncmp.1, label %for.cond6.for.inc26_crit_edge.us, label %for.body9.us, !llvm.loop !9
for.cond6.for.inc26_crit_edge.us: ; preds = %for.inc23.us.1
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
br i1 %exitcond75.not, label %for.cond29.preheader, label %for.cond6.preheader.us, !llvm.loop !11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200 x i32], ptr %l, 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
%5 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %5, 1
%6 = sext i32 %mul to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.cond29.preheader: ; preds = %for.cond6.for.inc26_crit_edge.us
br i1 %cmp460, label %for.body32.preheader, label %for.end37
for.body32.preheader: ; preds = %for.cond29.preheader
%7 = zext i32 %mul.lcssa to i64
%min.iters.check = icmp ult i32 %mul.lcssa, 17
br i1 %min.iters.check, label %for.body32.preheader84, label %vector.ph
vector.ph: ; preds = %for.body32.preheader
%8 = add nsw i64 %wide.trip.count74, -1
%9 = lshr i64 %8, 1
%10 = add nuw i64 %9, 1
%n.mod.vf = and i64 %10, 7
%11 = icmp eq i64 %n.mod.vf, 0
%12 = select i1 %11, i64 8, i64 %n.mod.vf
%n.vec = sub i64 %10, %12
%ind.end = shl i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%offset.idx = shl i64 %index, 1
%13 = or i64 %offset.idx, 8
%14 = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %offset.idx
%15 = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %13
%wide.vec = load <8 x i32>, ptr %14, align 16, !tbaa !5
%wide.vec82 = load <8 x i32>, ptr %15, align 16, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec83 = shufflevector <8 x i32> %wide.vec82, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%16 = add <4 x i32> %strided.vec, %vec.phi
%17 = add <4 x i32> %strided.vec83, %vec.phi81
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br label %for.body32.preheader84
for.body32.preheader84: ; preds = %for.body32.preheader, %middle.block
%indvars.iv76.ph = phi i64 [ 0, %for.body32.preheader ], [ %ind.end, %middle.block ]
%ans.063.ph = phi i32 [ 0, %for.body32.preheader ], [ %19, %middle.block ]
br label %for.body32
for.body32: ; preds = %for.body32.preheader84, %for.body32
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body32 ], [ %indvars.iv76.ph, %for.body32.preheader84 ]
%ans.063 = phi i32 [ %add, %for.body32 ], [ %ans.063.ph, %for.body32.preheader84 ]
%arrayidx34 = getelementptr inbounds [200 x i32], ptr %l, i64 0, i64 %indvars.iv76
%20 = load i32, ptr %arrayidx34, align 8, !tbaa !5
%add = add nsw i32 %20, %ans.063
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 2
%cmp31 = icmp ult i64 %indvars.iv.next77, %7
br i1 %cmp31, label %for.body32, label %for.end37, !llvm.loop !16
for.end37: ; preds = %for.body32, %for.cond2.preheader, %for.cond29.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ 0, %for.cond2.preheader ], [ %add, %for.body32 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include<stdio.h>
#include<string.h>
#define N 165003
int arr[N];
int main(){
int a;
scanf("%d",&a);
int i;
for(i=0;i<a*2;i++){
scanf("%d",arr+i);
}
int w;
for(i=0;i<a*2;i++){
for(w=0;w<a*2;w++){
if(arr[w]<arr[w+1]){
int temp=arr[w];
arr[w]=arr[w+1];
arr[w+1]=temp;
}
}
}
int s=0;
for(i=0;i<(a*2)-1;i+=2){
s+=arr[i+1];
}
printf("%d",s);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338725/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338725/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@arr = dso_local global [165003 x i32] zeroinitializer, align 16
; 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
%mul57 = shl nsw i32 %0, 1
%cmp58 = icmp sgt i32 %0, 0
br i1 %cmp58, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%mul.lcssa = phi i32 [ %mul57, %entry ], [ %mul, %for.body ]
%cmp462 = icmp sgt i32 %mul.lcssa, 0
br i1 %cmp462, label %for.cond6.preheader.us.preheader, label %for.end39
for.cond6.preheader.us.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %mul.lcssa to i64
br label %for.cond6.preheader.us
for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.inc26_crit_edge.us
%i.163.us = phi i32 [ %inc27.us, %for.cond6.for.inc26_crit_edge.us ], [ 0, %for.cond6.preheader.us.preheader ]
%.pre = load i32, ptr @arr, align 16, !tbaa !5
br label %for.body9.us
for.body9.us: ; preds = %for.inc23.us.1, %for.cond6.preheader.us
%1 = phi i32 [ %.pre, %for.cond6.preheader.us ], [ %5, %for.inc23.us.1 ]
%indvars.iv70 = phi i64 [ 0, %for.cond6.preheader.us ], [ %indvars.iv.next71.1, %for.inc23.us.1 ]
%niter = phi i64 [ 0, %for.cond6.preheader.us ], [ %niter.next.1, %for.inc23.us.1 ]
%indvars.iv.next71 = or i64 %indvars.iv70, 1
%arrayidx11.us = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %indvars.iv.next71
%2 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5
%cmp12.us = icmp slt i32 %1, %2
br i1 %cmp12.us, label %if.then.us, label %for.inc23.us
if.then.us: ; preds = %for.body9.us
%arrayidx.us = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %indvars.iv70
store i32 %2, ptr %arrayidx.us, align 8, !tbaa !5
store i32 %1, ptr %arrayidx11.us, align 4, !tbaa !5
br label %for.inc23.us
for.inc23.us: ; preds = %if.then.us, %for.body9.us
%3 = phi i32 [ %1, %if.then.us ], [ %2, %for.body9.us ]
%indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
%arrayidx11.us.1 = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %indvars.iv.next71.1
%4 = load i32, ptr %arrayidx11.us.1, align 8, !tbaa !5
%cmp12.us.1 = icmp slt i32 %3, %4
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc23.us.1
if.then.us.1: ; preds = %for.inc23.us
%arrayidx.us.1 = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %indvars.iv.next71
store i32 %4, ptr %arrayidx.us.1, align 4, !tbaa !5
store i32 %3, ptr %arrayidx11.us.1, align 8, !tbaa !5
br label %for.inc23.us.1
for.inc23.us.1: ; preds = %if.then.us.1, %for.inc23.us
%5 = phi i32 [ %3, %if.then.us.1 ], [ %4, %for.inc23.us ]
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %wide.trip.count
br i1 %niter.ncmp.1, label %for.cond6.for.inc26_crit_edge.us, label %for.body9.us, !llvm.loop !9
for.cond6.for.inc26_crit_edge.us: ; preds = %for.inc23.us.1
%inc27.us = add nuw nsw i32 %i.163.us, 1
%exitcond73.not = icmp eq i32 %inc27.us, %mul.lcssa
br i1 %exitcond73.not, label %for.cond29.preheader, label %for.cond6.preheader.us, !llvm.loop !11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @arr, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %a, align 4, !tbaa !5
%mul = shl nsw i32 %6, 1
%7 = sext i32 %mul to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.cond29.preheader: ; preds = %for.cond6.for.inc26_crit_edge.us
%cmp3164 = icmp sgt i32 %mul.lcssa, 1
br i1 %cmp3164, label %for.body32.preheader, label %for.end39
for.body32.preheader: ; preds = %for.cond29.preheader
%sub = add nsw i32 %mul.lcssa, -1
%8 = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %mul.lcssa, 18
br i1 %min.iters.check, label %for.body32.preheader84, label %vector.ph
vector.ph: ; preds = %for.body32.preheader
%9 = add nsw i64 %8, -1
%10 = lshr exact i64 %9, 1
%11 = add nuw nsw i64 %10, 1
%n.mod.vf = and i64 %11, 7
%12 = icmp eq i64 %n.mod.vf, 0
%13 = select i1 %12, i64 8, i64 %n.mod.vf
%n.vec = sub nsw i64 %11, %13
%ind.end = shl i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%vec.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%offset.idx = shl i64 %index, 1
%14 = or i64 %offset.idx, 1
%15 = or i64 %offset.idx, 9
%16 = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %14
%17 = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %15
%wide.vec = load <8 x i32>, ptr %16, align 4, !tbaa !5
%wide.vec82 = load <8 x i32>, ptr %17, align 4, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec83 = shufflevector <8 x i32> %wide.vec82, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%18 = add <4 x i32> %strided.vec, %vec.phi
%19 = add <4 x i32> %strided.vec83, %vec.phi81
%index.next = add nuw i64 %index, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br label %for.body32.preheader84
for.body32.preheader84: ; preds = %for.body32.preheader, %middle.block
%indvars.iv74.ph = phi i64 [ 0, %for.body32.preheader ], [ %ind.end, %middle.block ]
%s.066.ph = phi i32 [ 0, %for.body32.preheader ], [ %21, %middle.block ]
br label %for.body32
for.body32: ; preds = %for.body32.preheader84, %for.body32
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body32 ], [ %indvars.iv74.ph, %for.body32.preheader84 ]
%s.066 = phi i32 [ %add36, %for.body32 ], [ %s.066.ph, %for.body32.preheader84 ]
%22 = or i64 %indvars.iv74, 1
%arrayidx35 = getelementptr inbounds [165003 x i32], ptr @arr, i64 0, i64 %22
%23 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%add36 = add nsw i32 %23, %s.066
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 2
%cmp31 = icmp ult i64 %indvars.iv.next75, %8
br i1 %cmp31, label %for.body32, label %for.end39, !llvm.loop !16
for.end39: ; preds = %for.body32, %for.cond2.preheader, %for.cond29.preheader
%s.0.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ 0, %for.cond2.preheader ], [ %add36, %for.body32 ]
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include<stdio.h>
int main(void){
float r;
scanf("%e",&r);
printf("%e",2*r*3.14159265358979);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%e\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load float, ptr %r, align 4, !tbaa !5
%mul = fmul float %0, 2.000000e+00
%conv = fpext float %mul to double
%mul1 = fmul double %conv, 0x400921FB54442D11
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int R;
scanf("%d",&R);
printf("%f",2*R*3.141);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338833/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338833/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 3.141000e+00
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int R;
scanf("%d",&R);
printf("%f",2*R*3.14);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338877/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338877/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 3.140000e+00
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main() {
static char used[670];
static char s[105];
int n;
scanf("%d",&n);
scanf("\t%c",&s[0]);
int max=0;
int index=0;
int i;
for(i=1;i<n;i++){
scanf("%c",&s[i]);
index=(s[i-1]-'A')*26+(s[i]-'A');
used[index]++;
if(used[index]>used[max]){
max=index;
}
}
char x=max/26;
char y=max%26;
printf("%c%c", x+'A',y+'A');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33892/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33892/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main.used = internal unnamed_addr global [670 x i8] zeroinitializer, align 16
@main.s = internal global [105 x i8] 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"\09%c\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%c%c\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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @main.s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 1
br i1 %cmp36, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%max.038 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [105 x i8], ptr @main.s, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%1 = add nsw i64 %indvars.iv, -1
%arrayidx4 = getelementptr inbounds [105 x i8], ptr @main.s, i64 0, i64 %1
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !9
%conv = sext i8 %2 to i32
%3 = mul nsw i32 %conv, 26
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv8 = sext i8 %4 to i32
%sub9 = add nsw i32 %conv8, -1755
%add = add nsw i32 %sub9, %3
%idxprom10 = sext i32 %add to i64
%arrayidx11 = getelementptr inbounds [670 x i8], ptr @main.used, i64 0, i64 %idxprom10
%5 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%inc = add i8 %5, 1
store i8 %inc, ptr %arrayidx11, align 1, !tbaa !9
%idxprom15 = sext i32 %max.038 to i64
%arrayidx16 = getelementptr inbounds [670 x i8], ptr @main.used, i64 0, i64 %idxprom15
%6 = load i8, ptr %arrayidx16, align 1, !tbaa !9
%cmp18 = icmp sgt i8 %inc, %6
%spec.select = select i1 %cmp18, i32 %add, i32 %max.038
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%div = sdiv i32 %max.0.lcssa, 26
%rem = srem i32 %max.0.lcssa, 26
%sext = shl i32 %div, 24
%conv23 = ashr exact i32 %sext, 24
%add24 = add nsw i32 %conv23, 65
%add26 = add nsw i32 %rem, 65
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add24, i32 noundef %add26)
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int R;
float pi=3.14159,c;
if(1<=R<=100)
scanf("%d",&R);
c=2*pi*R;
printf("%.16f",c);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_338963/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_338963/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.16f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv3 = sitofp i32 %0 to float
%mul4 = fmul float %conv3, 0x401921FA00000000
%conv5 = fpext float %mul4 to double
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(void){
int r;
double result;
scanf("%d",&r);
result=2*M_PI*r;
printf("%lf",result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339005/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339005/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x401921FB54442D18
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define PI 3.14159265359
int main(){
int r;
scanf("%d", &r);
printf("%lf", 2 * PI * r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339056/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339056/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x401921FB54442EEA
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void){
int R;
scanf("%d", &R);
printf("%lf\n", (double)R*M_PI*2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339106/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339106/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x400921FB54442D18
%mul1 = fmul double %mul, 2.000000e+00
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int r;
scanf("%d",&r);
double pi,c;
pi = 3.141592654;
c = 2*pi*r;
printf("%lf\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339157/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339157/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul1 = fmul double %conv, 0x401921FB54524550
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int r;
float R;
scanf("%d",&r);
R=3.14159*2*r;
printf("%.2f",R);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339207/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339207/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%.2f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 6.283180e+00
%conv1 = fptrunc double %mul to float
%conv2 = fpext float %conv1 to double
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void){
int n;
double ans=0;
scanf("%d",&n);
ans=2*n*M_PI;
printf("%f\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339294/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339294/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 0x400921FB54442D18
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main()
{
int a;
scanf("%d", &a);
double m=acos(-1);
double ma=2*(m*a);
printf("%lf\n", ma);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339380/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339380/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x400921FB54442D18
%mul2 = fmul double %mul, 2.000000e+00
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define pi 3.1416
int main()
{
int r;
scanf("%d",&r);
float ans;
ans=2*pi*r;
printf("%f\n",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339423/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339423/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 6.283200e+00
%conv1 = fptrunc double %mul to float
%conv2 = fpext float %conv1 to double
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <math.h>
#include <stdio.h>
int main(){
float R;
float ans;
scanf("%f", &R);
ans = 2 * M_PI * R;
printf("%f", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339474/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339474/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load float, ptr %R, align 4, !tbaa !5
%conv = fpext float %0 to double
%mul = fmul double %conv, 0x401921FB54442D18
%conv1 = fptrunc double %mul to float
%conv2 = fpext float %conv1 to double
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(){
int R;
scanf("%d", &R);
printf("%.20lf\n", 2*acos(-1)*R);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339517/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339517/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%.20lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul2 = fmul double %conv, 0x401921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int R;
scanf("%d", &R);
printf("%f\n", 2.0 * (double)R * 3.1415926535);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339560/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339560/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 2.000000e+00
%mul1 = fmul double %mul, 0x400921FB54411744
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
scanf("%d",&a);
double b;
double pi;
pi=3.141592653589793;
b=a*2*pi;
printf("%lf",b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339603/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339603/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\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
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 0x400921FB54442D18
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(){
float r,L;
scanf("%f",&r);
L=6.2831853*r;
printf("%f\n",L);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339647/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339647/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load float, ptr %r, align 4, !tbaa !5
%conv = fpext float %0 to double
%mul = fmul double %conv, 0x401921FB53C8D4F1
%conv1 = fptrunc double %mul to float
%conv2 = fpext float %conv1 to double
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int R;
if (scanf("%d", &R) != 1) return 1;
printf("%.15f\n", R * 2 * (4 * atan(1)));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339698/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339698/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.15f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%0 = load i32, ptr %R, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul3 = fmul double %conv, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3)
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define PI 3.14
int main(){
int r;
scanf("%d", &r);
printf("%f\n", 2*r*PI);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339740/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339740/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 3.140000e+00
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(int argc, char *argv[]){
int r;
double pi = 3.1415926535897932;
double ans;
scanf("%d",&r);
ans = 2 * r * pi;
printf("%lf",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\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:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%conv = sitofp i32 %mul to double
%mul1 = fmul double %conv, 0x400921FB54442D18
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define PI 3.141592
int main()
{
int R;
scanf("%d", &R);
double length;
length = (double)R * 2.0 * PI;
printf("%f\n",length);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339834/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339834/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 2.000000e+00
%mul1 = fmul double %mul, 0x400921FAFC8B007A
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include<math.h>
int main(void){
int r;
scanf("%d",&r);
printf("%.10f\n",M_PI*2*r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339878/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339878/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x401921FB54442D18
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int i;
int R;
long cnt = 0;
scanf("%d", &R);
printf("%f\n", (double)R*2*3.141592);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339920/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339920/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 2.000000e+00
%mul1 = fmul double %mul, 0x400921FAFC8B007A
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(){
int r;
scanf("%d", &r);
printf("%f", (double)3.141592*2*r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_339964/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_339964/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x401921FAFC8B007A
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int r;
scanf("%d",&r);
printf("%lf\n",r*3.1415*2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340005/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340005/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 3.141500e+00
%mul1 = fmul double %mul, 2.000000e+00
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
struct node{
struct node *right;
struct node *left;
int key;
int priority;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while (x->left!=NIL) x=x->left;
return x;
}
Node treeMaximum(Node x){
while (x->right!=NIL) x=x->right;
return x;
}
Node treeSearch(Node u, int k){
Node ret = NIL;
if (u->key==k) return u;
else if (u->key>k) {
if (u->left!=NIL)
return treeSearch(u->left, k);
} else if (u->right!=NIL)
return treeSearch(u->right, k);
return ret;
}
Node rightRotate(Node t)
{
Node s = t->left;
if (t==root) root=s;
t->left = s->right;
s->right = t;
return s;
}
Node leftRotate(Node t)
{
Node s = t->right;
if (t==root) root=s;
t->right = s->left;
s->left = t;
return s;
}
Node _delete(Node, int);
Node delete(Node t, int key)
{
if (t==NIL)
return NIL;
if (key < t->key)
t->left = delete(t->left,key);
else if (key > t->key)
t->right = delete(t->right, key);
else
return _delete(t, key);
return t;
}
Node _delete(Node t, int key)
{
if (t->left == NIL && t->right==NIL) // has no child
return NIL;
if (t->left == NIL)
t=leftRotate(t);
else if (t->right == NIL)
t=rightRotate(t);
else {
if (t->left->priority > t->right->priority)
t = rightRotate(t);
else
t = leftRotate(t);
}
return delete(t, key);
}
Node insert(Node t, int key, int priority)
{
if (t==NIL) {
Node z = malloc(sizeof(struct node));
z->key = key;
z->priority = priority;
z->left = NIL;
z->right=NIL;
if (root==NIL) {
root = z;
}
return z;
}
if (key==t->key) return t;
if (key<t->key) {
t->left = insert(t->left, key, priority);
if (t->priority < t->left->priority)
t = rightRotate(t);
} else {
t->right = insert(t->right, key, priority);
if (t->priority < t->right->priority)
t = leftRotate(t);
}
return t;
}
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);
}
void print()
{
if (root==NIL) return;
preorder(root);
printf("\n");
inorder(root);
printf("\n");
}
int main(){
int n, i, x, y;
Node t;
char com[20];
root = NIL;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%s", com);
switch (com[0]) {
case 'f':
scanf("%d", &x);
t = treeSearch(root, x);
if (t != NIL) printf("yes\n");
else printf("no\n");
break;
case 'i':
scanf("%d %d", &x, &y);
insert(root, x, y);
break;
case 'p':
inorder(root);
printf("\n");
preorder(root);
printf("\n");
break;
case 'd':
scanf("%d", &x);
t = treeSearch(root, x);
if (t!=NIL) delete(root, x);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340049/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340049/source.c"
target datalayout = "e-m:e-p270: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, i32, 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.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.7 = 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 @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
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:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14
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 @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%key26 = getelementptr inbounds %struct.node, ptr %u, i64 0, i32 2
%0 = load i32, ptr %key26, align 8, !tbaa !15
%cmp27 = icmp eq i32 %0, %k
br i1 %cmp27, label %cleanup, label %if.else
if.else: ; preds = %entry, %tailrecurse.backedge
%1 = phi i32 [ %3, %tailrecurse.backedge ], [ %0, %entry ]
%u.tr28 = phi ptr [ %u.tr.be, %tailrecurse.backedge ], [ %u, %entry ]
%cmp2 = icmp sgt i32 %1, %k
br i1 %cmp2, label %if.then3, label %if.else7
if.then3: ; preds = %if.else
%left = getelementptr inbounds %struct.node, ptr %u.tr28, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !5
%cmp4.not = icmp eq ptr %2, null
br i1 %cmp4.not, label %cleanup, label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.then3, %if.else7
%u.tr.be = phi ptr [ %2, %if.then3 ], [ %4, %if.else7 ]
%key = getelementptr inbounds %struct.node, ptr %u.tr.be, i64 0, i32 2
%3 = load i32, ptr %key, align 8, !tbaa !15
%cmp = icmp eq i32 %3, %k
br i1 %cmp, label %cleanup, label %if.else
if.else7: ; preds = %if.else
%4 = load ptr, ptr %u.tr28, align 8, !tbaa !13
%cmp8.not = icmp eq ptr %4, null
br i1 %cmp8.not, label %cleanup, label %tailrecurse.backedge
cleanup: ; preds = %tailrecurse.backedge, %if.then3, %if.else7, %entry
%retval.0 = phi ptr [ %u, %entry ], [ null, %if.else7 ], [ null, %if.then3 ], [ %u.tr.be, %tailrecurse.backedge ]
ret ptr %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 norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @rightRotate(ptr noundef %t) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !16
%cmp = icmp eq ptr %1, %t
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store ptr %0, ptr @root, align 8, !tbaa !16
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = load ptr, ptr %0, align 8, !tbaa !13
store ptr %2, ptr %left, align 8, !tbaa !5
store ptr %t, ptr %0, align 8, !tbaa !13
ret ptr %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @leftRotate(ptr noundef %t) local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr %t, align 8, !tbaa !13
%1 = load ptr, ptr @root, align 8, !tbaa !16
%cmp = icmp eq ptr %1, %t
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store ptr %0, ptr @root, align 8, !tbaa !16
br label %if.end
if.end: ; preds = %if.then, %entry
%left = getelementptr inbounds %struct.node, ptr %0, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !5
store ptr %2, ptr %t, align 8, !tbaa !13
store ptr %t, ptr %left, align 8, !tbaa !5
ret ptr %0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @delete(ptr noundef %t, i32 noundef %key) local_unnamed_addr #3 {
entry:
%cmp45 = icmp eq ptr %t, null
br i1 %cmp45, label %common.ret63, label %if.end.preheader
if.end.preheader: ; preds = %entry
%key156 = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 2
%0 = load i32, ptr %key156, align 8, !tbaa !15
%cmp257 = icmp sgt i32 %0, %key
br i1 %cmp257, label %if.then3, label %if.else
common.ret63: ; preds = %entry, %land.lhs.true.i, %common.ret.sink.split
%common.ret63.op = phi ptr [ %t.tr4655, %common.ret.sink.split ], [ null, %land.lhs.true.i ], [ null, %entry ]
ret ptr %common.ret63.op
common.ret.sink.split: ; preds = %if.else, %if.then3
%t.tr4655 = phi ptr [ %t.tr46.lcssa, %if.then3 ], [ %t.tr4658, %if.else ]
%t.tr46.lcssa49.sink51 = phi ptr [ %left, %if.then3 ], [ %t.tr4658, %if.else ]
%1 = load ptr, ptr %t.tr46.lcssa49.sink51, align 8, !tbaa !16
%call8 = tail call ptr @delete(ptr noundef %1, i32 noundef %key)
store ptr %call8, ptr %t.tr46.lcssa49.sink51, align 8, !tbaa !16
br label %common.ret63
if.then3: ; preds = %if.end20.i, %if.end.preheader
%t.tr46.lcssa = phi ptr [ %t, %if.end.preheader ], [ %t.addr.0.i, %if.end20.i ]
%left = getelementptr inbounds %struct.node, ptr %t.tr46.lcssa, i64 0, i32 1
br label %common.ret.sink.split
if.else: ; preds = %if.end.preheader, %if.end20.i
%2 = phi i32 [ %11, %if.end20.i ], [ %0, %if.end.preheader ]
%t.tr4658 = phi ptr [ %t.addr.0.i, %if.end20.i ], [ %t, %if.end.preheader ]
%cmp6 = icmp slt i32 %2, %key
br i1 %cmp6, label %common.ret.sink.split, label %if.else10
if.else10: ; preds = %if.else
%left.i = getelementptr inbounds %struct.node, ptr %t.tr4658, i64 0, i32 1
%3 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.i = icmp eq ptr %3, null
%4 = load ptr, ptr %t.tr4658, align 8, !tbaa !13
%cmp1.i = icmp eq ptr %4, null
br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %if.else10
br i1 %cmp1.i, label %common.ret63, label %if.then4.i
if.then4.i: ; preds = %land.lhs.true.i
%5 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i38 = icmp eq ptr %5, %t.tr4658
br i1 %cmp.i38, label %if.then.i41, label %leftRotate.exit42
if.then.i41: ; preds = %if.then4.i
store ptr %4, ptr @root, align 8, !tbaa !16
br label %leftRotate.exit42
leftRotate.exit42: ; preds = %if.then4.i, %if.then.i41
%left.i40 = getelementptr inbounds %struct.node, ptr %4, i64 0, i32 1
br label %if.end20.i
if.else.i: ; preds = %if.else10
br i1 %cmp1.i, label %if.then7.i, label %if.else9.i
if.then7.i: ; preds = %if.else.i
%6 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i34 = icmp eq ptr %6, %t.tr4658
br i1 %cmp.i34, label %if.then.i36, label %if.end20.i
if.then.i36: ; preds = %if.then7.i
store ptr %3, ptr @root, align 8, !tbaa !16
br label %if.end20.i
if.else9.i: ; preds = %if.else.i
%priority.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 3
%7 = load i32, ptr %priority.i, align 4, !tbaa !17
%priority12.i = getelementptr inbounds %struct.node, ptr %4, i64 0, i32 3
%8 = load i32, ptr %priority12.i, align 4, !tbaa !17
%cmp13.i = icmp sgt i32 %7, %8
%9 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i30 = icmp eq ptr %9, %t.tr4658
br i1 %cmp13.i, label %if.then14.i, label %if.else16.i
if.then14.i: ; preds = %if.else9.i
br i1 %cmp.i30, label %if.then.i32, label %if.end20.i
if.then.i32: ; preds = %if.then14.i
store ptr %3, ptr @root, align 8, !tbaa !16
br label %if.end20.i
if.else16.i: ; preds = %if.else9.i
br i1 %cmp.i30, label %if.then.i, label %leftRotate.exit
if.then.i: ; preds = %if.else16.i
store ptr %4, ptr @root, align 8, !tbaa !16
br label %leftRotate.exit
leftRotate.exit: ; preds = %if.else16.i, %if.then.i
%left.i28 = getelementptr inbounds %struct.node, ptr %4, i64 0, i32 1
br label %if.end20.i
if.end20.i: ; preds = %if.then.i32, %if.then14.i, %if.then.i36, %if.then7.i, %leftRotate.exit, %leftRotate.exit42
%left.i28.sink52 = phi ptr [ %left.i28, %leftRotate.exit ], [ %left.i40, %leftRotate.exit42 ], [ %3, %if.then7.i ], [ %3, %if.then.i36 ], [ %3, %if.then14.i ], [ %3, %if.then.i32 ]
%t.tr46.sink = phi ptr [ %t.tr4658, %leftRotate.exit ], [ %t.tr4658, %leftRotate.exit42 ], [ %left.i, %if.then7.i ], [ %left.i, %if.then.i36 ], [ %left.i, %if.then14.i ], [ %left.i, %if.then.i32 ]
%t.addr.0.i = phi ptr [ %4, %leftRotate.exit ], [ %4, %leftRotate.exit42 ], [ %3, %if.then7.i ], [ %3, %if.then.i36 ], [ %3, %if.then14.i ], [ %3, %if.then.i32 ]
%10 = load ptr, ptr %left.i28.sink52, align 8, !tbaa !16
store ptr %10, ptr %t.tr46.sink, align 8, !tbaa !16
store ptr %t.tr4658, ptr %left.i28.sink52, align 8, !tbaa !16
%key1 = getelementptr inbounds %struct.node, ptr %t.addr.0.i, i64 0, i32 2
%11 = load i32, ptr %key1, align 8, !tbaa !15
%cmp2 = icmp sgt i32 %11, %key
br i1 %cmp2, label %if.then3, label %if.else
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @_delete(ptr noundef %t, i32 noundef %key) local_unnamed_addr #3 {
entry:
%left = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
%1 = load ptr, ptr %t, align 8, !tbaa !13
%cmp1 = icmp eq ptr %1, null
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
br i1 %cmp1, label %return, label %if.then4
if.then4: ; preds = %land.lhs.true
%2 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i = icmp eq ptr %2, %t
br i1 %cmp.i, label %if.then.i, label %leftRotate.exit
if.then.i: ; preds = %if.then4
store ptr %1, ptr @root, align 8, !tbaa !16
br label %leftRotate.exit
leftRotate.exit: ; preds = %if.then4, %if.then.i
%left.i = getelementptr inbounds %struct.node, ptr %1, i64 0, i32 1
br label %if.end20
if.else: ; preds = %entry
br i1 %cmp1, label %if.then7, label %if.else9
if.then7: ; preds = %if.else
%3 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i34 = icmp eq ptr %3, %t
br i1 %cmp.i34, label %if.then.i35, label %if.end20
if.then.i35: ; preds = %if.then7
store ptr %0, ptr @root, align 8, !tbaa !16
br label %if.end20
if.else9: ; preds = %if.else
%priority = getelementptr inbounds %struct.node, ptr %0, i64 0, i32 3
%4 = load i32, ptr %priority, align 4, !tbaa !17
%priority12 = getelementptr inbounds %struct.node, ptr %1, i64 0, i32 3
%5 = load i32, ptr %priority12, align 4, !tbaa !17
%cmp13 = icmp sgt i32 %4, %5
%6 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i37 = icmp eq ptr %6, %t
br i1 %cmp13, label %if.then14, label %if.else16
if.then14: ; preds = %if.else9
br i1 %cmp.i37, label %if.then.i38, label %if.end20
if.then.i38: ; preds = %if.then14
store ptr %0, ptr @root, align 8, !tbaa !16
br label %if.end20
if.else16: ; preds = %if.else9
br i1 %cmp.i37, label %if.then.i42, label %leftRotate.exit43
if.then.i42: ; preds = %if.else16
store ptr %1, ptr @root, align 8, !tbaa !16
br label %leftRotate.exit43
leftRotate.exit43: ; preds = %if.else16, %if.then.i42
%left.i41 = getelementptr inbounds %struct.node, ptr %1, i64 0, i32 1
br label %if.end20
if.end20: ; preds = %if.then.i38, %if.then14, %if.then.i35, %if.then7, %leftRotate.exit43, %leftRotate.exit
%.sink45 = phi ptr [ %left.i41, %leftRotate.exit43 ], [ %left.i, %leftRotate.exit ], [ %0, %if.then7 ], [ %0, %if.then.i35 ], [ %0, %if.then14 ], [ %0, %if.then.i38 ]
%left.sink = phi ptr [ %t, %leftRotate.exit43 ], [ %t, %leftRotate.exit ], [ %left, %if.then7 ], [ %left, %if.then.i35 ], [ %left, %if.then14 ], [ %left, %if.then.i38 ]
%t.addr.0 = phi ptr [ %1, %leftRotate.exit43 ], [ %1, %leftRotate.exit ], [ %0, %if.then7 ], [ %0, %if.then.i35 ], [ %0, %if.then14 ], [ %0, %if.then.i38 ]
%7 = load ptr, ptr %.sink45, align 8, !tbaa !16
store ptr %7, ptr %left.sink, align 8, !tbaa !16
store ptr %t, ptr %.sink45, align 8, !tbaa !16
%call21 = tail call ptr @delete(ptr noundef nonnull %t.addr.0, i32 noundef %key)
br label %return
return: ; preds = %land.lhs.true, %if.end20
%retval.0 = phi ptr [ %call21, %if.end20 ], [ null, %land.lhs.true ]
ret ptr %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local ptr @insert(ptr noundef %t, i32 noundef %key, i32 noundef %priority) local_unnamed_addr #4 {
entry:
%cmp = icmp eq ptr %t, null
br i1 %cmp, label %if.then, label %if.end5
if.then: ; preds = %entry
%call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #9
%key1 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store i32 %key, ptr %key1, align 8, !tbaa !15
%priority2 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %priority, ptr %priority2, align 4, !tbaa !17
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
%0 = load ptr, ptr @root, align 8, !tbaa !16
%cmp3 = icmp eq ptr %0, null
br i1 %cmp3, label %if.then4, label %return
if.then4: ; preds = %if.then
store ptr %call, ptr @root, align 8, !tbaa !16
br label %return
if.end5: ; preds = %entry
%key6 = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 2
%1 = load i32, ptr %key6, align 8, !tbaa !15
%cmp7 = icmp eq i32 %1, %key
br i1 %cmp7, label %return, label %if.end9
if.end9: ; preds = %if.end5
%cmp11 = icmp sgt i32 %1, %key
br i1 %cmp11, label %if.then12, label %if.else
if.then12: ; preds = %if.end9
%left13 = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 1
%2 = load ptr, ptr %left13, align 8, !tbaa !5
%call14 = tail call ptr @insert(ptr noundef %2, i32 noundef %key, i32 noundef %priority)
store ptr %call14, ptr %left13, align 8, !tbaa !5
%priority16 = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 3
%3 = load i32, ptr %priority16, align 4, !tbaa !17
%priority18 = getelementptr inbounds %struct.node, ptr %call14, i64 0, i32 3
%4 = load i32, ptr %priority18, align 4, !tbaa !17
%cmp19 = icmp slt i32 %3, %4
br i1 %cmp19, label %if.then20, label %return
if.then20: ; preds = %if.then12
%5 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i = icmp eq ptr %5, %t
br i1 %cmp.i, label %if.then.i, label %rightRotate.exit
if.then.i: ; preds = %if.then20
store ptr %call14, ptr @root, align 8, !tbaa !16
br label %rightRotate.exit
rightRotate.exit: ; preds = %if.then20, %if.then.i
%6 = load ptr, ptr %call14, align 8, !tbaa !13
store ptr %6, ptr %left13, align 8, !tbaa !5
store ptr %t, ptr %call14, align 8, !tbaa !13
br label %return
if.else: ; preds = %if.end9
%7 = load ptr, ptr %t, align 8, !tbaa !13
%call24 = tail call ptr @insert(ptr noundef %7, i32 noundef %key, i32 noundef %priority)
store ptr %call24, ptr %t, align 8, !tbaa !13
%priority26 = getelementptr inbounds %struct.node, ptr %t, i64 0, i32 3
%8 = load i32, ptr %priority26, align 4, !tbaa !17
%priority28 = getelementptr inbounds %struct.node, ptr %call24, i64 0, i32 3
%9 = load i32, ptr %priority28, align 4, !tbaa !17
%cmp29 = icmp slt i32 %8, %9
br i1 %cmp29, label %if.then30, label %return
if.then30: ; preds = %if.else
%10 = load ptr, ptr @root, align 8, !tbaa !16
%cmp.i59 = icmp eq ptr %10, %t
br i1 %cmp.i59, label %if.then.i61, label %leftRotate.exit
if.then.i61: ; preds = %if.then30
store ptr %call24, ptr @root, align 8, !tbaa !16
br label %leftRotate.exit
leftRotate.exit: ; preds = %if.then30, %if.then.i61
%left.i60 = getelementptr inbounds %struct.node, ptr %call24, i64 0, i32 1
%11 = load ptr, ptr %left.i60, align 8, !tbaa !5
store ptr %11, ptr %t, align 8, !tbaa !13
store ptr %t, ptr %left.i60, align 8, !tbaa !5
br label %return
return: ; preds = %rightRotate.exit, %if.then12, %leftRotate.exit, %if.else, %if.end5, %if.then, %if.then4
%retval.0 = phi ptr [ %call, %if.then4 ], [ %call, %if.then ], [ %t, %if.end5 ], [ %call14, %rightRotate.exit ], [ %t, %if.then12 ], [ %call24, %leftRotate.exit ], [ %t, %if.else ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr nocapture noundef readonly %u) local_unnamed_addr #4 {
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 !5
%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 2
%1 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr, align 8, !tbaa !13
%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
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr nocapture noundef readonly %u) local_unnamed_addr #4 {
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 2
%0 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
%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 !13
%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 @print() local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !16
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
tail call void @preorder(ptr noundef nonnull %0)
%putchar = tail call i32 @putchar(i32 10)
%1 = load ptr, ptr @root, align 8, !tbaa !16
tail call void @inorder(ptr noundef %1)
%putchar2 = tail call i32 @putchar(i32 10)
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #10
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #10
store ptr null, ptr @root, align 8, !tbaa !16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%cmp46 = icmp sgt i32 %0, 0
br i1 %cmp46, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.047 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !19
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 102, label %sw.bb
i32 105, label %sw.bb8
i32 112, label %sw.bb11
i32 100, label %sw.bb14
]
sw.bb: ; preds = %for.body
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !16
%3 = load i32, ptr %x, align 4, !tbaa !18
%key26.i = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 2
%4 = load i32, ptr %key26.i, align 8, !tbaa !15
%cmp27.i = icmp eq i32 %4, %3
br i1 %cmp27.i, label %if.then, label %if.else.i
if.else.i: ; preds = %sw.bb, %tailrecurse.backedge.i
%5 = phi i32 [ %7, %tailrecurse.backedge.i ], [ %4, %sw.bb ]
%u.tr28.i = phi ptr [ %u.tr.be.i, %tailrecurse.backedge.i ], [ %2, %sw.bb ]
%cmp2.i = icmp sgt i32 %5, %3
br i1 %cmp2.i, label %if.then3.i, label %if.else7.i
if.then3.i: ; preds = %if.else.i
%left.i = getelementptr inbounds %struct.node, ptr %u.tr28.i, i64 0, i32 1
%6 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp4.not.i = icmp eq ptr %6, null
br i1 %cmp4.not.i, label %if.else, label %tailrecurse.backedge.i
tailrecurse.backedge.i: ; preds = %if.else7.i, %if.then3.i
%u.tr.be.i = phi ptr [ %6, %if.then3.i ], [ %8, %if.else7.i ]
%key.i = getelementptr inbounds %struct.node, ptr %u.tr.be.i, i64 0, i32 2
%7 = load i32, ptr %key.i, align 8, !tbaa !15
%cmp.i = icmp eq i32 %7, %3
br i1 %cmp.i, label %if.then, label %if.else.i
if.else7.i: ; preds = %if.else.i
%8 = load ptr, ptr %u.tr28.i, align 8, !tbaa !13
%cmp8.not.i = icmp eq ptr %8, null
br i1 %cmp8.not.i, label %if.else, label %tailrecurse.backedge.i
if.then: ; preds = %tailrecurse.backedge.i, %sw.bb
%puts25 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %for.inc
if.else: ; preds = %if.else7.i, %if.then3.i
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
sw.bb8: ; preds = %for.body
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %x, ptr noundef nonnull %y)
%9 = load ptr, ptr @root, align 8, !tbaa !16
%10 = load i32, ptr %x, align 4, !tbaa !18
%11 = load i32, ptr %y, align 4, !tbaa !18
%call10 = call ptr @insert(ptr noundef %9, i32 noundef %10, i32 noundef %11)
br label %for.inc
sw.bb11: ; preds = %for.body
%12 = load ptr, ptr @root, align 8, !tbaa !16
call void @inorder(ptr noundef %12)
%putchar = call i32 @putchar(i32 10)
%13 = load ptr, ptr @root, align 8, !tbaa !16
call void @preorder(ptr noundef %13)
%putchar24 = call i32 @putchar(i32 10)
br label %for.inc
sw.bb14: ; preds = %for.body
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x)
%14 = load ptr, ptr @root, align 8, !tbaa !16
%15 = load i32, ptr %x, align 4, !tbaa !18
%key26.i26 = getelementptr inbounds %struct.node, ptr %14, i64 0, i32 2
%16 = load i32, ptr %key26.i26, align 8, !tbaa !15
%cmp27.i27 = icmp eq i32 %16, %15
br i1 %cmp27.i27, label %if.then19, label %if.else.i28
if.else.i28: ; preds = %sw.bb14, %tailrecurse.backedge.i33
%17 = phi i32 [ %19, %tailrecurse.backedge.i33 ], [ %16, %sw.bb14 ]
%u.tr28.i29 = phi ptr [ %u.tr.be.i34, %tailrecurse.backedge.i33 ], [ %14, %sw.bb14 ]
%cmp2.i30 = icmp sgt i32 %17, %15
br i1 %cmp2.i30, label %if.then3.i38, label %if.else7.i31
if.then3.i38: ; preds = %if.else.i28
%left.i39 = getelementptr inbounds %struct.node, ptr %u.tr28.i29, i64 0, i32 1
%18 = load ptr, ptr %left.i39, align 8, !tbaa !5
%cmp4.not.i40 = icmp eq ptr %18, null
br i1 %cmp4.not.i40, label %for.inc, label %tailrecurse.backedge.i33
tailrecurse.backedge.i33: ; preds = %if.else7.i31, %if.then3.i38
%u.tr.be.i34 = phi ptr [ %18, %if.then3.i38 ], [ %20, %if.else7.i31 ]
%key.i35 = getelementptr inbounds %struct.node, ptr %u.tr.be.i34, i64 0, i32 2
%19 = load i32, ptr %key.i35, align 8, !tbaa !15
%cmp.i36 = icmp eq i32 %19, %15
br i1 %cmp.i36, label %if.then19, label %if.else.i28
if.else7.i31: ; preds = %if.else.i28
%20 = load ptr, ptr %u.tr28.i29, align 8, !tbaa !13
%cmp8.not.i32 = icmp eq ptr %20, null
br i1 %cmp8.not.i32, label %for.inc, label %tailrecurse.backedge.i33
if.then19: ; preds = %tailrecurse.backedge.i33, %sw.bb14
%call20 = call ptr @delete(ptr noundef %14, i32 noundef %15)
br label %for.inc
for.inc: ; preds = %if.then3.i38, %if.else7.i31, %sw.bb8, %sw.bb11, %for.body, %if.else, %if.then, %if.then19
%inc = add nuw nsw i32 %i.047, 1
%21 = load i32, ptr %n, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %21
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) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
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 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn 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 #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 "no-trapping-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 nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind allocsize(0) }
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, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!6, !10, i64 16}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !10, i64 20}
!18 = !{!10, !10, i64 0}
!19 = !{!8, !8, i64 0}
!20 = distinct !{!20, !12}
|
#include <stdio.h>
#include <math.h>
#define rad 3.14159265358979 / 180
int main(){
int a,b,angle;
double h;
scanf("%d %d %d",&a,&b,&angle);
h = sin(angle * rad) * b;
printf("%f %f %f\n",a*h/2,a + b + sqrt(a*a + b*b -2 * a * b * cos(angle * rad)),h);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%f %f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%angle = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %angle) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %angle)
%0 = load i32, ptr %angle, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x400921FB54442D11
%div = fdiv double %mul, 1.800000e+02
%call1 = call double @sin(double noundef %div) #5
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv2 = sitofp i32 %1 to double
%mul3 = fmul double %call1, %conv2
%2 = load i32, ptr %a, align 4, !tbaa !5
%conv4 = sitofp i32 %2 to double
%mul5 = fmul double %mul3, %conv4
%div6 = fmul double %mul5, 5.000000e-01
%add = add nsw i32 %2, %1
%conv7 = sitofp i32 %add to double
%mul8 = mul nsw i32 %2, %2
%mul9 = mul nsw i32 %1, %1
%add10 = add nuw nsw i32 %mul8, %mul9
%conv11 = sitofp i32 %add10 to double
%mul12 = shl i32 %1, 1
%mul13 = mul i32 %mul12, %2
%conv14 = sitofp i32 %mul13 to double
%3 = load i32, ptr %angle, align 4, !tbaa !5
%conv15 = sitofp i32 %3 to double
%mul16 = fmul double %conv15, 0x400921FB54442D11
%div17 = fdiv double %mul16, 1.800000e+02
%call18 = call double @cos(double noundef %div17) #5
%neg = fneg double %conv14
%4 = call double @llvm.fmuladd.f64(double %neg, double %call18, double %conv11)
%call20 = call double @sqrt(double noundef %4) #5
%add21 = fadd double %call20, %conv7
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div6, double noundef %add21, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %angle) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
double a, b, c, C;
double s,l, h,d;
scanf("%lf %lf %lf",&a,&b,&C);
d = C / 180 * M_PI;
s = a * b * sin(d) / 2;
c = sqrt(a * a + b * b - 2 * a * b * cos(d));
l = a + b + c;
h = b * sin(d);
printf("%f\n%f\n%f\n",s,l,h);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%f\0A%f\0A%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%C = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %C)
%0 = load double, ptr %C, align 8, !tbaa !5
%div = fdiv double %0, 1.800000e+02
%mul = fmul double %div, 0x400921FB54442D18
%1 = load double, ptr %a, align 8, !tbaa !5
%2 = load double, ptr %b, align 8, !tbaa !5
%mul1 = fmul double %1, %2
%call2 = call double @sin(double noundef %mul) #5
%mul3 = fmul double %mul1, %call2
%div4 = fmul double %mul3, 5.000000e-01
%3 = load double, ptr %a, align 8, !tbaa !5
%4 = load double, ptr %b, align 8, !tbaa !5
%mul6 = fmul double %4, %4
%5 = call double @llvm.fmuladd.f64(double %3, double %3, double %mul6)
%call9 = call double @cos(double noundef %mul) #5
%6 = fmul double %3, -2.000000e+00
%neg = fmul double %6, %4
%7 = call double @llvm.fmuladd.f64(double %neg, double %call9, double %5)
%call11 = call double @sqrt(double noundef %7) #5
%8 = load double, ptr %a, align 8, !tbaa !5
%9 = load double, ptr %b, align 8, !tbaa !5
%add = fadd double %8, %9
%add12 = fadd double %call11, %add
%call13 = call double @sin(double noundef %mul) #5
%mul14 = fmul double %9, %call13
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div4, double noundef %add12, double noundef %mul14)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void)
{
double a, b, S, L, h;
double a1, a2, d, rad;
int C;
scanf("%lf %lf %d", &a, &b, &C);
rad = (C * M_PI) / 180;
h = b * sin(rad);
a1 = b * cos(rad);
a2 = a - a1;
d = sqrt(h * h + a2 * a2);
L = a + b + d;
S = (a * h) / 2;
printf("%.4f\n%.4f\n%.4f\n", S, L, h);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340193/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340193/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%lf %lf %d\00", align 1
@.str.1 = private unnamed_addr constant [16 x i8] c"%.4f\0A%.4f\0A%.4f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %C)
%0 = load i32, ptr %C, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 0x400921FB54442D18
%div = fdiv double %mul, 1.800000e+02
%1 = load double, ptr %b, align 8, !tbaa !9
%call1 = call double @sin(double noundef %div) #6
%mul2 = fmul double %1, %call1
%2 = load double, ptr %b, align 8, !tbaa !9
%call3 = call double @cos(double noundef %div) #6
%mul4 = fmul double %2, %call3
%3 = load double, ptr %a, align 8, !tbaa !9
%sub = fsub double %3, %mul4
%mul6 = fmul double %sub, %sub
%4 = call double @llvm.fmuladd.f64(double %mul2, double %mul2, double %mul6)
%sqrt = call double @llvm.sqrt.f64(double %4)
%5 = load double, ptr %b, align 8, !tbaa !9
%add = fadd double %3, %5
%add8 = fadd double %add, %sqrt
%mul9 = fmul double %mul2, %3
%div10 = fmul double %mul9, 5.000000e-01
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div10, double noundef %add8, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
|
#include <stdio.h>
int main(void) {
int n,a[3],i,j,k,temp;
scanf("%d",&n);
for (i=0; i<n; i++) scanf("%d",&a[i]);
for (i=0; i<n-1; i++) {
if (a[i]<a[i+1]) {
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
for (i=1; i<=a[n-1]; i++) {
for (j=0; j<n; j++) {
if (a[j]%i!=0) break;
}
if (j==n) printf("%d\n",i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340236/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340236/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.cond2.preheader.thread
for.cond2.preheader.thread: ; preds = %entry
%sub89 = add i32 %0, -1
br label %for.cond23.preheader
for.cond2.preheader: ; preds = %for.body
%sub = add i32 %2, -1
%cmp367 = icmp sgt i32 %2, 1
br i1 %cmp367, label %for.body4.preheader, label %for.cond23.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %a, align 4, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %sub, 1
br i1 %1, label %for.cond23.preheader.loopexit.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond23.preheader.loopexit.unr-lcssa: ; preds = %for.inc20.1, %for.body4.preheader
%.unr = phi i32 [ %.pre, %for.body4.preheader ], [ %11, %for.inc20.1 ]
%indvars.iv80.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next81.1, %for.inc20.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body4.epil
for.body4.epil: ; preds = %for.cond23.preheader.loopexit.unr-lcssa
%indvars.iv.next81.epil = add nuw nsw i64 %indvars.iv80.unr, 1
%arrayidx8.epil = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.next81.epil
%4 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%cmp9.epil = icmp slt i32 %.unr, %4
br i1 %cmp9.epil, label %if.then.epil, label %for.cond23.preheader
if.then.epil: ; preds = %for.body4.epil
%arrayidx6.epil = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv80.unr
store i32 %4, ptr %arrayidx6.epil, align 4, !tbaa !5
store i32 %.unr, ptr %arrayidx8.epil, align 4, !tbaa !5
br label %for.cond23.preheader
for.cond23.preheader: ; preds = %for.cond23.preheader.loopexit.unr-lcssa, %if.then.epil, %for.body4.epil, %for.cond2.preheader.thread, %for.cond2.preheader
%sub91 = phi i32 [ %sub89, %for.cond2.preheader.thread ], [ %sub, %for.cond2.preheader ], [ %sub, %for.body4.epil ], [ %sub, %if.then.epil ], [ %sub, %for.cond23.preheader.loopexit.unr-lcssa ]
%5 = phi i32 [ %0, %for.cond2.preheader.thread ], [ %2, %for.cond2.preheader ], [ %2, %for.body4.epil ], [ %2, %if.then.epil ], [ %2, %for.cond23.preheader.loopexit.unr-lcssa ]
%idxprom2574 = sext i32 %sub91 to i64
%arrayidx2675 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %idxprom2574
%6 = load i32, ptr %arrayidx2675, align 4, !tbaa !5
%cmp27.not76 = icmp slt i32 %6, 1
br i1 %cmp27.not76, label %for.end46, label %for.cond29.preheader
for.body4: ; preds = %for.inc20.1, %for.body4.preheader.new
%7 = phi i32 [ %.pre, %for.body4.preheader.new ], [ %11, %for.inc20.1 ]
%indvars.iv80 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next81.1, %for.inc20.1 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.inc20.1 ]
%indvars.iv.next81 = or i64 %indvars.iv80, 1
%arrayidx8 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.next81
%8 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %7, %8
br i1 %cmp9, label %if.then, label %for.inc20
if.then: ; preds = %for.body4
%arrayidx6 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv80
store i32 %8, ptr %arrayidx6, align 4, !tbaa !5
store i32 %7, ptr %arrayidx8, align 4, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.body4, %if.then
%9 = phi i32 [ %8, %for.body4 ], [ %7, %if.then ]
%indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
%arrayidx8.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.next81.1
%10 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%cmp9.1 = icmp slt i32 %9, %10
br i1 %cmp9.1, label %if.then.1, label %for.inc20.1
if.then.1: ; preds = %for.inc20
%arrayidx6.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.next81
store i32 %10, ptr %arrayidx6.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx8.1, align 4, !tbaa !5
br label %for.inc20.1
for.inc20.1: ; preds = %if.then.1, %for.inc20
%11 = phi i32 [ %10, %for.inc20 ], [ %9, %if.then.1 ]
%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.cond23.preheader.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11
for.cond29.preheader: ; preds = %for.cond23.preheader, %for.inc44
%12 = phi i32 [ %15, %for.inc44 ], [ %5, %for.cond23.preheader ]
%i.277 = phi i32 [ %inc45, %for.inc44 ], [ 1, %for.cond23.preheader ]
%cmp3069 = icmp sgt i32 %12, 0
br i1 %cmp3069, label %for.body31.preheader, label %for.end39
for.body31.preheader: ; preds = %for.cond29.preheader
%wide.trip.count86 = zext i32 %12 to i64
br label %for.body31
for.body31: ; preds = %for.body31.preheader, %for.inc37
%indvars.iv83 = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next84, %for.inc37 ]
%arrayidx33 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv83
%13 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%rem = srem i32 %13, %i.277
%cmp34.not = icmp eq i32 %rem, 0
br i1 %cmp34.not, label %for.inc37, label %for.end39.loopexit
for.inc37: ; preds = %for.body31
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %if.then41, label %for.body31, !llvm.loop !12
for.end39.loopexit: ; preds = %for.body31
%14 = trunc i64 %indvars.iv83 to i32
br label %for.end39
for.end39: ; preds = %for.end39.loopexit, %for.cond29.preheader
%j.0.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ %14, %for.end39.loopexit ]
%cmp40 = icmp eq i32 %j.0.lcssa, %12
br i1 %cmp40, label %if.then41, label %for.inc44
if.then41: ; preds = %for.inc37, %for.end39
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.277)
%.pre88 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc44
for.inc44: ; preds = %for.end39, %if.then41
%15 = phi i32 [ %12, %for.end39 ], [ %.pre88, %if.then41 ]
%inc45 = add nuw nsw i32 %i.277, 1
%sub24 = add nsw i32 %15, -1
%idxprom25 = sext i32 %sub24 to i64
%arrayidx26 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %idxprom25
%16 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not.not = icmp slt i32 %i.277, %16
br i1 %cmp27.not.not, label %for.cond29.preheader, label %for.end46, !llvm.loop !13
for.end46: ; preds = %for.inc44, %for.cond23.preheader
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main( void ) {
int i, j;
int n, m, a[ 50 ][ 50 ];
scanf( "%d %d", &n, &m );
for ( i = 0; i < n; i++ )
for ( j = 0; j < m; j++ )
scanf( "%d", a[ i ] + j );
for ( i = 0; i < n; i++ )
if ( a[ i ][ 0 ] || a[ i ][ m - 1 ] ) {
puts( "2" );
return 0;
}
for ( j = 0; j < m; j++ )
if ( a[ 0 ][ j ] || a[ n - 1 ][ j ] ) {
puts( "2" );
return 0;
}
puts( "4" );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_34028/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_34028/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"2\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"4\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
%a = alloca [50 x [50 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 10000, ptr nonnull %a) #3
%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
%cmp62 = icmp sgt i32 %0, 0
%.pre82.pre = load i32, ptr %m, align 4
br i1 %cmp62, label %for.cond1.preheader.lr.ph, label %for.cond23.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre82.pre, 0
br i1 %1, label %for.cond1.preheader, label %for.body10.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc5
%2 = phi i32 [ %6, %for.inc5 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %7, %for.inc5 ], [ %.pre82.pre, %for.cond1.preheader.lr.ph ]
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc5 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp260 = icmp sgt i32 %3, 0
br i1 %cmp260, label %for.body3.lr.ph, label %for.inc5
for.body3.lr.ph: ; preds = %for.cond1.preheader
%arrayidx = getelementptr inbounds [50 x [50 x i32]], ptr %a, i64 0, i64 %indvars.iv71
br label %for.body3
for.cond8.preheader: ; preds = %for.inc5
%cmp964 = icmp sgt i32 %6, 0
br i1 %cmp964, label %for.body10.lr.ph, label %for.cond23.preheader
for.body10.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond8.preheader
%.lcssa90 = phi i32 [ %6, %for.cond8.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%.pre8288 = phi i32 [ %7, %for.cond8.preheader ], [ %.pre82.pre, %for.cond1.preheader.lr.ph ]
%sub = add nsw i32 %.pre8288, -1
%idxprom16 = sext i32 %sub to i64
%wide.trip.count = zext i32 %.lcssa90 to i64
br label %for.body10
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ]
%add.ptr = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %m, align 4
%5 = sext i32 %4 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp2, label %for.body3, label %for.inc5.loopexit, !llvm.loop !9
for.inc5.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc5
for.inc5: ; preds = %for.inc5.loopexit, %for.cond1.preheader
%6 = phi i32 [ %.pre, %for.inc5.loopexit ], [ %2, %for.cond1.preheader ]
%7 = phi i32 [ %4, %for.inc5.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%8 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next72, %8
br i1 %cmp, label %for.cond1.preheader, label %for.cond8.preheader, !llvm.loop !11
for.cond8: ; preds = %lor.lhs.false
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%exitcond.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
br i1 %exitcond.not, label %for.cond23.preheader, label %for.body10, !llvm.loop !13
for.cond23.preheader: ; preds = %for.cond8, %entry, %for.cond8.preheader
%.lcssa89 = phi i32 [ %6, %for.cond8.preheader ], [ %0, %entry ], [ %.lcssa90, %for.cond8 ]
%.pre8287 = phi i32 [ %7, %for.cond8.preheader ], [ %.pre82.pre, %entry ], [ %.pre8288, %for.cond8 ]
%cmp2466 = icmp sgt i32 %.pre8287, 0
br i1 %cmp2466, label %for.body25.lr.ph, label %cleanup
for.body25.lr.ph: ; preds = %for.cond23.preheader
%sub31 = add nsw i32 %.lcssa89, -1
%idxprom32 = sext i32 %sub31 to i64
%wide.trip.count80 = zext i32 %.pre8287 to i64
br label %for.body25
for.body10: ; preds = %for.body10.lr.ph, %for.cond8
%indvars.iv74 = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next75, %for.cond8 ]
%arrayidx12 = getelementptr inbounds [50 x [50 x i32]], ptr %a, i64 0, i64 %indvars.iv74
%9 = load i32, ptr %arrayidx12, align 8, !tbaa !5
%tobool.not = icmp eq i32 %9, 0
br i1 %tobool.not, label %lor.lhs.false, label %cleanup
lor.lhs.false: ; preds = %for.body10
%arrayidx17 = getelementptr inbounds [50 x [50 x i32]], ptr %a, i64 0, i64 %indvars.iv74, i64 %idxprom16
%10 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%tobool18.not = icmp eq i32 %10, 0
br i1 %tobool18.not, label %for.cond8, label %cleanup
for.cond23: ; preds = %lor.lhs.false30
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
br i1 %exitcond81.not, label %cleanup, label %for.body25, !llvm.loop !14
for.body25: ; preds = %for.body25.lr.ph, %for.cond23
%indvars.iv77 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next78, %for.cond23 ]
%arrayidx28 = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv77
%11 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%tobool29.not = icmp eq i32 %11, 0
br i1 %tobool29.not, label %lor.lhs.false30, label %cleanup
lor.lhs.false30: ; preds = %for.body25
%arrayidx35 = getelementptr inbounds [50 x [50 x i32]], ptr %a, i64 0, i64 %idxprom32, i64 %indvars.iv77
%12 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%tobool36.not = icmp eq i32 %12, 0
br i1 %tobool36.not, label %for.cond23, label %cleanup
cleanup: ; preds = %for.body10, %lor.lhs.false, %for.cond23, %for.body25, %lor.lhs.false30, %for.cond23.preheader
%.str.3.sink = phi ptr [ @.str.3, %for.cond23.preheader ], [ @.str.2, %lor.lhs.false30 ], [ @.str.2, %for.body25 ], [ @.str.3, %for.cond23 ], [ @.str.2, %lor.lhs.false ], [ @.str.2, %for.body10 ]
%call43 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %a) #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 @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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main()
{
long long i,j,t;
while(scanf("%lld%lld",&i,&j)!=EOF)
{
if(i==1&&j==1)
t=1;
else if(i==1)
t=j-2;
else if(j==1)
t=i-2;
else
{
t=(i-2)*(j-2);
}
printf("%lld\n",t);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340322/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340322/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
%j = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %j) #3
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j)
%cmp.not17 = icmp eq i32 %call16, -1
br i1 %cmp.not17, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end13
%0 = load i64, ptr %i, align 8, !tbaa !5
%cmp1 = icmp eq i64 %0, 1
%1 = load i64, ptr %j, align 8
%cmp2 = icmp eq i64 %1, 1
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %if.end13, label %if.else
if.else: ; preds = %while.body
br i1 %cmp1, label %if.then4, label %if.else5
if.then4: ; preds = %if.else
%sub = add nsw i64 %1, -2
br label %if.end13
if.else5: ; preds = %if.else
%sub8 = add nsw i64 %0, -2
br i1 %cmp2, label %if.end13, label %if.else9
if.else9: ; preds = %if.else5
%sub11 = add nsw i64 %1, -2
%mul = mul nsw i64 %sub11, %sub8
br label %if.end13
if.end13: ; preds = %if.else5, %while.body, %if.then4, %if.else9
%t.0 = phi i64 [ %sub, %if.then4 ], [ %mul, %if.else9 ], [ 1, %while.body ], [ %sub8, %if.else5 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %t.0)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end13, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %j) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n, a, b, c;
scanf("%d %d %d %d", &n, &a, &b, &c);
int i;
char s[100005][4];
for (i = 0; i < n; i++)
scanf("%s", s[i]);
int f = 0;
int ans[100005];
if (s[0][0] == 'A' && s[0][1] == 'B' && a == 0 && b == 0)
f++;
if (s[0][0] == 'A' && s[0][1] == 'C' && a == 0 && c == 0)
f++;
if (s[0][0] == 'B' && s[0][1] == 'C' && b == 0 && c == 0)
f++;
if (f > 0)
{
printf("No\n");
return 0;
}
if (a + b + c == 0)
{
printf("No\n");
return 0;
}
if (a + b + c > 2)
{
for (i = 0; i < n; i++)
{
if (s[i][0] == 'A' && s[i][1] == 'B')
{
if (a > b)
{
ans[i] = 1;
a--;
b++;
}
else
{
ans[i] = 0;
a++;
b--;
}
}
else if (s[i][0] == 'A' && s[i][1] == 'C')
{
if (a > c)
{
ans[i] = 2;
a--;
c++;
}
else
{
ans[i] = 0;
a++;
c--;
}
}
else if (s[i][0] == 'B' && s[i][1] == 'C')
{
if (b > c)
{
ans[i] = 2;
b--;
c++;
}
else
{
ans[i] = 1;
b++;
c--;
}
}
}
printf("Yes\n");
for (i = 0; i < n; i++)
printf("%c\n", ans[i] + 'A');
return 0;
}
if (a + b + c == 1)
{
f = 0;
for (i = 0; i < n; i++)
{
if (s[i][0] == 'A' && s[i][1] == 'B')
{
if (a > 0)
{
ans[i] = 1;
b++;
a--;
}
else if (b > 0)
{
ans[i] = 0;
a++;
b--;
}
else
f++;
}
else if (s[i][0] == 'A' && s[i][1] == 'C')
{
if (a > 0)
{
ans[i] = 2;
c++;
a--;
}
else if (c > 0)
{
ans[i] = 0;
a++;
c--;
}
else
f++;
}
else
{
if (b > 0)
{
ans[i] = 2;
c++;
b--;
}
else if (c > 0)
{
ans[i] = 1;
b++;
c--;
}
else
f++;
}
}
if (f > 0)
printf("No\n");
else
{
printf("Yes\n");
for (i = 0; i < n; i++)
printf("%c\n", ans[i] + 'A');
}
return 0;
}
s[n][0] = 'A';
s[n][1] = 'C';
for (i = 0; i < n; i++)
{
if (s[i][0] == 'A' && s[i][1] == 'B')
{
if (a > b)
{
ans[i] = 1;
b++;
a--;
}
else if (a < b)
{
ans[i] = 0;
a++;
b--;
}
else
{
if (s[i + 1][0] == 'A')
{
ans[i] = 0;
a++;
b--;
}
else
{
ans[i] = 1;
b++;
a--;
}
}
}
else if (s[i][0] == 'A')
{
if (a < c)
{
ans[i] = 0;
a++;
c--;
}
else if (a > c)
{
ans[i] = 2;
c++;
a--;
}
else
{
if (s[i + 1][0] == 'A')
{
ans[i] = 0;
a++;
c--;
}
else
{
ans[i] = 2;
c++;
a--;
}
}
}
else
{
if (b < c)
{
ans[i] = 1;
b++;
c--;
}
else if (b > c)
{
ans[i] = 2;
c++;
b--;
}
else
{
if (s[i + 1][1] == 'C')
{
ans[i] = 2;
c++;
b--;
}
else
{
ans[i] = 1;
b++;
c--;
}
}
}
}
printf("Yes\n");
for (i = 0; i < n; i++)
printf("%c\n", ans[i] + 'A');
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340366/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.9 = 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
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%s = alloca [100005 x [4 x i8]], align 16
%ans = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %s) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp549 = icmp sgt i32 %0, 0
br i1 %cmp549, 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 [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i8, ptr %s, align 16, !tbaa !11
%arrayidx7.phi.trans.insert = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%.pre627 = load i8, ptr %arrayidx7.phi.trans.insert, align 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%3 = phi i8 [ undef, %entry ], [ %.pre627, %for.end.loopexit ]
%4 = phi i8 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.end.loopexit ]
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %ans) #4
%cmp4 = icmp eq i8 %4, 65
%cmp9 = icmp eq i8 %3, 66
%or.cond = select i1 %cmp4, i1 %cmp9, i1 false
%5 = load i32, ptr %a, align 4
%cmp12 = icmp eq i32 %5, 0
%or.cond463 = select i1 %or.cond, i1 %cmp12, i1 false
%6 = load i32, ptr %b, align 4
%cmp15 = icmp eq i32 %6, 0
%cmp27 = icmp eq i8 %3, 67
%or.cond465 = select i1 %cmp4, i1 %cmp27, i1 false
%or.cond466 = select i1 %or.cond465, i1 %cmp12, i1 false
%7 = load i32, ptr %c, align 4
%cmp33 = icmp eq i32 %7, 0
%or.cond467 = select i1 %or.cond466, i1 %cmp33, i1 false
%cmp41 = icmp eq i8 %4, 66
%or.cond468 = select i1 %cmp41, i1 %cmp27, i1 false
%or.cond469 = select i1 %or.cond468, i1 %cmp15, i1 false
%or.cond470 = select i1 %or.cond469, i1 %cmp33, i1 false
%8 = select i1 %or.cond463, i1 %cmp15, i1 %or.cond470
%9 = select i1 %or.cond467, i1 true, i1 %8
br i1 %9, label %cleanup.sink.split, label %if.end62
if.end62: ; preds = %for.end
%add = add nsw i32 %6, %5
%add63 = add nsw i32 %add, %7
%cmp64 = icmp eq i32 %add63, 0
br i1 %cmp64, label %cleanup.sink.split, label %if.end68
if.end68: ; preds = %if.end62
%cmp71 = icmp sgt i32 %add63, 2
br i1 %cmp71, label %for.cond74.preheader, label %if.end177
for.cond74.preheader: ; preds = %if.end68
%cmp75591 = icmp sgt i32 %.lcssa, 0
br i1 %cmp75591, label %for.body77.preheader, label %for.end164
for.body77.preheader: ; preds = %for.cond74.preheader
%wide.trip.count622 = zext i32 %.lcssa to i64
br label %for.body77
for.body77: ; preds = %for.body77.preheader, %for.inc162
%indvars.iv619 = phi i64 [ 0, %for.body77.preheader ], [ %indvars.iv.next620, %for.inc162 ]
%inc156584594 = phi i32 [ %6, %for.body77.preheader ], [ %inc156583, %for.inc162 ]
%dec157587593 = phi i32 [ %7, %for.body77.preheader ], [ %dec157586, %for.inc162 ]
%inc128590592 = phi i32 [ %5, %for.body77.preheader ], [ %inc128589, %for.inc162 ]
%arrayidx79 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv619
%10 = load i8, ptr %arrayidx79, align 4, !tbaa !11
switch i8 %10, label %for.inc162 [
i8 65, label %land.lhs.true84
i8 66, label %land.lhs.true138
]
land.lhs.true84: ; preds = %for.body77
%arrayidx87 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv619, i64 1
%11 = load i8, ptr %arrayidx87, align 1, !tbaa !11
switch i8 %11, label %for.inc162 [
i8 66, label %if.then91
i8 67, label %if.then117
]
if.then91: ; preds = %land.lhs.true84
%cmp92 = icmp sgt i32 %inc128590592, %inc156584594
%arrayidx96 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv619
br i1 %cmp92, label %if.then94, label %if.else
if.then94: ; preds = %if.then91
store i32 1, ptr %arrayidx96, align 4, !tbaa !5
%dec = add nsw i32 %inc128590592, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%inc97 = add nsw i32 %inc156584594, 1
store i32 %inc97, ptr %b, align 4, !tbaa !5
br label %for.inc162
if.else: ; preds = %if.then91
store i32 0, ptr %arrayidx96, align 4, !tbaa !5
%inc100 = add nsw i32 %inc128590592, 1
store i32 %inc100, ptr %a, align 4, !tbaa !5
%dec101 = add nsw i32 %inc156584594, -1
store i32 %dec101, ptr %b, align 4, !tbaa !5
br label %for.inc162
if.then117: ; preds = %land.lhs.true84
%cmp118 = icmp sgt i32 %inc128590592, %dec157587593
%arrayidx122 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv619
br i1 %cmp118, label %if.then120, label %if.else125
if.then120: ; preds = %if.then117
store i32 2, ptr %arrayidx122, align 4, !tbaa !5
%dec123 = add nsw i32 %inc128590592, -1
store i32 %dec123, ptr %a, align 4, !tbaa !5
%inc124 = add nsw i32 %dec157587593, 1
store i32 %inc124, ptr %c, align 4, !tbaa !5
br label %for.inc162
if.else125: ; preds = %if.then117
store i32 0, ptr %arrayidx122, align 4, !tbaa !5
%inc128 = add nsw i32 %inc128590592, 1
store i32 %inc128, ptr %a, align 4, !tbaa !5
%dec129 = add nsw i32 %dec157587593, -1
store i32 %dec129, ptr %c, align 4, !tbaa !5
br label %for.inc162
land.lhs.true138: ; preds = %for.body77
%arrayidx141 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv619, i64 1
%12 = load i8, ptr %arrayidx141, align 1, !tbaa !11
%cmp143 = icmp eq i8 %12, 67
br i1 %cmp143, label %if.then145, label %for.inc162
if.then145: ; preds = %land.lhs.true138
%cmp146 = icmp sgt i32 %inc156584594, %dec157587593
%arrayidx150 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv619
br i1 %cmp146, label %if.then148, label %if.else153
if.then148: ; preds = %if.then145
store i32 2, ptr %arrayidx150, align 4, !tbaa !5
%dec151 = add nsw i32 %inc156584594, -1
store i32 %dec151, ptr %b, align 4, !tbaa !5
%inc152 = add nsw i32 %dec157587593, 1
store i32 %inc152, ptr %c, align 4, !tbaa !5
br label %for.inc162
if.else153: ; preds = %if.then145
store i32 1, ptr %arrayidx150, align 4, !tbaa !5
%inc156 = add nsw i32 %inc156584594, 1
store i32 %inc156, ptr %b, align 4, !tbaa !5
%dec157 = add nsw i32 %dec157587593, -1
store i32 %dec157, ptr %c, align 4, !tbaa !5
br label %for.inc162
for.inc162: ; preds = %land.lhs.true84, %for.body77, %if.else, %if.then94, %land.lhs.true138, %if.else153, %if.then148, %if.then120, %if.else125
%inc128589 = phi i32 [ %inc128590592, %for.body77 ], [ %inc100, %if.else ], [ %dec, %if.then94 ], [ %inc128590592, %land.lhs.true138 ], [ %inc128590592, %if.else153 ], [ %inc128590592, %if.then148 ], [ %dec123, %if.then120 ], [ %inc128, %if.else125 ], [ %inc128590592, %land.lhs.true84 ]
%dec157586 = phi i32 [ %dec157587593, %for.body77 ], [ %dec157587593, %if.else ], [ %dec157587593, %if.then94 ], [ %dec157587593, %land.lhs.true138 ], [ %dec157, %if.else153 ], [ %inc152, %if.then148 ], [ %inc124, %if.then120 ], [ %dec129, %if.else125 ], [ %dec157587593, %land.lhs.true84 ]
%inc156583 = phi i32 [ %inc156584594, %for.body77 ], [ %dec101, %if.else ], [ %inc97, %if.then94 ], [ %inc156584594, %land.lhs.true138 ], [ %inc156, %if.else153 ], [ %dec151, %if.then148 ], [ %inc156584594, %if.then120 ], [ %inc156584594, %if.else125 ], [ %inc156584594, %land.lhs.true84 ]
%indvars.iv.next620 = add nuw nsw i64 %indvars.iv619, 1
%exitcond623.not = icmp eq i64 %indvars.iv.next620, %wide.trip.count622
br i1 %exitcond623.not, label %for.end164, label %for.body77, !llvm.loop !12
for.end164: ; preds = %for.inc162, %for.cond74.preheader
%puts542 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp167596 = icmp sgt i32 %13, 0
br i1 %cmp167596, label %for.body169, label %cleanup
for.body169: ; preds = %for.end164, %for.body169
%indvars.iv624 = phi i64 [ %indvars.iv.next625, %for.body169 ], [ 0, %for.end164 ]
%arrayidx171 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv624
%14 = load i32, ptr %arrayidx171, align 4, !tbaa !5
%add172 = add nsw i32 %14, 65
%call173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %add172)
%indvars.iv.next625 = add nuw nsw i64 %indvars.iv624, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp167 = icmp slt i64 %indvars.iv.next625, %16
br i1 %cmp167, label %for.body169, label %cleanup, !llvm.loop !13
if.end177: ; preds = %if.end68
%cmp180 = icmp eq i32 %add63, 1
br i1 %cmp180, label %for.cond183.preheader, label %if.end297
for.cond183.preheader: ; preds = %if.end177
%cmp184573 = icmp sgt i32 %.lcssa, 0
br i1 %cmp184573, label %for.body186.preheader, label %if.else283
for.body186.preheader: ; preds = %for.cond183.preheader
%wide.trip.count614 = zext i32 %.lcssa to i64
br label %for.body186
for.body186: ; preds = %for.body186.preheader, %for.inc276
%indvars.iv611 = phi i64 [ 0, %for.body186.preheader ], [ %indvars.iv.next612, %for.inc276 ]
%f.3578 = phi i32 [ 0, %for.body186.preheader ], [ %f.4, %for.inc276 ]
%inc268566576 = phi i32 [ %6, %for.body186.preheader ], [ %inc268565, %for.inc276 ]
%dec269569575 = phi i32 [ %7, %for.body186.preheader ], [ %dec269568, %for.inc276 ]
%inc248572574 = phi i32 [ %5, %for.body186.preheader ], [ %inc248571, %for.inc276 ]
%arrayidx188 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv611
%17 = load i8, ptr %arrayidx188, align 4, !tbaa !11
%cmp191 = icmp eq i8 %17, 65
br i1 %cmp191, label %land.lhs.true193, label %if.else254
land.lhs.true193: ; preds = %for.body186
%arrayidx196 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv611, i64 1
%18 = load i8, ptr %arrayidx196, align 1, !tbaa !11
switch i8 %18, label %if.else254 [
i8 66, label %if.then200
i8 67, label %if.then234
]
if.then200: ; preds = %land.lhs.true193
%cmp201 = icmp sgt i32 %inc248572574, 0
br i1 %cmp201, label %if.then203, label %if.else208
if.then203: ; preds = %if.then200
%arrayidx205 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 1, ptr %arrayidx205, align 4, !tbaa !5
%inc206 = add nsw i32 %inc268566576, 1
store i32 %inc206, ptr %b, align 4, !tbaa !5
%dec207 = add nsw i32 %inc248572574, -1
store i32 %dec207, ptr %a, align 4, !tbaa !5
br label %for.inc276
if.else208: ; preds = %if.then200
%cmp209 = icmp sgt i32 %inc268566576, 0
br i1 %cmp209, label %if.then211, label %if.else216
if.then211: ; preds = %if.else208
%arrayidx213 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 0, ptr %arrayidx213, align 4, !tbaa !5
%inc214 = add nsw i32 %inc248572574, 1
store i32 %inc214, ptr %a, align 4, !tbaa !5
%dec215 = add nsw i32 %inc268566576, -1
store i32 %dec215, ptr %b, align 4, !tbaa !5
br label %for.inc276
if.else216: ; preds = %if.else208
%inc217 = add nsw i32 %f.3578, 1
br label %for.inc276
if.then234: ; preds = %land.lhs.true193
%cmp235 = icmp sgt i32 %inc248572574, 0
br i1 %cmp235, label %if.then237, label %if.else242
if.then237: ; preds = %if.then234
%arrayidx239 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 2, ptr %arrayidx239, align 4, !tbaa !5
%inc240 = add nsw i32 %dec269569575, 1
store i32 %inc240, ptr %c, align 4, !tbaa !5
%dec241 = add nsw i32 %inc248572574, -1
store i32 %dec241, ptr %a, align 4, !tbaa !5
br label %for.inc276
if.else242: ; preds = %if.then234
%cmp243 = icmp sgt i32 %dec269569575, 0
br i1 %cmp243, label %if.then245, label %if.else250
if.then245: ; preds = %if.else242
%arrayidx247 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 0, ptr %arrayidx247, align 4, !tbaa !5
%inc248 = add nsw i32 %inc248572574, 1
store i32 %inc248, ptr %a, align 4, !tbaa !5
%dec249 = add nsw i32 %dec269569575, -1
store i32 %dec249, ptr %c, align 4, !tbaa !5
br label %for.inc276
if.else250: ; preds = %if.else242
%inc251 = add nsw i32 %f.3578, 1
br label %for.inc276
if.else254: ; preds = %land.lhs.true193, %for.body186
%cmp255 = icmp sgt i32 %inc268566576, 0
br i1 %cmp255, label %if.then257, label %if.else262
if.then257: ; preds = %if.else254
%arrayidx259 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 2, ptr %arrayidx259, align 4, !tbaa !5
%inc260 = add nsw i32 %dec269569575, 1
store i32 %inc260, ptr %c, align 4, !tbaa !5
%dec261 = add nsw i32 %inc268566576, -1
store i32 %dec261, ptr %b, align 4, !tbaa !5
br label %for.inc276
if.else262: ; preds = %if.else254
%cmp263 = icmp sgt i32 %dec269569575, 0
br i1 %cmp263, label %if.then265, label %if.else270
if.then265: ; preds = %if.else262
%arrayidx267 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv611
store i32 1, ptr %arrayidx267, align 4, !tbaa !5
%inc268 = add nsw i32 %inc268566576, 1
store i32 %inc268, ptr %b, align 4, !tbaa !5
%dec269 = add nsw i32 %dec269569575, -1
store i32 %dec269, ptr %c, align 4, !tbaa !5
br label %for.inc276
if.else270: ; preds = %if.else262
%inc271 = add nsw i32 %f.3578, 1
br label %for.inc276
for.inc276: ; preds = %if.then211, %if.else216, %if.then203, %if.then257, %if.else270, %if.then265, %if.then237, %if.else250, %if.then245
%inc248571 = phi i32 [ %dec207, %if.then203 ], [ %inc214, %if.then211 ], [ %inc248572574, %if.else216 ], [ %dec241, %if.then237 ], [ %inc248, %if.then245 ], [ %inc248572574, %if.else250 ], [ %inc248572574, %if.then257 ], [ %inc248572574, %if.then265 ], [ %inc248572574, %if.else270 ]
%dec269568 = phi i32 [ %dec269569575, %if.then203 ], [ %dec269569575, %if.then211 ], [ %dec269569575, %if.else216 ], [ %inc240, %if.then237 ], [ %dec249, %if.then245 ], [ %dec269569575, %if.else250 ], [ %inc260, %if.then257 ], [ %dec269, %if.then265 ], [ %dec269569575, %if.else270 ]
%inc268565 = phi i32 [ %inc206, %if.then203 ], [ %dec215, %if.then211 ], [ %inc268566576, %if.else216 ], [ %inc268566576, %if.then237 ], [ %inc268566576, %if.then245 ], [ %inc268566576, %if.else250 ], [ %dec261, %if.then257 ], [ %inc268, %if.then265 ], [ %inc268566576, %if.else270 ]
%f.4 = phi i32 [ %f.3578, %if.then203 ], [ %f.3578, %if.then211 ], [ %inc217, %if.else216 ], [ %f.3578, %if.then237 ], [ %f.3578, %if.then245 ], [ %inc251, %if.else250 ], [ %f.3578, %if.then257 ], [ %f.3578, %if.then265 ], [ %inc271, %if.else270 ]
%indvars.iv.next612 = add nuw nsw i64 %indvars.iv611, 1
%exitcond615.not = icmp eq i64 %indvars.iv.next612, %wide.trip.count614
br i1 %exitcond615.not, label %for.end278, label %for.body186, !llvm.loop !14
for.end278: ; preds = %for.inc276
%19 = icmp sgt i32 %f.4, 0
br i1 %19, label %cleanup.sink.split, label %if.else283
if.else283: ; preds = %for.cond183.preheader, %for.end278
%puts540 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp286580 = icmp sgt i32 %20, 0
br i1 %cmp286580, label %for.body288, label %cleanup
for.body288: ; preds = %if.else283, %for.body288
%indvars.iv616 = phi i64 [ %indvars.iv.next617, %for.body288 ], [ 0, %if.else283 ]
%arrayidx290 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv616
%21 = load i32, ptr %arrayidx290, align 4, !tbaa !5
%add291 = add nsw i32 %21, 65
%call292 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %add291)
%indvars.iv.next617 = add nuw nsw i64 %indvars.iv616, 1
%22 = load i32, ptr %n, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp286 = icmp slt i64 %indvars.iv.next617, %23
br i1 %cmp286, label %for.body288, label %cleanup, !llvm.loop !15
if.end297: ; preds = %if.end177
%idxprom298 = sext i32 %.lcssa to i64
%arrayidx299 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %idxprom298
store i8 65, ptr %arrayidx299, align 4, !tbaa !11
%arrayidx303 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %idxprom298, i64 1
store i8 67, ptr %arrayidx303, align 1, !tbaa !11
%cmp305557 = icmp sgt i32 %.lcssa, 0
br i1 %cmp305557, label %for.body307.preheader, label %for.end443
for.body307.preheader: ; preds = %if.end297
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.body307
for.body307: ; preds = %for.body307.preheader, %for.inc441
%indvars.iv602 = phi i64 [ 0, %for.body307.preheader ], [ %indvars.iv.next603, %for.inc441 ]
%inc434552560 = phi i32 [ %6, %for.body307.preheader ], [ %inc434551, %for.inc441 ]
%dec435554559 = phi i32 [ %7, %for.body307.preheader ], [ %dec435553, %for.inc441 ]
%dec398556558 = phi i32 [ %5, %for.body307.preheader ], [ %dec398555, %for.inc441 ]
%arrayidx309 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv602
%24 = load i8, ptr %arrayidx309, align 4, !tbaa !11
%cmp312 = icmp eq i8 %24, 65
br i1 %cmp312, label %land.lhs.true314, label %if.else402
land.lhs.true314: ; preds = %for.body307
%arrayidx317 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %indvars.iv602, i64 1
%25 = load i8, ptr %arrayidx317, align 1, !tbaa !11
%cmp319 = icmp eq i8 %25, 66
br i1 %cmp319, label %if.then321, label %if.then365
if.then321: ; preds = %land.lhs.true314
%cmp322 = icmp sgt i32 %dec398556558, %inc434552560
br i1 %cmp322, label %if.then324, label %if.else329
if.then324: ; preds = %if.then321
%arrayidx326 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 1, ptr %arrayidx326, align 4, !tbaa !5
%inc327 = add nsw i32 %inc434552560, 1
store i32 %inc327, ptr %b, align 4, !tbaa !5
%dec328 = add nsw i32 %dec398556558, -1
store i32 %dec328, ptr %a, align 4, !tbaa !5
br label %for.inc441
if.else329: ; preds = %if.then321
%cmp330 = icmp slt i32 %dec398556558, %inc434552560
br i1 %cmp330, label %if.then332, label %if.else337
if.then332: ; preds = %if.else329
%arrayidx334 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 0, ptr %arrayidx334, align 4, !tbaa !5
%inc335 = add nsw i32 %dec398556558, 1
store i32 %inc335, ptr %a, align 4, !tbaa !5
%dec336 = add nsw i32 %inc434552560, -1
store i32 %dec336, ptr %b, align 4, !tbaa !5
br label %for.inc441
if.else337: ; preds = %if.else329
%26 = add nuw nsw i64 %indvars.iv602, 1
%arrayidx340 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %26
%27 = load i8, ptr %arrayidx340, align 4, !tbaa !11
%cmp343 = icmp eq i8 %27, 65
%arrayidx347 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
br i1 %cmp343, label %if.then345, label %if.else350
if.then345: ; preds = %if.else337
store i32 0, ptr %arrayidx347, align 4, !tbaa !5
%inc348 = add nsw i32 %dec398556558, 1
store i32 %inc348, ptr %a, align 4, !tbaa !5
%dec349 = add nsw i32 %inc434552560, -1
store i32 %dec349, ptr %b, align 4, !tbaa !5
br label %for.inc441
if.else350: ; preds = %if.else337
store i32 1, ptr %arrayidx347, align 4, !tbaa !5
%inc353 = add nsw i32 %inc434552560, 1
store i32 %inc353, ptr %b, align 4, !tbaa !5
%dec354 = add nsw i32 %dec398556558, -1
store i32 %dec354, ptr %a, align 4, !tbaa !5
br label %for.inc441
if.then365: ; preds = %land.lhs.true314
%cmp366 = icmp slt i32 %dec398556558, %dec435554559
br i1 %cmp366, label %if.then368, label %if.else373
if.then368: ; preds = %if.then365
%arrayidx370 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 0, ptr %arrayidx370, align 4, !tbaa !5
%inc371 = add nsw i32 %dec398556558, 1
store i32 %inc371, ptr %a, align 4, !tbaa !5
%dec372 = add nsw i32 %dec435554559, -1
store i32 %dec372, ptr %c, align 4, !tbaa !5
br label %for.inc441
if.else373: ; preds = %if.then365
%cmp374 = icmp sgt i32 %dec398556558, %dec435554559
br i1 %cmp374, label %if.then376, label %if.else381
if.then376: ; preds = %if.else373
%arrayidx378 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 2, ptr %arrayidx378, align 4, !tbaa !5
%inc379 = add nsw i32 %dec435554559, 1
store i32 %inc379, ptr %c, align 4, !tbaa !5
%dec380 = add nsw i32 %dec398556558, -1
store i32 %dec380, ptr %a, align 4, !tbaa !5
br label %for.inc441
if.else381: ; preds = %if.else373
%28 = add nuw nsw i64 %indvars.iv602, 1
%arrayidx384 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %28
%29 = load i8, ptr %arrayidx384, align 4, !tbaa !11
%cmp387 = icmp eq i8 %29, 65
%arrayidx391 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
br i1 %cmp387, label %if.then389, label %if.else394
if.then389: ; preds = %if.else381
store i32 0, ptr %arrayidx391, align 4, !tbaa !5
%inc392 = add nsw i32 %dec398556558, 1
store i32 %inc392, ptr %a, align 4, !tbaa !5
%dec393 = add nsw i32 %dec435554559, -1
store i32 %dec393, ptr %c, align 4, !tbaa !5
br label %for.inc441
if.else394: ; preds = %if.else381
store i32 2, ptr %arrayidx391, align 4, !tbaa !5
%inc397 = add nsw i32 %dec435554559, 1
store i32 %inc397, ptr %c, align 4, !tbaa !5
%dec398 = add nsw i32 %dec398556558, -1
store i32 %dec398, ptr %a, align 4, !tbaa !5
br label %for.inc441
if.else402: ; preds = %for.body307
%cmp403 = icmp slt i32 %inc434552560, %dec435554559
br i1 %cmp403, label %if.then405, label %if.else410
if.then405: ; preds = %if.else402
%arrayidx407 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 1, ptr %arrayidx407, align 4, !tbaa !5
%inc408 = add nsw i32 %inc434552560, 1
store i32 %inc408, ptr %b, align 4, !tbaa !5
%dec409 = add nsw i32 %dec435554559, -1
store i32 %dec409, ptr %c, align 4, !tbaa !5
br label %for.inc441
if.else410: ; preds = %if.else402
%cmp411 = icmp sgt i32 %inc434552560, %dec435554559
br i1 %cmp411, label %if.then413, label %if.else418
if.then413: ; preds = %if.else410
%arrayidx415 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
store i32 2, ptr %arrayidx415, align 4, !tbaa !5
%inc416 = add nsw i32 %dec435554559, 1
store i32 %inc416, ptr %c, align 4, !tbaa !5
%dec417 = add nsw i32 %inc434552560, -1
store i32 %dec417, ptr %b, align 4, !tbaa !5
br label %for.inc441
if.else418: ; preds = %if.else410
%30 = add nuw nsw i64 %indvars.iv602, 1
%arrayidx422 = getelementptr inbounds [100005 x [4 x i8]], ptr %s, i64 0, i64 %30, i64 1
%31 = load i8, ptr %arrayidx422, align 1, !tbaa !11
%cmp424 = icmp eq i8 %31, 67
%arrayidx428 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv602
br i1 %cmp424, label %if.then426, label %if.else431
if.then426: ; preds = %if.else418
store i32 2, ptr %arrayidx428, align 4, !tbaa !5
%inc429 = add nsw i32 %dec435554559, 1
store i32 %inc429, ptr %c, align 4, !tbaa !5
%dec430 = add nsw i32 %inc434552560, -1
store i32 %dec430, ptr %b, align 4, !tbaa !5
br label %for.inc441
if.else431: ; preds = %if.else418
store i32 1, ptr %arrayidx428, align 4, !tbaa !5
%inc434 = add nsw i32 %inc434552560, 1
store i32 %inc434, ptr %b, align 4, !tbaa !5
%dec435 = add nsw i32 %dec435554559, -1
store i32 %dec435, ptr %c, align 4, !tbaa !5
br label %for.inc441
for.inc441: ; preds = %if.then332, %if.else350, %if.then345, %if.then324, %if.then405, %if.then426, %if.else431, %if.then413, %if.then368, %if.then389, %if.else394, %if.then376
%dec398555 = phi i32 [ %inc335, %if.then332 ], [ %dec354, %if.else350 ], [ %inc348, %if.then345 ], [ %dec328, %if.then324 ], [ %dec398556558, %if.then405 ], [ %dec398556558, %if.then426 ], [ %dec398556558, %if.else431 ], [ %dec398556558, %if.then413 ], [ %inc371, %if.then368 ], [ %inc392, %if.then389 ], [ %dec398, %if.else394 ], [ %dec380, %if.then376 ]
%dec435553 = phi i32 [ %dec435554559, %if.then332 ], [ %dec435554559, %if.else350 ], [ %dec435554559, %if.then345 ], [ %dec435554559, %if.then324 ], [ %dec409, %if.then405 ], [ %inc429, %if.then426 ], [ %dec435, %if.else431 ], [ %inc416, %if.then413 ], [ %dec372, %if.then368 ], [ %dec393, %if.then389 ], [ %inc397, %if.else394 ], [ %inc379, %if.then376 ]
%inc434551 = phi i32 [ %dec336, %if.then332 ], [ %inc353, %if.else350 ], [ %dec349, %if.then345 ], [ %inc327, %if.then324 ], [ %inc408, %if.then405 ], [ %dec430, %if.then426 ], [ %inc434, %if.else431 ], [ %dec417, %if.then413 ], [ %inc434552560, %if.then368 ], [ %inc434552560, %if.then389 ], [ %inc434552560, %if.else394 ], [ %inc434552560, %if.then376 ]
%indvars.iv.next603 = add nuw nsw i64 %indvars.iv602, 1
%exitcond.not = icmp eq i64 %indvars.iv.next603, %wide.trip.count
br i1 %exitcond.not, label %for.end443, label %for.body307, !llvm.loop !16
for.end443: ; preds = %for.inc441, %if.end297
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
%32 = load i32, ptr %n, align 4, !tbaa !5
%cmp446562 = icmp sgt i32 %32, 0
br i1 %cmp446562, label %for.body448, label %cleanup
for.body448: ; preds = %for.end443, %for.body448
%indvars.iv608 = phi i64 [ %indvars.iv.next609, %for.body448 ], [ 0, %for.end443 ]
%arrayidx450 = getelementptr inbounds [100005 x i32], ptr %ans, i64 0, i64 %indvars.iv608
%33 = load i32, ptr %arrayidx450, align 4, !tbaa !5
%add451 = add nsw i32 %33, 65
%call452 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %add451)
%indvars.iv.next609 = add nuw nsw i64 %indvars.iv608, 1
%34 = load i32, ptr %n, align 4, !tbaa !5
%35 = sext i32 %34 to i64
%cmp446 = icmp slt i64 %indvars.iv.next609, %35
br i1 %cmp446, label %for.body448, label %cleanup, !llvm.loop !17
cleanup.sink.split: ; preds = %for.end278, %if.end62, %for.end
%str.6.sink = phi ptr [ @str.9, %for.end ], [ @str.9, %if.end62 ], [ @str.9, %for.end278 ]
%puts541 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
br label %cleanup
cleanup: ; preds = %for.body448, %for.body288, %for.body169, %cleanup.sink.split, %for.end443, %if.else283, %for.end164
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define int long long
int max(int a, int b){
return a >= b ? a : b;
}
signed main(){
int L, N, i;
scanf("%lld%lld", &L, &N);
int *X = (int *)malloc(sizeof(int) * (N + 2));
int *Y = (int *)malloc(sizeof(int) * (N + 2));
int *SX = (int *)malloc(sizeof(int) * (N + 2));
int *SY = (int *)malloc(sizeof(int) * (N + 2));
for(i = 1; i <= N; i++){
scanf("%lld", &X[i]);
Y[i] = L - X[i];
}
SX[0] = 0;
for(i = 1; i <= N; i++){
SX[i] = SX[i - 1] + X[i];
}
SY[N + 1] = 0;
for(i = N; i >= 1; i--){
SY[i] = SY[i + 1] + Y[i];
}
int l, r, now, ans;
ans = max(X[N], Y[1]);
for(i = 1; i < N; i++){
// printf("i = %lld\n", i);
l = i;
r = N - i;
// k = min(l, r);
// now = 2 * SX[k]
if(l < r){
now = 2 * SX[i];
now += 2 * (SY[i + 1] - SY[i + 1 + l + 1]) - Y[i + 1];
ans = max(ans, now);
// printf("now1 = %lld\n", now);
now = 2 * SX[i] - X[i];
now += 2 * (SY[i + 1] - SY[i + 1 + l]);
ans = max(ans, now);
}
if(l > r){
now = 2 * SY[i + 1];
// printf("now = %lld\n", now);
// printf("test:%lld\n", 2 * (SX[i] - SX[i - r - 1]));
now += 2 * (SX[i] - SX[i - r - 1]) - X[i];
ans = max(ans, now);
// printf("now2 = %lld\n", now);
now = 2 * SY[i + 1] - Y[i + 1];
now += 2 * (SX[i] - SX[i - r]);
ans = max(ans, now);
}
if(l == r){
now = 2 * SX[i];
now += 2 * SY[i + 1] - Y[i + 1];
ans = max(ans, now);
// printf("now3 = %lld\n", now);
now = 2 * SY[i + 1];
now += 2 * SX[i] - X[i];
ans = max(ans, now);
// printf("now4 = %lld\n", now);
}
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%L = alloca i64, align 8
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %L) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%add = shl i64 %0, 3
%mul = add i64 %add, 16
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%call4 = call noalias ptr @malloc(i64 noundef %mul) #7
%call7 = call noalias ptr @malloc(i64 noundef %mul) #7
%call10 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp.not237 = icmp slt i64 %0, 1
br i1 %cmp.not237, label %for.end37.thread, label %for.body
for.body: ; preds = %entry, %for.body
%i.0238 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %call1, i64 %i.0238
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i64, ptr %L, align 8, !tbaa !5
%2 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub = sub nsw i64 %1, %2
%arrayidx13 = getelementptr inbounds i64, ptr %call4, i64 %i.0238
store i64 %sub, ptr %arrayidx13, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.0238, 1
%3 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.0238, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
store i64 0, ptr %call7, align 8, !tbaa !5
%cmp16.not239 = icmp slt i64 %3, 1
br i1 %cmp16.not239, label %for.end37.thread, label %for.body17.preheader
for.body17.preheader: ; preds = %for.end
%load_initial262 = load i64, ptr %call7, align 8
%xtraiter = and i64 %3, 3
%4 = icmp ult i64 %3, 4
br i1 %4, label %for.end25.unr-lcssa, label %for.body17.preheader.new
for.body17.preheader.new: ; preds = %for.body17.preheader
%unroll_iter = and i64 %3, -4
br label %for.body17
for.body17: ; preds = %for.body17, %for.body17.preheader.new
%store_forwarded263 = phi i64 [ %load_initial262, %for.body17.preheader.new ], [ %add21.3, %for.body17 ]
%i.1240 = phi i64 [ 1, %for.body17.preheader.new ], [ %inc24.3, %for.body17 ]
%niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.3, %for.body17 ]
%5 = getelementptr i64, ptr %call7, i64 %i.1240
%arrayidx20 = getelementptr inbounds i64, ptr %call1, i64 %i.1240
%6 = load i64, ptr %arrayidx20, align 8, !tbaa !5
%add21 = add nsw i64 %6, %store_forwarded263
store i64 %add21, ptr %5, align 8, !tbaa !5
%inc24 = add nuw nsw i64 %i.1240, 1
%7 = getelementptr i64, ptr %call7, i64 %inc24
%arrayidx20.1 = getelementptr inbounds i64, ptr %call1, i64 %inc24
%8 = load i64, ptr %arrayidx20.1, align 8, !tbaa !5
%add21.1 = add nsw i64 %8, %add21
store i64 %add21.1, ptr %7, align 8, !tbaa !5
%inc24.1 = add nuw nsw i64 %i.1240, 2
%9 = getelementptr i64, ptr %call7, i64 %inc24.1
%arrayidx20.2 = getelementptr inbounds i64, ptr %call1, i64 %inc24.1
%10 = load i64, ptr %arrayidx20.2, align 8, !tbaa !5
%add21.2 = add nsw i64 %10, %add21.1
store i64 %add21.2, ptr %9, align 8, !tbaa !5
%inc24.2 = add nuw i64 %i.1240, 3
%11 = getelementptr i64, ptr %call7, i64 %inc24.2
%arrayidx20.3 = getelementptr inbounds i64, ptr %call1, i64 %inc24.2
%12 = load i64, ptr %arrayidx20.3, align 8, !tbaa !5
%add21.3 = add nsw i64 %12, %add21.2
store i64 %add21.3, ptr %11, align 8, !tbaa !5
%inc24.3 = add nuw i64 %i.1240, 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.end25.unr-lcssa, label %for.body17, !llvm.loop !11
for.end25.unr-lcssa: ; preds = %for.body17, %for.body17.preheader
%store_forwarded263.unr = phi i64 [ %load_initial262, %for.body17.preheader ], [ %add21.3, %for.body17 ]
%i.1240.unr = phi i64 [ 1, %for.body17.preheader ], [ %inc24.3, %for.body17 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end25, label %for.body17.epil
for.body17.epil: ; preds = %for.end25.unr-lcssa, %for.body17.epil
%store_forwarded263.epil = phi i64 [ %add21.epil, %for.body17.epil ], [ %store_forwarded263.unr, %for.end25.unr-lcssa ]
%i.1240.epil = phi i64 [ %inc24.epil, %for.body17.epil ], [ %i.1240.unr, %for.end25.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body17.epil ], [ 0, %for.end25.unr-lcssa ]
%13 = getelementptr i64, ptr %call7, i64 %i.1240.epil
%arrayidx20.epil = getelementptr inbounds i64, ptr %call1, i64 %i.1240.epil
%14 = load i64, ptr %arrayidx20.epil, align 8, !tbaa !5
%add21.epil = add nsw i64 %14, %store_forwarded263.epil
store i64 %add21.epil, ptr %13, align 8, !tbaa !5
%inc24.epil = add nuw i64 %i.1240.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.end25, label %for.body17.epil, !llvm.loop !12
for.end25: ; preds = %for.body17.epil, %for.end25.unr-lcssa
%15 = getelementptr i64, ptr %call10, i64 %3
%arrayidx27 = getelementptr i64, ptr %15, i64 1
store i64 0, ptr %arrayidx27, align 8, !tbaa !5
%cmp29241 = icmp sgt i64 %3, 0
br i1 %cmp29241, label %for.body30.preheader, label %for.end37.thread
for.body30.preheader: ; preds = %for.end25
%scevgep = getelementptr i8, ptr %call10, i64 8
%16 = shl i64 %3, 3
%scevgep261 = getelementptr i8, ptr %scevgep, i64 %16
%load_initial = load i64, ptr %scevgep261, align 8
%xtraiter264 = and i64 %3, 3
%lcmp.mod265.not = icmp eq i64 %xtraiter264, 0
br i1 %lcmp.mod265.not, label %for.body30.prol.loopexit, label %for.body30.prol
for.body30.prol: ; preds = %for.body30.preheader, %for.body30.prol
%store_forwarded.prol = phi i64 [ %add34.prol, %for.body30.prol ], [ %load_initial, %for.body30.preheader ]
%i.2242.prol = phi i64 [ %dec.prol, %for.body30.prol ], [ %3, %for.body30.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body30.prol ], [ 0, %for.body30.preheader ]
%17 = getelementptr i64, ptr %call10, i64 %i.2242.prol
%arrayidx33.prol = getelementptr inbounds i64, ptr %call4, i64 %i.2242.prol
%18 = load i64, ptr %arrayidx33.prol, align 8, !tbaa !5
%add34.prol = add nsw i64 %18, %store_forwarded.prol
store i64 %add34.prol, ptr %17, align 8, !tbaa !5
%dec.prol = add nsw i64 %i.2242.prol, -1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter264
br i1 %prol.iter.cmp.not, label %for.body30.prol.loopexit, label %for.body30.prol, !llvm.loop !14
for.body30.prol.loopexit: ; preds = %for.body30.prol, %for.body30.preheader
%store_forwarded.unr = phi i64 [ %load_initial, %for.body30.preheader ], [ %add34.prol, %for.body30.prol ]
%i.2242.unr = phi i64 [ %3, %for.body30.preheader ], [ %dec.prol, %for.body30.prol ]
%19 = icmp ult i64 %3, 4
br i1 %19, label %for.end37, label %for.body30
for.body30: ; preds = %for.body30.prol.loopexit, %for.body30
%store_forwarded = phi i64 [ %add34.3, %for.body30 ], [ %store_forwarded.unr, %for.body30.prol.loopexit ]
%i.2242 = phi i64 [ %dec.3, %for.body30 ], [ %i.2242.unr, %for.body30.prol.loopexit ]
%20 = getelementptr i64, ptr %call10, i64 %i.2242
%arrayidx33 = getelementptr inbounds i64, ptr %call4, i64 %i.2242
%21 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%add34 = add nsw i64 %21, %store_forwarded
store i64 %add34, ptr %20, align 8, !tbaa !5
%dec = add nsw i64 %i.2242, -1
%22 = getelementptr i64, ptr %call10, i64 %dec
%arrayidx33.1 = getelementptr inbounds i64, ptr %call4, i64 %dec
%23 = load i64, ptr %arrayidx33.1, align 8, !tbaa !5
%add34.1 = add nsw i64 %23, %add34
store i64 %add34.1, ptr %22, align 8, !tbaa !5
%dec.1 = add nsw i64 %i.2242, -2
%24 = getelementptr i64, ptr %call10, i64 %dec.1
%arrayidx33.2 = getelementptr inbounds i64, ptr %call4, i64 %dec.1
%25 = load i64, ptr %arrayidx33.2, align 8, !tbaa !5
%add34.2 = add nsw i64 %25, %add34.1
store i64 %add34.2, ptr %24, align 8, !tbaa !5
%dec.2 = add nsw i64 %i.2242, -3
%26 = getelementptr i64, ptr %call10, i64 %dec.2
%arrayidx33.3 = getelementptr inbounds i64, ptr %call4, i64 %dec.2
%27 = load i64, ptr %arrayidx33.3, align 8, !tbaa !5
%add34.3 = add nsw i64 %27, %add34.2
store i64 %add34.3, ptr %26, align 8, !tbaa !5
%dec.3 = add nsw i64 %i.2242, -4
%cmp29.3 = icmp ugt i64 %dec.2, 1
br i1 %cmp29.3, label %for.body30, label %for.end37, !llvm.loop !15
for.end37.thread: ; preds = %for.end, %entry, %for.end25
%.lcssa251255.ph = phi i64 [ %3, %for.end25 ], [ %3, %for.end ], [ %0, %entry ]
%arrayidx38257 = getelementptr inbounds i64, ptr %call1, i64 %.lcssa251255.ph
%28 = load i64, ptr %arrayidx38257, align 8, !tbaa !5
%arrayidx39258 = getelementptr inbounds i64, ptr %call4, i64 1
%29 = load i64, ptr %arrayidx39258, align 8, !tbaa !5
%cond.i259 = call i64 @llvm.smax.i64(i64 %28, i64 %29)
br label %for.end127
for.end37: ; preds = %for.body30, %for.body30.prol.loopexit
%arrayidx38 = getelementptr inbounds i64, ptr %call1, i64 %3
%30 = load i64, ptr %arrayidx38, align 8, !tbaa !5
%arrayidx39 = getelementptr inbounds i64, ptr %call4, i64 1
%31 = load i64, ptr %arrayidx39, align 8, !tbaa !5
%cond.i = call i64 @llvm.smax.i64(i64 %30, i64 %31)
%cmp42243 = icmp sgt i64 %3, 1
br i1 %cmp42243, label %for.body43, label %for.end127
for.body43: ; preds = %for.end37, %for.inc125
%ans.0245 = phi i64 [ %ans.3, %for.inc125 ], [ %cond.i, %for.end37 ]
%i.3244 = phi i64 [ %inc126.pre-phi, %for.inc125 ], [ 1, %for.end37 ]
%sub44 = sub nsw i64 %3, %i.3244
%cmp45 = icmp slt i64 %i.3244, %sub44
br i1 %cmp45, label %if.then, label %if.end
if.then: ; preds = %for.body43
%arrayidx46 = getelementptr inbounds i64, ptr %call7, i64 %i.3244
%32 = load i64, ptr %arrayidx46, align 8, !tbaa !5
%mul47 = shl nsw i64 %32, 1
%add48 = add nuw nsw i64 %i.3244, 1
%arrayidx49 = getelementptr i64, ptr %call10, i64 %add48
%33 = load i64, ptr %arrayidx49, align 8, !tbaa !5
%34 = getelementptr i64, ptr %arrayidx49, i64 %i.3244
%arrayidx53 = getelementptr i64, ptr %34, i64 1
%35 = load i64, ptr %arrayidx53, align 8, !tbaa !5
%sub54 = sub nsw i64 %33, %35
%mul55 = shl nsw i64 %sub54, 1
%arrayidx57 = getelementptr inbounds i64, ptr %call4, i64 %add48
%36 = load i64, ptr %arrayidx57, align 8, !tbaa !5
%sub58 = sub i64 %mul47, %36
%add59 = add i64 %sub58, %mul55
%cond.i226 = call i64 @llvm.smax.i64(i64 %ans.0245, i64 %add59)
%arrayidx63 = getelementptr inbounds i64, ptr %call1, i64 %i.3244
%37 = load i64, ptr %arrayidx63, align 8, !tbaa !5
%sub64 = sub i64 %mul47, %37
%38 = load i64, ptr %34, align 8, !tbaa !5
%sub70 = sub nsw i64 %33, %38
%mul71 = shl nsw i64 %sub70, 1
%add72 = add nsw i64 %sub64, %mul71
%cond.i227 = call i64 @llvm.smax.i64(i64 %cond.i226, i64 %add72)
br label %if.end
if.end: ; preds = %if.then, %for.body43
%ans.1 = phi i64 [ %cond.i227, %if.then ], [ %ans.0245, %for.body43 ]
%cmp74 = icmp sgt i64 %i.3244, %sub44
br i1 %cmp74, label %if.then75, label %if.end102
if.then75: ; preds = %if.end
%add76 = add nuw nsw i64 %i.3244, 1
%arrayidx77 = getelementptr inbounds i64, ptr %call10, i64 %add76
%39 = load i64, ptr %arrayidx77, align 8, !tbaa !5
%mul78 = shl nsw i64 %39, 1
%arrayidx79 = getelementptr inbounds i64, ptr %call7, i64 %i.3244
%40 = load i64, ptr %arrayidx79, align 8, !tbaa !5
%sub80 = sub nsw i64 %i.3244, %sub44
%41 = getelementptr i64, ptr %call7, i64 %sub80
%arrayidx82 = getelementptr i64, ptr %41, i64 -1
%42 = load i64, ptr %arrayidx82, align 8, !tbaa !5
%sub83 = sub nsw i64 %40, %42
%mul84 = shl nsw i64 %sub83, 1
%arrayidx85 = getelementptr inbounds i64, ptr %call1, i64 %i.3244
%43 = load i64, ptr %arrayidx85, align 8, !tbaa !5
%sub86 = sub i64 %mul78, %43
%add87 = add i64 %sub86, %mul84
%cond.i228 = call i64 @llvm.smax.i64(i64 %ans.1, i64 %add87)
%arrayidx93 = getelementptr inbounds i64, ptr %call4, i64 %add76
%44 = load i64, ptr %arrayidx93, align 8, !tbaa !5
%sub94 = sub i64 %mul78, %44
%45 = load i64, ptr %41, align 8, !tbaa !5
%sub98 = sub nsw i64 %40, %45
%mul99 = shl nsw i64 %sub98, 1
%add100 = add nsw i64 %sub94, %mul99
%cond.i229 = call i64 @llvm.smax.i64(i64 %cond.i228, i64 %add100)
br label %if.end102
if.end102: ; preds = %if.then75, %if.end
%ans.2 = phi i64 [ %cond.i229, %if.then75 ], [ %ans.1, %if.end ]
%cmp103 = icmp eq i64 %i.3244, %sub44
br i1 %cmp103, label %if.then104, label %if.end102.for.inc125_crit_edge
if.end102.for.inc125_crit_edge: ; preds = %if.end102
%.pre = add nuw nsw i64 %i.3244, 1
br label %for.inc125
if.then104: ; preds = %if.end102
%arrayidx105 = getelementptr inbounds i64, ptr %call7, i64 %i.3244
%46 = load i64, ptr %arrayidx105, align 8, !tbaa !5
%mul106 = shl nsw i64 %46, 1
%add107 = add nuw nsw i64 %i.3244, 1
%arrayidx108 = getelementptr inbounds i64, ptr %call10, i64 %add107
%47 = load i64, ptr %arrayidx108, align 8, !tbaa !5
%mul109 = shl nsw i64 %47, 1
%arrayidx111 = getelementptr inbounds i64, ptr %call4, i64 %add107
%48 = load i64, ptr %arrayidx111, align 8, !tbaa !5
%sub112 = sub i64 %mul106, %48
%add113 = add i64 %sub112, %mul109
%cond.i230 = call i64 @llvm.smax.i64(i64 %ans.2, i64 %add113)
%arrayidx120 = getelementptr inbounds i64, ptr %call1, i64 %i.3244
%49 = load i64, ptr %arrayidx120, align 8, !tbaa !5
%sub121 = add i64 %mul109, %mul106
%add122 = sub i64 %sub121, %49
%cond.i231 = call i64 @llvm.smax.i64(i64 %cond.i230, i64 %add122)
br label %for.inc125
for.inc125: ; preds = %if.end102.for.inc125_crit_edge, %if.then104
%inc126.pre-phi = phi i64 [ %.pre, %if.end102.for.inc125_crit_edge ], [ %add107, %if.then104 ]
%ans.3 = phi i64 [ %ans.2, %if.end102.for.inc125_crit_edge ], [ %cond.i231, %if.then104 ]
%exitcond248.not = icmp eq i64 %inc126.pre-phi, %3
br i1 %exitcond248.not, label %for.end127, label %for.body43, !llvm.loop !16
for.end127: ; preds = %for.inc125, %for.end37.thread, %for.end37
%ans.0.lcssa = phi i64 [ %cond.i, %for.end37 ], [ %cond.i259, %for.end37.thread ], [ %ans.3, %for.inc125 ]
%call128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %L) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
int n,m,i,j,k,a[100][100];
scanf("%d %d",&n,&m);
for(i=1;i<=n;++i)
{
for(j=1;j<=m;++j)
{
scanf("%d",&a[i][j]);
}
}
int flag=4;
for(j=1;j<=m;++j)
{
if(a[1][j]==1)
{
flag=2;
break;
}
}
for(j=1;j<=n;++j)
{
if(a[j][1]==1)
{
flag=2;
break;
}
}
for(j=1;j<=n;++j)
{
if(a[j][m]==1||a[j][1]==1)
{
flag=2;
break;
}
}
for(j=1;j<=m;++j)
{
if(a[n][j]==1||a[1][j]==1)
{
flag=2;
break;
}
}
if(a[1][1]==1||a[1][m]==1||a[n][1]==1||a[n][m]==1)
flag=1;
printf("%d\n",flag);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_34046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_34046/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [100 x [100 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 40000, ptr nonnull %a) #3
%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
%cmp.not110 = icmp slt i32 %0, 1
%.pre155 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp.not110, label %for.cond10.preheader, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp slt i32 %.pre155, 1
br i1 %1, label %for.body22.preheader, label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %8, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %9, %for.inc7 ], [ %.pre155, %for.cond1.preheader.lr.ph ]
%indvars.iv134 = phi i64 [ %indvars.iv.next135, %for.inc7 ], [ 1, %for.cond1.preheader.lr.ph ]
%cmp2.not108 = icmp slt i32 %3, 1
br i1 %cmp2.not108, label %for.inc7, label %for.body3
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %.pre155, %entry ], [ %9, %for.inc7 ]
%.lcssa107 = phi i32 [ %0, %entry ], [ %8, %for.inc7 ]
%cmp11.not112 = icmp slt i32 %4, 1
br i1 %cmp11.not112, label %for.end19, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond10.preheader
%5 = add nuw i32 %4, 1
%wide.trip.count = zext i32 %5 to i64
br label %for.body12
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv134, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %7
br i1 %cmp2.not.not, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%8 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%9 = phi i32 [ %6, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
%10 = sext i32 %8 to i64
%cmp.not.not = icmp slt i64 %indvars.iv134, %10
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond10: ; preds = %for.body12
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count
br i1 %exitcond.not, label %for.end19, label %for.body12, !llvm.loop !13
for.body12: ; preds = %for.body12.preheader, %for.cond10
%indvars.iv137 = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next138, %for.cond10 ]
%arrayidx15 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv137
%11 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %11, 1
br i1 %cmp16, label %for.end19, label %for.cond10
for.end19: ; preds = %for.cond10, %for.body12, %for.cond10.preheader
%cmp11.not112159 = phi i1 [ true, %for.cond10.preheader ], [ %cmp11.not112, %for.body12 ], [ %cmp11.not112, %for.cond10 ]
%flag.0 = phi i32 [ 4, %for.cond10.preheader ], [ 4, %for.cond10 ], [ 2, %for.body12 ]
%cmp21.not118 = icmp slt i32 %.lcssa107, 1
br i1 %cmp21.not118, label %for.end31.thread, label %for.body22.preheader
for.end31.thread: ; preds = %for.end19
%idxprom52177 = sext i32 %.lcssa107 to i64
br i1 %cmp11.not112159, label %for.end66, label %for.body51.preheader
for.body22.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.end19
%flag.0168 = phi i32 [ %flag.0, %for.end19 ], [ 4, %for.cond1.preheader.lr.ph ]
%12 = phi i32 [ %4, %for.end19 ], [ %.pre155, %for.cond1.preheader.lr.ph ]
%.lcssa107158166 = phi i32 [ %.lcssa107, %for.end19 ], [ %0, %for.cond1.preheader.lr.ph ]
%cmp11.not112159164 = phi i1 [ %cmp11.not112159, %for.end19 ], [ true, %for.cond1.preheader.lr.ph ]
%13 = add nuw i32 %.lcssa107158166, 1
%wide.trip.count143 = zext i32 %13 to i64
br label %for.body22
for.cond20: ; preds = %for.body22
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%exitcond144.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count143
br i1 %exitcond144.not, label %for.body34.lr.ph, label %for.body22, !llvm.loop !14
for.body22: ; preds = %for.body22.preheader, %for.cond20
%indvars.iv140 = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next141, %for.cond20 ]
%arrayidx25 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv140, i64 1
%14 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26 = icmp eq i32 %14, 1
br i1 %cmp26, label %for.body34.lr.ph, label %for.cond20
for.body34.lr.ph: ; preds = %for.body22, %for.cond20
%flag.1 = phi i32 [ %flag.0168, %for.cond20 ], [ 2, %for.body22 ]
%idxprom37 = sext i32 %12 to i64
%15 = add i32 %.lcssa107158166, 1
%wide.trip.count148 = zext i32 %15 to i64
br label %for.body34
for.cond32: ; preds = %lor.lhs.false
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
br i1 %exitcond149.not, label %for.end48, label %for.body34, !llvm.loop !15
for.body34: ; preds = %for.body34.lr.ph, %for.cond32
%indvars.iv145 = phi i64 [ 1, %for.body34.lr.ph ], [ %indvars.iv.next146, %for.cond32 ]
%arrayidx38 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv145, i64 %idxprom37
%16 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%cmp39 = icmp eq i32 %16, 1
br i1 %cmp39, label %for.end48, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body34
%arrayidx42 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv145, i64 1
%17 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp eq i32 %17, 1
br i1 %cmp43, label %for.end48, label %for.cond32
for.end48: ; preds = %for.cond32, %lor.lhs.false, %for.body34
%flag.2 = phi i32 [ 2, %for.body34 ], [ 2, %lor.lhs.false ], [ %flag.1, %for.cond32 ]
%idxprom52 = sext i32 %.lcssa107158166 to i64
br i1 %cmp11.not112159164, label %for.end66, label %for.body51.preheader
for.body51.preheader: ; preds = %for.end31.thread, %for.end48
%idxprom52179 = phi i64 [ %idxprom52177, %for.end31.thread ], [ %idxprom52, %for.end48 ]
%flag.2178 = phi i32 [ %flag.0, %for.end31.thread ], [ %flag.2, %for.end48 ]
%18 = phi i32 [ %4, %for.end31.thread ], [ %12, %for.end48 ]
%19 = add i32 %18, 1
%wide.trip.count153 = zext i32 %19 to i64
br label %for.body51
for.cond49: ; preds = %lor.lhs.false57
%indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
%exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
br i1 %exitcond154.not, label %for.end66, label %for.body51, !llvm.loop !16
for.body51: ; preds = %for.body51.preheader, %for.cond49
%indvars.iv150 = phi i64 [ 1, %for.body51.preheader ], [ %indvars.iv.next151, %for.cond49 ]
%arrayidx55 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom52179, i64 %indvars.iv150
%20 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%cmp56 = icmp eq i32 %20, 1
br i1 %cmp56, label %for.end66, label %lor.lhs.false57
lor.lhs.false57: ; preds = %for.body51
%arrayidx60 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv150
%21 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%cmp61 = icmp eq i32 %21, 1
br i1 %cmp61, label %for.end66, label %for.cond49
for.end66: ; preds = %for.cond49, %lor.lhs.false57, %for.body51, %for.end31.thread, %for.end48
%idxprom52180 = phi i64 [ %idxprom52, %for.end48 ], [ %idxprom52177, %for.end31.thread ], [ %idxprom52179, %for.body51 ], [ %idxprom52179, %lor.lhs.false57 ], [ %idxprom52179, %for.cond49 ]
%22 = phi i32 [ %12, %for.end48 ], [ %4, %for.end31.thread ], [ %18, %for.body51 ], [ %18, %lor.lhs.false57 ], [ %18, %for.cond49 ]
%flag.3 = phi i32 [ %flag.2, %for.end48 ], [ %flag.0, %for.end31.thread ], [ %flag.2178, %for.cond49 ], [ 2, %lor.lhs.false57 ], [ 2, %for.body51 ]
%arrayidx68 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 1, i64 1
%23 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%cmp69 = icmp eq i32 %23, 1
br i1 %cmp69, label %if.then86, label %lor.lhs.false70
lor.lhs.false70: ; preds = %for.end66
%idxprom72 = sext i32 %22 to i64
%arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 1, i64 %idxprom72
%24 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%cmp74 = icmp eq i32 %24, 1
br i1 %cmp74, label %if.then86, label %lor.lhs.false75
lor.lhs.false75: ; preds = %lor.lhs.false70
%arrayidx78 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom52180, i64 1
%25 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%cmp79 = icmp eq i32 %25, 1
br i1 %cmp79, label %if.then86, label %lor.lhs.false80
lor.lhs.false80: ; preds = %lor.lhs.false75
%arrayidx84 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom52180, i64 %idxprom72
%26 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%cmp85 = icmp eq i32 %26, 1
br i1 %cmp85, label %if.then86, label %if.end87
if.then86: ; preds = %lor.lhs.false80, %lor.lhs.false75, %lor.lhs.false70, %for.end66
br label %if.end87
if.end87: ; preds = %if.then86, %lor.lhs.false80
%flag.4 = phi i32 [ 1, %if.then86 ], [ %flag.3, %lor.lhs.false80 ]
%call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %flag.4)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #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"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
int main(void) {
int W ,H ,x ,y ,r;
scanf("%d %d %d %d %d",&W ,&H ,&x ,&y ,&r);
if(0<=x-r && x+r<=W && 0<=y-r && y+r<=H){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340502/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340502/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %add, %2
br i1 %cmp1.not, label %if.else, label %land.lhs.true2
land.lhs.true2: ; preds = %land.lhs.true
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %3, %1
br i1 %cmp4.not, label %if.else, label %land.lhs.true5
land.lhs.true5: ; preds = %land.lhs.true2
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp7.not = icmp sgt i32 %add6, %4
br i1 %cmp7.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true5, %land.lhs.true2, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true5, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int width, height, x, y, r;
scanf("%d %d %d %d %d", &width, &height, &x, &y, &r);
if((x - r) < 0 || (x + r) > width || (y - r) < 0 || (y + r) > height){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340546/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340546/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%width = alloca i32, align 4
%height = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %width, ptr noundef nonnull %height, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %width, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %add, %2
br i1 %cmp1, label %if.end, label %lor.lhs.false2
lor.lhs.false2: ; preds = %lor.lhs.false
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4 = icmp slt i32 %3, %1
br i1 %cmp4, label %if.end, label %lor.lhs.false5
lor.lhs.false5: ; preds = %lor.lhs.false2
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %height, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %add6, %4
%spec.select = select i1 %cmp7, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false5, %entry, %lor.lhs.false, %lor.lhs.false2
%str.sink = phi ptr [ @str.3, %lor.lhs.false2 ], [ @str.3, %lor.lhs.false ], [ @str.3, %entry ], [ %spec.select, %lor.lhs.false5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %height) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int w,h,x,y,r;
scanf("%d %d %d %d %d",&w,&h,&x,&y,&r);
if(x+r>w||x-r<0||y+r>h||y-r<0)
printf("No\n");
else printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340597/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340597/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %w, align 4, !tbaa !5
%cmp = icmp sgt i32 %add, %2
%cmp1 = icmp slt i32 %0, %1
%or.cond = or i1 %cmp1, %cmp
br i1 %or.cond, label %if.end, label %lor.lhs.false2
lor.lhs.false2: ; preds = %entry
%3 = load i32, ptr %y, align 4, !tbaa !5
%add3 = add nsw i32 %3, %1
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %add3, %4
%cmp7 = icmp slt i32 %3, %1
%or.cond11 = or i1 %cmp7, %cmp4
%spec.select = select i1 %or.cond11, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false2, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %lor.lhs.false2 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int W,H;
int x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(H<y+r) puts("No");
else if(0>y-r) puts("No");
else if(W<x+r) puts("No");
else if(0>x-r) puts("No");
else puts("Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340654/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340654/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%2 = load i32, ptr %r, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%cmp = icmp slt i32 %0, %add
%cmp2 = icmp slt i32 %1, %2
%or.cond = or i1 %cmp, %cmp2
br i1 %or.cond, label %if.end19, label %if.else5
if.else5: ; preds = %entry
%3 = load i32, ptr %W, align 4, !tbaa !5
%4 = load i32, ptr %x, align 4, !tbaa !5
%add6 = add nsw i32 %4, %2
%cmp7 = icmp slt i32 %3, %add6
br i1 %cmp7, label %if.end19, label %if.else10
if.else10: ; preds = %if.else5
%cmp12 = icmp slt i32 %4, %2
%.str.1..str.2 = select i1 %cmp12, ptr @.str.1, ptr @.str.2
br label %if.end19
if.end19: ; preds = %if.else10, %if.else5, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.else5 ], [ %.str.1..str.2, %if.else10 ]
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int W, H, x, y, r;
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
if((((x-r) < 0) || ((x+r) > W)) || (((y-r)< 0) || ((y+r) > H))){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340698/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340698/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %add, %2
br i1 %cmp1, label %if.end, label %lor.lhs.false2
lor.lhs.false2: ; preds = %lor.lhs.false
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4 = icmp slt i32 %3, %1
br i1 %cmp4, label %if.end, label %lor.lhs.false5
lor.lhs.false5: ; preds = %lor.lhs.false2
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %add6, %4
%spec.select = select i1 %cmp7, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false5, %entry, %lor.lhs.false, %lor.lhs.false2
%str.sink = phi ptr [ @str.3, %lor.lhs.false2 ], [ @str.3, %lor.lhs.false ], [ @str.3, %entry ], [ %spec.select, %lor.lhs.false5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(W>=x+r && H>=y+r && x>0 && y>0)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %W, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4
%2 = load i32, ptr %r, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%cmp.not = icmp slt i32 %0, %add
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%3 = load i32, ptr %H, align 4, !tbaa !5
%4 = load i32, ptr %y, align 4
%add1 = add nsw i32 %4, %2
%cmp2 = icmp sge i32 %3, %add1
%cmp4 = icmp sgt i32 %1, 0
%or.cond = and i1 %cmp4, %cmp2
%cmp6 = icmp sgt i32 %4, 0
%or.cond9 = and i1 %cmp6, %or.cond
br i1 %or.cond9, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int W, H, x, y, r;
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
if(( x >= r && x + r <= W ) && ( y >= r && y + r <= H )){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %add, %2
br i1 %cmp1.not, label %if.else, label %land.lhs.true2
land.lhs.true2: ; preds = %land.lhs.true
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp3.not = icmp slt i32 %3, %1
br i1 %cmp3.not, label %if.else, label %land.lhs.true4
land.lhs.true4: ; preds = %land.lhs.true2
%add5 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %add5, %4
br i1 %cmp6.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true4, %land.lhs.true2, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true4, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true4 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(x-r>=0 && x+r<=W && y-r>=0 && y+r<=H){
printf("Yes\n");
}
if(x-r<0||x+r>W||y-r<0||y+r>H){
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340834/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340834/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.end, label %land.lhs.true
land.lhs.true: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %add, %2
br i1 %cmp1.not, label %if.end, label %land.lhs.true2
land.lhs.true2: ; preds = %land.lhs.true
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %3, %1
br i1 %cmp4.not, label %if.end, label %land.lhs.true5
land.lhs.true5: ; preds = %land.lhs.true2
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp7.not = icmp sgt i32 %add6, %4
br i1 %cmp7.not, label %if.end, label %if.then
if.then: ; preds = %land.lhs.true5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %x, align 4, !tbaa !5
%.pre23 = load i32, ptr %r, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %land.lhs.true5, %land.lhs.true2, %land.lhs.true, %entry
%5 = phi i32 [ %.pre23, %if.then ], [ %1, %land.lhs.true5 ], [ %1, %land.lhs.true2 ], [ %1, %land.lhs.true ], [ %1, %entry ]
%6 = phi i32 [ %.pre, %if.then ], [ %0, %land.lhs.true5 ], [ %0, %land.lhs.true2 ], [ %0, %land.lhs.true ], [ %0, %entry ]
%cmp10 = icmp slt i32 %6, %5
br i1 %cmp10, label %if.then19, label %lor.lhs.false
lor.lhs.false: ; preds = %if.end
%add11 = add nsw i32 %5, %6
%7 = load i32, ptr %W, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %add11, %7
br i1 %cmp12, label %if.then19, label %lor.lhs.false13
lor.lhs.false13: ; preds = %lor.lhs.false
%8 = load i32, ptr %y, align 4, !tbaa !5
%cmp15 = icmp slt i32 %8, %5
br i1 %cmp15, label %if.then19, label %lor.lhs.false16
lor.lhs.false16: ; preds = %lor.lhs.false13
%add17 = add nsw i32 %8, %5
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %add17, %9
br i1 %cmp18, label %if.then19, label %if.end21
if.then19: ; preds = %lor.lhs.false16, %lor.lhs.false13, %lor.lhs.false, %if.end
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %if.end21
if.end21: ; preds = %if.then19, %lor.lhs.false16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int w,h,x,y,r,a;
scanf("%d%d%d%d%d",&w,&h,&x,&y,&r);
a=0;
if(x-r<0){
a+=1;
}
if(y-r<0){
a+=1;
}
if(y+r>h){
a+=1;
}
if(x+r>w){
a+=1;
}
if(a==0){
printf("Yes\n");
}
if(a>0){
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340885/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340885/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%spec.select = zext i1 %cmp to i32
%2 = load i32, ptr %y, align 4, !tbaa !5
%cmp2 = icmp slt i32 %2, %1
%add4 = select i1 %cmp, i32 2, i32 1
%a.1 = select i1 %cmp2, i32 %add4, i32 %spec.select
%add6 = add nsw i32 %2, %1
%3 = load i32, ptr %h, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %add6, %3
%add9 = zext i1 %cmp7 to i32
%a.2 = add nuw nsw i32 %a.1, %add9
%add11 = add nsw i32 %1, %0
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %add11, %4
%add14.neg = sext i1 %cmp12 to i32
%cmp16 = icmp eq i32 %a.2, %add14.neg
%str.str.3 = select i1 %cmp16, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(x>=W || x<=0){
printf("No\n");
}else if(y>=H || y<=0){
printf("No\n");
}else if(x+r>W || x-r<0){
printf("No\n");
}else if(y+r>H || y-r<0){
printf("No\n");
}else
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340928/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340928/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4
%1 = load i32, ptr %W, align 4, !tbaa !5
%cmp = icmp sge i32 %0, %1
%cmp1 = icmp slt i32 %0, 1
%or.cond = or i1 %cmp1, %cmp
br i1 %or.cond, label %if.end26, label %if.else
if.else: ; preds = %entry
%2 = load i32, ptr %y, align 4
%3 = load i32, ptr %H, align 4, !tbaa !5
%cmp3 = icmp sge i32 %2, %3
%cmp5 = icmp slt i32 %2, 1
%or.cond27 = or i1 %cmp5, %cmp3
br i1 %or.cond27, label %if.end26, label %if.else8
if.else8: ; preds = %if.else
%4 = load i32, ptr %r, align 4, !tbaa !5
%add = add nsw i32 %4, %0
%cmp9 = icmp sgt i32 %add, %1
%cmp11 = icmp slt i32 %0, %4
%or.cond35 = or i1 %cmp11, %cmp9
br i1 %or.cond35, label %if.end26, label %if.else14
if.else14: ; preds = %if.else8
%add15 = add nsw i32 %4, %2
%cmp16 = icmp sgt i32 %add15, %3
%cmp19 = icmp slt i32 %2, %4
%or.cond36 = or i1 %cmp19, %cmp16
%str.3.str = select i1 %or.cond36, ptr @str.6, ptr @str
br label %if.end26
if.end26: ; preds = %if.else14, %if.else8, %if.else, %entry
%str.5.sink = phi ptr [ @str.6, %entry ], [ @str.6, %if.else ], [ @str.6, %if.else8 ], [ %str.3.str, %if.else14 ]
%puts33 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(x-r>=0&&x+r<=W&&y-r>=0&&y+r<=H){
printf("Yes\n");
}
else {
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_340971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_340971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %add, %2
br i1 %cmp1.not, label %if.else, label %land.lhs.true2
land.lhs.true2: ; preds = %land.lhs.true
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %3, %1
br i1 %cmp4.not, label %if.else, label %land.lhs.true5
land.lhs.true5: ; preds = %land.lhs.true2
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp7.not = icmp sgt i32 %add6, %4
br i1 %cmp7.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true5, %land.lhs.true2, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true5, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void)
{
int W, H, x, y, r;
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
if(x<0||y<0)
{
printf("No\n");
}
else
{
if(r>x||r>y)
{
printf("No\n");
}
else
{
if((r+x)<=W && (r+y)<=H)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_341020/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_341020/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp1 = icmp slt i32 %1, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.end17, label %if.else
if.else: ; preds = %entry
%2 = load i32, ptr %r, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %2, %0
%cmp5 = icmp sgt i32 %2, %1
%or.cond23 = select i1 %cmp3, i1 true, i1 %cmp5
br i1 %or.cond23, label %if.end17, label %if.else8
if.else8: ; preds = %if.else
%add = add nsw i32 %2, %0
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp9.not = icmp sgt i32 %add, %3
br i1 %cmp9.not, label %if.else14, label %land.lhs.true
land.lhs.true: ; preds = %if.else8
%add10 = add nsw i32 %2, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp11.not = icmp sgt i32 %add10, %4
br i1 %cmp11.not, label %if.else14, label %if.end17
if.else14: ; preds = %land.lhs.true, %if.else8
br label %if.end17
if.end17: ; preds = %land.lhs.true, %if.else, %entry, %if.else14
%str.4.sink = phi ptr [ @str.5, %if.else14 ], [ @str.5, %entry ], [ @str.5, %if.else ], [ @str.3, %land.lhs.true ]
%puts21 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(!(-100<=x&&x<=100)){
return 0;
}
if(!(-100<=x&&x<=100)){
return 0;
}
if(!(-100<=y&&y<=100)){
return 0;
}
if(!(0<W&&W<=100)){
return 0;
}
if(!(0<H&&x<=100)){
return 0;
}
if(!(0<r&&r<=100)){
return 0;
}
if(y+r<=H && y-r>=0 && x+r<=W && x-r>=0){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_341071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_341071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4
%1 = add i32 %0, 100
%or.cond = icmp ult i32 %1, 201
br i1 %or.cond, label %if.end6, label %cleanup
if.end6: ; preds = %entry
%2 = load i32, ptr %y, align 4
%3 = add i32 %2, 100
%or.cond45 = icmp ult i32 %3, 201
br i1 %or.cond45, label %if.end11, label %cleanup
if.end11: ; preds = %if.end6
%4 = load i32, ptr %W, align 4
%5 = add i32 %4, -1
%or.cond46 = icmp ult i32 %5, 100
br i1 %or.cond46, label %if.end16, label %cleanup
if.end16: ; preds = %if.end11
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %6, 0
br i1 %cmp17, label %if.end21, label %cleanup
if.end21: ; preds = %if.end16
%7 = load i32, ptr %r, align 4
%8 = add i32 %7, -1
%or.cond48 = icmp ult i32 %8, 100
br i1 %or.cond48, label %if.end26, label %cleanup
if.end26: ; preds = %if.end21
%add = add nsw i32 %7, %2
%cmp27.not = icmp sgt i32 %add, %6
%cmp29.not = icmp slt i32 %2, %7
%or.cond54 = or i1 %cmp29.not, %cmp27.not
%add31 = add nsw i32 %7, %0
%cmp32.not = icmp sgt i32 %add31, %4
%or.cond55 = select i1 %or.cond54, i1 true, i1 %cmp32.not
%cmp35.not = icmp slt i32 %0, %7
%or.cond56 = or i1 %cmp35.not, %or.cond55
%str.str.3 = select i1 %or.cond56, ptr @str, ptr @str.3
%puts53 = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
br label %cleanup
cleanup: ; preds = %if.end26, %if.end21, %if.end16, %if.end11, %if.end6, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int W, H, x, y, r;
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
if ((x - r) < 0 || (x + r) > W) {
puts("No");
} else if ((y - r) < 0 || (y + r) > H) {
puts("No");
} else {
puts("Yes");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_341114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_341114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end12, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%add = add nsw i32 %1, %0
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %add, %2
br i1 %cmp1, label %if.end12, label %if.else
if.else: ; preds = %lor.lhs.false
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4 = icmp slt i32 %3, %1
br i1 %cmp4, label %if.end12, label %lor.lhs.false5
lor.lhs.false5: ; preds = %if.else
%add6 = add nsw i32 %3, %1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %add6, %4
%spec.select = select i1 %cmp7, ptr @.str.1, ptr @.str.2
br label %if.end12
if.end12: ; preds = %lor.lhs.false5, %if.else, %entry, %lor.lhs.false
%.str.1.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ @.str.1, %if.else ], [ %spec.select, %lor.lhs.false5 ]
%call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void)
{
int W,H,x,y,r;
scanf("%d""%d""%d""%d""%d",&W,&H,&x,&y,&r);
if(r <= x&&r <= y&&x+r <= W&&y+r <= H){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_341158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_341158/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %y, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %0, %2
br i1 %cmp1.not, label %if.else, label %land.lhs.true2
land.lhs.true2: ; preds = %land.lhs.true
%add = add nsw i32 %1, %0
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %add, %3
br i1 %cmp3.not, label %if.else, label %land.lhs.true4
land.lhs.true4: ; preds = %land.lhs.true2
%add5 = add nsw i32 %2, %0
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %add5, %4
br i1 %cmp6.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true4, %land.lhs.true2, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true4, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true4 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
Subsets and Splits