Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(){
int i,j,H,W;
while(1){
scanf("%d %d",&H,&W);
if(H==0&&W==0) break;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if((i+j)%2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225226/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225226/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp225 = icmp sgt i32 %2, 0
br i1 %cmp225, label %for.cond3.preheader, label %for.end14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.026 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.024 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.024, %i.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.024, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
/* .................... compiled by alankar....................
*/
//......................SHORTCUTS..............................
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
//...........................................................
#define pi 3.14159265358979323846 //float type
#define MAX 100000 //for rmq
#define SQRTMAX 317 //for rmq
//#define gc getchar_unlocked
#define FOR(i,a,b) for(i=(a);i<(b);i++)
//only for +ve and single terms
#define s(x) scanf("%d",&x);
#define sl(x) scanf("%lld",&x);
#define p(x) printf("%d\n",x);
#define pl(x) printf("%lld\n",x);
//..........................................................
typedef long long int ll;
const ll MOD=1000000007;
//returns int and +ve numbers
/*inline int inp(){
int n=0;
char c;
c=gc();
while(c<'0' || c>'9'){
c=gc();
}
while(c>='0' && c<='9'){
n=(n<<3)+(n<<1)+c-'0';
c=gc();
}
return n;
}
*/
//...................................
//power with mod........long long int
ll power(ll a,ll b,ll mod){
if(b==0)
return 1;
ll temp=power(a,b/2,mod);
temp=(temp*temp)%mod;
if(b&1)
temp=(temp*a)%mod;
return temp;
}
//power without mod........ int
int pwr(int a,int b){
if(b==0)
return 1;
int temp=pwr(a,b/2);
temp=(temp*temp);
if(b&1)
temp=(temp*a);
return temp;
}
// .....long long int
ll gcd(ll a,ll b){
return b==0?a:gcd(b,a%b);
}
//......long long int
ll lcm(ll a,ll b){
return (a/gcd(a,b))*b;
}
//......long long int with mod
ll modularInverse(ll a,ll m){
return power(a,m-2,m);
}
//only for int
int min(int a,int b) { return a<b? a : b; }
//inline int max(int a,int b) { return a>b? a : b; }
//normal compare func on integers //for qsort(name,size,sizeof(type),compare)
int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
//.......................................................
//segment tree
//not template but how to use ST
//for minimum element
/*
long long s[400000];
long long a[1000000];
int create(long long b,long long e,long long n)
{
if(b==e)
{
s[n]=a[b];
}
else
{
create(b,(b+e)/2,2*n+1);
create((b+e)/2+1,e,2*n+2);
s[n]=s[2*n+1]<s[2*n+2]?s[2*n+1]:s[2*n+2];
}
return 0;
}
//for finding minimum element b/w l and r
long long messi(long long b,long long e,long long l,long long r,long long n)
{
long long i,j;
if(e<l||b>r)
{
return 100000001;
}
if(b>=l&&e<=r)
{
return s[n];
}
i=messi(b,(b+e)/2,l,r,2*n+1);
j=messi((b+e)/2+1,e,l,r,2*n+2);
return i<j?i:j;
}
*/
//............................................................................
//range minimam query
//for mim and max number
/*
//preprocess create the min array
long min[SQRTMAX], max[SQRTMAX], b[MAX];
int size, n;
void preProcess(int n){
int i=0, j=0, k=0;
long minimum, maximum;
size = sqrt(n);
//printf("size = %d\n",size);
while(j<size){
minimum = maximum = b[i];
for(k=0 ; k<size ; k++){
if(minimum>b[i])
minimum = b[i];
if(maximum<b[i])
maximum = b[i];
i++;
}
min[j] = minimum;
max[j] = maximum;
j++;
}
}
long findMin(int l, int r){
int j, j2;
long minimum = b[l];
j = l/size + 1;
j2 = r/size - 1;
//printf("j= %d and j2 = %d\n", j,j2);
while(l<j*size && l<=r){
if(minimum > b[l]){
minimum = b[l];
}
//printf("Checked for %d\n", l);
l++;
}
while(j<=j2 && l<=r && j<size){
if(minimum > min[j])
minimum = min[j];
l = (j+1)*size;
//printf("Checked for %d <--> %d\n", j*size, l-1);
j++;
}
while(l<=r){
if(minimum > b[l]){
minimum = b[l];
}
//printf("Checked for %d\n", l);
l++;
}
return minimum;
}
//finding max value
long findMax(int l, int r){
int j, j2;
long maximum = b[l];
j = l/size + 1;
j2 = r/size - 1;
//printf("j= %d and j2 = %d\n", j,j2);
while(l<j*size && l<=r){
if(maximum < b[l]){
maximum = b[l];
}
//printf("Checked for %d\n", l);
l++;
}
while(j<=j2 && l<=r && j<size){
if(maximum < max[j])
maximum = max[j];
l = (j+1)*size;
//printf("Checked for %d <--> %d\n", j*size, l-1);
j++;
}
while(l<=r){
if(maximum < b[l]){
maximum = b[l];
}
//printf("Checked for %d\n", l);
l++;
}
return maximum;
}
*/
//...........................................END OF TEMPLATE.................................................................
int a[1000000];
int b[1000000]={0};
int c[100000]={0};
int main()
{ int i,j,k,t,n,w,e,r,m;
s(n)
s(m)
if(m<=n)
p(n-m)
else
{
a[0]=n;
b[0]=0;
c[n]=1;
i=1;
j=0;
while(1)
{
k=a[j++];
w=b[j-1];
t=a[j-1];
if(k==m||t==m)
{
p(w)
break;
}
if(((k*2)<30000)&&c[k*2]!=1)
{
a[i++]=k*2;
b[i-1]=w+1;
c[k*2]=1;
}
if(t-1>0&&c[t-1]!=1)
{
a[i++]=t-1;
b[i-1]=w+1;
c[t-1]=1;
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@MOD = dso_local local_unnamed_addr constant i64 1000000007, align 8
@b = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@a = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @power(i64 noundef %a, i64 noundef %b, i64 noundef %mod) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i64 %b, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%div = sdiv i64 %b, 2
%call = tail call i64 @power(i64 noundef %a, i64 noundef %div, i64 noundef %mod)
%mul = mul nsw i64 %call, %call
%rem = srem i64 %mul, %mod
%and = and i64 %b, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %return, label %if.then1
if.then1: ; preds = %if.end
%mul2 = mul nsw i64 %rem, %a
%rem3 = srem i64 %mul2, %mod
br label %return
return: ; preds = %if.end, %if.then1, %entry
%retval.0 = phi i64 [ 1, %entry ], [ %rem3, %if.then1 ], [ %rem, %if.end ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @pwr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %b, 0
br i1 %cmp, label %common.ret10, label %if.end
common.ret10: ; preds = %entry, %if.end
%common.ret10.op = phi i32 [ %spec.select, %if.end ], [ 1, %entry ]
ret i32 %common.ret10.op
if.end: ; preds = %entry
%div = sdiv i32 %b, 2
%call = tail call i32 @pwr(i32 noundef %a, i32 noundef %div)
%and = and i32 %b, 1
%tobool.not = icmp eq i32 %and, 0
%mul2 = select i1 %tobool.not, i32 1, i32 %a
%mul = mul i32 %call, %mul2
%spec.select = mul i32 %mul, %call
br label %common.ret10
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp4 = icmp eq i64 %b, 0
br i1 %cmp4, label %cond.end, label %cond.false
cond.false: ; preds = %entry, %cond.false
%b.tr6 = phi i64 [ %rem, %cond.false ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.false ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %cond.end, label %cond.false
cond.end: ; preds = %cond.false, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.false ]
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 #2 {
entry:
%cmp4.i = icmp eq i64 %b, 0
br i1 %cmp4.i, label %gcd.exit, label %cond.false.i
cond.false.i: ; preds = %entry, %cond.false.i
%b.tr6.i = phi i64 [ %rem.i, %cond.false.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.false.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i64 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %cond.false.i
gcd.exit: ; preds = %cond.false.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.false.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @modularInverse(i64 noundef %a, i64 noundef %m) local_unnamed_addr #0 {
entry:
%sub = add nsw i64 %m, -2
%call = tail call i64 @power(i64 noundef %a, i64 noundef %sub, i64 noundef %m)
ret i64 %call
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
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 #5 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.end.preheader, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i32 %1, %0
br label %if.end52
if.end.preheader: ; preds = %entry
store i32 %1, ptr @a, align 16, !tbaa !5
store i32 0, ptr @b, align 16, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @c, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.end.preheader, %if.end51
%indvars.iv = phi i64 [ 1, %if.end.preheader ], [ %indvars.iv.next, %if.end51 ]
%2 = phi i32 [ 0, %if.end.preheader ], [ %7, %if.end51 ]
%3 = phi i32 [ %1, %if.end.preheader ], [ %6, %if.end51 ]
%i.076 = phi i32 [ 1, %if.end.preheader ], [ %i.2, %if.end51 ]
%mul = shl nsw i32 %3, 1
%cmp15 = icmp slt i32 %3, 15000
br i1 %cmp15, label %land.lhs.true, label %land.lhs.true34
land.lhs.true: ; preds = %if.end
%idxprom17 = sext i32 %mul to i64
%arrayidx18 = getelementptr inbounds [100000 x i32], ptr @c, i64 0, i64 %idxprom17
%4 = load i32, ptr %arrayidx18, align 8, !tbaa !5
%cmp19.not = icmp eq i32 %4, 1
br i1 %cmp19.not, label %if.end31, label %if.then20
if.then20: ; preds = %land.lhs.true
%inc22 = add nsw i32 %i.076, 1
%idxprom23 = sext i32 %i.076 to i64
%arrayidx24 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom23
store i32 %mul, ptr %arrayidx24, align 4, !tbaa !5
%add = add nsw i32 %2, 1
%arrayidx27 = getelementptr inbounds [1000000 x i32], ptr @b, i64 0, i64 %idxprom23
store i32 %add, ptr %arrayidx27, align 4, !tbaa !5
store i32 1, ptr %arrayidx18, align 8, !tbaa !5
br label %if.end31
if.end31: ; preds = %if.then20, %land.lhs.true
%i.1 = phi i32 [ %inc22, %if.then20 ], [ %i.076, %land.lhs.true ]
%cmp33 = icmp sgt i32 %3, 1
br i1 %cmp33, label %land.lhs.true34, label %if.end51
land.lhs.true34: ; preds = %if.end, %if.end31
%i.173 = phi i32 [ %i.1, %if.end31 ], [ %i.076, %if.end ]
%sub3274 = add nsw i32 %3, -1
%idxprom36 = zext i32 %sub3274 to i64
%arrayidx37 = getelementptr inbounds [100000 x i32], ptr @c, i64 0, i64 %idxprom36
%5 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cmp38.not = icmp eq i32 %5, 1
br i1 %cmp38.not, label %if.end51, label %if.then39
if.then39: ; preds = %land.lhs.true34
%inc41 = add nsw i32 %i.173, 1
%idxprom42 = sext i32 %i.173 to i64
%arrayidx43 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom42
store i32 %sub3274, ptr %arrayidx43, align 4, !tbaa !5
%add44 = add nsw i32 %2, 1
%arrayidx47 = getelementptr inbounds [1000000 x i32], ptr @b, i64 0, i64 %idxprom42
store i32 %add44, ptr %arrayidx47, align 4, !tbaa !5
store i32 1, ptr %arrayidx37, align 4, !tbaa !5
br label %if.end51
if.end51: ; preds = %if.then39, %land.lhs.true34, %if.end31
%i.2 = phi i32 [ %inc41, %if.then39 ], [ %i.173, %land.lhs.true34 ], [ %i.1, %if.end31 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx4 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr @b, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp11 = icmp eq i32 %6, %0
br i1 %cmp11, label %if.end52, label %if.end
if.end52: ; preds = %if.end51, %if.then
%.lcssa.sink = phi i32 [ %sub, %if.then ], [ %7, %if.end51 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int h, w;
int i, j, k;
while(1){
scanf("%d %d", &h, &w);
if(h == 0 && w == 0){
break;
}
for(i = 0; i < h; i++){
if(i % 2 == 0){
for(k = 0; k < w; k++){
if(k % 2 == 0){
putchar('#');
}else{
putchar('.');
}
}
}else{
for(k = 0; k < w; k++){
if(k % 2 == 0){
putchar('.');
}else{
putchar('#');
}
}
}
putchar('\n');
}
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp54 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp155 = icmp eq i32 %1, 0
%or.cond56 = select i1 %cmp54, i1 %cmp155, i1 false
br i1 %or.cond56, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end32
%2 = phi i32 [ %11, %for.end32 ], [ %0, %entry ]
%cmp251 = icmp sgt i32 %2, 0
br i1 %cmp251, label %for.body, label %for.end32
for.body: ; preds = %for.cond.preheader, %if.end28
%i.052 = phi i32 [ %inc31, %if.end28 ], [ 0, %for.cond.preheader ]
%rem = and i32 %i.052, 1
%cmp3 = icmp eq i32 %rem, 0
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp649 = icmp sgt i32 %3, 0
br i1 %cmp3, label %for.cond5.preheader, label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.body
br i1 %cmp649, label %for.body17, label %if.end28
for.cond5.preheader: ; preds = %for.body
br i1 %cmp649, label %for.body7, label %if.end28
for.body7: ; preds = %for.cond5.preheader, %for.body7
%k.050 = phi i32 [ %inc, %for.body7 ], [ 0, %for.cond5.preheader ]
%rem8 = and i32 %k.050, 1
%cmp9 = icmp eq i32 %rem8, 0
%4 = load ptr, ptr @stdout, align 8, !tbaa !9
%. = select i1 %cmp9, i32 35, i32 46
%call.i = call i32 @putc(i32 noundef %., ptr noundef %4)
%inc = add nuw nsw i32 %k.050, 1
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp6 = icmp slt i32 %inc, %5
br i1 %cmp6, label %for.body7, label %if.end28, !llvm.loop !11
for.body17: ; preds = %for.cond15.preheader, %for.body17
%k.148 = phi i32 [ %inc26, %for.body17 ], [ 0, %for.cond15.preheader ]
%rem18 = and i32 %k.148, 1
%cmp19 = icmp eq i32 %rem18, 0
%6 = load ptr, ptr @stdout, align 8, !tbaa !9
%.60 = select i1 %cmp19, i32 46, i32 35
%call.i42 = call i32 @putc(i32 noundef %.60, ptr noundef %6)
%inc26 = add nuw nsw i32 %k.148, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc26, %7
br i1 %cmp16, label %for.body17, label %if.end28, !llvm.loop !13
if.end28: ; preds = %for.body17, %for.body7, %for.cond15.preheader, %for.cond5.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i44 = call i32 @putc(i32 noundef 10, ptr noundef %8)
%inc31 = add nuw nsw i32 %i.052, 1
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc31, %9
br i1 %cmp2, label %for.body, label %for.end32, !llvm.loop !14
for.end32: ; preds = %if.end28, %for.cond.preheader
%10 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i45 = call i32 @putc(i32 noundef 10, ptr noundef %10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%11 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
%12 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %12, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end32, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
int n, p[100], i, f, j, a[100], b;
char s[100][101], c[101];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s%d",&s[i],&p[i]);
a[i]=i+1;
}
for(i=0;i<n-1;i++)
for(f=i+1;f<n;f++){
j=0;
while((j<strlen(s[i]))&&(j<strlen(s[f]))&&(s[i][j]==s[f][j]))
j++;
if((strlen(s[i])==j)&&(strlen(s[f])==j)){
if(p[i]<p[f]){
b=a[i];
a[i]=a[f];
a[f]=b;
b=p[i];
p[i]=p[f];
p[f]=b;
strcpy(c,s[i]);
strcpy(s[i],s[f]);
strcpy(s[f],c);
}
}
else if(s[i][j]>s[f][j]){
b=a[i];
a[i]=a[f];
a[f]=b;
b=p[i];
p[i]=p[f];
p[f]=b;
strcpy(c,s[i]);
strcpy(s[i],s[f]);
strcpy(s[f],c);
}
}
for(i=0;i<n;i++)
printf("%d\n",a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225378/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225378/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%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
%p = alloca [100 x i32], align 16
%a = alloca [100 x i32], align 16
%s = alloca [100 x [101 x i8]], align 16
%c = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 10100, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp214 = icmp sgt i32 %0, 0
br i1 %cmp214, label %for.body, label %for.end156
for.cond6.preheader: ; preds = %for.body
%cmp7230 = icmp sgt i32 %3, 1
br i1 %cmp7230, label %for.body8.preheader, label %for.cond147.preheader
for.body8.preheader: ; preds = %for.cond6.preheader
%sub = add nsw i32 %3, -1
%1 = zext i32 %3 to i64
%wide.trip.count249 = zext i32 %sub to i64
%wide.trip.count = zext i32 %3 to i64
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx5 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%2 = trunc i64 %indvars.iv.next to i32
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond6.loopexit: ; preds = %for.inc141, %for.body8
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%exitcond250.not = icmp eq i64 %indvars.iv.next247, %wide.trip.count249
br i1 %exitcond250.not, label %for.cond147.preheader, label %for.body8, !llvm.loop !11
for.cond147.preheader: ; preds = %for.cond6.loopexit, %for.cond6.preheader
%cmp148232 = icmp sgt i32 %3, 0
br i1 %cmp148232, label %for.body150, label %for.end156
for.body8: ; preds = %for.body8.preheader, %for.cond6.loopexit
%indvars.iv246 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next247, %for.cond6.loopexit ]
%indvars.iv240 = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next241, %for.cond6.loopexit ]
%indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1
%cmp11228 = icmp ult i64 %indvars.iv.next247, %1
br i1 %cmp11228, label %while.cond.preheader.lr.ph, label %for.cond6.loopexit
while.cond.preheader.lr.ph: ; preds = %for.body8
%arrayidx14 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv246
%arrayidx107 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv246
%arrayidx115 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv246
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %for.inc141
%indvars.iv242 = phi i64 [ %indvars.iv240, %while.cond.preheader.lr.ph ], [ %indvars.iv.next243, %for.inc141 ]
%call15 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx14) #6
%cmp16216.not = icmp eq i64 %call15, 0
br i1 %cmp16216.not, label %land.lhs.true45, label %land.lhs.true.lr.ph
land.lhs.true.lr.ph: ; preds = %while.cond.preheader
%arrayidx20 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv242
%call22 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx20) #6
br label %land.lhs.true
while.cond: ; preds = %land.rhs
%indvars.iv.next237 = add nuw i64 %indvars.iv236, 1
%exitcond239.not = icmp eq i64 %indvars.iv.next237, %call15
br i1 %exitcond239.not, label %land.lhs.true45, label %land.lhs.true, !llvm.loop !12
land.lhs.true: ; preds = %land.lhs.true.lr.ph, %while.cond
%indvars.iv236 = phi i64 [ 0, %land.lhs.true.lr.ph ], [ %indvars.iv.next237, %while.cond ]
%exitcond.not = icmp eq i64 %indvars.iv236, %call22
br i1 %exitcond.not, label %while.end, label %land.rhs
land.rhs: ; preds = %land.lhs.true
%arrayidx28 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv246, i64 %indvars.iv236
%5 = load i8, ptr %arrayidx28, align 1, !tbaa !13
%arrayidx33 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv242, i64 %indvars.iv236
%6 = load i8, ptr %arrayidx33, align 1, !tbaa !13
%cmp35 = icmp eq i8 %5, %6
br i1 %cmp35, label %while.cond, label %while.end
while.end: ; preds = %land.rhs, %land.lhs.true
%conv.lcssa = phi i64 [ %indvars.iv236, %land.rhs ], [ %call22, %land.lhs.true ]
%cmp43 = icmp eq i64 %call15, %conv.lcssa
br i1 %cmp43, label %land.lhs.true45, label %if.else
land.lhs.true45: ; preds = %while.cond, %while.cond.preheader, %while.end
%conv.lcssa259 = phi i64 [ %conv.lcssa, %while.end ], [ 0, %while.cond.preheader ], [ %call15, %while.cond ]
%arrayidx47 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv242
%call49 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx47) #6
%cmp51 = icmp eq i64 %call49, %call15
br i1 %cmp51, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true45
%7 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%arrayidx56 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv242
%8 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%cmp57 = icmp slt i32 %7, %8
br i1 %cmp57, label %if.then59, label %for.inc141
if.then59: ; preds = %if.then
%9 = load i32, ptr %arrayidx107, align 4, !tbaa !5
%arrayidx63 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv242
%10 = load i32, ptr %arrayidx63, align 4, !tbaa !5
store i32 %10, ptr %arrayidx107, align 4, !tbaa !5
store i32 %9, ptr %arrayidx63, align 4, !tbaa !5
store i32 %8, ptr %arrayidx115, align 4, !tbaa !5
store i32 %7, ptr %arrayidx56, align 4, !tbaa !5
br label %for.inc141.sink.split
if.else: ; preds = %land.lhs.true45, %while.end
%conv.lcssa258 = phi i64 [ %conv.lcssa259, %land.lhs.true45 ], [ %conv.lcssa, %while.end ]
%arrayidx96 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv246, i64 %conv.lcssa258
%11 = load i8, ptr %arrayidx96, align 1, !tbaa !13
%arrayidx101 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv242, i64 %conv.lcssa258
%12 = load i8, ptr %arrayidx101, align 1, !tbaa !13
%cmp103 = icmp sgt i8 %11, %12
br i1 %cmp103, label %if.then105, label %for.inc141
if.then105: ; preds = %if.else
%arrayidx99 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv242
%13 = load i32, ptr %arrayidx107, align 4, !tbaa !5
%arrayidx109 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv242
%14 = load i32, ptr %arrayidx109, align 4, !tbaa !5
store i32 %14, ptr %arrayidx107, align 4, !tbaa !5
store i32 %13, ptr %arrayidx109, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%arrayidx117 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv242
%16 = load i32, ptr %arrayidx117, align 4, !tbaa !5
store i32 %16, ptr %arrayidx115, align 4, !tbaa !5
store i32 %15, ptr %arrayidx117, align 4, !tbaa !5
br label %for.inc141.sink.split
for.inc141.sink.split: ; preds = %if.then105, %if.then59
%arrayidx47.sink260 = phi ptr [ %arrayidx47, %if.then59 ], [ %arrayidx99, %if.then105 ]
%call80 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) %arrayidx14) #5
%call87 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx14, ptr noundef nonnull dereferenceable(1) %arrayidx47.sink260) #5
%call92 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx47.sink260, ptr noundef nonnull dereferenceable(1) %c) #5
br label %for.inc141
for.inc141: ; preds = %for.inc141.sink.split, %if.then, %if.else
%indvars.iv.next243 = add nuw nsw i64 %indvars.iv242, 1
%exitcond245.not = icmp eq i64 %indvars.iv.next243, %wide.trip.count
br i1 %exitcond245.not, label %for.cond6.loopexit, label %while.cond.preheader, !llvm.loop !14
for.body150: ; preds = %for.cond147.preheader, %for.body150
%indvars.iv251 = phi i64 [ %indvars.iv.next252, %for.body150 ], [ 0, %for.cond147.preheader ]
%arrayidx152 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv251
%17 = load i32, ptr %arrayidx152, align 4, !tbaa !5
%call153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp148 = icmp slt i64 %indvars.iv.next252, %19
br i1 %cmp148, label %for.body150, label %for.end156, !llvm.loop !15
for.end156: ; preds = %for.body150, %entry, %for.cond147.preheader
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 10100, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 400, 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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; 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 #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct
{
char city[12];
int rev;
int num;
}rest;
int cmp(const void *p,const void *q)//降順
{
if(strcmp(((rest*)p)->city,((rest*)q)->city)==0)return ((rest*)q)->rev - ((rest*)p)->rev;
return strcmp(((rest*)p)->city,((rest*)q)->city);
}
int main()
{
int n,p,i;
char s[11];
rest lst[110];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",s);
scanf("%d",&p);
strcpy(lst[i].city,s);
lst[i].rev=p;
lst[i].num=(i+1);
}
qsort(lst,n,sizeof(rest),cmp);
for(i=0;i<n;i++)
{
printf("%d\n",lst[i].num);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225435/source.c"
target datalayout = "e-m:e-p270: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.rest = type { [12 x i8], i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p, ptr noundef nonnull dereferenceable(1) %q) #7
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %if.then, label %return
if.then: ; preds = %entry
%rev = getelementptr inbounds %struct.rest, ptr %q, i64 0, i32 1
%0 = load i32, ptr %rev, align 4, !tbaa !5
%rev3 = getelementptr inbounds %struct.rest, ptr %p, i64 0, i32 1
%1 = load i32, ptr %rev3, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
br label %return
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ %sub, %if.then ], [ %call, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%p = alloca i32, align 4
%s = alloca [11 x i8], align 1
%lst = alloca [110 x %struct.rest], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #8
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #8
call void @llvm.lifetime.start.p0(i64 2200, ptr nonnull %lst) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !10
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%arrayidx = getelementptr inbounds [110 x %struct.rest], ptr %lst, i64 0, i64 %indvars.iv
%call5 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %s) #8
%1 = load i32, ptr %p, align 4, !tbaa !10
%rev = getelementptr inbounds [110 x %struct.rest], ptr %lst, i64 0, i64 %indvars.iv, i32 1
store i32 %1, ptr %rev, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%num = getelementptr inbounds [110 x %struct.rest], ptr %lst, i64 0, i64 %indvars.iv, i32 2
%2 = trunc i64 %indvars.iv.next to i32
store i32 %2, ptr %num, align 4, !tbaa !11
%3 = load i32, ptr %n, align 4, !tbaa !10
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull %lst, i64 noundef %conv.pre-phi, i64 noundef 20, ptr noundef nonnull @cmp) #8
%5 = load i32, ptr %n, align 4, !tbaa !10
%cmp1232 = icmp sgt i32 %5, 0
br i1 %cmp1232, label %for.body14, label %for.end21
for.body14: ; preds = %for.end, %for.body14
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %for.body14 ], [ 0, %for.end ]
%num17 = getelementptr inbounds [110 x %struct.rest], ptr %lst, i64 0, i64 %indvars.iv36, i32 2
%6 = load i32, ptr %num17, align 4, !tbaa !11
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6)
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%7 = load i32, ptr %n, align 4, !tbaa !10
%8 = sext i32 %7 to i64
%cmp12 = icmp slt i64 %indvars.iv.next37, %8
br i1 %cmp12, label %for.body14, label %for.end21, !llvm.loop !14
for.end21: ; preds = %for.body14, %for.end
call void @llvm.lifetime.end.p0(i64 2200, ptr nonnull %lst) #8
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree "no-trapping-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 = { nounwind willreturn memory(read) }
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, !9, i64 12}
!6 = !{!"", !7, i64 0, !9, i64 12, !9, i64 16}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!9, !9, i64 0}
!11 = !{!6, !9, i64 16}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include<stdio.h>
#include<string.h>
struct d{
char s[20];
int p;
int cc;
};
int main(){
int n;
char buf[17];
scanf("%d", &n);
struct d ss[n];
for(int i=0;i<=n;i++){
scanf("%s %d", ss[i].s, &ss[i].p);
ss[i].cc=i+1;
}
for(int i=0;i<n-1;i++){
for(int j=n-1;j>i;j--){
if(strcmp(ss[j].s,ss[j-1].s)<0){
//printf("dd\n");
struct d t = ss[j];
ss[j] = ss[j-1];
ss[j-1] = t;
} else if(strcmp(ss[j].s,ss[j-1].s)==0){
if(ss[j].p > ss[j-1].p){
struct d t = ss[j];
ss[j] = ss[j-1];
ss[j-1] = t;
}
}
}
}
for(int i=0;i<n;i++)
printf("%d\n", ss[i].cc);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225486/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225486/source.c"
target datalayout = "e-m:e-p270: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.d = type { [20 x i8], i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %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 %struct.d, align 4
%t58 = alloca %struct.d, 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 %struct.d, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not112 = icmp slt i32 %3, 0
br i1 %cmp.not112, label %for.cond.cleanup79, label %for.body
for.cond7.preheader: ; preds = %for.body
%cmp8115 = icmp sgt i32 %7, 1
br i1 %cmp8115, label %for.cond12.preheader.preheader, label %for.cond77.preheader
for.cond12.preheader.preheader: ; preds = %for.cond7.preheader
%sub = add nsw i32 %7, -1
%4 = zext i32 %7 to i64
%5 = add nsw i64 %4, -1
%wide.trip.count = zext i32 %sub to i64
br label %for.cond12.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv
%p = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %p)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cc = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv, i32 2
%6 = trunc i64 %indvars.iv.next to i32
store i32 %6, ptr %cc, align 4, !tbaa !9
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %8
br i1 %cmp.not.not, label %for.body, label %for.cond7.preheader, !llvm.loop !11
for.cond12.preheader: ; preds = %for.cond12.preheader.preheader, %for.cond.cleanup14
%indvars.iv124 = phi i64 [ 0, %for.cond12.preheader.preheader ], [ %indvars.iv.next125, %for.cond.cleanup14 ]
br label %for.body15
for.cond77.preheader: ; preds = %for.cond.cleanup14, %for.cond7.preheader
%cmp78117 = icmp sgt i32 %7, 0
br i1 %cmp78117, label %for.body80, label %for.cond.cleanup79
for.cond.cleanup14: ; preds = %for.inc71
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%exitcond.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count
br i1 %exitcond.not, label %for.cond77.preheader, label %for.cond12.preheader, !llvm.loop !13
for.body15: ; preds = %for.cond12.preheader, %for.inc71
%indvars.iv121 = phi i64 [ %5, %for.cond12.preheader ], [ %indvars.iv.next122, %for.inc71 ]
%arrayidx17 = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv121
%indvars.iv.next122 = add nsw i64 %indvars.iv121, -1
%arrayidx22 = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv.next122
%call25 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx17, ptr noundef nonnull dereferenceable(1) %arrayidx22) #7
%cmp26 = icmp slt i32 %call25, 0
br i1 %cmp26, label %if.then, label %if.else
if.then: ; preds = %for.body15
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %t)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %t, ptr noundef nonnull align 4 dereferenceable(28) %arrayidx17, i64 28, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %arrayidx17, ptr noundef nonnull align 4 dereferenceable(28) %arrayidx22, i64 28, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %arrayidx22, ptr noundef nonnull align 4 dereferenceable(28) %t, i64 28, i1 false), !tbaa.struct !14
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %t)
br label %for.inc71
if.else: ; preds = %for.body15
%cmp47 = icmp eq i32 %call25, 0
br i1 %cmp47, label %if.then48, label %for.inc71
if.then48: ; preds = %if.else
%p51 = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv121, i32 1
%9 = load i32, ptr %p51, align 4, !tbaa !16
%p55 = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv.next122, i32 1
%10 = load i32, ptr %p55, align 4, !tbaa !16
%cmp56 = icmp sgt i32 %9, %10
br i1 %cmp56, label %if.then57, label %for.inc71
if.then57: ; preds = %if.then48
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %t58)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %t58, ptr noundef nonnull align 4 dereferenceable(28) %arrayidx17, i64 28, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %arrayidx17, ptr noundef nonnull align 4 dereferenceable(28) %arrayidx22, i64 28, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %arrayidx22, ptr noundef nonnull align 4 dereferenceable(28) %t58, i64 28, i1 false), !tbaa.struct !14
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %t58)
br label %for.inc71
for.inc71: ; preds = %if.then, %if.then48, %if.then57, %if.else
%cmp13 = icmp sgt i64 %indvars.iv.next122, %indvars.iv124
br i1 %cmp13, label %for.body15, label %for.cond.cleanup14, !llvm.loop !17
for.cond.cleanup79: ; preds = %for.body80, %entry, %for.cond77.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body80: ; preds = %for.cond77.preheader, %for.body80
%indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.body80 ], [ 0, %for.cond77.preheader ]
%cc83 = getelementptr inbounds %struct.d, ptr %vla, i64 %indvars.iv127, i32 2
%11 = load i32, ptr %cc83, align 4, !tbaa !9
%call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp78 = icmp slt i64 %indvars.iv.next128, %13
br i1 %cmp78, label %for.body80, label %for.cond.cleanup79, !llvm.loop !18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"d", !7, i64 0, !6, i64 20, !6, i64 24}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{i64 0, i64 20, !15, i64 20, i64 4, !5, i64 24, i64 4, !5}
!15 = !{!7, !7, i64 0}
!16 = !{!10, !6, i64 20}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
|
#include<stdio.h>
int main(){
int i=0;
char s[19];
scanf("%s", s);
for(;i<19;i++){
if(s[i] == ','){
s[i] = ' ';
}
}
printf("%s\n", s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225529/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225529/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [19 x i8], align 16
call void @llvm.lifetime.start.p0(i64 19, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp1 = icmp eq i8 %0, 44
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %entry
store i8 32, ptr %s, align 16, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then
%arrayidx.1 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 44
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i8 32, ptr %arrayidx.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx.2 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 44
br i1 %cmp1.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i8 32, ptr %arrayidx.2, align 2, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx.3 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%cmp1.3 = icmp eq i8 %3, 44
br i1 %cmp1.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i8 32, ptr %arrayidx.3, align 1, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx.4 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 4
%4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%cmp1.4 = icmp eq i8 %4, 44
br i1 %cmp1.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i8 32, ptr %arrayidx.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx.5 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 5
%5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%cmp1.5 = icmp eq i8 %5, 44
br i1 %cmp1.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
store i8 32, ptr %arrayidx.5, align 1, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx.6 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 6
%6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%cmp1.6 = icmp eq i8 %6, 44
br i1 %cmp1.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
store i8 32, ptr %arrayidx.6, align 2, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx.7 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 7
%7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%cmp1.7 = icmp eq i8 %7, 44
br i1 %cmp1.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
store i8 32, ptr %arrayidx.7, align 1, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%arrayidx.8 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 8
%8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5
%cmp1.8 = icmp eq i8 %8, 44
br i1 %cmp1.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %for.inc.7
store i8 32, ptr %arrayidx.8, align 8, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%arrayidx.9 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 9
%9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5
%cmp1.9 = icmp eq i8 %9, 44
br i1 %cmp1.9, label %if.then.9, label %for.inc.9
if.then.9: ; preds = %for.inc.8
store i8 32, ptr %arrayidx.9, align 1, !tbaa !5
br label %for.inc.9
for.inc.9: ; preds = %if.then.9, %for.inc.8
%arrayidx.10 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 10
%10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5
%cmp1.10 = icmp eq i8 %10, 44
br i1 %cmp1.10, label %if.then.10, label %for.inc.10
if.then.10: ; preds = %for.inc.9
store i8 32, ptr %arrayidx.10, align 2, !tbaa !5
br label %for.inc.10
for.inc.10: ; preds = %if.then.10, %for.inc.9
%arrayidx.11 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 11
%11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5
%cmp1.11 = icmp eq i8 %11, 44
br i1 %cmp1.11, label %if.then.11, label %for.inc.11
if.then.11: ; preds = %for.inc.10
store i8 32, ptr %arrayidx.11, align 1, !tbaa !5
br label %for.inc.11
for.inc.11: ; preds = %if.then.11, %for.inc.10
%arrayidx.12 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 12
%12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5
%cmp1.12 = icmp eq i8 %12, 44
br i1 %cmp1.12, label %if.then.12, label %for.inc.12
if.then.12: ; preds = %for.inc.11
store i8 32, ptr %arrayidx.12, align 4, !tbaa !5
br label %for.inc.12
for.inc.12: ; preds = %if.then.12, %for.inc.11
%arrayidx.13 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 13
%13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5
%cmp1.13 = icmp eq i8 %13, 44
br i1 %cmp1.13, label %if.then.13, label %for.inc.13
if.then.13: ; preds = %for.inc.12
store i8 32, ptr %arrayidx.13, align 1, !tbaa !5
br label %for.inc.13
for.inc.13: ; preds = %if.then.13, %for.inc.12
%arrayidx.14 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 14
%14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5
%cmp1.14 = icmp eq i8 %14, 44
br i1 %cmp1.14, label %if.then.14, label %for.inc.14
if.then.14: ; preds = %for.inc.13
store i8 32, ptr %arrayidx.14, align 2, !tbaa !5
br label %for.inc.14
for.inc.14: ; preds = %if.then.14, %for.inc.13
%arrayidx.15 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 15
%15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5
%cmp1.15 = icmp eq i8 %15, 44
br i1 %cmp1.15, label %if.then.15, label %for.inc.15
if.then.15: ; preds = %for.inc.14
store i8 32, ptr %arrayidx.15, align 1, !tbaa !5
br label %for.inc.15
for.inc.15: ; preds = %if.then.15, %for.inc.14
%arrayidx.16 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 16
%16 = load i8, ptr %arrayidx.16, align 16, !tbaa !5
%cmp1.16 = icmp eq i8 %16, 44
br i1 %cmp1.16, label %if.then.16, label %for.inc.16
if.then.16: ; preds = %for.inc.15
store i8 32, ptr %arrayidx.16, align 16, !tbaa !5
br label %for.inc.16
for.inc.16: ; preds = %if.then.16, %for.inc.15
%arrayidx.17 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 17
%17 = load i8, ptr %arrayidx.17, align 1, !tbaa !5
%cmp1.17 = icmp eq i8 %17, 44
br i1 %cmp1.17, label %if.then.17, label %for.inc.17
if.then.17: ; preds = %for.inc.16
store i8 32, ptr %arrayidx.17, align 1, !tbaa !5
br label %for.inc.17
for.inc.17: ; preds = %if.then.17, %for.inc.16
%arrayidx.18 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 18
%18 = load i8, ptr %arrayidx.18, align 2, !tbaa !5
%cmp1.18 = icmp eq i8 %18, 44
br i1 %cmp1.18, label %if.then.18, label %for.inc.18
if.then.18: ; preds = %for.inc.17
store i8 32, ptr %arrayidx.18, align 2, !tbaa !5
br label %for.inc.18
for.inc.18: ; preds = %if.then.18, %for.inc.17
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 19, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main()
{
char s[20];
if (scanf("%s", s) != 1) {
printf("Failed to read strings.\n");
return -1;
}
int i = 0;
while (i < strlen(s)) {
if (s[i] == ',') {
s[i] = ' ';
}
i = i + 1;
}
printf("%s", s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [24 x i8] c"Failed to read strings.\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %while.cond.preheader, label %if.then
while.cond.preheader: ; preds = %entry
%char0 = load i8, ptr %s, align 16
%cmp419.not = icmp eq i8 %char0, 0
br i1 %cmp419.not, label %while.end, label %while.body
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
while.body: ; preds = %while.cond.preheader, %if.end12
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end12 ], [ 0, %while.cond.preheader ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp7 = icmp eq i8 %0, 44
br i1 %cmp7, label %if.then9, label %if.end12
if.then9: ; preds = %while.body
store i8 32, ptr %arrayidx, align 1, !tbaa !5
br label %if.end12
if.end12: ; preds = %if.then9, %while.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp4 = icmp ugt i64 %call3, %indvars.iv.next
br i1 %cmp4, label %while.body, label %while.end, !llvm.loop !8
while.end: ; preds = %if.end12, %while.cond.preheader
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
br label %cleanup
cleanup: ; preds = %while.end, %if.then
%retval.0 = phi i32 [ -1, %if.then ], [ 0, %while.end ]
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #5
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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int t,i,j,l,v,x,y,p,a,b,c;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%d %d %d %d",&l,&v,&x,&y);
x--;
p=(l/v)-(y/v)+(x/v);
printf("%d\n",p);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%l = alloca i32, align 4
%v = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not6 = icmp slt i32 %0, 1
br i1 %cmp.not6, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %v, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %x, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %l, align 4, !tbaa !5
%3 = load i32, ptr %v, align 4, !tbaa !5
%div = sdiv i32 %2, %3
%4 = load i32, ptr %y, align 4, !tbaa !5
%div2 = sdiv i32 %4, %3
%sub = sub i32 %div, %div2
%div3 = sdiv i32 %dec, %3
%add = add nsw i32 %sub, %div3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
%inc = add nuw nsw i32 %i.07, 1
%5 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.07, %5
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
char s[20];
scanf("%s",&s);
s[5]=' ';
s[13]=' ';
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225673/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225673/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 5
store i8 32, ptr %arrayidx, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 13
store i8 32, ptr %arrayidx1, align 1, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char s[20];
int i;
scanf("%s",s);
for(i=0;s[i]!='\0';i++){
if(s[i]==','){
s[i] = ' ';
}
}
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225745/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225745/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 0, label %for.end
i8 44, label %if.then
]
if.then: ; preds = %for.cond
store i8 32, ptr %arrayidx, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int i;
char s[19];
scanf("%s", s);
for (i = 0; i < 19; i++) if (s[i] == ',') s[i] = ' ';
printf("%s", s);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225796/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225796/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [19 x i8], align 16
call void @llvm.lifetime.start.p0(i64 19, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp1 = icmp eq i8 %0, 44
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %entry
store i8 32, ptr %s, align 16, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then
%arrayidx.1 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 44
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i8 32, ptr %arrayidx.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx.2 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 44
br i1 %cmp1.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i8 32, ptr %arrayidx.2, align 2, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx.3 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%cmp1.3 = icmp eq i8 %3, 44
br i1 %cmp1.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i8 32, ptr %arrayidx.3, align 1, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx.4 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 4
%4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%cmp1.4 = icmp eq i8 %4, 44
br i1 %cmp1.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i8 32, ptr %arrayidx.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx.5 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 5
%5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%cmp1.5 = icmp eq i8 %5, 44
br i1 %cmp1.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
store i8 32, ptr %arrayidx.5, align 1, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx.6 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 6
%6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%cmp1.6 = icmp eq i8 %6, 44
br i1 %cmp1.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
store i8 32, ptr %arrayidx.6, align 2, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx.7 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 7
%7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%cmp1.7 = icmp eq i8 %7, 44
br i1 %cmp1.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
store i8 32, ptr %arrayidx.7, align 1, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%arrayidx.8 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 8
%8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5
%cmp1.8 = icmp eq i8 %8, 44
br i1 %cmp1.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %for.inc.7
store i8 32, ptr %arrayidx.8, align 8, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%arrayidx.9 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 9
%9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5
%cmp1.9 = icmp eq i8 %9, 44
br i1 %cmp1.9, label %if.then.9, label %for.inc.9
if.then.9: ; preds = %for.inc.8
store i8 32, ptr %arrayidx.9, align 1, !tbaa !5
br label %for.inc.9
for.inc.9: ; preds = %if.then.9, %for.inc.8
%arrayidx.10 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 10
%10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5
%cmp1.10 = icmp eq i8 %10, 44
br i1 %cmp1.10, label %if.then.10, label %for.inc.10
if.then.10: ; preds = %for.inc.9
store i8 32, ptr %arrayidx.10, align 2, !tbaa !5
br label %for.inc.10
for.inc.10: ; preds = %if.then.10, %for.inc.9
%arrayidx.11 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 11
%11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5
%cmp1.11 = icmp eq i8 %11, 44
br i1 %cmp1.11, label %if.then.11, label %for.inc.11
if.then.11: ; preds = %for.inc.10
store i8 32, ptr %arrayidx.11, align 1, !tbaa !5
br label %for.inc.11
for.inc.11: ; preds = %if.then.11, %for.inc.10
%arrayidx.12 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 12
%12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5
%cmp1.12 = icmp eq i8 %12, 44
br i1 %cmp1.12, label %if.then.12, label %for.inc.12
if.then.12: ; preds = %for.inc.11
store i8 32, ptr %arrayidx.12, align 4, !tbaa !5
br label %for.inc.12
for.inc.12: ; preds = %if.then.12, %for.inc.11
%arrayidx.13 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 13
%13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5
%cmp1.13 = icmp eq i8 %13, 44
br i1 %cmp1.13, label %if.then.13, label %for.inc.13
if.then.13: ; preds = %for.inc.12
store i8 32, ptr %arrayidx.13, align 1, !tbaa !5
br label %for.inc.13
for.inc.13: ; preds = %if.then.13, %for.inc.12
%arrayidx.14 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 14
%14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5
%cmp1.14 = icmp eq i8 %14, 44
br i1 %cmp1.14, label %if.then.14, label %for.inc.14
if.then.14: ; preds = %for.inc.13
store i8 32, ptr %arrayidx.14, align 2, !tbaa !5
br label %for.inc.14
for.inc.14: ; preds = %if.then.14, %for.inc.13
%arrayidx.15 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 15
%15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5
%cmp1.15 = icmp eq i8 %15, 44
br i1 %cmp1.15, label %if.then.15, label %for.inc.15
if.then.15: ; preds = %for.inc.14
store i8 32, ptr %arrayidx.15, align 1, !tbaa !5
br label %for.inc.15
for.inc.15: ; preds = %if.then.15, %for.inc.14
%arrayidx.16 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 16
%16 = load i8, ptr %arrayidx.16, align 16, !tbaa !5
%cmp1.16 = icmp eq i8 %16, 44
br i1 %cmp1.16, label %if.then.16, label %for.inc.16
if.then.16: ; preds = %for.inc.15
store i8 32, ptr %arrayidx.16, align 16, !tbaa !5
br label %for.inc.16
for.inc.16: ; preds = %if.then.16, %for.inc.15
%arrayidx.17 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 17
%17 = load i8, ptr %arrayidx.17, align 1, !tbaa !5
%cmp1.17 = icmp eq i8 %17, 44
br i1 %cmp1.17, label %if.then.17, label %for.inc.17
if.then.17: ; preds = %for.inc.16
store i8 32, ptr %arrayidx.17, align 1, !tbaa !5
br label %for.inc.17
for.inc.17: ; preds = %if.then.17, %for.inc.16
%arrayidx.18 = getelementptr inbounds [19 x i8], ptr %s, i64 0, i64 18
%18 = load i8, ptr %arrayidx.18, align 2, !tbaa !5
%cmp1.18 = icmp eq i8 %18, 44
br i1 %cmp1.18, label %if.then.18, label %for.inc.18
if.then.18: ; preds = %for.inc.17
store i8 32, ptr %arrayidx.18, align 2, !tbaa !5
br label %for.inc.18
for.inc.18: ; preds = %if.then.18, %for.inc.17
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 19, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
char s1[6], s2[8], s3[6];
scanf("%[^,],%[^,],%s", s1, s2, s3);
printf("%s %s %s\n", s1, s2, s3);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225846/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225846/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^,],%[^,],%s\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%s %s %s\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [6 x i8], align 1
%s2 = alloca [8 x i8], align 1
%s3 = alloca [6 x i8], align 1
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3)
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(void)
{
char s[32];
scanf("%s", s);
s[5] = s[13] = ' ';
puts(s);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225897/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225897/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [32 x i8], align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx = getelementptr inbounds [32 x i8], ptr %s, i64 0, i64 13
store i8 32, ptr %arrayidx, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [32 x i8], ptr %s, i64 0, i64 5
store i8 32, ptr %arrayidx1, align 1, !tbaa !5
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
// puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int main(void){
ll A, B, C;
scanf("%lld %lld %lld", &A, &B, &C);
if(A+B>=C) printf("%lld\n", B+C);
else printf("%lld\n", 1+A+B+B);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225947/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225947/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @powll(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
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 ]
%r.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
%r.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.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 %r.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 !5
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%r.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 %r.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 !7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
%C = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%0 = load i64, ptr %A, align 8, !tbaa !9
%1 = load i64, ptr %B, align 8, !tbaa !9
%add = add nsw i64 %1, %0
%2 = load i64, ptr %C, align 8, !tbaa !9
%cmp.not = icmp slt i64 %add, %2
%add3 = add nsw i64 %0, 1
%reass.add = shl i64 %1, 1
%add5 = add i64 %add3, %reass.add
%add1 = add nsw i64 %2, %1
%add5.sink = select i1 %cmp.not, i64 %add5, i64 %add1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add5.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.unroll.disable"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int A,B,C;
scanf("%d %d %d", &A,&B,&C);
if(A+B>=C){
printf("%d\n", B+C);
}else{
printf("%d\n", A+B+1+B);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %C, align 4, !tbaa !5
%cmp.not = icmp slt i32 %add, %2
%add4 = add i32 %1, 1
%add5 = add i32 %add4, %add
%add1 = add nsw i32 %2, %1
%add5.sink = select i1 %cmp.not, i32 %add5, i32 %add1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int temp[100001];
int ans[100002];
int co[100002]={0},ne[100002],a[100002];
int main()
{
int i,n,k;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
for(i=1;i<=n;i++)
{
scanf("%d",&ne[i]);
co[ne[i]]++;
}
// for(i=0;i<=n;i++)
// printf("%d ",co[i]);
int next=n,max=-1;
for(i=1;i<=n;i++)
{
if(a[i]==1)
{
next=i;
temp[0]=i;
int c=0;
while(1)
{
next=ne[next];
if(next==0)
break;
if(co[next]<=1 && a[next]==0)
temp[++c]=next;
else
break;
if(co[next]==0)
break;
if(c==n)
break;
}
if(c>max)
{
max=c;
int j;
for(j=0;j<=c;j++)
ans[j]=temp[j];
}
}
}
printf("%d\n",max+1);
for(i=max;i>=0;i--)
printf("%d ",ans[i]);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@co = dso_local local_unnamed_addr global [100002 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global [100002 x i32] zeroinitializer, align 16
@ne = dso_local global [100002 x i32] zeroinitializer, align 16
@temp = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global [100002 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = 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:
%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
%cmp.not100 = icmp slt i32 %0, 1
br i1 %cmp.not100, label %for.end61.thread, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not102 = icmp slt i32 %1, 1
br i1 %cmp3.not102, label %for.end61.thread, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100002 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !5
for.cond16.preheader: ; preds = %for.body4
%cmp17.not105 = icmp slt i32 %7, 1
br i1 %cmp17.not105, label %for.end61.thread, label %for.body18.preheader
for.body18.preheader: ; preds = %for.cond16.preheader
%3 = zext i32 %7 to i64
%4 = add nuw i32 %7, 1
%wide.trip.count = zext i32 %4 to i64
br label %for.body18
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.body4 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100002 x i32], ptr @ne, i64 0, i64 %indvars.iv113
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !7
%idxprom10 = sext i32 %5 to i64
%arrayidx11 = getelementptr inbounds [100002 x i32], ptr @co, i64 0, i64 %idxprom10
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !7
%inc12 = add nsw i32 %6, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !7
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%7 = load i32, ptr %n, align 4
%8 = sext i32 %7 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv113, %8
br i1 %cmp3.not.not, label %for.body4, label %for.cond16.preheader, !llvm.loop !11
for.body18: ; preds = %for.body18.preheader, %for.inc59
%indvars.iv123 = phi i64 [ 1, %for.body18.preheader ], [ %indvars.iv.next124, %for.inc59 ]
%max.0107 = phi i32 [ -1, %for.body18.preheader ], [ %max.2, %for.inc59 ]
%arrayidx20 = getelementptr inbounds [100002 x i32], ptr @a, i64 0, i64 %indvars.iv123
%9 = load i32, ptr %arrayidx20, align 4, !tbaa !7
%cmp21 = icmp eq i32 %9, 1
br i1 %cmp21, label %if.then, label %for.inc59
if.then: ; preds = %for.body18
%10 = trunc i64 %indvars.iv123 to i32
store i32 %10, ptr @temp, align 16, !tbaa !7
br label %while.cond
while.cond: ; preds = %if.then32, %if.then
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %if.then32 ], [ 0, %if.then ]
%next.0 = phi i32 [ %11, %if.then32 ], [ %10, %if.then ]
%idxprom22 = sext i32 %next.0 to i64
%arrayidx23 = getelementptr inbounds [100002 x i32], ptr @ne, i64 0, i64 %idxprom22
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !7
%cmp24 = icmp eq i32 %11, 0
br i1 %cmp24, label %while.end, label %if.end
if.end: ; preds = %while.cond
%idxprom26 = sext i32 %11 to i64
%arrayidx27 = getelementptr inbounds [100002 x i32], ptr @co, i64 0, i64 %idxprom26
%12 = load i32, ptr %arrayidx27, align 4, !tbaa !7
%cmp28 = icmp slt i32 %12, 2
br i1 %cmp28, label %land.lhs.true, label %while.end
land.lhs.true: ; preds = %if.end
%arrayidx30 = getelementptr inbounds [100002 x i32], ptr @a, i64 0, i64 %idxprom26
%13 = load i32, ptr %arrayidx30, align 4, !tbaa !7
%cmp31 = icmp eq i32 %13, 0
br i1 %cmp31, label %if.then32, label %while.end
if.then32: ; preds = %land.lhs.true
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%arrayidx35 = getelementptr inbounds [100001 x i32], ptr @temp, i64 0, i64 %indvars.iv.next117
store i32 %11, ptr %arrayidx35, align 4, !tbaa !7
%cmp39 = icmp eq i32 %12, 0
%cmp42 = icmp eq i64 %indvars.iv.next117, %3
%or.cond = or i1 %cmp42, %cmp39
br i1 %or.cond, label %while.end, label %while.cond
while.end: ; preds = %if.then32, %if.end, %land.lhs.true, %while.cond
%c.1.in = phi i64 [ %indvars.iv116, %while.cond ], [ %indvars.iv.next117, %if.then32 ], [ %indvars.iv116, %land.lhs.true ], [ %indvars.iv116, %if.end ]
%c.1 = trunc i64 %c.1.in to i32
%cmp45 = icmp slt i32 %max.0107, %c.1
br i1 %cmp45, label %for.body49.preheader, label %for.inc59
for.body49.preheader: ; preds = %while.end
%14 = shl i64 %c.1.in, 2
%15 = and i64 %14, 17179869180
%16 = add nuw nsw i64 %15, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @ans, ptr noundef nonnull align 16 dereferenceable(1) @temp, i64 %16, i1 false), !tbaa !7
br label %for.inc59
for.inc59: ; preds = %for.body49.preheader, %while.end, %for.body18
%max.2 = phi i32 [ %max.0107, %for.body18 ], [ %max.0107, %while.end ], [ %c.1, %for.body49.preheader ]
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%exitcond.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count
br i1 %exitcond.not, label %for.end61, label %for.body18, !llvm.loop !12
for.end61.thread: ; preds = %for.cond16.preheader, %for.cond2.preheader, %entry
%call62136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
br label %for.end70
for.end61: ; preds = %for.inc59
%add = add nsw i32 %max.2, 1
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%cmp64109 = icmp sgt i32 %max.2, -1
br i1 %cmp64109, label %for.body65.preheader, label %for.end70
for.body65.preheader: ; preds = %for.end61
%17 = zext i32 %max.2 to i64
br label %for.body65
for.body65: ; preds = %for.body65.preheader, %for.body65
%indvars.iv127 = phi i64 [ %17, %for.body65.preheader ], [ %indvars.iv.next128, %for.body65 ]
%arrayidx67 = getelementptr inbounds [100002 x i32], ptr @ans, i64 0, i64 %indvars.iv127
%18 = load i32, ptr %arrayidx67, align 4, !tbaa !7
%call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%indvars.iv.next128 = add nsw i64 %indvars.iv127, -1
%cmp64.not = icmp eq i64 %indvars.iv127, 0
br i1 %cmp64.not, label %for.end70, label %for.body65, !llvm.loop !13
for.end70: ; preds = %for.body65, %for.end61.thread, %for.end61
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include<stdio.h>
int main(){
long long i,n,d[31]={1,1,2};
for(i=3;i<31;i++)d[i]=d[i-1]+d[i-2]+d[i-3];
while(scanf("%lld",&n),n)printf("%lld\n",(d[n]-10)/3650+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226083/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226083/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%d = alloca [31 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 248, ptr nonnull %d) #4
%0 = getelementptr inbounds i8, ptr %d, i64 16
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(248) %0, i8 0, i64 232, i1 false)
store i64 1, ptr %d, align 16
%1 = getelementptr inbounds <{ i64, i64, i64, [28 x i64] }>, ptr %d, i64 0, i32 1
store i64 1, ptr %1, align 8
%2 = getelementptr inbounds <{ i64, i64, i64, [28 x i64] }>, ptr %d, i64 0, i32 2
store i64 2, ptr %2, align 16
%arrayidx2 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 1
%3 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%add5 = add nsw i64 %3, 3
%arrayidx6 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 3
store i64 %add5, ptr %arrayidx6, align 8, !tbaa !5
%arrayidx2.1 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 2
%4 = load i64, ptr %arrayidx2.1, align 16, !tbaa !5
%add.1 = add nsw i64 %4, %add5
%add5.1 = add nsw i64 %add.1, %3
%arrayidx6.1 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 4
store i64 %add5.1, ptr %arrayidx6.1, align 16, !tbaa !5
%arrayidx2.2 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 3
%5 = load i64, ptr %arrayidx2.2, align 8, !tbaa !5
%add.2 = add nsw i64 %5, %add5.1
%add5.2 = add nsw i64 %add.2, %4
%arrayidx6.2 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 5
store i64 %add5.2, ptr %arrayidx6.2, align 8, !tbaa !5
%arrayidx2.3 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 4
%6 = load i64, ptr %arrayidx2.3, align 16, !tbaa !5
%add.3 = add nsw i64 %6, %add5.2
%add5.3 = add nsw i64 %add.3, %5
%arrayidx6.3 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 6
store i64 %add5.3, ptr %arrayidx6.3, align 16, !tbaa !5
%arrayidx2.4 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 5
%7 = load i64, ptr %arrayidx2.4, align 8, !tbaa !5
%add.4 = add nsw i64 %7, %add5.3
%add5.4 = add nsw i64 %add.4, %6
%arrayidx6.4 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 7
store i64 %add5.4, ptr %arrayidx6.4, align 8, !tbaa !5
%arrayidx2.5 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 6
%8 = load i64, ptr %arrayidx2.5, align 16, !tbaa !5
%add.5 = add nsw i64 %8, %add5.4
%add5.5 = add nsw i64 %add.5, %7
%arrayidx6.5 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 8
store i64 %add5.5, ptr %arrayidx6.5, align 16, !tbaa !5
%arrayidx2.6 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 7
%9 = load i64, ptr %arrayidx2.6, align 8, !tbaa !5
%add.6 = add nsw i64 %9, %add5.5
%add5.6 = add nsw i64 %add.6, %8
%arrayidx6.6 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 9
store i64 %add5.6, ptr %arrayidx6.6, align 8, !tbaa !5
%arrayidx2.7 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 8
%10 = load i64, ptr %arrayidx2.7, align 16, !tbaa !5
%add.7 = add nsw i64 %10, %add5.6
%add5.7 = add nsw i64 %add.7, %9
%arrayidx6.7 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 10
store i64 %add5.7, ptr %arrayidx6.7, align 16, !tbaa !5
%arrayidx2.8 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 9
%11 = load i64, ptr %arrayidx2.8, align 8, !tbaa !5
%add.8 = add nsw i64 %11, %add5.7
%add5.8 = add nsw i64 %add.8, %10
%arrayidx6.8 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 11
store i64 %add5.8, ptr %arrayidx6.8, align 8, !tbaa !5
%arrayidx2.9 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 10
%12 = load i64, ptr %arrayidx2.9, align 16, !tbaa !5
%add.9 = add nsw i64 %12, %add5.8
%add5.9 = add nsw i64 %add.9, %11
%arrayidx6.9 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 12
store i64 %add5.9, ptr %arrayidx6.9, align 16, !tbaa !5
%arrayidx2.10 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 11
%13 = load i64, ptr %arrayidx2.10, align 8, !tbaa !5
%add.10 = add nsw i64 %13, %add5.9
%add5.10 = add nsw i64 %add.10, %12
%arrayidx6.10 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 13
store i64 %add5.10, ptr %arrayidx6.10, align 8, !tbaa !5
%arrayidx2.11 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 12
%14 = load i64, ptr %arrayidx2.11, align 16, !tbaa !5
%add.11 = add nsw i64 %14, %add5.10
%add5.11 = add nsw i64 %add.11, %13
%arrayidx6.11 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 14
store i64 %add5.11, ptr %arrayidx6.11, align 16, !tbaa !5
%arrayidx2.12 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 13
%15 = load i64, ptr %arrayidx2.12, align 8, !tbaa !5
%add.12 = add nsw i64 %15, %add5.11
%add5.12 = add nsw i64 %add.12, %14
%arrayidx6.12 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 15
store i64 %add5.12, ptr %arrayidx6.12, align 8, !tbaa !5
%arrayidx2.13 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 14
%16 = load i64, ptr %arrayidx2.13, align 16, !tbaa !5
%add.13 = add nsw i64 %16, %add5.12
%add5.13 = add nsw i64 %add.13, %15
%arrayidx6.13 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 16
store i64 %add5.13, ptr %arrayidx6.13, align 16, !tbaa !5
%arrayidx2.14 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 15
%17 = load i64, ptr %arrayidx2.14, align 8, !tbaa !5
%add.14 = add nsw i64 %17, %add5.13
%add5.14 = add nsw i64 %add.14, %16
%arrayidx6.14 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 17
store i64 %add5.14, ptr %arrayidx6.14, align 8, !tbaa !5
%arrayidx2.15 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 16
%18 = load i64, ptr %arrayidx2.15, align 16, !tbaa !5
%add.15 = add nsw i64 %18, %add5.14
%add5.15 = add nsw i64 %add.15, %17
%arrayidx6.15 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 18
store i64 %add5.15, ptr %arrayidx6.15, align 16, !tbaa !5
%arrayidx2.16 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 17
%19 = load i64, ptr %arrayidx2.16, align 8, !tbaa !5
%add.16 = add nsw i64 %19, %add5.15
%add5.16 = add nsw i64 %add.16, %18
%arrayidx6.16 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 19
store i64 %add5.16, ptr %arrayidx6.16, align 8, !tbaa !5
%arrayidx2.17 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 18
%20 = load i64, ptr %arrayidx2.17, align 16, !tbaa !5
%add.17 = add nsw i64 %20, %add5.16
%add5.17 = add nsw i64 %add.17, %19
%arrayidx6.17 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 20
store i64 %add5.17, ptr %arrayidx6.17, align 16, !tbaa !5
%arrayidx2.18 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 19
%21 = load i64, ptr %arrayidx2.18, align 8, !tbaa !5
%add.18 = add nsw i64 %21, %add5.17
%add5.18 = add nsw i64 %add.18, %20
%arrayidx6.18 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 21
store i64 %add5.18, ptr %arrayidx6.18, align 8, !tbaa !5
%arrayidx2.19 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 20
%22 = load i64, ptr %arrayidx2.19, align 16, !tbaa !5
%add.19 = add nsw i64 %22, %add5.18
%add5.19 = add nsw i64 %add.19, %21
%arrayidx6.19 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 22
store i64 %add5.19, ptr %arrayidx6.19, align 16, !tbaa !5
%arrayidx2.20 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 21
%23 = load i64, ptr %arrayidx2.20, align 8, !tbaa !5
%add.20 = add nsw i64 %23, %add5.19
%add5.20 = add nsw i64 %add.20, %22
%arrayidx6.20 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 23
store i64 %add5.20, ptr %arrayidx6.20, align 8, !tbaa !5
%arrayidx2.21 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 22
%24 = load i64, ptr %arrayidx2.21, align 16, !tbaa !5
%add.21 = add nsw i64 %24, %add5.20
%add5.21 = add nsw i64 %add.21, %23
%arrayidx6.21 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 24
store i64 %add5.21, ptr %arrayidx6.21, align 16, !tbaa !5
%arrayidx2.22 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 23
%25 = load i64, ptr %arrayidx2.22, align 8, !tbaa !5
%add.22 = add nsw i64 %25, %add5.21
%add5.22 = add nsw i64 %add.22, %24
%arrayidx6.22 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 25
store i64 %add5.22, ptr %arrayidx6.22, align 8, !tbaa !5
%arrayidx2.23 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 24
%26 = load i64, ptr %arrayidx2.23, align 16, !tbaa !5
%add.23 = add nsw i64 %26, %add5.22
%add5.23 = add nsw i64 %add.23, %25
%arrayidx6.23 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 26
store i64 %add5.23, ptr %arrayidx6.23, align 16, !tbaa !5
%arrayidx2.24 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 25
%27 = load i64, ptr %arrayidx2.24, align 8, !tbaa !5
%add.24 = add nsw i64 %27, %add5.23
%add5.24 = add nsw i64 %add.24, %26
%arrayidx6.24 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 27
store i64 %add5.24, ptr %arrayidx6.24, align 8, !tbaa !5
%arrayidx2.25 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 26
%28 = load i64, ptr %arrayidx2.25, align 16, !tbaa !5
%add.25 = add nsw i64 %28, %add5.24
%add5.25 = add nsw i64 %add.25, %27
%arrayidx6.25 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 28
store i64 %add5.25, ptr %arrayidx6.25, align 16, !tbaa !5
%arrayidx2.26 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 27
%29 = load i64, ptr %arrayidx2.26, align 8, !tbaa !5
%add.26 = add nsw i64 %29, %add5.25
%add5.26 = add nsw i64 %add.26, %28
%arrayidx6.26 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 29
store i64 %add5.26, ptr %arrayidx6.26, align 8, !tbaa !5
%arrayidx2.27 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 28
%30 = load i64, ptr %arrayidx2.27, align 16, !tbaa !5
%add.27 = add nsw i64 %30, %add5.26
%add5.27 = add nsw i64 %add.27, %29
%arrayidx6.27 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 30
store i64 %add5.27, ptr %arrayidx6.27, align 16, !tbaa !5
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%31 = load i64, ptr %n, align 8, !tbaa !5
%tobool.not18 = icmp eq i64 %31, 0
br i1 %tobool.not18, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%32 = phi i64 [ %34, %while.body ], [ %31, %entry ]
%arrayidx7 = getelementptr inbounds [31 x i64], ptr %d, i64 0, i64 %32
%33 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%sub8 = add nsw i64 %33, -10
%div = sdiv i64 %sub8, 3650
%add9 = add nsw i64 %div, 1
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add9)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%34 = load i64, ptr %n, align 8, !tbaa !5
%tobool.not = icmp eq i64 %34, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int p1,p2,p3,p4,p5,s,U,N,M,C,P,L,K,J,i;
scanf("%d",&N);
scanf("%d",&C);
P=0;
for(i=0;i<C;i++) {
scanf("%d",&p1);
P=P+p1;
}
K=N+1;
L=P/K;
M=P%K;
if (M>0) {
L=L+1;
}
// printf("L=%d M=%d\n",L,M);
printf("%d\n",L);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226177/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226177/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%p1 = alloca i32, align 4
%N = alloca i32, align 4
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%0 = load i32, ptr %C, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%P.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p1)
%1 = load i32, ptr %p1, align 4, !tbaa !5
%add = add nsw i32 %1, %P.013
%inc = add nuw nsw i32 %i.014, 1
%2 = load i32, ptr %C, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%P.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %N, align 4, !tbaa !5
%add3 = add nsw i32 %3, 1
%div = sdiv i32 %P.0.lcssa, %add3
%rem = srem i32 %P.0.lcssa, %add3
%cmp4 = icmp sgt i32 %rem, 0
%add5 = zext i1 %cmp4 to i32
%spec.select = add nsw i32 %div, %add5
%call6 = 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 %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>
int main()
{
int i,j,m,n,ans,ma,mi;
int fma;
int x;
while(scanf("%d%d",&m,&n)!=EOF)
{
ma=INT_MIN;
fma=INT_MAX;
mi=INT_MAX;
for(i=0;i<m;i++)
{
scanf("%d",&x);
ma=ma>x?ma:x;
mi=mi>x?x:mi;
}
for(i=0;i<n;i++)
{
scanf("%d",&x);
fma=fma<x?fma:x;
}
ans=2*mi>ma?2*mi:ma;
if(ans>=fma)
{
printf("-1\n");
}
else
printf("%d\n",ans);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22622/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22622/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%cmp.not52 = icmp eq i32 %call51, -1
br i1 %cmp.not52, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp142 = icmp sgt i32 %0, 0
br i1 %cmp142, label %for.body, label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.body, %for.cond.preheader
%ma.0.lcssa = phi i32 [ -2147483648, %for.cond.preheader ], [ %cond, %for.body ]
%mi.0.lcssa = phi i32 [ 2147483647, %for.cond.preheader ], [ %cond8, %for.body ]
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp1047 = icmp sgt i32 %1, 0
br i1 %cmp1047, label %for.body11, label %for.end20
for.body: ; preds = %for.cond.preheader, %for.body
%mi.045 = phi i32 [ %cond8, %for.body ], [ 2147483647, %for.cond.preheader ]
%ma.044 = phi i32 [ %cond, %for.body ], [ -2147483648, %for.cond.preheader ]
%i.043 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load i32, ptr %x, align 4
%cond = call i32 @llvm.smax.i32(i32 %ma.044, i32 %2)
%cond8 = call i32 @llvm.smin.i32(i32 %mi.045, i32 %2)
%inc = add nuw nsw i32 %i.043, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %3
br i1 %cmp1, label %for.body, label %for.cond9.preheader, !llvm.loop !9
for.body11: ; preds = %for.cond9.preheader, %for.body11
%fma.049 = phi i32 [ %cond17, %for.body11 ], [ 2147483647, %for.cond9.preheader ]
%i.148 = phi i32 [ %inc19, %for.body11 ], [ 0, %for.cond9.preheader ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%4 = load i32, ptr %x, align 4
%cond17 = call i32 @llvm.smin.i32(i32 %fma.049, i32 %4)
%inc19 = add nuw nsw i32 %i.148, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc19, %5
br i1 %cmp10, label %for.body11, label %for.end20, !llvm.loop !11
for.end20: ; preds = %for.body11, %for.cond9.preheader
%fma.0.lcssa = phi i32 [ 2147483647, %for.cond9.preheader ], [ %cond17, %for.body11 ]
%mul = shl nsw i32 %mi.0.lcssa, 1
%cond26 = call i32 @llvm.smax.i32(i32 %mul, i32 %ma.0.lcssa)
%cmp27.not = icmp slt i32 %cond26, %fma.0.lcssa
br i1 %cmp27.not, label %if.else, label %if.then
if.then: ; preds = %for.end20
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.end20
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cond26)
br label %if.end
if.end: ; preds = %if.else, %if.then
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void)
{
int n, h, w, x, y;
scanf("%d %d %d", &n, &h, &w);
x = n - h + 1;
y = n - w + 1;
printf("%d", x * y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226285/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226285/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%h = alloca i32, align 4
%w = 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 %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 %n, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %h, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%2 = load i32, ptr %w, align 4, !tbaa !5
%add2 = sub i32 %sub, %2
%mul = mul nsw i32 %add2, %add
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
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 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,c=0;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(int i=1;i<n-1;i++){
if(a[i-1]>a[i] && a[i]>a[i+1]){
c++;
}
else if(a[i-1]<a[i] && a[i]<a[i+1]){
c++;
}
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = 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
%cmp53 = icmp sgt i32 %3, 0
br i1 %cmp53, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp455 = icmp sgt i32 %4, 2
br i1 %cmp455, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%sub = add nsw i32 %4, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
br label %for.body6
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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.inc35, %entry, %for.cond3.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %c.1, %for.inc35 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body6: ; preds = %for.body6.preheader, %for.inc35
%6 = phi i32 [ %.pre, %for.body6.preheader ], [ %7, %for.inc35 ]
%indvars.iv62 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next63.pre-phi, %for.inc35 ]
%c.056 = phi i32 [ 0, %for.body6.preheader ], [ %c.1, %for.inc35 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv62
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %6, %7
br i1 %cmp12, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %for.body6
%8 = add nuw nsw i64 %indvars.iv62, 1
%arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %8
%9 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %7, %9
br i1 %cmp17, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true
%inc18 = add nsw i32 %c.056, 1
br label %for.inc35
if.else: ; preds = %land.lhs.true, %for.body6
%cmp24 = icmp slt i32 %6, %7
%10 = add nuw nsw i64 %indvars.iv62, 1
br i1 %cmp24, label %land.lhs.true25, label %for.inc35
land.lhs.true25: ; preds = %if.else
%arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 %10
%11 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31 = icmp slt i32 %7, %11
%inc33 = zext i1 %cmp31 to i32
%spec.select = add nsw i32 %c.056, %inc33
br label %for.inc35
for.inc35: ; preds = %if.else, %land.lhs.true25, %if.then
%indvars.iv.next63.pre-phi = phi i64 [ %10, %land.lhs.true25 ], [ %8, %if.then ], [ %10, %if.else ]
%c.1 = phi i32 [ %spec.select, %land.lhs.true25 ], [ %inc18, %if.then ], [ %c.056, %if.else ]
%exitcond.not = icmp eq i64 %indvars.iv.next63.pre-phi, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(){
int n;
int p[22];
int i;
int cnt = 0;
scanf("%d", &n);
for(i = 1;i <= n;i++) scanf("%d", &p[i]);
for(i = 2;i < n;i++){
if(p[i - 1] < p[i] && p[i] < p[i + 1]) cnt++;
if(p[i - 1] > p[i] && p[i] > p[i + 1]) cnt++;
}
printf("%d\n", cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [22 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %p) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not52 = icmp slt i32 %0, 1
br i1 %cmp.not52, label %for.end34, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp354 = icmp sgt i32 %1, 2
br i1 %cmp354, label %for.body4.preheader, label %for.end34
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %1 to i64
%arrayidx6.phi.trans.insert = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 1
%.pre = load i32, ptr %arrayidx6.phi.trans.insert, align 4, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %for.inc32
%3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc32 ]
%indvars.iv60 = phi i64 [ 2, %for.body4.preheader ], [ %7, %for.inc32 ]
%cnt.056 = phi i32 [ 0, %for.body4.preheader ], [ %cnt.2, %for.inc32 ]
%arrayidx8 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 %indvars.iv60
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %3, %4
br i1 %cmp9, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body4
%5 = add nuw nsw i64 %indvars.iv60, 1
%arrayidx13 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 %5
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp slt i32 %4, %6
%inc15 = zext i1 %cmp14 to i32
%spec.select = add nsw i32 %cnt.056, %inc15
br label %if.end
if.end: ; preds = %land.lhs.true, %for.body4
%cnt.1 = phi i32 [ %cnt.056, %for.body4 ], [ %spec.select, %land.lhs.true ]
%cmp21 = icmp sgt i32 %3, %4
%7 = add nuw nsw i64 %indvars.iv60, 1
br i1 %cmp21, label %land.lhs.true22, label %for.inc32
land.lhs.true22: ; preds = %if.end
%arrayidx27 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 %7
%8 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %4, %8
%inc30 = zext i1 %cmp28 to i32
%spec.select51 = add nsw i32 %cnt.1, %inc30
br label %for.inc32
for.inc32: ; preds = %if.end, %land.lhs.true22
%cnt.2 = phi i32 [ %spec.select51, %land.lhs.true22 ], [ %cnt.1, %if.end ]
%exitcond.not = icmp eq i64 %7, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !11
for.end34: ; preds = %for.inc32, %entry, %for.cond2.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %cnt.2, %for.inc32 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %p) #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}
|
#include<stdio.h>
int main(){
int n,p[21],i,j,k,cnt=0;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%d",&p[i]);
}
for(i=0; i<n-2; i++){
j=i+1;
k=i+2;
if((p[j]<=p[k] && p[j]>=p[i]) || (p[j]<=p[i] && p[j]>=p[k])){
cnt++;
}
}
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [21 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 84, 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
%cmp46 = icmp sgt i32 %0, 0
br i1 %cmp46, label %for.body, label %for.end30
for.cond2.preheader: ; preds = %for.body
%cmp348 = icmp sgt i32 %26, 2
br i1 %cmp348, label %for.body4.preheader, label %for.end30
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add i32 %26, -2
%wide.trip.count = zext i32 %sub to i64
%arrayidx7.phi.trans.insert = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 1
%.pre = load i32, ptr %arrayidx7.phi.trans.insert, align 4, !tbaa !5
%min.iters.check = icmp ult i32 %sub, 8
br i1 %min.iters.check, label %for.body4.preheader68, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load63, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %vector.body ]
%vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi66, %vector.body ]
%1 = or i64 %index, 2
%2 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %1
%wide.load = load <4 x i32>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load63 = load <4 x i32>, ptr %3, align 8, !tbaa !5
%4 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load63, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = icmp sgt <4 x i32> %4, %wide.load
%7 = icmp sgt <4 x i32> %5, %wide.load63
%8 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %index
%wide.load64 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load65 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = icmp slt <4 x i32> %4, %wide.load64
%11 = icmp slt <4 x i32> %5, %wide.load65
%12 = select <4 x i1> %6, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %10
%13 = select <4 x i1> %7, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %11
%14 = icmp sgt <4 x i32> %4, %wide.load64
%15 = icmp sgt <4 x i32> %5, %wide.load65
%16 = icmp slt <4 x i32> %4, %wide.load
%17 = icmp slt <4 x i32> %5, %wide.load63
%18 = or <4 x i1> %16, %14
%19 = or <4 x i1> %17, %15
%20 = select <4 x i1> %12, <4 x i1> %18, <4 x i1> zeroinitializer
%21 = select <4 x i1> %13, <4 x i1> %19, <4 x i1> zeroinitializer
%not. = xor <4 x i1> %20, <i1 true, i1 true, i1 true, i1 true>
%22 = zext <4 x i1> %not. to <4 x i32>
%predphi = add <4 x i32> %vec.phi, %22
%not.67 = xor <4 x i1> %21, <i1 true, i1 true, i1 true, i1 true>
%23 = zext <4 x i1> %not.67 to <4 x i32>
%predphi66 = add <4 x i32> %vec.phi62, %23
%index.next = add nuw i64 %index, 8
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %predphi66, %predphi
%25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load63, i64 3
br i1 %cmp.n, label %for.end30, label %for.body4.preheader68
for.body4.preheader68: ; preds = %for.body4.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body4.preheader ]
%indvars.iv54.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body4.preheader ]
%cnt.050.ph = phi i32 [ %25, %middle.block ], [ 0, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [21 x i32], ptr %p, 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
%26 = load i32, ptr %n, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp = icmp slt i64 %indvars.iv.next, %27
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader68, %for.inc28
%scalar.recur = phi i32 [ %29, %for.inc28 ], [ %scalar.recur.ph, %for.body4.preheader68 ]
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.inc28 ], [ %indvars.iv54.ph, %for.body4.preheader68 ]
%cnt.050 = phi i32 [ %cnt.1, %for.inc28 ], [ %cnt.050.ph, %for.body4.preheader68 ]
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%28 = add nuw nsw i64 %indvars.iv54, 2
%arrayidx9 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %28
%29 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10.not = icmp sgt i32 %scalar.recur, %29
%arrayidx19.phi.trans.insert = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %indvars.iv54
%.pre58 = load i32, ptr %arrayidx19.phi.trans.insert, align 4, !tbaa !5
%cmp15.not = icmp slt i32 %scalar.recur, %.pre58
%or.cond61 = select i1 %cmp10.not, i1 true, i1 %cmp15.not
br i1 %or.cond61, label %lor.lhs.false, label %if.then
lor.lhs.false: ; preds = %for.body4
%cmp20.not = icmp sgt i32 %scalar.recur, %.pre58
%cmp26.not = icmp slt i32 %scalar.recur, %29
%or.cond = or i1 %cmp26.not, %cmp20.not
br i1 %or.cond, label %for.inc28, label %if.then
if.then: ; preds = %for.body4, %lor.lhs.false
%inc27 = add nsw i32 %cnt.050, 1
br label %for.inc28
for.inc28: ; preds = %lor.lhs.false, %if.then
%cnt.1 = phi i32 [ %inc27, %if.then ], [ %cnt.050, %lor.lhs.false ]
%exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
br i1 %exitcond.not, label %for.end30, label %for.body4, !llvm.loop !14
for.end30: ; preds = %for.inc28, %middle.block, %entry, %for.cond2.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %25, %middle.block ], [ %cnt.1, %for.inc28 ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 84, 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.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, !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}
|
#include <stdio.h>
int main(){
int n, p[20], i, c=0;
scanf("%d", &n);
for(i=0; i<n; i++)
scanf("%d", &p[i]);
for(i=2; i<n; i++){
if((p[i-2] < p[i-1] && p[i-1] < p[i]) || (p[i] < p[i-1] && p[i-1] < p[i-2]))
c++;
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 80, 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
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end34
for.cond2.preheader: ; preds = %for.body
%cmp352 = icmp sgt i32 %23, 2
br i1 %cmp352, label %for.body4.preheader, label %for.end34
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %23 to i64
%.pre = load i32, ptr %p, align 16, !tbaa !5
%1 = add nsw i64 %wide.trip.count, -2
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body4.preheader82, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %1, -8
%ind.end = or i64 %n.vec, 2
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load69, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %vector.body ]
%vec.phi68 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi72, %vector.body ]
%offset.idx = or i64 %index, 2
%2 = or i64 %index, 1
%3 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %2
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load69 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load69, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%7 = icmp sge <4 x i32> %5, %wide.load
%8 = icmp sge <4 x i32> %6, %wide.load69
%9 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %offset.idx
%wide.load70 = load <4 x i32>, ptr %9, align 8, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load71 = load <4 x i32>, ptr %10, align 8, !tbaa !5
%11 = icmp sge <4 x i32> %wide.load, %wide.load70
%12 = icmp sge <4 x i32> %wide.load69, %wide.load71
%.not74 = select <4 x i1> %7, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %11
%.not76 = select <4 x i1> %8, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %12
%13 = icmp sge <4 x i32> %wide.load70, %wide.load
%14 = icmp sge <4 x i32> %wide.load71, %wide.load69
%15 = icmp sge <4 x i32> %wide.load, %5
%16 = icmp sge <4 x i32> %wide.load69, %6
%.not78 = or <4 x i1> %15, %13
%.not80 = or <4 x i1> %16, %14
%17 = select <4 x i1> %.not74, <4 x i1> %.not78, <4 x i1> zeroinitializer
%18 = select <4 x i1> %.not76, <4 x i1> %.not80, <4 x i1> zeroinitializer
%not. = xor <4 x i1> %17, <i1 true, i1 true, i1 true, i1 true>
%19 = zext <4 x i1> %not. to <4 x i32>
%predphi = add <4 x i32> %vec.phi, %19
%not.81 = xor <4 x i1> %18, <i1 true, i1 true, i1 true, i1 true>
%20 = zext <4 x i1> %not.81 to <4 x i32>
%predphi72 = add <4 x i32> %vec.phi68, %20
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %predphi72, %predphi
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %1, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load69, i64 3
br i1 %cmp.n, label %for.end34, label %for.body4.preheader82
for.body4.preheader82: ; preds = %for.body4.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body4.preheader ]
%indvars.iv59.ph = phi i64 [ %ind.end, %middle.block ], [ 2, %for.body4.preheader ]
%c.055.ph = phi i32 [ %22, %middle.block ], [ 0, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %p, 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
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp = icmp slt i64 %indvars.iv.next, %24
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader82, %for.inc32
%scalar.recur = phi i32 [ %26, %for.inc32 ], [ %scalar.recur.ph, %for.body4.preheader82 ]
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.inc32 ], [ %indvars.iv59.ph, %for.body4.preheader82 ]
%c.055 = phi i32 [ %c.1, %for.inc32 ], [ %c.055.ph, %for.body4.preheader82 ]
%25 = add nsw i64 %indvars.iv59, -1
%arrayidx9 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %25
%26 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp slt i32 %scalar.recur, %26
%arrayidx15 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv59
%27 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp slt i32 %26, %27
%or.cond67 = select i1 %cmp10, i1 %cmp16, i1 false
br i1 %or.cond67, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body4
%cmp22 = icmp slt i32 %27, %26
%cmp30 = icmp slt i32 %26, %scalar.recur
%or.cond = and i1 %cmp30, %cmp22
br i1 %or.cond, label %if.then, label %for.inc32
if.then: ; preds = %for.body4, %lor.lhs.false
%inc31 = add nsw i32 %c.055, 1
br label %for.inc32
for.inc32: ; preds = %lor.lhs.false, %if.then
%c.1 = phi i32 [ %inc31, %if.then ], [ %c.055, %lor.lhs.false ]
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !14
for.end34: ; preds = %for.inc32, %middle.block, %entry, %for.cond2.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %22, %middle.block ], [ %c.1, %for.inc32 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, 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.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, !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}
|
#include <stdio.h>
int main(void) {
int i,n,p[20],r=0;
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d",&p[i]);
}
for(i=1;i<n-1;i++) {
r += (p[i] < p[i+1] && p[i] > p[i-1]) || (p[i] > p[i+1] && p[i] < p[i-1]);
}
printf("%d\n",r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226522/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226522/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %p) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %0, 0
br i1 %cmp47, label %for.body, label %for.end31
for.cond2.preheader: ; preds = %for.body
%cmp349 = icmp sgt i32 %1, 2
br i1 %cmp349, label %for.body4.preheader, label %for.end31
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %1, -1
%wide.trip.count = zext i32 %sub to i64
%arrayidx6.phi.trans.insert = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 1
%.pre = load i32, ptr %arrayidx6.phi.trans.insert, align 4, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %lor.end
%3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %lor.end ]
%indvars.iv55 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next56, %lor.end ]
%r.051 = phi i32 [ 0, %for.body4.preheader ], [ %add28, %lor.end ]
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%arrayidx8 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv.next56
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %3, %4
br i1 %cmp9, label %land.lhs.true, label %lor.rhs
land.lhs.true: ; preds = %for.body4
%5 = add nsw i64 %indvars.iv55, -1
%arrayidx14 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %5
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %3, %6
br i1 %cmp15, label %lor.end, label %lor.rhs
lor.rhs: ; preds = %land.lhs.true, %for.body4
%cmp21 = icmp sgt i32 %3, %4
br i1 %cmp21, label %land.rhs, label %lor.end
land.rhs: ; preds = %lor.rhs
%7 = add nsw i64 %indvars.iv55, -1
%arrayidx26 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %7
%8 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27 = icmp slt i32 %3, %8
br label %lor.end
lor.end: ; preds = %lor.rhs, %land.rhs, %land.lhs.true
%9 = phi i1 [ true, %land.lhs.true ], [ false, %lor.rhs ], [ %cmp27, %land.rhs ]
%lor.ext = zext i1 %9 to i32
%add28 = add nuw nsw i32 %r.051, %lor.ext
%exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
br i1 %exitcond.not, label %for.end31, label %for.body4, !llvm.loop !11
for.end31: ; preds = %lor.end, %entry, %for.cond2.preheader
%r.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %add28, %lor.end ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #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}
|
#include<stdio.h>
int main(){
int n,i,ans=0;
int p[21];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&p[i]);
}
for(int j=1;j<n-1;j++){
if((p[j-1]<p[j]&&p[j]<=p[j+1])||(p[j+1]<p[j]&&p[j]<=p[j-1])){
ans++;
}
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [21 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 84, 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
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup
for.cond2.preheader: ; preds = %for.body
%cmp353 = icmp sgt i32 %27, 2
br i1 %cmp353, label %for.body4.preheader, label %for.cond.cleanup
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add i32 %27, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %p, align 16, !tbaa !5
%1 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i64 %1, 8
br i1 %min.iters.check, label %for.body4.preheader76, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %1, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load70, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi74, %vector.body ]
%vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi75, %vector.body ]
%offset.idx = or i64 %index, 1
%2 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load70 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load70, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = icmp slt <4 x i32> %4, %wide.load
%7 = icmp slt <4 x i32> %5, %wide.load70
%8 = or i64 %index, 2
%9 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %8
%wide.load71 = load <4 x i32>, ptr %9, align 8, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load72 = load <4 x i32>, ptr %10, align 8, !tbaa !5
%11 = icmp slt <4 x i32> %wide.load71, %wide.load
%12 = icmp slt <4 x i32> %wide.load72, %wide.load70
%13 = icmp sle <4 x i32> %wide.load, %wide.load71
%14 = icmp sle <4 x i32> %wide.load70, %wide.load72
%15 = xor <4 x i1> %6, <i1 true, i1 true, i1 true, i1 true>
%16 = xor <4 x i1> %7, <i1 true, i1 true, i1 true, i1 true>
%17 = select <4 x i1> %15, <4 x i1> %11, <4 x i1> zeroinitializer
%18 = select <4 x i1> %16, <4 x i1> %12, <4 x i1> zeroinitializer
%19 = select <4 x i1> %6, <4 x i1> %13, <4 x i1> zeroinitializer
%20 = select <4 x i1> %7, <4 x i1> %14, <4 x i1> zeroinitializer
%21 = or <4 x i1> %17, %19
%22 = or <4 x i1> %18, %20
%23 = zext <4 x i1> %21 to <4 x i32>
%predphi74 = add <4 x i32> %vec.phi, %23
%24 = zext <4 x i1> %22 to <4 x i32>
%predphi75 = add <4 x i32> %vec.phi69, %24
%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 !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %predphi75, %predphi74
%26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %1, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load70, i64 3
br i1 %cmp.n, label %for.cond.cleanup, label %for.body4.preheader76
for.body4.preheader76: ; preds = %for.body4.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body4.preheader ]
%indvars.iv60.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body4.preheader ]
%ans.054.ph = phi i32 [ %26, %middle.block ], [ 0, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [21 x i32], ptr %p, 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
%27 = load i32, ptr %n, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp = icmp slt i64 %indvars.iv.next, %28
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.cond.cleanup: ; preds = %for.inc30, %middle.block, %entry, %for.cond2.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %26, %middle.block ], [ %ans.1, %for.inc30 ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body4: ; preds = %for.body4.preheader76, %for.inc30
%scalar.recur = phi i32 [ %29, %for.inc30 ], [ %scalar.recur.ph, %for.body4.preheader76 ]
%indvars.iv60 = phi i64 [ %30, %for.inc30 ], [ %indvars.iv60.ph, %for.body4.preheader76 ]
%ans.054 = phi i32 [ %ans.1, %for.inc30 ], [ %ans.054.ph, %for.body4.preheader76 ]
%arrayidx9 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %indvars.iv60
%29 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp slt i32 %scalar.recur, %29
%30 = add nuw nsw i64 %indvars.iv60, 1
%arrayidx14 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %30
%31 = load i32, ptr %arrayidx14, align 4, !tbaa !5
br i1 %cmp10, label %land.lhs.true, label %lor.lhs.false.thread
land.lhs.true: ; preds = %for.body4
%cmp15.not = icmp sgt i32 %29, %31
br i1 %cmp15.not, label %for.inc30, label %if.then
lor.lhs.false.thread: ; preds = %for.body4
%cmp2150 = icmp slt i32 %31, %29
br i1 %cmp2150, label %if.then, label %for.inc30
if.then: ; preds = %lor.lhs.false.thread, %land.lhs.true
%inc29 = add nsw i32 %ans.054, 1
br label %for.inc30
for.inc30: ; preds = %land.lhs.true, %lor.lhs.false.thread, %if.then
%ans.1 = phi i32 [ %ans.054, %land.lhs.true ], [ %ans.054, %lor.lhs.false.thread ], [ %inc29, %if.then ]
%exitcond.not = icmp eq i64 %30, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body4, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; 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, !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}
|
#include<stdio.h>
int kansu(int a,int b,int c)
{
if((a<b&&b<=c)||(a>=b&&b>c))
return 1;
else
return 0;
}
int main(void)
{
int n;
int p[20];
int ans=0;
int i;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&p[i]);
for(i=0;i<n-2;i++)
{
ans += kansu(p[i],p[i+1],p[i+2]);
}
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @kansu(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %a, %b
%cmp1.not = icmp sgt i32 %b, %c
%narrow = xor i1 %cmp, %cmp1.not
%retval.0 = zext i1 %narrow to i32
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%p = alloca [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 80, 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
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, label %for.body, label %for.end16
for.cond2.preheader: ; preds = %for.body
%cmp328 = icmp sgt i32 %24, 2
br i1 %cmp328, label %for.body4.preheader, label %for.end16
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %24, -2
%wide.trip.count = zext i32 %sub to i64
%1 = load <2 x i32>, ptr %p, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %sub, 8
br i1 %min.iters.check, label %for.body4.preheader48, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%2 = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 1>
%3 = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 0>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %2, %vector.ph ], [ %wide.load44, %vector.body ]
%vector.recur42 = phi <4 x i32> [ %3, %vector.ph ], [ %8, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%vec.phi43 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%4 = or i64 %index, 2
%5 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %4
%wide.load = load <4 x i32>, ptr %5, align 8, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load44 = load <4 x i32>, ptr %6, align 8, !tbaa !5
%7 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%8 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load44, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = shufflevector <4 x i32> %vector.recur42, <4 x i32> %7, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = shufflevector <4 x i32> %7, <4 x i32> %8, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = icmp slt <4 x i32> %9, %7
%12 = icmp slt <4 x i32> %10, %8
%13 = icmp sgt <4 x i32> %7, %wide.load
%14 = icmp sgt <4 x i32> %8, %wide.load44
%15 = xor <4 x i1> %11, %13
%16 = xor <4 x i1> %12, %14
%17 = zext <4 x i1> %15 to <4 x i32>
%18 = zext <4 x i1> %16 to <4 x i32>
%19 = add <4 x i32> %vec.phi, %17
%20 = add <4 x i32> %vec.phi43, %18
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %20, %19
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%23 = shufflevector <4 x i32> %wide.load44, <4 x i32> poison, <2 x i32> <i32 2, i32 3>
br i1 %cmp.n, label %for.end16, label %for.body4.preheader48
for.body4.preheader48: ; preds = %for.body4.preheader, %middle.block
%indvars.iv34.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body4.preheader ]
%ans.029.ph = phi i32 [ %22, %middle.block ], [ 0, %for.body4.preheader ]
%.ph = phi <2 x i32> [ %23, %middle.block ], [ %1, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %p, 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
%24 = load i32, ptr %n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp = icmp slt i64 %indvars.iv.next, %25
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader48, %for.body4
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body4 ], [ %indvars.iv34.ph, %for.body4.preheader48 ]
%ans.029 = phi i32 [ %add13, %for.body4 ], [ %ans.029.ph, %for.body4.preheader48 ]
%26 = phi <2 x i32> [ %32, %for.body4 ], [ %.ph, %for.body4.preheader48 ]
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%27 = add nuw nsw i64 %indvars.iv34, 2
%arrayidx11 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %27
%28 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%29 = extractelement <2 x i32> %26, i64 0
%30 = extractelement <2 x i32> %26, i64 1
%cmp.i = icmp slt i32 %29, %30
%cmp1.not.i = icmp sgt i32 %30, %28
%narrow.i = xor i1 %cmp.i, %cmp1.not.i
%retval.0.i = zext i1 %narrow.i to i32
%add13 = add nuw nsw i32 %ans.029, %retval.0.i
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
%31 = shufflevector <2 x i32> %26, <2 x i32> poison, <2 x i32> <i32 1, i32 poison>
%32 = insertelement <2 x i32> %31, i32 %28, i64 1
br i1 %exitcond.not, label %for.end16, label %for.body4, !llvm.loop !14
for.end16: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %22, %middle.block ], [ %add13, %for.body4 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, 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) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}
|
#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int i;
int pre,dir = 1,tmp,cn = 0;
scanf("%d",&pre);
for(i=1;i<n;i++){
scanf("%d",&tmp);
if((tmp -pre)*dir<0) dir *= -1;
else if(i != 1) cn++;
pre = tmp;
}
printf("%d",cn);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%pre = alloca i32, align 4
%tmp = 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pre) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pre)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 1
br i1 %cmp14, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%cn.017 = phi i32 [ %cn.1, %for.body ], [ 0, %entry ]
%dir.016 = phi i32 [ %dir.1, %for.body ], [ 1, %entry ]
%i.015 = phi i32 [ %inc8, %for.body ], [ 1, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
%2 = load i32, ptr %pre, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%mul = mul nsw i32 %sub, %dir.016
%cmp3 = icmp sgt i32 %mul, -1
%mul4 = sub nsw i32 0, %dir.016
%cmp5.not = icmp ne i32 %i.015, 1
%dir.1 = select i1 %cmp3, i32 %dir.016, i32 %mul4
%narrow = and i1 %cmp5.not, %cmp3
%spec.select = zext i1 %narrow to i32
%cn.1 = add nuw nsw i32 %cn.017, %spec.select
store i32 %1, ptr %pre, align 4, !tbaa !5
%inc8 = add nuw nsw i32 %i.015, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc8, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%cn.0.lcssa = phi i32 [ 0, %entry ], [ %cn.1, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cn.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pre) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n;
int i;
int ct = 0;
int num[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ) {
scanf("%d", &num[i]);
}
for (i = 1; i < n-1; i++) {
if ( num[i] > num[i-1] && num[i] < num[i+1] ) {
ct++;
}
if ( num[i] < num[i-1] && num[i] > num[i+1] ) {
ct++;
}
}
printf("%d", ct);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%num = alloca [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %num) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %0, 0
br i1 %cmp53, label %for.body, label %for.end35
for.cond2.preheader: ; preds = %for.body
%cmp355 = icmp sgt i32 %1, 2
br i1 %cmp355, label %for.body4.preheader, label %for.end35
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %1, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %num, align 16, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %num, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %for.inc33
%3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc33 ]
%indvars.iv61 = phi i64 [ 1, %for.body4.preheader ], [ %7, %for.inc33 ]
%ct.057 = phi i32 [ 0, %for.body4.preheader ], [ %ct.2, %for.inc33 ]
%arrayidx6 = getelementptr inbounds [20 x i32], ptr %num, i64 0, i64 %indvars.iv61
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %4, %3
br i1 %cmp10, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body4
%5 = add nuw nsw i64 %indvars.iv61, 1
%arrayidx14 = getelementptr inbounds [20 x i32], ptr %num, i64 0, i64 %5
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp slt i32 %4, %6
%inc16 = zext i1 %cmp15 to i32
%spec.select = add nsw i32 %ct.057, %inc16
br label %if.end
if.end: ; preds = %land.lhs.true, %for.body4
%ct.1 = phi i32 [ %ct.057, %for.body4 ], [ %spec.select, %land.lhs.true ]
%cmp22 = icmp slt i32 %4, %3
%7 = add nuw nsw i64 %indvars.iv61, 1
br i1 %cmp22, label %land.lhs.true23, label %for.inc33
land.lhs.true23: ; preds = %if.end
%arrayidx28 = getelementptr inbounds [20 x i32], ptr %num, i64 0, i64 %7
%8 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %4, %8
%inc31 = zext i1 %cmp29 to i32
%spec.select52 = add nsw i32 %ct.1, %inc31
br label %for.inc33
for.inc33: ; preds = %if.end, %land.lhs.true23
%ct.2 = phi i32 [ %spec.select52, %land.lhs.true23 ], [ %ct.1, %if.end ]
%exitcond.not = icmp eq i64 %7, %wide.trip.count
br i1 %exitcond.not, label %for.end35, label %for.body4, !llvm.loop !11
for.end35: ; preds = %for.inc33, %entry, %for.cond2.preheader
%ct.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %ct.2, %for.inc33 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ct.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %num) #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}
|
#include<stdio.h>
int main()
{
int A,B,C,D,L,R;
scanf("%d %d %d %d",&A,&B,&C,&D);
L=A+B;
R=C+D;
if(L>R) printf("Left\n");
if(L<R) printf("Right\n");
if(L==R) printf("Balanced\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.5 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.then, %entry
%cmp3 = icmp slt i32 %add, %add1
br i1 %cmp3, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
%puts15 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%cmp7 = icmp eq i32 %add, %add1
br i1 %cmp7, label %if.then8, label %if.end10
if.then8: ; preds = %if.end6
%puts16 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end10
if.end10: ; preds = %if.then8, %if.end6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
printf(a+b==c+d?"Balanced":a+b>c+d?"Left":"Right");
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226782/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226782/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp eq i32 %add, %add1
%cmp4 = icmp sgt i32 %add, %add1
%cond = select i1 %cmp4, ptr @.str.2, ptr @.str.3
%cond5 = select i1 %cmp, ptr @.str.1, ptr %cond
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void){
int A,B,C,X;
char S[10];
scanf("%d %d %d %d",&A,&B,&C,&X);
if(A+B>C+X){
printf("Left");
}else if(A+B==C+X){
printf("Balanced");
}else{
printf("Right");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Left\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %X)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %X, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp5 = icmp eq i32 %add, %add1
%.str.2..str.3 = select i1 %cmp5, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int a,b,c,d ;
int main(void){
scanf ("%d%d%d%d",&a,&b,&c,&d) ;
if ( a+b>c+d ){
printf ("Left\n") ;
} else if ( a+b==c+d ){
printf ("Balanced\n") ;
} else {
printf ("Right\n") ;
}
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226876/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226876/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1
@a = dso_local global i32 0, align 4
@b = dso_local global i32 0, align 4
@c = dso_local global i32 0, align 4
@d = dso_local global i32 0, align 4
@str = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.4 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c, ptr noundef nonnull @d)
%0 = load i32, ptr @a, align 4, !tbaa !5
%1 = load i32, ptr @b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr @c, align 4, !tbaa !5
%3 = load i32, ptr @d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp5 = icmp eq i32 %add, %add1
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int A,B,C,D;
scanf("%d %d %d %d",&A,&B,&C,&D);
int ans=A+B-C-D;
if(ans > 0){
printf("Left");
}
else if(ans==0){
printf("Balanced");
}
else{
printf("Right");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226919/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226919/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Left\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%4 = add i32 %3, %2
%sub1 = sub i32 %add, %4
%cmp = icmp sgt i32 %sub1, 0
%cmp3 = icmp eq i32 %add, %4
%.str.2..str.3 = select i1 %cmp3, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
if (( a + b ) > ( c + d ))
{
printf("Left\n");
}
else if (( a + b ) < ( c + d ))
{
printf("Right\n");
}
else
{
printf("Balanced\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1
@str = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp5 = icmp slt i32 %add, %add1
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n[5],i,m=1;
for(i=0;i<5;i++)scanf("%d",&n[i]);
i=1;
while(n[0]>n[1]*m)++m;
while(n[0]>n[3]*i)++i;
n[2]*=m,n[4]*=i;
if(n[2]>n[4])n[2]=n[4];
printf("%d\n",n[2]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i32], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%0 = load i32, ptr %n, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%smax = call i32 @llvm.smax.i32(i32 %1, i32 %0)
%2 = icmp slt i32 %1, %0
%umin = zext i1 %2 to i32
%3 = add i32 %1, %umin
%4 = sub i32 %smax, %3
%umax = call i32 @llvm.umax.i32(i32 %1, i32 1)
%5 = udiv i32 %4, %umax
%6 = add i32 %5, %umin
%7 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%smax33 = call i32 @llvm.smax.i32(i32 %7, i32 %0)
%8 = icmp slt i32 %7, %0
%umin34 = zext i1 %8 to i32
%9 = add i32 %7, %umin34
%10 = sub i32 %smax33, %9
%umax35 = call i32 @llvm.umax.i32(i32 %7, i32 1)
%11 = udiv i32 %10, %umax35
%12 = add i32 %11, %umin34
%13 = add i32 %6, 1
%14 = add i32 %12, 1
%15 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%mul14 = mul nsw i32 %15, %13
store i32 %mul14, ptr %arrayidx.2, align 8, !tbaa !5
%16 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%mul16 = mul nsw i32 %16, %14
store i32 %mul16, ptr %arrayidx.4, align 16, !tbaa !5
%cmp19 = icmp sgt i32 %mul14, %mul16
br i1 %cmp19, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %mul16, ptr %arrayidx.2, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%17 = phi i32 [ %mul16, %if.then ], [ %mul14, %entry ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 20, 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 i32 @llvm.umax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int kin(int n, int m, int k)
{
return((n%m==0)?(n/m*k):((n/m+1)*k));
}
int main(int rgc, char *argv[])
{
int a, b, c, d, n, set1, set2;
scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
set1 = kin(n, a, b);
set2 = kin(n, c, d);
printf("%d\n", (set1 <= set2)?(set1):(set2));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227048/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227048/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @kin(i32 noundef %n, i32 noundef %m, i32 noundef %k) local_unnamed_addr #0 {
entry:
%rem = srem i32 %n, %m
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %n, %m
%add = zext i1 %cmp to i32
%div.pn = add nsw i32 %div, %add
%cond = mul nsw i32 %div.pn, %k
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %rgc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%n = 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 %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%rem.i = srem i32 %0, %1
%cmp.i = icmp ne i32 %rem.i, 0
%div.i = sdiv i32 %0, %1
%add.i = zext i1 %cmp.i to i32
%div.pn.i = add nsw i32 %div.i, %add.i
%cond.i = mul nsw i32 %div.pn.i, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%4 = load i32, ptr %d, align 4, !tbaa !5
%rem.i6 = srem i32 %0, %3
%cmp.i7 = icmp ne i32 %rem.i6, 0
%div.i8 = sdiv i32 %0, %3
%add.i9 = zext i1 %cmp.i7 to i32
%div.pn.i10 = add nsw i32 %div.i8, %add.i9
%cond.i11 = mul nsw i32 %div.pn.i10, %4
%cond = call i32 @llvm.smin.i32(i32 %cond.i, i32 %cond.i11)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int x1,x2,a;
scanf("%d %d",&x1,&x2);
if(x1<x2){
printf("%d\n",x2-x1);
}
else{
printf("%d\n",x1-x2);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227099/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x1 = alloca i32, align 4
%x2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %x2)
%0 = load i32, ptr %x1, align 4, !tbaa !5
%1 = load i32, ptr %x2, align 4, !tbaa !5
%sub2 = sub nsw i32 %0, %1
%sub2.sink = call i32 @llvm.abs.i32(i32 %sub2, i1 true)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("%d\n",(b-a));
}
else if(a==b){
printf("%d\n",(a-b));
}
else{
printf("%d\n",(a-b));
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227141/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227141/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub7 = sub nsw i32 %0, %1
%.sink = call i32 @llvm.abs.i32(i32 %sub7, i1 true)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void){
long a, b;
scanf("%ld %ld", &a, &b);
if ( (a*b)%2 == 0 ) {printf("Even");}
else {printf("Odd");}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227192/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227192/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = and i64 %mul, 1
%cmp = icmp eq i64 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,x;
scanf("%d %d",&a,&b);
x=a*b;
if(x%2==0) printf("Even\n");
else printf("Odd\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227235/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227235/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(((a*b)%2) == 0) printf("Even\n");
else if(((a*b)%2) != 0) printf("Odd\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2==0)
{
printf("Even");
}else{
printf("Odd");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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;
scanf("%d %d",&a, &b);
x = a * b;
if(x % 2 == 0){
printf("Even");
} else {
printf("Odd");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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;
scanf("%d %d", &x,&y);
if (x*y % 2 == 0) {
printf("Even");
}else{
printf("Odd");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a*b;
if(c%2==0){
printf("Even");
}
else{
printf("Odd");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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 <math.h>
#include <time.h>
#define REP(i,n) for(i=0;i<n;i++)
#define ll long long
int main(void){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
if(a%2==0 || b%2==0){
printf("Even");
} else{
printf("Odd");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%2 = load i32, ptr %b, align 4
%3 = and i32 %2, 1
%cmp3 = icmp eq i32 %3, 0
%4 = select i1 %cmp, i1 true, i1 %cmp3
%.str.2.sink = select i1 %4, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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);
int product = a * b;
if(product % 2 == 0){
printf("Even\n");
}else{
printf("Odd\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227538/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227538/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b;
scanf("%d%d",&a,&b);
if((a*b)%2 == 0) printf("Even");
else printf("Odd");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227581/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227581/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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);
if(a*b%2==0){
printf("Even\n");
}else{
printf("Odd\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227624/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227624/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void) {
int a, b, c;
scanf("%d %d", &a, &b);
c = a*b;
if(c%2 == 0) puts("Even");
else puts("Odd");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227668/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227668/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c;
scanf("%d %d", &a, &b);
c = a * b;
if(c % 2 == 0) {
printf("Even\n");
}
else {
printf("Odd\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227710/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227710/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2==1){
printf("Odd");
}else if(a*b%2==0){
printf("Even");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\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
%rem = srem i32 %mul, 2
switch i32 %rem, label %if.end7 [
i32 1, label %if.end7.sink.split
i32 0, label %if.then5
]
if.then5: ; preds = %entry
br label %if.end7.sink.split
if.end7.sink.split: ; preds = %entry, %if.then5
%.str.2.sink = phi ptr [ @.str.2, %if.then5 ], [ @.str.1, %entry ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
br label %if.end7
if.end7: ; preds = %if.end7.sink.split, %entry
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",&a);
scanf("%d",&b);
if(a*b%2==0){
printf("Even");
}
else{printf("Odd");}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227804/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227804/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c, d;
c=0;
d=0;
scanf("%d %d", &a, &b);
c = a * b;
d = c % 2;
if(d == 0){
printf("Even");
}else{
printf("Odd");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227848/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227848/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\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
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
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=0;
int b=0;
scanf("%d %d",&a,&b);
if((a*b)%2){
printf("Odd");
}else{
printf("Even");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227891/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227891/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\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
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%.str.2..str.1 = select i1 %tobool.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
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 <inttypes.h>
static unsigned int x=62526377;
static unsigned int y=5463654;
static unsigned int z=87602543;
static unsigned int w=13597657;
void seed(unsigned int a,unsigned int b,unsigned int c,unsigned int d) {
if((a|b|c|d)==0)return;
x=a;y=b;z=c;w=d;
}
unsigned int randint(void) {
unsigned int t;
t=(x^(x<<11));
x=y;y=z;z=w;
w=(w^(w>>19))^(t^(t>>8));
return w;
}
#define MAX 200000
int32_t N;
struct lr_t {
int32_t L, R;
} LR[MAX];
int32_t solve(int32_t seed1, int32_t seed2) {
int32_t i;
int32_t al, ar, bl, br;
/* 損が少ない方に入れる貪欲 */
al = LR[seed1].L; ar = LR[seed1].R;
bl = LR[seed2].L; br = LR[seed2].R;
for (i = 0; i < N; i++) {
int32_t al2 = al, ar2 = ar, bl2 = bl, br2 = br;
int32_t psa = ar - al, psb = br - bl, asa, asb;
if (i == seed1 || i == seed2) continue;
if (al2 < LR[i].L) al2 = LR[i].L;
if (LR[i].R < ar2) ar2 = LR[i].R;
if (bl2 < LR[i].L) bl2 = LR[i].L;
if (LR[i].R < br2) br2 = LR[i].R;
if (ar2 < al2) ar2 = al2;
if (br2 < bl2) br2 = bl2;
asa = ar2 - al2;
asb = br2 - bl2;
if (((psa - asa) < (psb - asb)) || ((psa - asa) == (psb - asb) && randint() % 2 == 0)) {
al = al2; ar = ar2;
} else {
bl = bl2; br = br2;
}
}
return (ar - al) + (br - bl);
}
int main(void) {
int32_t i;
int32_t ai = 0, bi = 0, asmax = -1, bsmax = -1;
int32_t best = 0, candidate;
int32_t r, s;
if (scanf("%" SCNd32, &N) != 1) return 1;
for (i = 0; i < N; i++) {
if (scanf("%" SCNd32 "%" SCNd32, &LR[i].L, &LR[i].R) != 2) return 1;
LR[i].R++; /* [L, R) に変換 */
}
for (r = 0; r < 180; r++) {
/* やけくそシャッフル */
for (s = N - 1; s > 0; s--) {
int32_t idx = randint() % (s + 1);
struct lr_t temp = LR[s];
LR[s] = LR[idx];
LR[idx] = temp;
}
/* 一番長いのを選ぶ */
asmax = -1;
for (i = 0; i < N; i++) {
int32_t as = LR[i].R - LR[i].L;
if (as > asmax) { ai = i; asmax = as; }
}
/* それと一番共通部分が少ないのを選ぶ */
bsmax = MAX;
for (i = 0; i < N; i++) {
int32_t l = LR[ai].L < LR[i].L ? LR[i].L : LR[ai].L;
int32_t r = LR[i].R < LR[ai].R ? LR[i].R : LR[ai].R;
int32_t bs;
if (i == ai) continue;
bs = l < r ? r - l : 0;
if (bs < bsmax) { bi = i; bsmax = bs; }
}
candidate = solve(ai, bi);
if (best < candidate) best = candidate;
/* Lが一番左のを選ぶ */
asmax = MAX;
for (i = 0; i < N; i++) {
int32_t as = LR[i].L;
if (as < asmax) { ai = i; asmax = as; }
}
/* Rが一番右のを選ぶ */
bsmax = -1;
for (i = 0; i < N; i++) {
int32_t bs;
if (i == ai) continue;
bs = LR[i].R;
if (bs > bsmax) { bi = i; bsmax = bs; }
}
candidate = solve(ai, bi);
if (best < candidate) best = candidate;
/* Rが一番左のを選ぶ */
asmax = MAX;
for (i = 0; i < N; i++) {
int32_t as = LR[i].R;
if (as < asmax) { ai = i; asmax = as; }
}
/* Lが一番右のを選ぶ */
bsmax = -1;
for (i = 0; i < N; i++) {
int32_t bs;
if (i == ai) continue;
bs = LR[i].L;
if (bs > bsmax) { bi = i; bsmax = bs; }
}
candidate = solve(ai, bi);
if (best < candidate) best = candidate;
/* 一番短いのを選ぶ */
asmax = MAX;
for (i = 0; i < N; i++) {
int32_t as = LR[i].R - LR[i].L;
if (as < asmax) { ai = i; asmax = as; }
}
/* 二番目に短いのを選ぶ */
bsmax = MAX;
for (i = 0; i < N; i++) {
int32_t bs;
if (i == ai) continue;
bs = LR[i].R - LR[i].L;
if (bs > bsmax) { bi = i; bsmax = bs; }
}
candidate = solve(ai, bi);
if (best < candidate) best = candidate;
/* やけくそ乱択 */
for (i = 0; i < 10; i++) {
ai = randint() % N;
bi = randint() % (N - 1);
if (ai <= bi) bi++;
candidate = solve(ai, bi);
if (best < candidate) best = candidate;
}
}
printf("%" PRId32 "\n", best);
return 0;
}
/*
各コンテスト最初の1問を除いて、問題をコンテストに入れたとき
* 必ず解ける人は減るか変わらない (増えない)
* 必ず範囲の左端は変わらないか右に動く
* 必ず範囲の右端は変わらないか左に動く
予想:一番長いのと一番短いのは別のコンテストにするべき
これは偽
3
1 10
9 15
11 100
-> 92
入力例1
12345678
****
****
****
****
もし、共通部分が無い問題の組があるとき
同じコンテストに入れる -> 楽しさ0になる -> もう1方は残りから一番長い1問を取ってほかを全部ぶちこむ
違うコンテストに入れる -> ?
1. 各コンテスト最初の1問を決める
2. 残りを適当に割り振る
「1本とそれ以外」を超えるパフォーマンスを出せるか?
*/
/*
4
1 10
11 101
2 100
12 13
-> 99
**********
******************************************
**********************************
*
*/
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227934/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227934/source.c"
target datalayout = "e-m:e-p270: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.lr_t = type { i32, i32 }
@x = internal unnamed_addr global i32 62526377, align 4
@y = internal unnamed_addr global i32 5463654, align 4
@z = internal unnamed_addr global i32 87602543, align 4
@w = internal unnamed_addr global i32 13597657, align 4
@LR = dso_local global [200000 x %struct.lr_t] zeroinitializer, align 16
@N = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @seed(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d) local_unnamed_addr #0 {
entry:
%or = or i32 %b, %a
%or1 = or i32 %or, %c
%or2 = or i32 %or1, %d
%cmp = icmp eq i32 %or2, 0
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
store i32 %a, ptr @x, align 4, !tbaa !5
store i32 %b, ptr @y, align 4, !tbaa !5
store i32 %c, ptr @z, align 4, !tbaa !5
store i32 %d, ptr @w, align 4, !tbaa !5
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @randint() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @x, align 4, !tbaa !5
%shl = shl i32 %0, 11
%xor = xor i32 %shl, %0
%1 = load i32, ptr @y, align 4, !tbaa !5
store i32 %1, ptr @x, align 4, !tbaa !5
%2 = load i32, ptr @z, align 4, !tbaa !5
store i32 %2, ptr @y, align 4, !tbaa !5
%3 = load i32, ptr @w, align 4, !tbaa !5
store i32 %3, ptr @z, align 4, !tbaa !5
%shr = lshr i32 %3, 19
%shr2 = lshr i32 %xor, 8
%4 = xor i32 %shr2, %shr
%5 = xor i32 %4, %xor
%xor4 = xor i32 %5, %3
store i32 %xor4, ptr @w, align 4, !tbaa !5
ret i32 %xor4
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @solve(i32 noundef %seed1, i32 noundef %seed2) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %seed1 to i64
%arrayidx = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 8, !tbaa !9
%R = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom, i32 1
%1 = load i32, ptr %R, align 4, !tbaa !11
%idxprom3 = sext i32 %seed2 to i64
%arrayidx4 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom3
%2 = load i32, ptr %arrayidx4, align 8, !tbaa !9
%R8 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom3, i32 1
%3 = load i32, ptr %R8, align 4, !tbaa !11
%4 = load i32, ptr @N, align 4, !tbaa !5
%cmp127 = icmp sgt i32 %4, 0
br i1 %cmp127, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%w.promoted = load i32, ptr @w, align 4, !tbaa !5
%z.promoted = load i32, ptr @z, align 4, !tbaa !5
%y.promoted = load i32, ptr @y, align 4, !tbaa !5
%x.promoted = load i32, ptr @x, align 4, !tbaa !5
%5 = zext i32 %seed2 to i64
%6 = zext i32 %seed1 to i64
%wide.trip.count = zext i32 %4 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %cleanup
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %cleanup ]
%al.0132 = phi i32 [ %0, %for.body.preheader ], [ %al.2, %cleanup ]
%ar.0131 = phi i32 [ %1, %for.body.preheader ], [ %ar.2, %cleanup ]
%bl.0130 = phi i32 [ %2, %for.body.preheader ], [ %bl.2, %cleanup ]
%br.0129 = phi i32 [ %3, %for.body.preheader ], [ %br.2, %cleanup ]
%7 = phi i32 [ %x.promoted, %for.body.preheader ], [ %19, %cleanup ]
%8 = phi i32 [ %y.promoted, %for.body.preheader ], [ %18, %cleanup ]
%9 = phi i32 [ %z.promoted, %for.body.preheader ], [ %17, %cleanup ]
%xor4.i126128 = phi i32 [ %w.promoted, %for.body.preheader ], [ %xor4.i125, %cleanup ]
%cmp10 = icmp eq i64 %indvars.iv, %6
%cmp11 = icmp eq i64 %indvars.iv, %5
%or.cond = or i1 %cmp10, %cmp11
br i1 %or.cond, label %cleanup, label %if.end
if.end: ; preds = %for.body
%sub9 = sub nsw i32 %br.0129, %bl.0130
%sub = sub nsw i32 %ar.0131, %al.0132
%arrayidx13 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx13, align 8, !tbaa !9
%spec.select = tail call i32 @llvm.smax.i32(i32 %al.0132, i32 %10)
%R23 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv, i32 1
%11 = load i32, ptr %R23, align 4, !tbaa !11
%ar2.0 = tail call i32 @llvm.smin.i32(i32 %11, i32 %ar.0131)
%bl2.0 = tail call i32 @llvm.smax.i32(i32 %bl.0130, i32 %10)
%br2.0 = tail call i32 @llvm.smin.i32(i32 %11, i32 %br.0129)
%ar2.1 = tail call i32 @llvm.smax.i32(i32 %ar2.0, i32 %spec.select)
%br2.1 = tail call i32 @llvm.smax.i32(i32 %br2.0, i32 %bl2.0)
%sub54.neg = sub i32 %spec.select, %ar2.1
%sub55.neg = sub i32 %bl2.0, %br2.1
%sub56 = add i32 %sub54.neg, %sub
%sub57 = add i32 %sub55.neg, %sub9
%cmp58 = icmp slt i32 %sub56, %sub57
br i1 %cmp58, label %cleanup, label %lor.lhs.false59
lor.lhs.false59: ; preds = %if.end
%cmp62 = icmp eq i32 %sub56, %sub57
br i1 %cmp62, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %lor.lhs.false59
%shl.i = shl i32 %7, 11
%xor.i = xor i32 %shl.i, %7
store i32 %8, ptr @x, align 4, !tbaa !5
store i32 %9, ptr @y, align 4, !tbaa !5
store i32 %xor4.i126128, ptr @z, align 4, !tbaa !5
%shr.i = lshr i32 %xor4.i126128, 19
%shr2.i = lshr i32 %xor.i, 8
%12 = xor i32 %shr2.i, %shr.i
%13 = xor i32 %12, %xor.i
%xor4.i = xor i32 %13, %xor4.i126128
store i32 %xor4.i, ptr @w, align 4, !tbaa !5
%rem = and i32 %xor4.i, 1
%cmp63 = icmp eq i32 %rem, 0
br i1 %cmp63, label %cleanup, label %if.else
if.else: ; preds = %land.lhs.true, %lor.lhs.false59
%xor4.i124 = phi i32 [ %xor4.i, %land.lhs.true ], [ %xor4.i126128, %lor.lhs.false59 ]
%14 = phi i32 [ %xor4.i126128, %land.lhs.true ], [ %9, %lor.lhs.false59 ]
%15 = phi i32 [ %9, %land.lhs.true ], [ %8, %lor.lhs.false59 ]
%16 = phi i32 [ %8, %land.lhs.true ], [ %7, %lor.lhs.false59 ]
br label %cleanup
cleanup: ; preds = %if.else, %land.lhs.true, %if.end, %for.body
%xor4.i125 = phi i32 [ %xor4.i126128, %for.body ], [ %xor4.i124, %if.else ], [ %xor4.i, %land.lhs.true ], [ %xor4.i126128, %if.end ]
%17 = phi i32 [ %9, %for.body ], [ %14, %if.else ], [ %xor4.i126128, %land.lhs.true ], [ %9, %if.end ]
%18 = phi i32 [ %8, %for.body ], [ %15, %if.else ], [ %9, %land.lhs.true ], [ %8, %if.end ]
%19 = phi i32 [ %7, %for.body ], [ %16, %if.else ], [ %8, %land.lhs.true ], [ %7, %if.end ]
%br.2 = phi i32 [ %br.0129, %for.body ], [ %br2.1, %if.else ], [ %br.0129, %land.lhs.true ], [ %br.0129, %if.end ]
%bl.2 = phi i32 [ %bl.0130, %for.body ], [ %bl2.0, %if.else ], [ %bl.0130, %land.lhs.true ], [ %bl.0130, %if.end ]
%ar.2 = phi i32 [ %ar.0131, %for.body ], [ %ar.0131, %if.else ], [ %ar2.1, %land.lhs.true ], [ %ar2.1, %if.end ]
%al.2 = phi i32 [ %al.0132, %for.body ], [ %al.0132, %if.else ], [ %spec.select, %land.lhs.true ], [ %spec.select, %if.end ]
%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 !12
for.end: ; preds = %cleanup, %entry
%br.0.lcssa = phi i32 [ %3, %entry ], [ %br.2, %cleanup ]
%bl.0.lcssa = phi i32 [ %2, %entry ], [ %bl.2, %cleanup ]
%ar.0.lcssa = phi i32 [ %1, %entry ], [ %ar.2, %cleanup ]
%al.0.lcssa = phi i32 [ %0, %entry ], [ %al.2, %cleanup ]
%20 = add i32 %br.0.lcssa, %ar.0.lcssa
%21 = add i32 %bl.0.lcssa, %al.0.lcssa
%add = sub i32 %20, %21
ret i32 %add
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %for.cond.preheader, label %cleanup239
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp1390 = icmp sgt i32 %0, 0
br i1 %cmp1390, label %for.body, label %for.cond12.preheader
for.cond12.preheader: ; preds = %if.end7, %for.cond.preheader
%1 = phi i32 [ %0, %for.cond.preheader ], [ %3, %if.end7 ]
%x.promoted.pre = load i32, ptr @x, align 4, !tbaa !5
%y.promoted.pre = load i32, ptr @y, align 4, !tbaa !5
%z.promoted.pre = load i32, ptr @z, align 4, !tbaa !5
%w.promoted.pre = load i32, ptr @w, align 4, !tbaa !5
br label %for.body14
for.body: ; preds = %for.cond.preheader, %if.end7
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end7 ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv
%R = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv, i32 1
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %R)
%cmp5.not = icmp eq i32 %call4, 2
br i1 %cmp5.not, label %if.end7, label %cleanup239
if.end7: ; preds = %for.body
%2 = load i32, ptr %R, align 4, !tbaa !11
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %R, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.cond12.preheader, !llvm.loop !14
for.body14: ; preds = %for.cond12.preheader, %for.inc235
%w.promoted = phi i32 [ %w.promoted.pre, %for.cond12.preheader ], [ %xor4.i.i449, %for.inc235 ]
%z.promoted = phi i32 [ %z.promoted.pre, %for.cond12.preheader ], [ %xor4.i126128.i446, %for.inc235 ]
%y.promoted = phi i32 [ %y.promoted.pre, %for.cond12.preheader ], [ %114, %for.inc235 ]
%x.promoted = phi i32 [ %x.promoted.pre, %for.cond12.preheader ], [ %115, %for.inc235 ]
%5 = phi i32 [ %1, %for.cond12.preheader ], [ %88, %for.inc235 ]
%ai.0460 = phi i32 [ 0, %for.cond12.preheader ], [ %rem220, %for.inc235 ]
%bi.0459 = phi i32 [ 0, %for.cond12.preheader ], [ %spec.select377, %for.inc235 ]
%best.0458 = phi i32 [ 0, %for.cond12.preheader ], [ %best.6, %for.inc235 ]
%r.0457 = phi i32 [ 0, %for.cond12.preheader ], [ %inc236, %for.inc235 ]
%cmp16393 = icmp sgt i32 %5, 1
br i1 %cmp16393, label %for.body17.preheader, label %for.cond29.preheader
for.body17.preheader: ; preds = %for.body14
%6 = zext i32 %5 to i64
br label %for.body17
for.cond15.for.cond29.preheader_crit_edge: ; preds = %for.body17
store i32 %9, ptr @x, align 4, !tbaa !5
store i32 %10, ptr @y, align 4, !tbaa !5
store i32 %xor4.i392394, ptr @z, align 4, !tbaa !5
store i32 %xor4.i, ptr @w, align 4, !tbaa !5
br label %for.cond29.preheader
for.cond29.preheader: ; preds = %for.cond15.for.cond29.preheader_crit_edge, %for.body14
%cmp30398 = icmp sgt i32 %5, 0
br i1 %cmp30398, label %for.body31.preheader, label %for.end95
for.body31.preheader: ; preds = %for.cond29.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%7 = icmp eq i32 %5, 1
br i1 %7, label %for.cond45.preheader.unr-lcssa, label %for.body31.preheader.new
for.body31.preheader.new: ; preds = %for.body31.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body31
for.body17: ; preds = %for.body17.preheader, %for.body17
%indvars.iv468 = phi i64 [ %6, %for.body17.preheader ], [ %indvars.iv.next469, %for.body17 ]
%8 = phi i32 [ %x.promoted, %for.body17.preheader ], [ %9, %for.body17 ]
%9 = phi i32 [ %y.promoted, %for.body17.preheader ], [ %10, %for.body17 ]
%10 = phi i32 [ %z.promoted, %for.body17.preheader ], [ %xor4.i392394, %for.body17 ]
%xor4.i392394 = phi i32 [ %w.promoted, %for.body17.preheader ], [ %xor4.i, %for.body17 ]
%indvars.iv.next469 = add nsw i64 %indvars.iv468, -1
%shl.i = shl i32 %8, 11
%xor.i = xor i32 %shl.i, %8
%shr.i = lshr i32 %xor4.i392394, 19
%shr2.i = lshr i32 %xor.i, 8
%11 = xor i32 %shr2.i, %shr.i
%12 = xor i32 %11, %xor.i
%xor4.i = xor i32 %12, %xor4.i392394
%13 = trunc i64 %indvars.iv468 to i32
%rem = urem i32 %xor4.i, %13
%idxprom19 = and i64 %indvars.iv.next469, 4294967295
%arrayidx20 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom19
%14 = load i64, ptr %arrayidx20, align 8
%idxprom23 = zext i32 %rem to i64
%arrayidx24 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom23
%15 = load i64, ptr %arrayidx24, align 8
store i64 %15, ptr %arrayidx20, align 8
store i64 %14, ptr %arrayidx24, align 8
%cmp16 = icmp ugt i64 %indvars.iv468, 2
br i1 %cmp16, label %for.body17, label %for.cond15.for.cond29.preheader_crit_edge, !llvm.loop !15
for.cond45.preheader.unr-lcssa: ; preds = %for.body31, %for.body31.preheader
%spec.select358.lcssa.ph = phi i32 [ undef, %for.body31.preheader ], [ %spec.select358.1, %for.body31 ]
%indvars.iv471.unr = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next472.1, %for.body31 ]
%ai.1400.unr = phi i32 [ %ai.0460, %for.body31.preheader ], [ %spec.select358.1, %for.body31 ]
%asmax.0399.unr = phi i32 [ -1, %for.body31.preheader ], [ %spec.select.1, %for.body31 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond45.preheader, label %for.body31.epil
for.body31.epil: ; preds = %for.cond45.preheader.unr-lcssa
%arrayidx33.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv471.unr
%R34.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv471.unr, i32 1
%16 = load i32, ptr %R34.epil, align 4, !tbaa !11
%17 = load i32, ptr %arrayidx33.epil, align 8, !tbaa !9
%sub38.epil = sub nsw i32 %16, %17
%cmp39.epil = icmp sgt i32 %sub38.epil, %asmax.0399.unr
%18 = trunc i64 %indvars.iv471.unr to i32
%spec.select358.epil = select i1 %cmp39.epil, i32 %18, i32 %ai.1400.unr
br label %for.cond45.preheader
for.cond45.preheader: ; preds = %for.cond45.preheader.unr-lcssa, %for.body31.epil
%spec.select358.lcssa = phi i32 [ %spec.select358.lcssa.ph, %for.cond45.preheader.unr-lcssa ], [ %spec.select358.epil, %for.body31.epil ]
br i1 %cmp30398, label %for.body47.lr.ph, label %for.end95
for.body47.lr.ph: ; preds = %for.cond45.preheader
%idxprom48 = sext i32 %spec.select358.lcssa to i64
%R67 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom48, i32 1
%arrayidx49 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom48
%19 = zext i32 %spec.select358.lcssa to i64
%wide.trip.count479 = zext i32 %5 to i64
br label %for.body47
for.body31: ; preds = %for.body31, %for.body31.preheader.new
%indvars.iv471 = phi i64 [ 0, %for.body31.preheader.new ], [ %indvars.iv.next472.1, %for.body31 ]
%ai.1400 = phi i32 [ %ai.0460, %for.body31.preheader.new ], [ %spec.select358.1, %for.body31 ]
%asmax.0399 = phi i32 [ -1, %for.body31.preheader.new ], [ %spec.select.1, %for.body31 ]
%niter = phi i64 [ 0, %for.body31.preheader.new ], [ %niter.next.1, %for.body31 ]
%arrayidx33 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv471
%R34 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv471, i32 1
%20 = load i32, ptr %R34, align 4, !tbaa !11
%21 = load i32, ptr %arrayidx33, align 16, !tbaa !9
%sub38 = sub nsw i32 %20, %21
%cmp39 = icmp sgt i32 %sub38, %asmax.0399
%spec.select = tail call i32 @llvm.smax.i32(i32 %sub38, i32 %asmax.0399)
%22 = trunc i64 %indvars.iv471 to i32
%spec.select358 = select i1 %cmp39, i32 %22, i32 %ai.1400
%indvars.iv.next472 = or i64 %indvars.iv471, 1
%arrayidx33.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next472
%R34.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next472, i32 1
%23 = load i32, ptr %R34.1, align 4, !tbaa !11
%24 = load i32, ptr %arrayidx33.1, align 8, !tbaa !9
%sub38.1 = sub nsw i32 %23, %24
%cmp39.1 = icmp sgt i32 %sub38.1, %spec.select
%spec.select.1 = tail call i32 @llvm.smax.i32(i32 %sub38.1, i32 %spec.select)
%25 = trunc i64 %indvars.iv.next472 to i32
%spec.select358.1 = select i1 %cmp39.1, i32 %25, i32 %spec.select358
%indvars.iv.next472.1 = add nuw nsw i64 %indvars.iv471, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond45.preheader.unr-lcssa, label %for.body31, !llvm.loop !16
for.body47: ; preds = %for.body47.lr.ph, %cleanup
%indvars.iv475 = phi i64 [ 0, %for.body47.lr.ph ], [ %indvars.iv.next476, %cleanup ]
%bi.1404 = phi i32 [ %bi.0459, %for.body47.lr.ph ], [ %bi.3, %cleanup ]
%bsmax.0403 = phi i32 [ 200000, %for.body47.lr.ph ], [ %bsmax.2, %cleanup ]
%cmp79 = icmp eq i64 %indvars.iv475, %19
br i1 %cmp79, label %cleanup, label %if.end81
if.end81: ; preds = %for.body47
%R64 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv475, i32 1
%26 = load i32, ptr %R64, align 4, !tbaa !11
%27 = load i32, ptr %R67, align 4, !tbaa !11
%cond78 = tail call i32 @llvm.smin.i32(i32 %26, i32 %27)
%arrayidx52 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv475
%28 = load i32, ptr %arrayidx52, align 8, !tbaa !9
%29 = load i32, ptr %arrayidx49, align 8, !tbaa !9
%. = tail call i32 @llvm.smax.i32(i32 %29, i32 %28)
%cmp82 = icmp slt i32 %., %cond78
%sub84 = sub nsw i32 %cond78, %.
%cond87 = select i1 %cmp82, i32 %sub84, i32 0
%cmp88 = icmp slt i32 %cond87, %bsmax.0403
%spec.select359 = tail call i32 @llvm.smin.i32(i32 %cond87, i32 %bsmax.0403)
%30 = trunc i64 %indvars.iv475 to i32
%spec.select360 = select i1 %cmp88, i32 %30, i32 %bi.1404
br label %cleanup
cleanup: ; preds = %for.body47, %if.end81
%bsmax.2 = phi i32 [ %spec.select359, %if.end81 ], [ %bsmax.0403, %for.body47 ]
%bi.3 = phi i32 [ %spec.select360, %if.end81 ], [ %bi.1404, %for.body47 ]
%indvars.iv.next476 = add nuw nsw i64 %indvars.iv475, 1
%exitcond480.not = icmp eq i64 %indvars.iv.next476, %wide.trip.count479
br i1 %exitcond480.not, label %for.end95, label %for.body47, !llvm.loop !17
for.end95: ; preds = %cleanup, %for.cond29.preheader, %for.cond45.preheader
%ai.1.lcssa524 = phi i32 [ %spec.select358.lcssa, %for.cond45.preheader ], [ %ai.0460, %for.cond29.preheader ], [ %spec.select358.lcssa, %cleanup ]
%bi.1.lcssa = phi i32 [ %bi.0459, %for.cond45.preheader ], [ %bi.0459, %for.cond29.preheader ], [ %bi.3, %cleanup ]
%call96 = tail call i32 @solve(i32 noundef %ai.1.lcssa524, i32 noundef %bi.1.lcssa)
%spec.select361 = tail call i32 @llvm.smax.i32(i32 %best.0458, i32 %call96)
%31 = load i32, ptr @N, align 4, !tbaa !5
%cmp101407 = icmp sgt i32 %31, 0
br i1 %cmp101407, label %for.body102.preheader, label %for.end131
for.body102.preheader: ; preds = %for.end95
%wide.trip.count485 = zext i32 %31 to i64
%32 = add nsw i64 %wide.trip.count485, -1
%xtraiter553 = and i64 %wide.trip.count485, 1
%33 = icmp eq i64 %32, 0
br i1 %33, label %for.cond113.preheader.unr-lcssa, label %for.body102.preheader.new
for.body102.preheader.new: ; preds = %for.body102.preheader
%unroll_iter556 = and i64 %wide.trip.count485, 4294967294
br label %for.body102
for.cond113.preheader.unr-lcssa: ; preds = %for.body102, %for.body102.preheader
%spec.select363.lcssa.ph = phi i32 [ undef, %for.body102.preheader ], [ %spec.select363.1, %for.body102 ]
%indvars.iv481.unr = phi i64 [ 0, %for.body102.preheader ], [ %indvars.iv.next482.1, %for.body102 ]
%ai.3409.unr = phi i32 [ %ai.1.lcssa524, %for.body102.preheader ], [ %spec.select363.1, %for.body102 ]
%asmax.2408.unr = phi i32 [ 200000, %for.body102.preheader ], [ %spec.select362.1, %for.body102 ]
%lcmp.mod554.not = icmp eq i64 %xtraiter553, 0
br i1 %lcmp.mod554.not, label %for.cond113.preheader, label %for.body102.epil
for.body102.epil: ; preds = %for.cond113.preheader.unr-lcssa
%arrayidx105.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv481.unr
%34 = load i32, ptr %arrayidx105.epil, align 8, !tbaa !9
%cmp107.epil = icmp slt i32 %34, %asmax.2408.unr
%35 = trunc i64 %indvars.iv481.unr to i32
%spec.select363.epil = select i1 %cmp107.epil, i32 %35, i32 %ai.3409.unr
br label %for.cond113.preheader
for.cond113.preheader: ; preds = %for.cond113.preheader.unr-lcssa, %for.body102.epil
%spec.select363.lcssa = phi i32 [ %spec.select363.lcssa.ph, %for.cond113.preheader.unr-lcssa ], [ %spec.select363.epil, %for.body102.epil ]
br i1 %cmp101407, label %for.body115.preheader, label %for.end131
for.body115.preheader: ; preds = %for.cond113.preheader
%36 = zext i32 %spec.select363.lcssa to i64
%xtraiter558 = and i64 %wide.trip.count485, 1
%37 = icmp eq i64 %32, 0
br i1 %37, label %for.end131.loopexit.unr-lcssa, label %for.body115.preheader.new
for.body115.preheader.new: ; preds = %for.body115.preheader
%unroll_iter561 = and i64 %wide.trip.count485, 4294967294
br label %for.body115
for.body102: ; preds = %for.body102, %for.body102.preheader.new
%indvars.iv481 = phi i64 [ 0, %for.body102.preheader.new ], [ %indvars.iv.next482.1, %for.body102 ]
%ai.3409 = phi i32 [ %ai.1.lcssa524, %for.body102.preheader.new ], [ %spec.select363.1, %for.body102 ]
%asmax.2408 = phi i32 [ 200000, %for.body102.preheader.new ], [ %spec.select362.1, %for.body102 ]
%niter557 = phi i64 [ 0, %for.body102.preheader.new ], [ %niter557.next.1, %for.body102 ]
%arrayidx105 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv481
%38 = load i32, ptr %arrayidx105, align 16, !tbaa !9
%cmp107 = icmp slt i32 %38, %asmax.2408
%spec.select362 = tail call i32 @llvm.smin.i32(i32 %38, i32 %asmax.2408)
%39 = trunc i64 %indvars.iv481 to i32
%spec.select363 = select i1 %cmp107, i32 %39, i32 %ai.3409
%indvars.iv.next482 = or i64 %indvars.iv481, 1
%arrayidx105.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next482
%40 = load i32, ptr %arrayidx105.1, align 8, !tbaa !9
%cmp107.1 = icmp slt i32 %40, %spec.select362
%spec.select362.1 = tail call i32 @llvm.smin.i32(i32 %40, i32 %spec.select362)
%41 = trunc i64 %indvars.iv.next482 to i32
%spec.select363.1 = select i1 %cmp107.1, i32 %41, i32 %spec.select363
%indvars.iv.next482.1 = add nuw nsw i64 %indvars.iv481, 2
%niter557.next.1 = add i64 %niter557, 2
%niter557.ncmp.1 = icmp eq i64 %niter557.next.1, %unroll_iter556
br i1 %niter557.ncmp.1, label %for.cond113.preheader.unr-lcssa, label %for.body102, !llvm.loop !18
for.body115: ; preds = %cleanup126.1, %for.body115.preheader.new
%indvars.iv487 = phi i64 [ 0, %for.body115.preheader.new ], [ %indvars.iv.next488.1, %cleanup126.1 ]
%bi.4415 = phi i32 [ %bi.1.lcssa, %for.body115.preheader.new ], [ %bi.6.1, %cleanup126.1 ]
%bsmax.3414 = phi i32 [ -1, %for.body115.preheader.new ], [ %bsmax.5.1, %cleanup126.1 ]
%niter562 = phi i64 [ 0, %for.body115.preheader.new ], [ %niter562.next.1, %cleanup126.1 ]
%cmp117 = icmp eq i64 %indvars.iv487, %36
br i1 %cmp117, label %cleanup126, label %if.end119
if.end119: ; preds = %for.body115
%R122 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv487, i32 1
%42 = load i32, ptr %R122, align 4, !tbaa !11
%cmp123 = icmp sgt i32 %42, %bsmax.3414
%spec.select364 = tail call i32 @llvm.smax.i32(i32 %42, i32 %bsmax.3414)
%43 = trunc i64 %indvars.iv487 to i32
%spec.select365 = select i1 %cmp123, i32 %43, i32 %bi.4415
br label %cleanup126
cleanup126: ; preds = %for.body115, %if.end119
%bsmax.5 = phi i32 [ %spec.select364, %if.end119 ], [ %bsmax.3414, %for.body115 ]
%bi.6 = phi i32 [ %spec.select365, %if.end119 ], [ %bi.4415, %for.body115 ]
%indvars.iv.next488 = or i64 %indvars.iv487, 1
%cmp117.1 = icmp eq i64 %indvars.iv.next488, %36
br i1 %cmp117.1, label %cleanup126.1, label %if.end119.1
if.end119.1: ; preds = %cleanup126
%R122.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next488, i32 1
%44 = load i32, ptr %R122.1, align 4, !tbaa !11
%cmp123.1 = icmp sgt i32 %44, %bsmax.5
%spec.select364.1 = tail call i32 @llvm.smax.i32(i32 %44, i32 %bsmax.5)
%45 = trunc i64 %indvars.iv.next488 to i32
%spec.select365.1 = select i1 %cmp123.1, i32 %45, i32 %bi.6
br label %cleanup126.1
cleanup126.1: ; preds = %if.end119.1, %cleanup126
%bsmax.5.1 = phi i32 [ %spec.select364.1, %if.end119.1 ], [ %bsmax.5, %cleanup126 ]
%bi.6.1 = phi i32 [ %spec.select365.1, %if.end119.1 ], [ %bi.6, %cleanup126 ]
%indvars.iv.next488.1 = add nuw nsw i64 %indvars.iv487, 2
%niter562.next.1 = add i64 %niter562, 2
%niter562.ncmp.1 = icmp eq i64 %niter562.next.1, %unroll_iter561
br i1 %niter562.ncmp.1, label %for.end131.loopexit.unr-lcssa, label %for.body115, !llvm.loop !19
for.end131.loopexit.unr-lcssa: ; preds = %cleanup126.1, %for.body115.preheader
%bi.6.lcssa.ph = phi i32 [ undef, %for.body115.preheader ], [ %bi.6.1, %cleanup126.1 ]
%indvars.iv487.unr = phi i64 [ 0, %for.body115.preheader ], [ %indvars.iv.next488.1, %cleanup126.1 ]
%bi.4415.unr = phi i32 [ %bi.1.lcssa, %for.body115.preheader ], [ %bi.6.1, %cleanup126.1 ]
%bsmax.3414.unr = phi i32 [ -1, %for.body115.preheader ], [ %bsmax.5.1, %cleanup126.1 ]
%lcmp.mod559.not = icmp eq i64 %xtraiter558, 0
br i1 %lcmp.mod559.not, label %for.end131, label %for.body115.epil
for.body115.epil: ; preds = %for.end131.loopexit.unr-lcssa
%cmp117.epil = icmp eq i64 %indvars.iv487.unr, %36
br i1 %cmp117.epil, label %for.end131, label %if.end119.epil
if.end119.epil: ; preds = %for.body115.epil
%R122.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv487.unr, i32 1
%46 = load i32, ptr %R122.epil, align 4, !tbaa !11
%cmp123.epil = icmp sgt i32 %46, %bsmax.3414.unr
%47 = trunc i64 %indvars.iv487.unr to i32
%spec.select365.epil = select i1 %cmp123.epil, i32 %47, i32 %bi.4415.unr
br label %for.end131
for.end131: ; preds = %for.end131.loopexit.unr-lcssa, %if.end119.epil, %for.body115.epil, %for.end95, %for.cond113.preheader
%ai.3.lcssa526 = phi i32 [ %spec.select363.lcssa, %for.cond113.preheader ], [ %ai.1.lcssa524, %for.end95 ], [ %spec.select363.lcssa, %for.body115.epil ], [ %spec.select363.lcssa, %if.end119.epil ], [ %spec.select363.lcssa, %for.end131.loopexit.unr-lcssa ]
%bi.4.lcssa = phi i32 [ %bi.1.lcssa, %for.cond113.preheader ], [ %bi.1.lcssa, %for.end95 ], [ %bi.6.lcssa.ph, %for.end131.loopexit.unr-lcssa ], [ %spec.select365.epil, %if.end119.epil ], [ %bi.4415.unr, %for.body115.epil ]
%call132 = tail call i32 @solve(i32 noundef %ai.3.lcssa526, i32 noundef %bi.4.lcssa)
%spec.select366 = tail call i32 @llvm.smax.i32(i32 %spec.select361, i32 %call132)
%48 = load i32, ptr @N, align 4, !tbaa !5
%cmp137418 = icmp sgt i32 %48, 0
br i1 %cmp137418, label %for.body138.preheader, label %for.end167
for.body138.preheader: ; preds = %for.end131
%wide.trip.count497 = zext i32 %48 to i64
%49 = add nsw i64 %wide.trip.count497, -1
%xtraiter563 = and i64 %wide.trip.count497, 1
%50 = icmp eq i64 %49, 0
br i1 %50, label %for.cond149.preheader.unr-lcssa, label %for.body138.preheader.new
for.body138.preheader.new: ; preds = %for.body138.preheader
%unroll_iter566 = and i64 %wide.trip.count497, 4294967294
br label %for.body138
for.cond149.preheader.unr-lcssa: ; preds = %for.body138, %for.body138.preheader
%spec.select368.lcssa.ph = phi i32 [ undef, %for.body138.preheader ], [ %spec.select368.1, %for.body138 ]
%indvars.iv493.unr = phi i64 [ 0, %for.body138.preheader ], [ %indvars.iv.next494.1, %for.body138 ]
%ai.5420.unr = phi i32 [ %ai.3.lcssa526, %for.body138.preheader ], [ %spec.select368.1, %for.body138 ]
%asmax.4419.unr = phi i32 [ 200000, %for.body138.preheader ], [ %spec.select367.1, %for.body138 ]
%lcmp.mod564.not = icmp eq i64 %xtraiter563, 0
br i1 %lcmp.mod564.not, label %for.cond149.preheader, label %for.body138.epil
for.body138.epil: ; preds = %for.cond149.preheader.unr-lcssa
%R142.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv493.unr, i32 1
%51 = load i32, ptr %R142.epil, align 4, !tbaa !11
%cmp143.epil = icmp slt i32 %51, %asmax.4419.unr
%52 = trunc i64 %indvars.iv493.unr to i32
%spec.select368.epil = select i1 %cmp143.epil, i32 %52, i32 %ai.5420.unr
br label %for.cond149.preheader
for.cond149.preheader: ; preds = %for.cond149.preheader.unr-lcssa, %for.body138.epil
%spec.select368.lcssa = phi i32 [ %spec.select368.lcssa.ph, %for.cond149.preheader.unr-lcssa ], [ %spec.select368.epil, %for.body138.epil ]
br i1 %cmp137418, label %for.body151.preheader, label %for.end167
for.body151.preheader: ; preds = %for.cond149.preheader
%53 = zext i32 %spec.select368.lcssa to i64
%xtraiter568 = and i64 %wide.trip.count497, 1
%54 = icmp eq i64 %49, 0
br i1 %54, label %for.end167.loopexit.unr-lcssa, label %for.body151.preheader.new
for.body151.preheader.new: ; preds = %for.body151.preheader
%unroll_iter571 = and i64 %wide.trip.count497, 4294967294
br label %for.body151
for.body138: ; preds = %for.body138, %for.body138.preheader.new
%indvars.iv493 = phi i64 [ 0, %for.body138.preheader.new ], [ %indvars.iv.next494.1, %for.body138 ]
%ai.5420 = phi i32 [ %ai.3.lcssa526, %for.body138.preheader.new ], [ %spec.select368.1, %for.body138 ]
%asmax.4419 = phi i32 [ 200000, %for.body138.preheader.new ], [ %spec.select367.1, %for.body138 ]
%niter567 = phi i64 [ 0, %for.body138.preheader.new ], [ %niter567.next.1, %for.body138 ]
%R142 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv493, i32 1
%55 = load i32, ptr %R142, align 4, !tbaa !11
%cmp143 = icmp slt i32 %55, %asmax.4419
%spec.select367 = tail call i32 @llvm.smin.i32(i32 %55, i32 %asmax.4419)
%56 = trunc i64 %indvars.iv493 to i32
%spec.select368 = select i1 %cmp143, i32 %56, i32 %ai.5420
%indvars.iv.next494 = or i64 %indvars.iv493, 1
%R142.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next494, i32 1
%57 = load i32, ptr %R142.1, align 4, !tbaa !11
%cmp143.1 = icmp slt i32 %57, %spec.select367
%spec.select367.1 = tail call i32 @llvm.smin.i32(i32 %57, i32 %spec.select367)
%58 = trunc i64 %indvars.iv.next494 to i32
%spec.select368.1 = select i1 %cmp143.1, i32 %58, i32 %spec.select368
%indvars.iv.next494.1 = add nuw nsw i64 %indvars.iv493, 2
%niter567.next.1 = add i64 %niter567, 2
%niter567.ncmp.1 = icmp eq i64 %niter567.next.1, %unroll_iter566
br i1 %niter567.ncmp.1, label %for.cond149.preheader.unr-lcssa, label %for.body138, !llvm.loop !20
for.body151: ; preds = %cleanup162.1, %for.body151.preheader.new
%indvars.iv499 = phi i64 [ 0, %for.body151.preheader.new ], [ %indvars.iv.next500.1, %cleanup162.1 ]
%bi.7426 = phi i32 [ %bi.4.lcssa, %for.body151.preheader.new ], [ %bi.9.1, %cleanup162.1 ]
%bsmax.6425 = phi i32 [ -1, %for.body151.preheader.new ], [ %bsmax.8.1, %cleanup162.1 ]
%niter572 = phi i64 [ 0, %for.body151.preheader.new ], [ %niter572.next.1, %cleanup162.1 ]
%cmp153 = icmp eq i64 %indvars.iv499, %53
br i1 %cmp153, label %cleanup162, label %if.end155
if.end155: ; preds = %for.body151
%arrayidx157 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv499
%59 = load i32, ptr %arrayidx157, align 16, !tbaa !9
%cmp159 = icmp sgt i32 %59, %bsmax.6425
%spec.select369 = tail call i32 @llvm.smax.i32(i32 %59, i32 %bsmax.6425)
%60 = trunc i64 %indvars.iv499 to i32
%spec.select370 = select i1 %cmp159, i32 %60, i32 %bi.7426
br label %cleanup162
cleanup162: ; preds = %for.body151, %if.end155
%bsmax.8 = phi i32 [ %spec.select369, %if.end155 ], [ %bsmax.6425, %for.body151 ]
%bi.9 = phi i32 [ %spec.select370, %if.end155 ], [ %bi.7426, %for.body151 ]
%indvars.iv.next500 = or i64 %indvars.iv499, 1
%cmp153.1 = icmp eq i64 %indvars.iv.next500, %53
br i1 %cmp153.1, label %cleanup162.1, label %if.end155.1
if.end155.1: ; preds = %cleanup162
%arrayidx157.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next500
%61 = load i32, ptr %arrayidx157.1, align 8, !tbaa !9
%cmp159.1 = icmp sgt i32 %61, %bsmax.8
%spec.select369.1 = tail call i32 @llvm.smax.i32(i32 %61, i32 %bsmax.8)
%62 = trunc i64 %indvars.iv.next500 to i32
%spec.select370.1 = select i1 %cmp159.1, i32 %62, i32 %bi.9
br label %cleanup162.1
cleanup162.1: ; preds = %if.end155.1, %cleanup162
%bsmax.8.1 = phi i32 [ %spec.select369.1, %if.end155.1 ], [ %bsmax.8, %cleanup162 ]
%bi.9.1 = phi i32 [ %spec.select370.1, %if.end155.1 ], [ %bi.9, %cleanup162 ]
%indvars.iv.next500.1 = add nuw nsw i64 %indvars.iv499, 2
%niter572.next.1 = add i64 %niter572, 2
%niter572.ncmp.1 = icmp eq i64 %niter572.next.1, %unroll_iter571
br i1 %niter572.ncmp.1, label %for.end167.loopexit.unr-lcssa, label %for.body151, !llvm.loop !21
for.end167.loopexit.unr-lcssa: ; preds = %cleanup162.1, %for.body151.preheader
%bi.9.lcssa.ph = phi i32 [ undef, %for.body151.preheader ], [ %bi.9.1, %cleanup162.1 ]
%indvars.iv499.unr = phi i64 [ 0, %for.body151.preheader ], [ %indvars.iv.next500.1, %cleanup162.1 ]
%bi.7426.unr = phi i32 [ %bi.4.lcssa, %for.body151.preheader ], [ %bi.9.1, %cleanup162.1 ]
%bsmax.6425.unr = phi i32 [ -1, %for.body151.preheader ], [ %bsmax.8.1, %cleanup162.1 ]
%lcmp.mod569.not = icmp eq i64 %xtraiter568, 0
br i1 %lcmp.mod569.not, label %for.end167, label %for.body151.epil
for.body151.epil: ; preds = %for.end167.loopexit.unr-lcssa
%cmp153.epil = icmp eq i64 %indvars.iv499.unr, %53
br i1 %cmp153.epil, label %for.end167, label %if.end155.epil
if.end155.epil: ; preds = %for.body151.epil
%arrayidx157.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv499.unr
%63 = load i32, ptr %arrayidx157.epil, align 8, !tbaa !9
%cmp159.epil = icmp sgt i32 %63, %bsmax.6425.unr
%64 = trunc i64 %indvars.iv499.unr to i32
%spec.select370.epil = select i1 %cmp159.epil, i32 %64, i32 %bi.7426.unr
br label %for.end167
for.end167: ; preds = %for.end167.loopexit.unr-lcssa, %if.end155.epil, %for.body151.epil, %for.end131, %for.cond149.preheader
%ai.5.lcssa528 = phi i32 [ %spec.select368.lcssa, %for.cond149.preheader ], [ %ai.3.lcssa526, %for.end131 ], [ %spec.select368.lcssa, %for.body151.epil ], [ %spec.select368.lcssa, %if.end155.epil ], [ %spec.select368.lcssa, %for.end167.loopexit.unr-lcssa ]
%bi.7.lcssa = phi i32 [ %bi.4.lcssa, %for.cond149.preheader ], [ %bi.4.lcssa, %for.end131 ], [ %bi.9.lcssa.ph, %for.end167.loopexit.unr-lcssa ], [ %spec.select370.epil, %if.end155.epil ], [ %bi.7426.unr, %for.body151.epil ]
%call168 = tail call i32 @solve(i32 noundef %ai.5.lcssa528, i32 noundef %bi.7.lcssa)
%spec.select371 = tail call i32 @llvm.smax.i32(i32 %spec.select366, i32 %call168)
%65 = load i32, ptr @N, align 4, !tbaa !5
%cmp173429 = icmp sgt i32 %65, 0
br i1 %cmp173429, label %for.body174.preheader, label %for.end211
for.body174.preheader: ; preds = %for.end167
%wide.trip.count509 = zext i32 %65 to i64
%66 = add nsw i64 %wide.trip.count509, -1
%xtraiter573 = and i64 %wide.trip.count509, 1
%67 = icmp eq i64 %66, 0
br i1 %67, label %for.cond189.preheader.unr-lcssa, label %for.body174.preheader.new
for.body174.preheader.new: ; preds = %for.body174.preheader
%unroll_iter576 = and i64 %wide.trip.count509, 4294967294
br label %for.body174
for.cond189.preheader.unr-lcssa: ; preds = %for.body174, %for.body174.preheader
%spec.select373.lcssa.ph = phi i32 [ undef, %for.body174.preheader ], [ %spec.select373.1, %for.body174 ]
%indvars.iv505.unr = phi i64 [ 0, %for.body174.preheader ], [ %indvars.iv.next506.1, %for.body174 ]
%ai.7431.unr = phi i32 [ %ai.5.lcssa528, %for.body174.preheader ], [ %spec.select373.1, %for.body174 ]
%asmax.6430.unr = phi i32 [ 200000, %for.body174.preheader ], [ %spec.select372.1, %for.body174 ]
%lcmp.mod574.not = icmp eq i64 %xtraiter573, 0
br i1 %lcmp.mod574.not, label %for.cond189.preheader, label %for.body174.epil
for.body174.epil: ; preds = %for.cond189.preheader.unr-lcssa
%arrayidx177.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv505.unr
%R178.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv505.unr, i32 1
%68 = load i32, ptr %R178.epil, align 4, !tbaa !11
%69 = load i32, ptr %arrayidx177.epil, align 8, !tbaa !9
%sub182.epil = sub nsw i32 %68, %69
%cmp183.epil = icmp slt i32 %sub182.epil, %asmax.6430.unr
%70 = trunc i64 %indvars.iv505.unr to i32
%spec.select373.epil = select i1 %cmp183.epil, i32 %70, i32 %ai.7431.unr
br label %for.cond189.preheader
for.cond189.preheader: ; preds = %for.cond189.preheader.unr-lcssa, %for.body174.epil
%spec.select373.lcssa = phi i32 [ %spec.select373.lcssa.ph, %for.cond189.preheader.unr-lcssa ], [ %spec.select373.epil, %for.body174.epil ]
br i1 %cmp173429, label %for.body191.preheader, label %for.end211
for.body191.preheader: ; preds = %for.cond189.preheader
%71 = zext i32 %spec.select373.lcssa to i64
%wide.trip.count515 = zext i32 %65 to i64
%xtraiter578 = and i64 %wide.trip.count515, 1
%72 = icmp eq i64 %66, 0
br i1 %72, label %for.end211.loopexit.unr-lcssa, label %for.body191.preheader.new
for.body191.preheader.new: ; preds = %for.body191.preheader
%unroll_iter581 = and i64 %wide.trip.count515, 4294967294
br label %for.body191
for.body174: ; preds = %for.body174, %for.body174.preheader.new
%indvars.iv505 = phi i64 [ 0, %for.body174.preheader.new ], [ %indvars.iv.next506.1, %for.body174 ]
%ai.7431 = phi i32 [ %ai.5.lcssa528, %for.body174.preheader.new ], [ %spec.select373.1, %for.body174 ]
%asmax.6430 = phi i32 [ 200000, %for.body174.preheader.new ], [ %spec.select372.1, %for.body174 ]
%niter577 = phi i64 [ 0, %for.body174.preheader.new ], [ %niter577.next.1, %for.body174 ]
%arrayidx177 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv505
%R178 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv505, i32 1
%73 = load i32, ptr %R178, align 4, !tbaa !11
%74 = load i32, ptr %arrayidx177, align 16, !tbaa !9
%sub182 = sub nsw i32 %73, %74
%cmp183 = icmp slt i32 %sub182, %asmax.6430
%spec.select372 = tail call i32 @llvm.smin.i32(i32 %sub182, i32 %asmax.6430)
%75 = trunc i64 %indvars.iv505 to i32
%spec.select373 = select i1 %cmp183, i32 %75, i32 %ai.7431
%indvars.iv.next506 = or i64 %indvars.iv505, 1
%arrayidx177.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next506
%R178.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next506, i32 1
%76 = load i32, ptr %R178.1, align 4, !tbaa !11
%77 = load i32, ptr %arrayidx177.1, align 8, !tbaa !9
%sub182.1 = sub nsw i32 %76, %77
%cmp183.1 = icmp slt i32 %sub182.1, %spec.select372
%spec.select372.1 = tail call i32 @llvm.smin.i32(i32 %sub182.1, i32 %spec.select372)
%78 = trunc i64 %indvars.iv.next506 to i32
%spec.select373.1 = select i1 %cmp183.1, i32 %78, i32 %spec.select373
%indvars.iv.next506.1 = add nuw nsw i64 %indvars.iv505, 2
%niter577.next.1 = add i64 %niter577, 2
%niter577.ncmp.1 = icmp eq i64 %niter577.next.1, %unroll_iter576
br i1 %niter577.ncmp.1, label %for.cond189.preheader.unr-lcssa, label %for.body174, !llvm.loop !22
for.body191: ; preds = %cleanup206.1, %for.body191.preheader.new
%indvars.iv511 = phi i64 [ 0, %for.body191.preheader.new ], [ %indvars.iv.next512.1, %cleanup206.1 ]
%bi.10437 = phi i32 [ %bi.7.lcssa, %for.body191.preheader.new ], [ %bi.12.1, %cleanup206.1 ]
%bsmax.9436 = phi i32 [ 200000, %for.body191.preheader.new ], [ %bsmax.11.1, %cleanup206.1 ]
%niter582 = phi i64 [ 0, %for.body191.preheader.new ], [ %niter582.next.1, %cleanup206.1 ]
%cmp193 = icmp eq i64 %indvars.iv511, %71
br i1 %cmp193, label %cleanup206, label %if.end195
if.end195: ; preds = %for.body191
%arrayidx197 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv511
%R198 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv511, i32 1
%79 = load i32, ptr %R198, align 4, !tbaa !11
%80 = load i32, ptr %arrayidx197, align 16, !tbaa !9
%sub202 = sub nsw i32 %79, %80
%cmp203 = icmp sgt i32 %sub202, %bsmax.9436
%spec.select374 = tail call i32 @llvm.smax.i32(i32 %sub202, i32 %bsmax.9436)
%81 = trunc i64 %indvars.iv511 to i32
%spec.select375 = select i1 %cmp203, i32 %81, i32 %bi.10437
br label %cleanup206
cleanup206: ; preds = %for.body191, %if.end195
%bsmax.11 = phi i32 [ %spec.select374, %if.end195 ], [ %bsmax.9436, %for.body191 ]
%bi.12 = phi i32 [ %spec.select375, %if.end195 ], [ %bi.10437, %for.body191 ]
%indvars.iv.next512 = or i64 %indvars.iv511, 1
%cmp193.1 = icmp eq i64 %indvars.iv.next512, %71
br i1 %cmp193.1, label %cleanup206.1, label %if.end195.1
if.end195.1: ; preds = %cleanup206
%arrayidx197.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next512
%R198.1 = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.next512, i32 1
%82 = load i32, ptr %R198.1, align 4, !tbaa !11
%83 = load i32, ptr %arrayidx197.1, align 8, !tbaa !9
%sub202.1 = sub nsw i32 %82, %83
%cmp203.1 = icmp sgt i32 %sub202.1, %bsmax.11
%spec.select374.1 = tail call i32 @llvm.smax.i32(i32 %sub202.1, i32 %bsmax.11)
%84 = trunc i64 %indvars.iv.next512 to i32
%spec.select375.1 = select i1 %cmp203.1, i32 %84, i32 %bi.12
br label %cleanup206.1
cleanup206.1: ; preds = %if.end195.1, %cleanup206
%bsmax.11.1 = phi i32 [ %spec.select374.1, %if.end195.1 ], [ %bsmax.11, %cleanup206 ]
%bi.12.1 = phi i32 [ %spec.select375.1, %if.end195.1 ], [ %bi.12, %cleanup206 ]
%indvars.iv.next512.1 = add nuw nsw i64 %indvars.iv511, 2
%niter582.next.1 = add i64 %niter582, 2
%niter582.ncmp.1 = icmp eq i64 %niter582.next.1, %unroll_iter581
br i1 %niter582.ncmp.1, label %for.end211.loopexit.unr-lcssa, label %for.body191, !llvm.loop !23
for.end211.loopexit.unr-lcssa: ; preds = %cleanup206.1, %for.body191.preheader
%bi.12.lcssa.ph = phi i32 [ undef, %for.body191.preheader ], [ %bi.12.1, %cleanup206.1 ]
%indvars.iv511.unr = phi i64 [ 0, %for.body191.preheader ], [ %indvars.iv.next512.1, %cleanup206.1 ]
%bi.10437.unr = phi i32 [ %bi.7.lcssa, %for.body191.preheader ], [ %bi.12.1, %cleanup206.1 ]
%bsmax.9436.unr = phi i32 [ 200000, %for.body191.preheader ], [ %bsmax.11.1, %cleanup206.1 ]
%lcmp.mod579.not = icmp eq i64 %xtraiter578, 0
br i1 %lcmp.mod579.not, label %for.end211, label %for.body191.epil
for.body191.epil: ; preds = %for.end211.loopexit.unr-lcssa
%cmp193.epil = icmp eq i64 %indvars.iv511.unr, %71
br i1 %cmp193.epil, label %for.end211, label %if.end195.epil
if.end195.epil: ; preds = %for.body191.epil
%arrayidx197.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv511.unr
%R198.epil = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv511.unr, i32 1
%85 = load i32, ptr %R198.epil, align 4, !tbaa !11
%86 = load i32, ptr %arrayidx197.epil, align 8, !tbaa !9
%sub202.epil = sub nsw i32 %85, %86
%cmp203.epil = icmp sgt i32 %sub202.epil, %bsmax.9436.unr
%87 = trunc i64 %indvars.iv511.unr to i32
%spec.select375.epil = select i1 %cmp203.epil, i32 %87, i32 %bi.10437.unr
br label %for.end211
for.end211: ; preds = %for.end211.loopexit.unr-lcssa, %if.end195.epil, %for.body191.epil, %for.end167, %for.cond189.preheader
%ai.7.lcssa530 = phi i32 [ %spec.select373.lcssa, %for.cond189.preheader ], [ %ai.5.lcssa528, %for.end167 ], [ %spec.select373.lcssa, %for.body191.epil ], [ %spec.select373.lcssa, %if.end195.epil ], [ %spec.select373.lcssa, %for.end211.loopexit.unr-lcssa ]
%bi.10.lcssa = phi i32 [ %bi.7.lcssa, %for.cond189.preheader ], [ %bi.7.lcssa, %for.end167 ], [ %bi.12.lcssa.ph, %for.end211.loopexit.unr-lcssa ], [ %spec.select375.epil, %if.end195.epil ], [ %bi.10437.unr, %for.body191.epil ]
%call212 = tail call i32 @solve(i32 noundef %ai.7.lcssa530, i32 noundef %bi.10.lcssa)
%spec.select376 = tail call i32 @llvm.smax.i32(i32 %spec.select371, i32 %call212)
%88 = load i32, ptr @N, align 4, !tbaa !5
%sub222 = add nsw i32 %88, -1
%cmp127.i = icmp sgt i32 %88, 0
%x.promoted440 = load i32, ptr @x, align 4, !tbaa !5
%y.promoted442 = load i32, ptr @y, align 4, !tbaa !5
%z.promoted444 = load i32, ptr @z, align 4, !tbaa !5
%w.promoted447 = load i32, ptr @w, align 4, !tbaa !5
%wide.trip.count.i = zext i32 %88 to i64
br label %for.body218
for.body218: ; preds = %for.end211, %solve.exit
%i.9456 = phi i32 [ 0, %for.end211 ], [ %inc233, %solve.exit ]
%best.5455 = phi i32 [ %spec.select376, %for.end211 ], [ %best.6, %solve.exit ]
%89 = phi i32 [ %x.promoted440, %for.end211 ], [ %115, %solve.exit ]
%90 = phi i32 [ %y.promoted442, %for.end211 ], [ %114, %solve.exit ]
%xor4.i126128.i445454 = phi i32 [ %z.promoted444, %for.end211 ], [ %xor4.i126128.i446, %solve.exit ]
%xor4.i.i448453 = phi i32 [ %w.promoted447, %for.end211 ], [ %xor4.i.i449, %solve.exit ]
%shl.i378 = shl i32 %89, 11
%xor.i379 = xor i32 %shl.i378, %89
%shr.i380 = lshr i32 %xor4.i.i448453, 19
%shr2.i381 = lshr i32 %xor.i379, 8
%91 = xor i32 %shr2.i381, %shr.i380
%92 = xor i32 %91, %xor.i379
%xor4.i382 = xor i32 %92, %xor4.i.i448453
%rem220 = urem i32 %xor4.i382, %88
%shl.i383 = shl i32 %90, 11
%xor.i384 = xor i32 %shl.i383, %90
%shr.i385 = lshr i32 %xor4.i382, 19
%shr2.i386 = lshr i32 %xor.i384, 8
%93 = xor i32 %shr2.i386, %shr.i385
%94 = xor i32 %93, %xor.i384
%xor4.i387 = xor i32 %94, %xor4.i382
%rem223 = urem i32 %xor4.i387, %sub222
%cmp224.not = icmp sle i32 %rem220, %rem223
%inc226 = zext i1 %cmp224.not to i32
%spec.select377 = add nuw nsw i32 %rem223, %inc226
%idxprom.i = sext i32 %rem220 to i64
%arrayidx.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom.i
%95 = load i32, ptr %arrayidx.i, align 8, !tbaa !9
%R.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom.i, i32 1
%96 = load i32, ptr %R.i, align 4, !tbaa !11
%idxprom3.i = sext i32 %spec.select377 to i64
%arrayidx4.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom3.i
%97 = load i32, ptr %arrayidx4.i, align 8, !tbaa !9
%R8.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %idxprom3.i, i32 1
%98 = load i32, ptr %R8.i, align 4, !tbaa !11
br i1 %cmp127.i, label %for.body.preheader.i, label %solve.exit
for.body.preheader.i: ; preds = %for.body218
%99 = zext i32 %spec.select377 to i64
%100 = zext i32 %rem220 to i64
br label %for.body.i
for.body.i: ; preds = %cleanup.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %cleanup.i ]
%al.0132.i = phi i32 [ %95, %for.body.preheader.i ], [ %al.2.i, %cleanup.i ]
%ar.0131.i = phi i32 [ %96, %for.body.preheader.i ], [ %ar.2.i, %cleanup.i ]
%bl.0130.i = phi i32 [ %97, %for.body.preheader.i ], [ %bl.2.i, %cleanup.i ]
%br.0129.i = phi i32 [ %98, %for.body.preheader.i ], [ %br.2.i, %cleanup.i ]
%101 = phi i32 [ %xor4.i126128.i445454, %for.body.preheader.i ], [ %113, %cleanup.i ]
%102 = phi i32 [ %xor4.i.i448453, %for.body.preheader.i ], [ %112, %cleanup.i ]
%103 = phi i32 [ %xor4.i382, %for.body.preheader.i ], [ %111, %cleanup.i ]
%xor4.i126128.i = phi i32 [ %xor4.i387, %for.body.preheader.i ], [ %xor4.i125.i, %cleanup.i ]
%cmp10.i = icmp eq i64 %indvars.iv.i, %100
%cmp11.i = icmp eq i64 %indvars.iv.i, %99
%or.cond.i = or i1 %cmp10.i, %cmp11.i
br i1 %or.cond.i, label %cleanup.i, label %if.end.i
if.end.i: ; preds = %for.body.i
%sub9.i = sub nsw i32 %br.0129.i, %bl.0130.i
%sub.i = sub nsw i32 %ar.0131.i, %al.0132.i
%arrayidx13.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.i
%104 = load i32, ptr %arrayidx13.i, align 8, !tbaa !9
%spec.select.i = tail call i32 @llvm.smax.i32(i32 %al.0132.i, i32 %104)
%R23.i = getelementptr inbounds [200000 x %struct.lr_t], ptr @LR, i64 0, i64 %indvars.iv.i, i32 1
%105 = load i32, ptr %R23.i, align 4, !tbaa !11
%ar2.0.i = tail call i32 @llvm.smin.i32(i32 %105, i32 %ar.0131.i)
%bl2.0.i = tail call i32 @llvm.smax.i32(i32 %bl.0130.i, i32 %104)
%br2.0.i = tail call i32 @llvm.smin.i32(i32 %105, i32 %br.0129.i)
%ar2.1.i = tail call i32 @llvm.smax.i32(i32 %ar2.0.i, i32 %spec.select.i)
%br2.1.i = tail call i32 @llvm.smax.i32(i32 %br2.0.i, i32 %bl2.0.i)
%sub54.neg.i = sub i32 %spec.select.i, %ar2.1.i
%sub55.neg.i = sub i32 %bl2.0.i, %br2.1.i
%sub56.i = add i32 %sub54.neg.i, %sub.i
%sub57.i = add i32 %sub55.neg.i, %sub9.i
%cmp58.i = icmp slt i32 %sub56.i, %sub57.i
br i1 %cmp58.i, label %cleanup.i, label %lor.lhs.false59.i
lor.lhs.false59.i: ; preds = %if.end.i
%cmp62.i = icmp eq i32 %sub56.i, %sub57.i
br i1 %cmp62.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %lor.lhs.false59.i
%shl.i.i = shl i32 %101, 11
%xor.i.i = xor i32 %shl.i.i, %101
%shr.i.i = lshr i32 %xor4.i126128.i, 19
%shr2.i.i = lshr i32 %xor.i.i, 8
%106 = xor i32 %shr2.i.i, %shr.i.i
%107 = xor i32 %106, %xor.i.i
%xor4.i.i = xor i32 %107, %xor4.i126128.i
%rem.i = and i32 %xor4.i.i, 1
%cmp63.i = icmp eq i32 %rem.i, 0
br i1 %cmp63.i, label %cleanup.i, label %if.else.i
if.else.i: ; preds = %land.lhs.true.i, %lor.lhs.false59.i
%xor4.i124.i = phi i32 [ %xor4.i.i, %land.lhs.true.i ], [ %xor4.i126128.i, %lor.lhs.false59.i ]
%108 = phi i32 [ %xor4.i126128.i, %land.lhs.true.i ], [ %103, %lor.lhs.false59.i ]
%109 = phi i32 [ %103, %land.lhs.true.i ], [ %102, %lor.lhs.false59.i ]
%110 = phi i32 [ %102, %land.lhs.true.i ], [ %101, %lor.lhs.false59.i ]
br label %cleanup.i
cleanup.i: ; preds = %if.else.i, %land.lhs.true.i, %if.end.i, %for.body.i
%xor4.i125.i = phi i32 [ %xor4.i126128.i, %for.body.i ], [ %xor4.i124.i, %if.else.i ], [ %xor4.i.i, %land.lhs.true.i ], [ %xor4.i126128.i, %if.end.i ]
%111 = phi i32 [ %103, %for.body.i ], [ %108, %if.else.i ], [ %xor4.i126128.i, %land.lhs.true.i ], [ %103, %if.end.i ]
%112 = phi i32 [ %102, %for.body.i ], [ %109, %if.else.i ], [ %103, %land.lhs.true.i ], [ %102, %if.end.i ]
%113 = phi i32 [ %101, %for.body.i ], [ %110, %if.else.i ], [ %102, %land.lhs.true.i ], [ %101, %if.end.i ]
%br.2.i = phi i32 [ %br.0129.i, %for.body.i ], [ %br2.1.i, %if.else.i ], [ %br.0129.i, %land.lhs.true.i ], [ %br.0129.i, %if.end.i ]
%bl.2.i = phi i32 [ %bl.0130.i, %for.body.i ], [ %bl2.0.i, %if.else.i ], [ %bl.0130.i, %land.lhs.true.i ], [ %bl.0130.i, %if.end.i ]
%ar.2.i = phi i32 [ %ar.0131.i, %for.body.i ], [ %ar.0131.i, %if.else.i ], [ %ar2.1.i, %land.lhs.true.i ], [ %ar2.1.i, %if.end.i ]
%al.2.i = phi i32 [ %al.0132.i, %for.body.i ], [ %al.0132.i, %if.else.i ], [ %spec.select.i, %land.lhs.true.i ], [ %spec.select.i, %if.end.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %solve.exit, label %for.body.i, !llvm.loop !12
solve.exit: ; preds = %cleanup.i, %for.body218
%xor4.i.i449 = phi i32 [ %xor4.i387, %for.body218 ], [ %xor4.i125.i, %cleanup.i ]
%xor4.i126128.i446 = phi i32 [ %xor4.i382, %for.body218 ], [ %111, %cleanup.i ]
%114 = phi i32 [ %xor4.i.i448453, %for.body218 ], [ %112, %cleanup.i ]
%115 = phi i32 [ %xor4.i126128.i445454, %for.body218 ], [ %113, %cleanup.i ]
%br.0.lcssa.i = phi i32 [ %98, %for.body218 ], [ %br.2.i, %cleanup.i ]
%bl.0.lcssa.i = phi i32 [ %97, %for.body218 ], [ %bl.2.i, %cleanup.i ]
%ar.0.lcssa.i = phi i32 [ %96, %for.body218 ], [ %ar.2.i, %cleanup.i ]
%al.0.lcssa.i = phi i32 [ %95, %for.body218 ], [ %al.2.i, %cleanup.i ]
%116 = add i32 %br.0.lcssa.i, %ar.0.lcssa.i
%117 = add i32 %bl.0.lcssa.i, %al.0.lcssa.i
%add.i = sub i32 %116, %117
%best.6 = tail call i32 @llvm.smax.i32(i32 %best.5455, i32 %add.i)
%inc233 = add nuw nsw i32 %i.9456, 1
%exitcond517.not = icmp eq i32 %inc233, 10
br i1 %exitcond517.not, label %for.inc235, label %for.body218, !llvm.loop !24
for.inc235: ; preds = %solve.exit
store i32 %115, ptr @x, align 4, !tbaa !5
store i32 %114, ptr @y, align 4, !tbaa !5
store i32 %xor4.i126128.i446, ptr @z, align 4, !tbaa !5
store i32 %xor4.i.i449, ptr @w, align 4, !tbaa !5
%inc236 = add nuw nsw i32 %r.0457, 1
%exitcond518.not = icmp eq i32 %inc236, 180
br i1 %exitcond518.not, label %for.end237, label %for.body14, !llvm.loop !25
for.end237: ; preds = %for.inc235
%call238 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %best.6)
br label %cleanup239
cleanup239: ; preds = %for.body, %entry, %for.end237
%retval.0 = phi i32 [ 0, %for.end237 ], [ 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 #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree 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, !6, i64 0}
!10 = !{!"lr_t", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
|
#include<stdio.h>
int main()
{
long long int t,n,i,j,grid[305][305],k,m,flag;
scanf("%lld",&t);
for(i=0;i<t;i++)
{
flag=0;
scanf("%lld%lld",&n,&m);
for(j=0;j<n;j++)
{
for(k=0;k<m;k++)
{
scanf("%lld",&grid[j][k]);
if(grid[j][k]>4)
flag=1;
if(j==0||j==n-1)
{
if(grid[j][k]>3)
flag=1;
}
if(k==0||k==m-1)
{
if(grid[j][k]>3)
flag=1;
}
}
}
if(grid[0][0]>2||grid[0][m-1]>2||grid[n-1][0]>2||grid[n-1][m-1]>2)
flag=1;
if(flag==1)
{
printf("NO\n");
}
else
{
printf("YES\n");
for(j=0;j<n;j++)
{
for(k=0;k<m;k++)
{
if(j==0||j==n-1)
{
if(k==0||k==m-1)
printf("2 ");
else
printf("3 ");
}
else if(k==0||k==m-1)
{
printf("3 ");
}
else
printf("4 ");
}
printf("\n");
}
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22802/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22802/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"2 \00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"3 \00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"4 \00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.8 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
%grid = alloca [305 x [305 x i64]], align 16
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 744200, ptr nonnull %grid) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%cmp153 = icmp sgt i64 %0, 0
br i1 %cmp153, label %for.body, label %for.end102
for.body: ; preds = %entry, %for.inc100
%i.0154 = phi i64 [ %inc101, %for.inc100 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp3140 = icmp sgt i64 %1, 0
%2 = load i64, ptr %m, align 8
%3 = icmp sgt i64 %2, 0
%or.cond = select i1 %cmp3140, i1 %3, i1 false
br i1 %or.cond, label %for.cond5.preheader, label %for.end35
for.cond5.preheader: ; preds = %for.body, %for.inc33
%4 = phi i64 [ %18, %for.inc33 ], [ %1, %for.body ]
%5 = phi i64 [ %19, %for.inc33 ], [ %2, %for.body ]
%flag.0143 = phi i64 [ %flag.1.lcssa, %for.inc33 ], [ 0, %for.body ]
%j.0141 = phi i64 [ %inc34, %for.inc33 ], [ 0, %for.body ]
%cmp6136 = icmp sgt i64 %5, 0
br i1 %cmp6136, label %for.body7.lr.ph, label %for.inc33
for.body7.lr.ph: ; preds = %for.cond5.preheader
%cmp13 = icmp eq i64 %j.0141, 0
br i1 %cmp13, label %for.inc.us.peel, label %for.inc.peel
for.inc.peel: ; preds = %for.body7.lr.ph
%arrayidx8.peel = getelementptr inbounds [305 x [305 x i64]], ptr %grid, i64 0, i64 %j.0141, i64 0
%call9.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.peel)
%6 = load i64, ptr %n, align 8, !tbaa !5
%.pre.pre = load i64, ptr %m, align 8, !tbaa !5
%7 = load i64, ptr %arrayidx8.peel, align 8, !tbaa !5
%cmp18.peel = icmp sgt i64 %7, 3
%spec.select131.peel = select i1 %cmp18.peel, i64 1, i64 %flag.0143
%cmp6.peel = icmp sgt i64 %.pre.pre, 1
br i1 %cmp6.peel, label %lor.lhs.false23, label %for.inc33
for.inc.us.peel: ; preds = %for.body7.lr.ph
%call9.us.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %grid)
%.pre164.pre = load i64, ptr %m, align 8, !tbaa !5
%8 = load i64, ptr %grid, align 16, !tbaa !5
%cmp18.us.peel = icmp sgt i64 %8, 3
%spec.select131.us.peel = select i1 %cmp18.us.peel, i64 1, i64 %flag.0143
%cmp6.us.peel = icmp sgt i64 %.pre164.pre, 1
br i1 %cmp6.us.peel, label %lor.lhs.false23.us, label %for.inc33.loopexit
lor.lhs.false23.us: ; preds = %for.inc.us.peel, %lor.lhs.false23.us
%flag.1139.us = phi i64 [ %spec.select, %lor.lhs.false23.us ], [ %spec.select131.us.peel, %for.inc.us.peel ]
%k.0137.us = phi i64 [ %inc.us, %lor.lhs.false23.us ], [ 1, %for.inc.us.peel ]
%arrayidx8.us = getelementptr inbounds [305 x [305 x i64]], ptr %grid, i64 0, i64 0, i64 %k.0137.us
%call9.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.us)
%9 = load i64, ptr %arrayidx8.us, align 8, !tbaa !5
%cmp18.us = icmp sgt i64 %9, 3
%spec.select130.us = select i1 %cmp18.us, i64 1, i64 %flag.1139.us
%10 = load i64, ptr %m, align 8, !tbaa !5
%sub24.us = add nsw i64 %10, -1
%cmp25.us = icmp eq i64 %k.0137.us, %sub24.us
%spec.select131.us = select i1 %cmp18.us, i64 1, i64 %flag.1139.us
%spec.select = select i1 %cmp25.us, i64 %spec.select131.us, i64 %spec.select130.us
%inc.us = add nuw nsw i64 %k.0137.us, 1
%cmp6.us = icmp slt i64 %inc.us, %10
br i1 %cmp6.us, label %lor.lhs.false23.us, label %for.inc33.loopexit, !llvm.loop !9
lor.lhs.false23: ; preds = %for.inc.peel, %lor.lhs.false23
%flag.1139 = phi i64 [ %spec.select177, %lor.lhs.false23 ], [ %spec.select131.peel, %for.inc.peel ]
%k.0137 = phi i64 [ %inc, %lor.lhs.false23 ], [ 1, %for.inc.peel ]
%arrayidx8 = getelementptr inbounds [305 x [305 x i64]], ptr %grid, i64 0, i64 %j.0141, i64 %k.0137
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%11 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%cmp12 = icmp sgt i64 %11, 4
%12 = load i64, ptr %n, align 8, !tbaa !5
%sub = add nsw i64 %12, -1
%cmp14 = icmp eq i64 %j.0141, %sub
%cmp18 = icmp sgt i64 %11, 3
%13 = load i64, ptr %m, align 8, !tbaa !5
%sub24 = add nsw i64 %13, -1
%cmp25 = icmp eq i64 %k.0137, %sub24
%14 = select i1 %cmp25, i1 true, i1 %cmp14
%15 = select i1 %14, i1 %cmp18, i1 false
%16 = select i1 %15, i1 true, i1 %cmp12
%spec.select177 = select i1 %16, i64 1, i64 %flag.1139
%inc = add nuw nsw i64 %k.0137, 1
%cmp6 = icmp slt i64 %inc, %13
br i1 %cmp6, label %lor.lhs.false23, label %for.inc33, !llvm.loop !12
for.inc33.loopexit: ; preds = %lor.lhs.false23.us, %for.inc.us.peel
%17 = phi i64 [ %.pre164.pre, %for.inc.us.peel ], [ %10, %lor.lhs.false23.us ]
%flag.4.us.lcssa = phi i64 [ %spec.select131.us.peel, %for.inc.us.peel ], [ %spec.select, %lor.lhs.false23.us ]
%.pre166 = load i64, ptr %n, align 8, !tbaa !5
br label %for.inc33
for.inc33: ; preds = %lor.lhs.false23, %for.inc.peel, %for.inc33.loopexit, %for.cond5.preheader
%18 = phi i64 [ %4, %for.cond5.preheader ], [ %.pre166, %for.inc33.loopexit ], [ %6, %for.inc.peel ], [ %12, %lor.lhs.false23 ]
%19 = phi i64 [ %5, %for.cond5.preheader ], [ %17, %for.inc33.loopexit ], [ %.pre.pre, %for.inc.peel ], [ %13, %lor.lhs.false23 ]
%flag.1.lcssa = phi i64 [ %flag.0143, %for.cond5.preheader ], [ %flag.4.us.lcssa, %for.inc33.loopexit ], [ %spec.select131.peel, %for.inc.peel ], [ %spec.select177, %lor.lhs.false23 ]
%inc34 = add nuw nsw i64 %j.0141, 1
%cmp3 = icmp slt i64 %inc34, %18
br i1 %cmp3, label %for.cond5.preheader, label %for.end35, !llvm.loop !13
for.end35: ; preds = %for.inc33, %for.body
%flag.0.lcssa = phi i64 [ 0, %for.body ], [ %flag.1.lcssa, %for.inc33 ]
%.lcssa = phi i64 [ %1, %for.body ], [ %18, %for.inc33 ]
%20 = load i64, ptr %grid, align 16, !tbaa !5
%cmp38 = icmp sgt i64 %20, 2
br i1 %cmp38, label %if.then58, label %lor.lhs.false39
lor.lhs.false39: ; preds = %for.end35
%21 = load i64, ptr %m, align 8, !tbaa !5
%sub41 = add nsw i64 %21, -1
%arrayidx42 = getelementptr inbounds [305 x i64], ptr %grid, i64 0, i64 %sub41
%22 = load i64, ptr %arrayidx42, align 8, !tbaa !5
%cmp43 = icmp sgt i64 %22, 2
br i1 %cmp43, label %if.then58, label %lor.lhs.false44
lor.lhs.false44: ; preds = %lor.lhs.false39
%sub45 = add nsw i64 %.lcssa, -1
%arrayidx46 = getelementptr inbounds [305 x [305 x i64]], ptr %grid, i64 0, i64 %sub45
%23 = load i64, ptr %arrayidx46, align 8, !tbaa !5
%cmp48 = icmp sgt i64 %23, 2
br i1 %cmp48, label %if.then58, label %lor.lhs.false49
lor.lhs.false49: ; preds = %lor.lhs.false44
%arrayidx53 = getelementptr inbounds [305 x [305 x i64]], ptr %grid, i64 0, i64 %sub45, i64 %sub41
%24 = load i64, ptr %arrayidx53, align 8, !tbaa !5
%cmp54 = icmp sgt i64 %24, 2
%cmp57 = icmp eq i64 %flag.0.lcssa, 1
%or.cond134 = select i1 %cmp54, i1 true, i1 %cmp57
br i1 %or.cond134, label %if.then58, label %if.else
if.then58: ; preds = %lor.lhs.false49, %lor.lhs.false44, %lor.lhs.false39, %for.end35
%puts129 = call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
br label %for.inc100
if.else: ; preds = %lor.lhs.false49
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%25 = load i64, ptr %n, align 8, !tbaa !5
%cmp62150 = icmp sgt i64 %25, 0
br i1 %cmp62150, label %for.cond64.preheader, label %for.inc100
for.cond64.preheader: ; preds = %if.else, %for.end94
%26 = phi i64 [ %34, %for.end94 ], [ %25, %if.else ]
%j.1151 = phi i64 [ %inc97, %for.end94 ], [ 0, %if.else ]
%27 = load i64, ptr %m, align 8, !tbaa !5
%cmp65148 = icmp sgt i64 %27, 0
br i1 %cmp65148, label %for.body66.lr.ph, label %for.end94
for.body66.lr.ph: ; preds = %for.cond64.preheader
%cmp67 = icmp eq i64 %j.1151, 0
br i1 %cmp67, label %for.inc92.us.peel, label %for.body66.preheader
for.body66.preheader: ; preds = %for.body66.lr.ph
%sub69.peel = add nsw i64 %26, -1
%cmp70.peel = icmp eq i64 %j.1151, %sub69.peel
%.str.4..str.5 = select i1 %cmp70.peel, ptr @.str.4, ptr @.str.5
%call77.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4..str.5)
%28 = load i64, ptr %m, align 8, !tbaa !5
%cmp65.peel = icmp sgt i64 %28, 1
br i1 %cmp65.peel, label %for.body66, label %for.end94
for.inc92.us.peel: ; preds = %for.body66.lr.ph
%call77.us.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
%.pre167 = load i64, ptr %m, align 8, !tbaa !5
%cmp65.us.peel = icmp sgt i64 %.pre167, 1
br i1 %cmp65.us.peel, label %for.body66.us, label %for.end94
for.body66.us: ; preds = %for.inc92.us.peel, %for.body66.us
%29 = phi i64 [ %30, %for.body66.us ], [ %.pre167, %for.inc92.us.peel ]
%k.1149.us = phi i64 [ %inc93.us, %for.body66.us ], [ 1, %for.inc92.us.peel ]
%sub74.us = add nsw i64 %29, -1
%cmp75.us = icmp eq i64 %k.1149.us, %sub74.us
%.str.4..str.5180 = select i1 %cmp75.us, ptr @.str.4, ptr @.str.5
%call77.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4..str.5180)
%inc93.us = add nuw nsw i64 %k.1149.us, 1
%30 = load i64, ptr %m, align 8, !tbaa !5
%cmp65.us = icmp slt i64 %inc93.us, %30
br i1 %cmp65.us, label %for.body66.us, label %for.end94, !llvm.loop !15
for.body66: ; preds = %for.body66.preheader, %for.body66
%31 = phi i64 [ %33, %for.body66 ], [ %28, %for.body66.preheader ]
%k.1149 = phi i64 [ %inc93, %for.body66 ], [ 1, %for.body66.preheader ]
%32 = load i64, ptr %n, align 8, !tbaa !5
%sub69 = add nsw i64 %32, -1
%cmp70 = icmp eq i64 %j.1151, %sub69
%sub74 = add nsw i64 %31, -1
%cmp75 = icmp eq i64 %k.1149, %sub74
%.str.4..str.5181 = select i1 %cmp75, ptr @.str.4, ptr @.str.5
%.str.5..str.6 = select i1 %cmp75, ptr @.str.5, ptr @.str.6
%.str.5.sink = select i1 %cmp70, ptr %.str.4..str.5181, ptr %.str.5..str.6
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
%inc93 = add nuw nsw i64 %k.1149, 1
%33 = load i64, ptr %m, align 8, !tbaa !5
%cmp65 = icmp slt i64 %inc93, %33
br i1 %cmp65, label %for.body66, label %for.end94, !llvm.loop !16
for.end94: ; preds = %for.body66, %for.body66.us, %for.body66.preheader, %for.inc92.us.peel, %for.cond64.preheader
%putchar = call i32 @putchar(i32 10)
%inc97 = add nuw nsw i64 %j.1151, 1
%34 = load i64, ptr %n, align 8, !tbaa !5
%cmp62 = icmp slt i64 %inc97, %34
br i1 %cmp62, label %for.cond64.preheader, label %for.inc100, !llvm.loop !17
for.inc100: ; preds = %for.end94, %if.else, %if.then58
%inc101 = add nuw nsw i64 %i.0154, 1
%35 = load i64, ptr %t, align 8, !tbaa !5
%cmp = icmp slt i64 %inc101, %35
br i1 %cmp, label %for.body, label %for.end102, !llvm.loop !18
for.end102: ; preds = %for.inc100, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 744200, ptr nonnull %grid) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10, !11}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int gcd(int a,int b){
if(a<b){
int now=a;
a=b;
b=a;
}
int r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
return b;
}
/* 値を入れ替える関数 */
void swap (int *x, int *y) {
int temp; // 値を一時保存する変数
temp = *x;
*x = *y;
*y = temp;
}
/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition (int array[], int left, int right) {
int i, j, pivot;
i = left;
j = right + 1;
pivot = left; // 先頭要素をpivotとする
do {
do { i++; } while (array[i] < array[pivot]);
do { j--; } while (array[pivot] < array[j]);
// pivotより小さいものを左へ、大きいものを右へ
if (i < j) { swap(&array[i], &array[j]); }
} while (i < j);
swap(&array[pivot], &array[j]); //pivotを更新
return j;
}
/* クイックソート */
void quick_sort (int array[], int left, int right) {
int pivot;
if (left < right) {
pivot = partition(array, left, right);
quick_sort(array, left, pivot-1); // pivotを境に再帰的にクイックソート
quick_sort(array, pivot+1, right);
}
}
int main(void){
int n;
scanf("%d",&n);
int A[n];
int i;
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
quick_sort(A,0,n-1);
printf("%d\n",A[n-1]-A[0]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228106/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228106/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%rem = srem i32 %spec.select, %b
%cmp1.not13 = icmp eq i32 %rem, 0
br i1 %cmp1.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.015 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ]
%b.addr.114 = phi i32 [ %r.015, %while.body ], [ %b, %entry ]
%rem2 = srem i32 %b.addr.114, %r.015
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i32 [ %b, %entry ], [ %r.015, %while.body ]
ret i32 %b.addr.1.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !7
%1 = load i32, ptr %y, align 4, !tbaa !7
store i32 %1, ptr %x, align 4, !tbaa !7
store i32 %0, ptr %y, align 4, !tbaa !7
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %array, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%add = add nsw i32 %right, 1
%idxprom2 = sext i32 %left to i64
%arrayidx3 = getelementptr inbounds i32, ptr %array, i64 %idxprom2
br label %do.body
do.body: ; preds = %if.then, %entry
%j.0 = phi i32 [ %add, %entry ], [ %6, %if.then ]
%i.0 = phi i32 [ %left, %entry ], [ %3, %if.then ]
%0 = load i32, ptr %arrayidx3, align 4, !tbaa !7
%1 = sext i32 %i.0 to i64
br label %do.body1
do.body1: ; preds = %do.body1, %do.body
%indvars.iv = phi i64 [ %indvars.iv.next, %do.body1 ], [ %1, %do.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx, align 4, !tbaa !7
%cmp = icmp slt i32 %2, %0
br i1 %cmp, label %do.body1, label %do.body4.preheader, !llvm.loop !11
do.body4.preheader: ; preds = %do.body1
%arrayidx.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next
%3 = trunc i64 %indvars.iv.next to i32
%4 = sext i32 %j.0 to i64
br label %do.body4
do.body4: ; preds = %do.body4.preheader, %do.body4
%indvars.iv49 = phi i64 [ %4, %do.body4.preheader ], [ %indvars.iv.next50, %do.body4 ]
%indvars.iv.next50 = add i64 %indvars.iv49, -1
%arrayidx9 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !7
%cmp10 = icmp slt i32 %0, %5
br i1 %cmp10, label %do.body4, label %do.end11, !llvm.loop !12
do.end11: ; preds = %do.body4
%arrayidx9.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50
%6 = trunc i64 %indvars.iv.next50 to i32
%cmp12 = icmp slt i32 %3, %6
br i1 %cmp12, label %if.then, label %do.end19
if.then: ; preds = %do.end11
store i32 %5, ptr %arrayidx.le, align 4, !tbaa !7
store i32 %2, ptr %arrayidx9.le, align 4, !tbaa !7
br label %do.body, !llvm.loop !13
do.end19: ; preds = %do.end11
store i32 %5, ptr %arrayidx3, align 4, !tbaa !7
store i32 %0, ptr %arrayidx9.le, align 4, !tbaa !7
ret i32 %6
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quick_sort(ptr nocapture noundef %array, i32 noundef %left, i32 noundef %right) local_unnamed_addr #4 {
entry:
%cmp13 = icmp slt i32 %left, %right
br i1 %cmp13, label %if.then.lr.ph, label %if.end
if.then.lr.ph: ; preds = %entry
%add.i = add nsw i32 %right, 1
br label %if.then
if.then: ; preds = %if.then.lr.ph, %partition.exit
%left.tr14 = phi i32 [ %left, %if.then.lr.ph ], [ %add, %partition.exit ]
%idxprom2.i = sext i32 %left.tr14 to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %array, i64 %idxprom2.i
br label %do.body.i
do.body.i: ; preds = %if.then.i, %if.then
%j.0.i = phi i32 [ %add.i, %if.then ], [ %6, %if.then.i ]
%i.0.i = phi i32 [ %left.tr14, %if.then ], [ %5, %if.then.i ]
%0 = load i32, ptr %arrayidx3.i, align 4, !tbaa !7
%1 = sext i32 %i.0.i to i64
br label %do.body1.i
do.body1.i: ; preds = %do.body1.i, %do.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %do.body1.i ], [ %1, %do.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !7
%cmp.i = icmp slt i32 %2, %0
br i1 %cmp.i, label %do.body1.i, label %do.body4.preheader.i, !llvm.loop !11
do.body4.preheader.i: ; preds = %do.body1.i
%arrayidx.i.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i
%3 = sext i32 %j.0.i to i64
br label %do.body4.i
do.body4.i: ; preds = %do.body4.i, %do.body4.preheader.i
%indvars.iv49.i = phi i64 [ %3, %do.body4.preheader.i ], [ %indvars.iv.next50.i, %do.body4.i ]
%indvars.iv.next50.i = add i64 %indvars.iv49.i, -1
%arrayidx9.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50.i
%4 = load i32, ptr %arrayidx9.i, align 4, !tbaa !7
%cmp10.i = icmp slt i32 %0, %4
br i1 %cmp10.i, label %do.body4.i, label %do.end11.i, !llvm.loop !12
do.end11.i: ; preds = %do.body4.i
%arrayidx9.i.le = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next50.i
%5 = trunc i64 %indvars.iv.next.i to i32
%6 = trunc i64 %indvars.iv.next50.i to i32
%cmp12.i = icmp slt i32 %5, %6
br i1 %cmp12.i, label %if.then.i, label %partition.exit
if.then.i: ; preds = %do.end11.i
store i32 %4, ptr %arrayidx.i.le, align 4, !tbaa !7
store i32 %2, ptr %arrayidx9.i.le, align 4, !tbaa !7
br label %do.body.i, !llvm.loop !13
partition.exit: ; preds = %do.end11.i
store i32 %4, ptr %arrayidx3.i, align 4, !tbaa !7
store i32 %0, ptr %arrayidx9.i.le, align 4, !tbaa !7
%sub = add nsw i32 %6, -1
tail call void @quick_sort(ptr noundef nonnull %array, i32 noundef %left.tr14, i32 noundef %sub)
%add = add nsw i32 %6, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%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 !7
%cmp10 = icmp sgt i32 %3, 0
br i1 %cmp10, 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 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 !7
%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, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @quick_sort(ptr noundef nonnull %vla, i32 noundef 0, i32 noundef %sub)
%idxprom3 = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %idxprom3
%6 = load i32, ptr %arrayidx4, align 4, !tbaa !7
%7 = load i32, ptr %vla, align 16, !tbaa !7
%sub6 = sub nsw i32 %6, %7
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub6)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
|
#include <stdio.h>
int main(){
int t, n, i;
int a[99];
scanf("%d", &t);
while(t--){
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d", &a[i]);
if(i % 2 == 0){
if(a[i] < 0){
a[i] *= -1;
}
}
else{
if(a[i] > 0){
a[i] *= -1;
}
}
printf("%d ", a[i]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22815/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22815/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [99 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 396, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec34 = add nsw i32 %0, -1
store i32 %dec34, ptr %t, align 4, !tbaa !5
%tobool.not35 = icmp eq i32 %0, 0
br i1 %tobool.not35, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %1, 0
br i1 %cmp32, label %for.body, label %for.end
for.body: ; preds = %while.body, %if.end18
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end18 ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [99 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%rem37 = and i64 %indvars.iv, 1
%cmp3 = icmp eq i64 %rem37, 0
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
br i1 %cmp3, label %if.then, label %if.else
if.then: ; preds = %for.body
%cmp6 = icmp slt i32 %2, 0
br i1 %cmp6, label %if.end18.sink.split, label %if.end18
if.else: ; preds = %for.body
%cmp12 = icmp sgt i32 %2, 0
br i1 %cmp12, label %if.end18.sink.split, label %if.end18
if.end18.sink.split: ; preds = %if.else, %if.then
%mul16.sink = sub nsw i32 0, %2
store i32 %mul16.sink, ptr %arrayidx, align 4, !tbaa !5
br label %if.end18
if.end18: ; preds = %if.end18.sink.split, %if.else, %if.then
%3 = phi i32 [ %2, %if.else ], [ %2, %if.then ], [ %mul16.sink, %if.end18.sink.split ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %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.end, !llvm.loop !9
for.end: ; preds = %if.end18, %while.body
%putchar = call i32 @putchar(i32 10)
%6 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 396, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int t;
scanf("%d", &t);
while(t--){
int n, m;
scanf("%d%d", &n, &m);
int a[n][m], flag = 1;
for(int i = 0; i < n; i++)
for(int j = 0; j < m; j++){
scanf("%d", &a[i][j]);
if( (i == 0 || i == n - 1) && (j == 0 || j == m-1) &&
a[i][j] > 2)
flag = 0;
else if(( i == 0 || i == n-1 || j == 0 || j == m-1) &&
a[i][j] > 3)
flag = 0;
else if(a[i][j] > 4)
flag = 0;
}
if(!flag)
printf("NO\n");
else{
printf("YES\n");
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if((i == 0 || i == n-1) && (j == 0 || j == m-1))
printf("2 ");
else if(i == 0 || i == n-1 || j == 0 || j == m-1)
printf("3 ");
else
printf("4 ");
}
printf("\n");
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22820/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22820/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"2 \00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"3 \00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"4 \00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec148 = add nsw i32 %0, -1
store i32 %dec148, ptr %t, align 4, !tbaa !5
%tobool.not149 = icmp eq i32 %0, 0
br i1 %tobool.not149, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end98
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = load i32, ptr %m, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%5 = call ptr @llvm.stacksave.p0()
%6 = mul nuw i64 %4, %2
%vla = alloca i32, i64 %6, align 16
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp136 = icmp sgt i32 %7, 0
%8 = load i32, ptr %m, align 4
%9 = icmp sgt i32 %8, 0
%or.cond = select i1 %cmp136, i1 %9, i1 false
br i1 %or.cond, label %for.cond2.preheader, label %if.else52
for.cond2.preheader: ; preds = %while.body, %for.cond.cleanup4
%10 = phi i32 [ %25, %for.cond.cleanup4 ], [ %7, %while.body ]
%11 = phi i32 [ %26, %for.cond.cleanup4 ], [ %8, %while.body ]
%indvars.iv159 = phi i64 [ %indvars.iv.next160, %for.cond.cleanup4 ], [ 0, %while.body ]
%flag.0137 = phi i32 [ %flag.1.lcssa, %for.cond.cleanup4 ], [ 1, %while.body ]
%cmp3131 = icmp sgt i32 %11, 0
br i1 %cmp3131, label %for.body5.lr.ph, label %for.cond.cleanup4
for.body5.lr.ph: ; preds = %for.cond2.preheader
%12 = mul nuw nsw i64 %indvars.iv159, %4
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %12
%cmp9 = icmp eq i64 %indvars.iv159, 0
%call8.us.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
br i1 %cmp9, label %land.lhs.true15.us.peel, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body5.lr.ph
%13 = load i32, ptr %n, align 4, !tbaa !5
%sub.peel = add nsw i32 %13, -1
%14 = zext i32 %sub.peel to i64
%cmp10.peel = icmp eq i64 %indvars.iv159, %14
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
br i1 %cmp10.peel, label %land.lhs.true15.peel, label %land.lhs.true30.peel
land.lhs.true15.peel: ; preds = %for.body5.preheader
%cmp20.peel = icmp sgt i32 %15, 2
br i1 %cmp20.peel, label %for.inc.peel, label %if.else37.peel
land.lhs.true30.peel: ; preds = %for.body5.preheader
%cmp35.peel = icmp sgt i32 %15, 3
br i1 %cmp35.peel, label %for.inc.peel, label %if.else37.peel
if.else37.peel: ; preds = %land.lhs.true15.peel, %land.lhs.true30.peel
br label %for.inc.peel
for.inc.peel: ; preds = %if.else37.peel, %land.lhs.true30.peel, %land.lhs.true15.peel
%flag.2.peel = phi i32 [ 0, %land.lhs.true15.peel ], [ 0, %land.lhs.true30.peel ], [ %flag.0137, %if.else37.peel ]
%16 = load i32, ptr %m, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %16, 1
br i1 %cmp3.peel, label %for.body5, label %for.cond.cleanup4
land.lhs.true15.us.peel: ; preds = %for.body5.lr.ph
%17 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp20.us.peel = icmp sgt i32 %17, 2
%spec.select185 = select i1 %cmp20.us.peel, i32 0, i32 %flag.0137
%18 = load i32, ptr %m, align 4, !tbaa !5
%cmp3.us.peel = icmp sgt i32 %18, 1
br i1 %cmp3.us.peel, label %lor.lhs.false12.us, label %for.cond.cleanup4.loopexit
lor.lhs.false12.us: ; preds = %land.lhs.true15.us.peel, %for.inc.us
%indvars.iv155 = phi i64 [ %indvars.iv.next156, %for.inc.us ], [ 1, %land.lhs.true15.us.peel ]
%flag.1132.us = phi i32 [ %flag.2.us, %for.inc.us ], [ %spec.select185, %land.lhs.true15.us.peel ]
%arrayidx7.us = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv155
%call8.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.us)
%19 = load i32, ptr %m, align 4, !tbaa !5
%sub13.us = add nsw i32 %19, -1
%20 = zext i32 %sub13.us to i64
%cmp14.us = icmp eq i64 %indvars.iv155, %20
%21 = load i32, ptr %arrayidx7.us, align 4, !tbaa !5
br i1 %cmp14.us, label %land.lhs.true15.us, label %if.else.us
land.lhs.true15.us: ; preds = %lor.lhs.false12.us
%cmp20.us = icmp sgt i32 %21, 2
br i1 %cmp20.us, label %for.inc.us, label %if.else37.us
if.else.us: ; preds = %lor.lhs.false12.us
%cmp35.us = icmp sgt i32 %21, 3
br i1 %cmp35.us, label %for.inc.us, label %if.else37.us
if.else37.us: ; preds = %land.lhs.true15.us, %if.else.us
br label %for.inc.us
for.inc.us: ; preds = %if.else37.us, %if.else.us, %land.lhs.true15.us
%flag.2.us = phi i32 [ 0, %land.lhs.true15.us ], [ 0, %if.else.us ], [ %flag.1132.us, %if.else37.us ]
%indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
%22 = load i32, ptr %m, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp3.us = icmp slt i64 %indvars.iv.next156, %23
br i1 %cmp3.us, label %lor.lhs.false12.us, label %for.cond.cleanup4.loopexit, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond.cleanup4
%tobool49.not = icmp eq i32 %flag.1.lcssa, 0
br i1 %tobool49.not, label %if.then50, label %if.else52
for.cond.cleanup4.loopexit: ; preds = %for.inc.us, %land.lhs.true15.us.peel
%24 = phi i32 [ %18, %land.lhs.true15.us.peel ], [ %22, %for.inc.us ]
%flag.2.us.lcssa = phi i32 [ %spec.select185, %land.lhs.true15.us.peel ], [ %flag.2.us, %for.inc.us ]
%.pre167 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.inc, %for.inc.peel, %for.cond.cleanup4.loopexit, %for.cond2.preheader
%25 = phi i32 [ %10, %for.cond2.preheader ], [ %.pre167, %for.cond.cleanup4.loopexit ], [ %13, %for.inc.peel ], [ %28, %for.inc ]
%26 = phi i32 [ %11, %for.cond2.preheader ], [ %24, %for.cond.cleanup4.loopexit ], [ %16, %for.inc.peel ], [ %35, %for.inc ]
%flag.1.lcssa = phi i32 [ %flag.0137, %for.cond2.preheader ], [ %flag.2.us.lcssa, %for.cond.cleanup4.loopexit ], [ %flag.2.peel, %for.inc.peel ], [ %flag.2, %for.inc ]
%indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
%27 = sext i32 %25 to i64
%cmp = icmp slt i64 %indvars.iv.next160, %27
br i1 %cmp, label %for.cond2.preheader, label %for.cond.cleanup, !llvm.loop !12
for.body5: ; preds = %for.inc.peel, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ]
%flag.1132 = phi i32 [ %flag.2, %for.inc ], [ %flag.2.peel, %for.inc.peel ]
%arrayidx7 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%28 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %28, -1
%29 = zext i32 %sub to i64
%cmp10 = icmp eq i64 %indvars.iv159, %29
%30 = load i32, ptr %m, align 4, !tbaa !5
%sub13 = add nsw i32 %30, -1
%31 = zext i32 %sub13 to i64
%cmp14 = icmp eq i64 %indvars.iv, %31
br i1 %cmp10, label %lor.lhs.false12, label %lor.lhs.false27
lor.lhs.false12: ; preds = %for.body5
br i1 %cmp14, label %land.lhs.true15, label %lor.lhs.false22.land.lhs.true30_crit_edge
land.lhs.true15: ; preds = %lor.lhs.false12
%32 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %32, 2
br i1 %cmp20, label %for.inc, label %lor.lhs.false22.land.lhs.true30_crit_edge
lor.lhs.false22.land.lhs.true30_crit_edge: ; preds = %lor.lhs.false12, %land.lhs.true15
%.pre169 = load i32, ptr %arrayidx7, align 4, !tbaa !5
br label %land.lhs.true30
lor.lhs.false27: ; preds = %for.body5
%.pre170 = load i32, ptr %arrayidx7, align 4, !tbaa !5
br i1 %cmp14, label %land.lhs.true30, label %if.else37
land.lhs.true30: ; preds = %lor.lhs.false22.land.lhs.true30_crit_edge, %lor.lhs.false27
%33 = phi i32 [ %.pre169, %lor.lhs.false22.land.lhs.true30_crit_edge ], [ %.pre170, %lor.lhs.false27 ]
%cmp35 = icmp sgt i32 %33, 3
br i1 %cmp35, label %for.inc, label %if.else37
if.else37: ; preds = %lor.lhs.false27, %land.lhs.true30
%34 = phi i32 [ %33, %land.lhs.true30 ], [ %.pre170, %lor.lhs.false27 ]
%cmp42 = icmp sgt i32 %34, 4
%spec.select = select i1 %cmp42, i32 0, i32 %flag.1132
br label %for.inc
for.inc: ; preds = %if.else37, %land.lhs.true30, %land.lhs.true15
%flag.2 = phi i32 [ 0, %land.lhs.true15 ], [ 0, %land.lhs.true30 ], [ %spec.select, %if.else37 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%35 = load i32, ptr %m, align 4, !tbaa !5
%36 = sext i32 %35 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %36
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !14
if.then50: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end98
if.else52: ; preds = %while.body, %for.cond.cleanup
%puts128 = call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
%37 = load i32, ptr %n, align 4, !tbaa !5
%cmp56145 = icmp sgt i32 %37, 0
br i1 %cmp56145, label %for.cond60.preheader, label %if.end98
for.cond60.preheader: ; preds = %if.else52, %for.cond.cleanup62
%38 = phi i32 [ %43, %for.cond.cleanup62 ], [ %37, %if.else52 ]
%i54.0146 = phi i32 [ %inc96, %for.cond.cleanup62 ], [ 0, %if.else52 ]
%39 = load i32, ptr %m, align 4, !tbaa !5
%cmp61142 = icmp sgt i32 %39, 0
br i1 %cmp61142, label %for.body63.lr.ph, label %for.cond.cleanup62
for.body63.lr.ph: ; preds = %for.cond60.preheader
%cmp64 = icmp eq i32 %i54.0146, 0
br i1 %cmp64, label %for.inc91.us.peel, label %for.body63.preheader
for.body63.preheader: ; preds = %for.body63.lr.ph
%sub66.peel = add nsw i32 %38, -1
%cmp67.peel = icmp eq i32 %i54.0146, %sub66.peel
%.str.4..str.5 = select i1 %cmp67.peel, ptr @.str.4, ptr @.str.5
%call74.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4..str.5)
%40 = load i32, ptr %m, align 4, !tbaa !5
%cmp61.peel = icmp sgt i32 %40, 1
br i1 %cmp61.peel, label %for.body63, label %for.cond.cleanup62
for.inc91.us.peel: ; preds = %for.body63.lr.ph
%call74.us.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
%.pre168 = load i32, ptr %m, align 4, !tbaa !5
%cmp61.us.peel = icmp sgt i32 %.pre168, 1
br i1 %cmp61.us.peel, label %for.body63.us, label %for.cond.cleanup62
for.body63.us: ; preds = %for.inc91.us.peel, %for.body63.us
%41 = phi i32 [ %42, %for.body63.us ], [ %.pre168, %for.inc91.us.peel ]
%j59.0143.us = phi i32 [ %inc92.us, %for.body63.us ], [ 1, %for.inc91.us.peel ]
%sub71.us = add nsw i32 %41, -1
%cmp72.us = icmp eq i32 %j59.0143.us, %sub71.us
%.str.4..str.5189 = select i1 %cmp72.us, ptr @.str.4, ptr @.str.5
%call74.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4..str.5189)
%inc92.us = add nuw nsw i32 %j59.0143.us, 1
%42 = load i32, ptr %m, align 4, !tbaa !5
%cmp61.us = icmp slt i32 %inc92.us, %42
br i1 %cmp61.us, label %for.body63.us, label %for.cond.cleanup62, !llvm.loop !15
for.cond.cleanup62: ; preds = %for.inc91, %for.body63.us, %for.body63.preheader, %for.inc91.us.peel, %for.cond60.preheader
%putchar = call i32 @putchar(i32 10)
%inc96 = add nuw nsw i32 %i54.0146, 1
%43 = load i32, ptr %n, align 4, !tbaa !5
%cmp56 = icmp slt i32 %inc96, %43
br i1 %cmp56, label %for.cond60.preheader, label %if.end98, !llvm.loop !16
for.body63: ; preds = %for.body63.preheader, %for.inc91
%44 = phi i32 [ %46, %for.inc91 ], [ %40, %for.body63.preheader ]
%j59.0143 = phi i32 [ %inc92, %for.inc91 ], [ 1, %for.body63.preheader ]
%45 = load i32, ptr %n, align 4, !tbaa !5
%sub66 = add nsw i32 %45, -1
%cmp67 = icmp eq i32 %i54.0146, %sub66
%sub71 = add nsw i32 %44, -1
%cmp72 = icmp eq i32 %j59.0143, %sub71
br i1 %cmp67, label %land.lhs.true68, label %lor.lhs.false77
land.lhs.true68: ; preds = %for.body63
br i1 %cmp72, label %for.inc91, label %if.then85
lor.lhs.false77: ; preds = %for.body63
br i1 %cmp72, label %if.then85, label %for.inc91
if.then85: ; preds = %land.lhs.true68, %lor.lhs.false77
br label %for.inc91
for.inc91: ; preds = %lor.lhs.false77, %land.lhs.true68, %if.then85
%.str.4.sink187 = phi ptr [ @.str.5, %if.then85 ], [ @.str.4, %land.lhs.true68 ], [ @.str.6, %lor.lhs.false77 ]
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink187)
%inc92 = add nuw nsw i32 %j59.0143, 1
%46 = load i32, ptr %m, align 4, !tbaa !5
%cmp61 = icmp slt i32 %inc92, %46
br i1 %cmp61, label %for.body63, label %for.cond.cleanup62, !llvm.loop !17
if.end98: ; preds = %for.cond.cleanup62, %if.else52, %if.then50
call void @llvm.stackrestore.p0(ptr %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
%47 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %47, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %47, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !18
while.end: ; preds = %if.end98, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10, !11}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int i,j,n,s[100],max,min,ans;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&s[i]);
}
max = 0;
min = 1000;
for(j=0;j<n;j++){
if(s[j]>=max){
max=s[j];
}
if(s[j]<=min){
min = s[j];
}
}
ans=max-min;
printf("%d",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228243/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228243/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%s = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end19
for.cond2.preheader: ; preds = %for.body
%cmp333 = icmp sgt i32 %10, 0
br i1 %cmp333, label %for.body4.preheader, label %for.end19
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %10 to i64
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body4.preheader52, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %5, %vector.body ]
%vec.phi46 = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %6, %vector.body ]
%vec.phi47 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load49 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi47)
%4 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load49, <4 x i32> %vec.phi48)
%5 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%6 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load49, <4 x i32> %vec.phi46)
%index.next = add nuw i64 %index, 8
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax50 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %3, <4 x i32> %4)
%8 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax50)
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %5, <4 x i32> %6)
%9 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end19.loopexit, label %for.body4.preheader52
for.body4.preheader52: ; preds = %for.body4.preheader, %middle.block
%indvars.iv41.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%min.036.ph = phi i32 [ 1000, %for.body4.preheader ], [ %9, %middle.block ]
%max.035.ph = phi i32 [ 0, %for.body4.preheader ], [ %8, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %s, 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
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader52, %for.body4
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body4 ], [ %indvars.iv41.ph, %for.body4.preheader52 ]
%min.036 = phi i32 [ %min.1, %for.body4 ], [ %min.036.ph, %for.body4.preheader52 ]
%max.035 = phi i32 [ %spec.select, %for.body4 ], [ %max.035.ph, %for.body4.preheader52 ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv41
%12 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %12, i32 %max.035)
%min.1 = call i32 @llvm.smin.i32(i32 %12, i32 %min.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.end19.loopexit, label %for.body4, !llvm.loop !14
for.end19.loopexit: ; preds = %for.body4, %middle.block
%spec.select.lcssa = phi i32 [ %8, %middle.block ], [ %spec.select, %for.body4 ]
%min.1.lcssa = phi i32 [ %9, %middle.block ], [ %min.1, %for.body4 ]
%13 = sub nsw i32 %spec.select.lcssa, %min.1.lcssa
br label %for.end19
for.end19: ; preds = %entry, %for.end19.loopexit, %for.cond2.preheader
%sub = phi i32 [ -1000, %for.cond2.preheader ], [ %13, %for.end19.loopexit ], [ -1000, %entry ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 400, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; 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 <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<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, !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}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i,min,max;
int a[101];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(i==0)
{
min=a[i];
max=a[i];
}
else
{
if(max<a[i])
max=a[i];
if(min>a[i])
min=a[i];
}
}
printf("%d",max-min);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228287/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228287/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp35)
%call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 16, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.peel = icmp sgt i32 %2, 1
br i1 %cmp.peel, label %for.inc, label %for.end.loopexit
for.inc: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%max.038 = phi i32 [ %spec.select, %for.inc ], [ %1, %entry ]
%min.037 = phi i32 [ %spec.select34, %for.inc ], [ %1, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max.038, i32 %3)
%spec.select34 = call i32 @llvm.smin.i32(i32 %min.037, 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.inc, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc, %entry
%min.1.lcssa = phi i32 [ %1, %entry ], [ %spec.select34, %for.inc ]
%max.2.lcssa = phi i32 [ %1, %entry ], [ %spec.select, %for.inc ]
%6 = sub nsw i32 %max.2.lcssa, %min.1.lcssa
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <stdlib.h>
void func1(int N, int divisor_num, int *ans)
{
int i, j, count;
for (i = 1; i <= N; i += 2) //O(N/2)
{
count = 0;
for (j = 1; j * j <= i; j++) //O(√i)
{
if (i == j * j)
{
count++;
}
else if (i % j == 0)
{
count += 2;
}
}
if (count == divisor_num)
{
*ans += 1;
}
}
}
int main(void)
{
int N, ans = 0;
scanf("%d", &N);
func1(N, 8, &ans);
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228344/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228344/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @func1(i32 noundef %N, i32 noundef %divisor_num, ptr nocapture noundef %ans) local_unnamed_addr #0 {
entry:
%cmp.not31 = icmp slt i32 %N, 1
br i1 %cmp.not31, label %for.end16, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc14
%i.032 = phi i32 [ %add15, %for.inc14 ], [ 1, %entry ]
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.inc
%mul30 = phi i32 [ 1, %for.cond1.preheader ], [ %mul, %for.inc ]
%count.029 = phi i32 [ 0, %for.cond1.preheader ], [ %count.1, %for.inc ]
%j.028 = phi i32 [ 1, %for.cond1.preheader ], [ %inc9, %for.inc ]
%cmp5 = icmp eq i32 %i.032, %mul30
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.body3
%inc = add nsw i32 %count.029, 1
br label %for.inc
if.else: ; preds = %for.body3
%rem = urem i32 %i.032, %j.028
%cmp6 = icmp eq i32 %rem, 0
%add = add nsw i32 %count.029, 2
%spec.select = select i1 %cmp6, i32 %add, i32 %count.029
br label %for.inc
for.inc: ; preds = %if.else, %if.then
%count.1 = phi i32 [ %inc, %if.then ], [ %spec.select, %if.else ]
%inc9 = add nuw nsw i32 %j.028, 1
%mul = mul nsw i32 %inc9, %inc9
%cmp2.not = icmp ugt i32 %mul, %i.032
br i1 %cmp2.not, label %for.end, label %for.body3, !llvm.loop !5
for.end: ; preds = %for.inc
%cmp10 = icmp eq i32 %count.1, %divisor_num
br i1 %cmp10, label %if.then11, label %for.inc14
if.then11: ; preds = %for.end
%0 = load i32, ptr %ans, align 4, !tbaa !7
%add12 = add nsw i32 %0, 1
store i32 %add12, ptr %ans, align 4, !tbaa !7
br label %for.inc14
for.inc14: ; preds = %for.end, %if.then11
%add15 = add nuw nsw i32 %i.032, 2
%cmp.not = icmp sgt i32 %add15, %N
br i1 %cmp.not, label %for.end16, label %for.cond1.preheader, !llvm.loop !11
for.end16: ; preds = %for.inc14, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !7
%cmp.not31.i = icmp slt i32 %0, 1
br i1 %cmp.not31.i, label %func1.exit, label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %entry, %for.end.i
%ans.0 = phi i32 [ %spec.select, %for.end.i ], [ 0, %entry ]
%i.032.i = phi i32 [ %add15.i, %for.end.i ], [ 1, %entry ]
br label %for.body3.i
for.body3.i: ; preds = %for.inc.i, %for.cond1.preheader.i
%mul30.i = phi i32 [ 1, %for.cond1.preheader.i ], [ %mul.i, %for.inc.i ]
%count.029.i = phi i32 [ 0, %for.cond1.preheader.i ], [ %count.1.i, %for.inc.i ]
%j.028.i = phi i32 [ 1, %for.cond1.preheader.i ], [ %inc9.i, %for.inc.i ]
%cmp5.i = icmp eq i32 %i.032.i, %mul30.i
br i1 %cmp5.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %for.body3.i
%inc.i = add nsw i32 %count.029.i, 1
br label %for.inc.i
if.else.i: ; preds = %for.body3.i
%rem.i = urem i32 %i.032.i, %j.028.i
%cmp6.i = icmp eq i32 %rem.i, 0
%add.i = add nsw i32 %count.029.i, 2
%spec.select.i = select i1 %cmp6.i, i32 %add.i, i32 %count.029.i
br label %for.inc.i
for.inc.i: ; preds = %if.else.i, %if.then.i
%count.1.i = phi i32 [ %inc.i, %if.then.i ], [ %spec.select.i, %if.else.i ]
%inc9.i = add nuw nsw i32 %j.028.i, 1
%mul.i = mul nsw i32 %inc9.i, %inc9.i
%cmp2.not.i = icmp ugt i32 %mul.i, %i.032.i
br i1 %cmp2.not.i, label %for.end.i, label %for.body3.i, !llvm.loop !5
for.end.i: ; preds = %for.inc.i
%cmp10.i = icmp eq i32 %count.1.i, 8
%add12.i = zext i1 %cmp10.i to i32
%spec.select = add nuw nsw i32 %ans.0, %add12.i
%add15.i = add nuw nsw i32 %i.032.i, 2
%cmp.not.i = icmp sgt i32 %add15.i, %0
br i1 %cmp.not.i, label %func1.exit, label %for.cond1.preheader.i, !llvm.loop !11
func1.exit: ; preds = %for.end.i, %entry
%ans.2 = phi i32 [ 0, %entry ], [ %spec.select, %for.end.i ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
int main() {
int n, count, ans = 0, num, cnt;
scanf("%d", &n);
for (int i = 105; i <= n; i += 2) {
count = 1;
num = i;
for (int j = 3; j <= i; j++) {
cnt = 0;
while (num % j == 0) {
num /= j;
cnt++;
}
count *= cnt + 1;
}
if (count == 8) {
ans++;
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228388/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228388/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not33 = icmp slt i32 %0, 105
br i1 %cmp.not33, label %for.cond.cleanup, label %while.cond.preheader.preheader
while.cond.preheader.preheader: ; preds = %entry, %for.cond.cleanup3
%indvars.iv = phi i32 [ %indvars.iv.next, %for.cond.cleanup3 ], [ 106, %entry ]
%i.035 = phi i32 [ %add10, %for.cond.cleanup3 ], [ 105, %entry ]
%ans.034 = phi i32 [ %spec.select, %for.cond.cleanup3 ], [ 0, %entry ]
br label %while.cond.preheader
for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.cond.cleanup3 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
while.cond.preheader: ; preds = %while.cond.preheader.preheader, %while.end
%j.031 = phi i32 [ %inc6, %while.end ], [ 3, %while.cond.preheader.preheader ]
%num.030 = phi i32 [ %num.1.lcssa, %while.end ], [ %i.035, %while.cond.preheader.preheader ]
%count.029 = phi i32 [ %mul, %while.end ], [ 1, %while.cond.preheader.preheader ]
%rem23 = srem i32 %num.030, %j.031
%cmp524 = icmp eq i32 %rem23, 0
br i1 %cmp524, label %while.body, label %while.end
for.cond.cleanup3: ; preds = %while.end
%cmp7 = icmp eq i32 %mul, 8
%inc8 = zext i1 %cmp7 to i32
%spec.select = add nuw nsw i32 %ans.034, %inc8
%add10 = add nuw nsw i32 %i.035, 2
%cmp.not = icmp sgt i32 %add10, %0
%indvars.iv.next = add nuw i32 %indvars.iv, 2
br i1 %cmp.not, label %for.cond.cleanup, label %while.cond.preheader.preheader, !llvm.loop !9
while.body: ; preds = %while.cond.preheader, %while.body
%cnt.026 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ]
%num.125 = phi i32 [ %div, %while.body ], [ %num.030, %while.cond.preheader ]
%div = sdiv i32 %num.125, %j.031
%inc = add nuw nsw i32 %cnt.026, 1
%rem = srem i32 %div, %j.031
%cmp5 = icmp eq i32 %rem, 0
br i1 %cmp5, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body, %while.cond.preheader
%num.1.lcssa = phi i32 [ %num.030, %while.cond.preheader ], [ %div, %while.body ]
%cnt.0.lcssa = phi i32 [ 0, %while.cond.preheader ], [ %inc, %while.body ]
%add = add nuw nsw i32 %cnt.0.lcssa, 1
%mul = mul nsw i32 %add, %count.029
%inc6 = add nuw nsw i32 %j.031, 1
%exitcond.not = icmp eq i32 %inc6, %indvars.iv
br i1 %exitcond.not, label %for.cond.cleanup3, label %while.cond.preheader, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void){
int N;
scanf("%d", &N);
if(N >= 105){
if(N >= 135){
if(N >= 165){
if(N >= 189){
if(N >= 195){
printf("5\n");
}
else{
printf("4\n");
}
}
else{
printf("3\n");
}
}
else{
printf("2\n");
}
}
else{
printf("1\n");
}
}
else{
printf("0\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228430/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228430/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
@str.7 = private unnamed_addr constant [2 x i8] c"1\00", align 1
@str.8 = private unnamed_addr constant [2 x i8] c"2\00", align 1
@str.9 = private unnamed_addr constant [2 x i8] c"3\00", align 1
@str.10 = private unnamed_addr constant [2 x i8] c"4\00", align 1
@str.11 = private unnamed_addr constant [2 x i8] c"5\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 104
br i1 %cmp, label %if.then, label %if.end22
if.then: ; preds = %entry
%cmp1 = icmp ugt i32 %0, 134
br i1 %cmp1, label %if.then2, label %if.end22
if.then2: ; preds = %if.then
%cmp3 = icmp ugt i32 %0, 164
br i1 %cmp3, label %if.then4, label %if.end22
if.then4: ; preds = %if.then2
%cmp5 = icmp ugt i32 %0, 188
br i1 %cmp5, label %if.then6, label %if.end22
if.then6: ; preds = %if.then4
%cmp7 = icmp ugt i32 %0, 194
%str.11.str.10 = select i1 %cmp7, ptr @str.11, ptr @str.10
br label %if.end22
if.end22: ; preds = %entry, %if.then, %if.then2, %if.then4, %if.then6
%str.7.sink = phi ptr [ %str.11.str.10, %if.then6 ], [ @str.9, %if.then4 ], [ @str.8, %if.then2 ], [ @str.7, %if.then ], [ @str, %entry ]
%puts23 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int n,di,x;
x=0;
scanf("%d",&n);
for(int i=1; i<=n; i+=2){
di=0;
for(int j=1; j<=i; j++){
if(i%j==0)
di++;
}
if(di==8)
x++;
}
printf("%d",x);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228474/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228474/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not24 = icmp slt i32 %0, 1
br i1 %cmp.not24, label %for.cond.cleanup, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.body4.epil
%indvar = phi i32 [ %indvar.next, %for.body4.epil ], [ 0, %entry ]
%i.026 = phi i32 [ %add, %for.body4.epil ], [ 1, %entry ]
%x.025 = phi i32 [ %spec.select, %for.body4.epil ], [ 0, %entry ]
%1 = icmp eq i32 %indvar, 0
br i1 %1, label %for.body4.epil, label %for.cond1.preheader.new
for.cond1.preheader.new: ; preds = %for.cond1.preheader
%2 = shl nuw nsw i32 %indvar, 1
br label %for.body4
for.cond.cleanup: ; preds = %for.body4.epil, %entry
%x.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body4.epil ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %x.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body4.epil: ; preds = %for.body4, %for.cond1.preheader
%j.023.unr = phi i32 [ 1, %for.cond1.preheader ], [ %inc6.1, %for.body4 ]
%di.022.unr = phi i32 [ 0, %for.cond1.preheader ], [ %spec.select21.1, %for.body4 ]
%rem.epil = urem i32 %i.026, %j.023.unr
%cmp5.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp5.epil to i32
%spec.select21.epil = add nuw nsw i32 %di.022.unr, %inc.epil
%cmp7 = icmp eq i32 %spec.select21.epil, 8
%inc9 = zext i1 %cmp7 to i32
%spec.select = add nuw nsw i32 %x.025, %inc9
%add = add nuw nsw i32 %i.026, 2
%cmp.not = icmp sgt i32 %add, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4, %for.cond1.preheader.new
%j.023 = phi i32 [ 1, %for.cond1.preheader.new ], [ %inc6.1, %for.body4 ]
%di.022 = phi i32 [ 0, %for.cond1.preheader.new ], [ %spec.select21.1, %for.body4 ]
%niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body4 ]
%rem = urem i32 %i.026, %j.023
%cmp5 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp5 to i32
%spec.select21 = add nuw nsw i32 %di.022, %inc
%inc6 = add nuw nsw i32 %j.023, 1
%rem.1 = urem i32 %i.026, %inc6
%cmp5.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp5.1 to i32
%spec.select21.1 = add nuw nsw i32 %spec.select21, %inc.1
%inc6.1 = add nuw nsw i32 %j.023, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %2
br i1 %niter.ncmp.1, label %for.body4.epil, label %for.body4, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void) {
// your code goes here
int n,i,num=0;
scanf("%d",&n);
if(n<12)printf("0\n");
else if(n>12) {
for(i=13;i<=n;i++){
if(i%2!=0){
int cnt=0;
for(int j=1;j<=i;j++){
if(i%j==0)cnt++;
if(cnt>7)num++;
}
//printf("%d ",cnt);
}
else continue;
}
printf("%d\n",num);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228517/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228517/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 12
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end25
if.else: ; preds = %entry
%cmp2.not = icmp eq i32 %0, 12
br i1 %cmp2.not, label %if.end25, label %for.body.preheader
for.body.preheader: ; preds = %if.else
%1 = add i32 %0, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc20
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.inc20 ]
%indvars.iv = phi i32 [ 14, %for.body.preheader ], [ %indvars.iv.next, %for.inc20 ]
%num.039 = phi i32 [ 0, %for.body.preheader ], [ %num.3, %for.inc20 ]
%i.038 = phi i32 [ 13, %for.body.preheader ], [ %inc21, %for.inc20 ]
%rem = and i32 %i.038, 1
%cmp5.not = icmp eq i32 %rem, 0
br i1 %cmp5.not, label %for.inc20, label %for.body9.preheader
for.body9.preheader: ; preds = %for.body
%xtraiter = and i32 %i.038, 1
%2 = icmp eq i32 %indvar, -12
br i1 %2, label %for.inc20.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i32 %i.038, 2147483646
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%j.036 = phi i32 [ 1, %for.body9.preheader.new ], [ %inc17.1, %for.body9 ]
%cnt.035 = phi i32 [ 0, %for.body9.preheader.new ], [ %spec.select.1, %for.body9 ]
%num.134 = phi i32 [ %num.039, %for.body9.preheader.new ], [ %num.2.1, %for.body9 ]
%niter = phi i32 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.body9 ]
%rem10 = urem i32 %i.038, %j.036
%cmp11 = icmp eq i32 %rem10, 0
%inc = zext i1 %cmp11 to i32
%spec.select = add nuw nsw i32 %cnt.035, %inc
%cmp13 = icmp ugt i32 %spec.select, 7
%inc15 = zext i1 %cmp13 to i32
%num.2 = add nsw i32 %num.134, %inc15
%inc17 = add nuw i32 %j.036, 1
%rem10.1 = urem i32 %i.038, %inc17
%cmp11.1 = icmp eq i32 %rem10.1, 0
%inc.1 = zext i1 %cmp11.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%cmp13.1 = icmp ugt i32 %spec.select.1, 7
%inc15.1 = zext i1 %cmp13.1 to i32
%num.2.1 = add nsw i32 %num.2, %inc15.1
%inc17.1 = add nuw i32 %j.036, 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.inc20.loopexit.unr-lcssa, label %for.body9, !llvm.loop !9
for.inc20.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%num.2.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %num.2.1, %for.body9 ]
%j.036.unr = phi i32 [ 1, %for.body9.preheader ], [ %inc17.1, %for.body9 ]
%cnt.035.unr = phi i32 [ 0, %for.body9.preheader ], [ %spec.select.1, %for.body9 ]
%num.134.unr = phi i32 [ %num.039, %for.body9.preheader ], [ %num.2.1, %for.body9 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc20, label %for.body9.epil
for.body9.epil: ; preds = %for.inc20.loopexit.unr-lcssa
%rem10.epil = urem i32 %i.038, %j.036.unr
%cmp11.epil = icmp eq i32 %rem10.epil, 0
%inc.epil = zext i1 %cmp11.epil to i32
%spec.select.epil = add nuw nsw i32 %cnt.035.unr, %inc.epil
%cmp13.epil = icmp ugt i32 %spec.select.epil, 7
%inc15.epil = zext i1 %cmp13.epil to i32
%num.2.epil = add nsw i32 %num.134.unr, %inc15.epil
br label %for.inc20
for.inc20: ; preds = %for.body9.epil, %for.inc20.loopexit.unr-lcssa, %for.body
%num.3 = phi i32 [ %num.039, %for.body ], [ %num.2.lcssa.ph, %for.inc20.loopexit.unr-lcssa ], [ %num.2.epil, %for.body9.epil ]
%inc21 = add nuw nsw i32 %i.038, 1
%indvars.iv.next = add nuw i32 %indvars.iv, 1
%exitcond40.not = icmp eq i32 %indvars.iv, %1
%indvar.next = add i32 %indvar, 1
br i1 %exitcond40.not, label %for.end22, label %for.body, !llvm.loop !11
for.end22: ; preds = %for.inc20
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.3)
br label %if.end25
if.end25: ; preds = %if.else, %for.end22, %if.then
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 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void)
{
int i,j,N;
int count=0;
scanf("%d",&N);
for(i=1;i<=N;i+=2){
int res = 0;
for(j=1;j<=i;j++){
if(i%j==0){res++;}
}
if(res==8){count++;}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228560/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228560/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not23 = icmp slt i32 %0, 1
br i1 %cmp.not23, label %for.end11, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.body3.epil
%indvar = phi i32 [ %indvar.next, %for.body3.epil ], [ 0, %entry ]
%count.025 = phi i32 [ %spec.select20, %for.body3.epil ], [ 0, %entry ]
%i.024 = phi i32 [ %add, %for.body3.epil ], [ 1, %entry ]
%1 = icmp eq i32 %indvar, 0
br i1 %1, label %for.body3.epil, label %for.cond1.preheader.new
for.cond1.preheader.new: ; preds = %for.cond1.preheader
%2 = shl nuw nsw i32 %indvar, 1
br label %for.body3
for.body3: ; preds = %for.body3, %for.cond1.preheader.new
%res.022 = phi i32 [ 0, %for.cond1.preheader.new ], [ %spec.select.1, %for.body3 ]
%j.021 = phi i32 [ 1, %for.cond1.preheader.new ], [ %inc5.1, %for.body3 ]
%niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body3 ]
%rem = urem i32 %i.024, %j.021
%cmp4 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp4 to i32
%spec.select = add nuw nsw i32 %res.022, %inc
%inc5 = add nuw nsw i32 %j.021, 1
%rem.1 = urem i32 %i.024, %inc5
%cmp4.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp4.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc5.1 = add nuw nsw i32 %j.021, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %2
br i1 %niter.ncmp.1, label %for.body3.epil, label %for.body3, !llvm.loop !9
for.body3.epil: ; preds = %for.body3, %for.cond1.preheader
%res.022.unr = phi i32 [ 0, %for.cond1.preheader ], [ %spec.select.1, %for.body3 ]
%j.021.unr = phi i32 [ 1, %for.cond1.preheader ], [ %inc5.1, %for.body3 ]
%rem.epil = urem i32 %i.024, %j.021.unr
%cmp4.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp4.epil to i32
%spec.select.epil = add nuw nsw i32 %res.022.unr, %inc.epil
%cmp6 = icmp eq i32 %spec.select.epil, 8
%inc8 = zext i1 %cmp6 to i32
%spec.select20 = add nuw nsw i32 %count.025, %inc8
%add = add nuw nsw i32 %i.024, 2
%cmp.not = icmp sgt i32 %add, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !11
for.end11: ; preds = %for.body3.epil, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select20, %for.body3.epil ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{ int a,b,i,n,cnt=0,ans=0;
scanf("%d",&a);
for(i=1;i<=a;i++){
for(n=1;n<=i;n++){
if(i%n==0){
cnt+=1;
}
}if(cnt==8){
ans+=1;
cnt=0;
i+=1;
}else{cnt=0;i+=1;}
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228610/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228610/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %0, 1
br i1 %cmp.not26, label %for.end13, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.body3.epil
%indvar = phi i32 [ %indvar.next, %for.body3.epil ], [ 0, %entry ]
%ans.028 = phi i32 [ %ans.1, %for.body3.epil ], [ 0, %entry ]
%i.027 = phi i32 [ %inc12, %for.body3.epil ], [ 1, %entry ]
%1 = icmp eq i32 %indvar, 0
br i1 %1, label %for.body3.epil, label %for.cond1.preheader.new
for.cond1.preheader.new: ; preds = %for.cond1.preheader
%2 = shl nuw nsw i32 %indvar, 1
br label %for.body3
for.body3: ; preds = %for.body3, %for.cond1.preheader.new
%cnt.125 = phi i32 [ 0, %for.cond1.preheader.new ], [ %spec.select.1, %for.body3 ]
%n.024 = phi i32 [ 1, %for.cond1.preheader.new ], [ %inc.1, %for.body3 ]
%niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body3 ]
%rem = urem i32 %i.027, %n.024
%cmp4 = icmp eq i32 %rem, 0
%add = zext i1 %cmp4 to i32
%spec.select = add nuw nsw i32 %cnt.125, %add
%inc = add nuw nsw i32 %n.024, 1
%rem.1 = urem i32 %i.027, %inc
%cmp4.1 = icmp eq i32 %rem.1, 0
%add.1 = zext i1 %cmp4.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %add.1
%inc.1 = add nuw nsw i32 %n.024, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %2
br i1 %niter.ncmp.1, label %for.body3.epil, label %for.body3, !llvm.loop !9
for.body3.epil: ; preds = %for.body3, %for.cond1.preheader
%cnt.125.unr = phi i32 [ 0, %for.cond1.preheader ], [ %spec.select.1, %for.body3 ]
%n.024.unr = phi i32 [ 1, %for.cond1.preheader ], [ %inc.1, %for.body3 ]
%rem.epil = urem i32 %i.027, %n.024.unr
%cmp4.epil = icmp eq i32 %rem.epil, 0
%add.epil = zext i1 %cmp4.epil to i32
%spec.select.epil = add nuw nsw i32 %cnt.125.unr, %add.epil
%cmp5 = icmp eq i32 %spec.select.epil, 8
%add7 = zext i1 %cmp5 to i32
%ans.1 = add nuw nsw i32 %ans.028, %add7
%inc12 = add nuw nsw i32 %i.027, 2
%cmp.not = icmp sgt i32 %inc12, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.end13, label %for.cond1.preheader, !llvm.loop !11
for.end13: ; preds = %for.body3.epil, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1, %for.body3.epil ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
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<stdlib.h>
#include<math.h>
typedef long long int int64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
void run(void){
int n;
scanf("%d",&n);
int cnt=0;
int i;
for(i=1;i<=n;i+=2){
int c=0;
int j;
for(j=1;j<=i;j++){
if(i%j==0) c++;
}
if(c==8) cnt++;
}
printf("%d\n",cnt);
}
int main(void){
run();
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228654/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228654/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @run() 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
%cmp.not23 = icmp slt i32 %0, 1
br i1 %cmp.not23, label %for.end11, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.body3.epil
%indvar = phi i32 [ %indvar.next, %for.body3.epil ], [ 0, %entry ]
%i.025 = phi i32 [ %add, %for.body3.epil ], [ 1, %entry ]
%cnt.024 = phi i32 [ %spec.select20, %for.body3.epil ], [ 0, %entry ]
%1 = icmp eq i32 %indvar, 0
br i1 %1, label %for.body3.epil, label %for.cond1.preheader.new
for.cond1.preheader.new: ; preds = %for.cond1.preheader
%2 = shl nuw nsw i32 %indvar, 1
br label %for.body3
for.body3: ; preds = %for.body3, %for.cond1.preheader.new
%j.022 = phi i32 [ 1, %for.cond1.preheader.new ], [ %inc5.1, %for.body3 ]
%c.021 = phi i32 [ 0, %for.cond1.preheader.new ], [ %spec.select.1, %for.body3 ]
%niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body3 ]
%rem = urem i32 %i.025, %j.022
%cmp4 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp4 to i32
%spec.select = add nuw nsw i32 %c.021, %inc
%inc5 = add nuw nsw i32 %j.022, 1
%rem.1 = urem i32 %i.025, %inc5
%cmp4.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp4.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc5.1 = add nuw nsw i32 %j.022, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %2
br i1 %niter.ncmp.1, label %for.body3.epil, label %for.body3, !llvm.loop !9
for.body3.epil: ; preds = %for.body3, %for.cond1.preheader
%j.022.unr = phi i32 [ 1, %for.cond1.preheader ], [ %inc5.1, %for.body3 ]
%c.021.unr = phi i32 [ 0, %for.cond1.preheader ], [ %spec.select.1, %for.body3 ]
%rem.epil = urem i32 %i.025, %j.022.unr
%cmp4.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp4.epil to i32
%spec.select.epil = add nuw nsw i32 %c.021.unr, %inc.epil
%cmp6 = icmp eq i32 %spec.select.epil, 8
%inc8 = zext i1 %cmp6 to i32
%spec.select20 = add nuw nsw i32 %cnt.024, %inc8
%add = add nuw nsw i32 %i.025, 2
%cmp.not = icmp sgt i32 %add, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !11
for.end11: ; preds = %for.body3.epil, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select20, %for.body3.epil ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n.i) #3
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n.i)
%0 = load i32, ptr %n.i, align 4, !tbaa !5
%cmp.not23.i = icmp slt i32 %0, 1
br i1 %cmp.not23.i, label %run.exit, label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %entry, %for.body3.i.epil
%indvar = phi i32 [ %indvar.next, %for.body3.i.epil ], [ 0, %entry ]
%i.025.i = phi i32 [ %add.i, %for.body3.i.epil ], [ 1, %entry ]
%cnt.024.i = phi i32 [ %spec.select20.i, %for.body3.i.epil ], [ 0, %entry ]
%1 = icmp eq i32 %indvar, 0
br i1 %1, label %for.body3.i.epil, label %for.cond1.preheader.i.new
for.cond1.preheader.i.new: ; preds = %for.cond1.preheader.i
%2 = shl nuw nsw i32 %indvar, 1
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i, %for.cond1.preheader.i.new
%j.022.i = phi i32 [ 1, %for.cond1.preheader.i.new ], [ %inc5.i.1, %for.body3.i ]
%c.021.i = phi i32 [ 0, %for.cond1.preheader.i.new ], [ %spec.select.i.1, %for.body3.i ]
%niter = phi i32 [ 0, %for.cond1.preheader.i.new ], [ %niter.next.1, %for.body3.i ]
%rem.i = urem i32 %i.025.i, %j.022.i
%cmp4.i = icmp eq i32 %rem.i, 0
%inc.i = zext i1 %cmp4.i to i32
%spec.select.i = add nuw nsw i32 %c.021.i, %inc.i
%inc5.i = add nuw nsw i32 %j.022.i, 1
%rem.i.1 = urem i32 %i.025.i, %inc5.i
%cmp4.i.1 = icmp eq i32 %rem.i.1, 0
%inc.i.1 = zext i1 %cmp4.i.1 to i32
%spec.select.i.1 = add nuw nsw i32 %spec.select.i, %inc.i.1
%inc5.i.1 = add nuw nsw i32 %j.022.i, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %2
br i1 %niter.ncmp.1, label %for.body3.i.epil, label %for.body3.i, !llvm.loop !9
for.body3.i.epil: ; preds = %for.body3.i, %for.cond1.preheader.i
%j.022.i.unr = phi i32 [ 1, %for.cond1.preheader.i ], [ %inc5.i.1, %for.body3.i ]
%c.021.i.unr = phi i32 [ 0, %for.cond1.preheader.i ], [ %spec.select.i.1, %for.body3.i ]
%rem.i.epil = urem i32 %i.025.i, %j.022.i.unr
%cmp4.i.epil = icmp eq i32 %rem.i.epil, 0
%inc.i.epil = zext i1 %cmp4.i.epil to i32
%spec.select.i.epil = add nuw nsw i32 %c.021.i.unr, %inc.i.epil
%cmp6.i = icmp eq i32 %spec.select.i.epil, 8
%inc8.i = zext i1 %cmp6.i to i32
%spec.select20.i = add nuw nsw i32 %cnt.024.i, %inc8.i
%add.i = add nuw nsw i32 %i.025.i, 2
%cmp.not.i = icmp sgt i32 %add.i, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not.i, label %run.exit, label %for.cond1.preheader.i, !llvm.loop !11
run.exit: ; preds = %for.body3.i.epil, %entry
%cnt.0.lcssa.i = phi i32 [ 0, %entry ], [ %spec.select20.i, %for.body3.i.epil ]
%call12.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n.i) #3
ret i32 0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
char a[50], b[50];
scanf("%s %s", a, b);
int i,j=0,k=0;
for(i=0;a[j]!='\0'||b[k]!='\0';i++){
if(i%2==0){printf("%c",a[j++]);}
else{printf("%c",b[k++]);}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228698/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228698/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [50 x i8], align 16
%b = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%i.0 = phi i32 [ 0, %entry ], [ %inc19, %for.inc ]
%j.0 = phi i32 [ 0, %entry ], [ %j.1, %for.inc ]
%k.0 = phi i32 [ 0, %entry ], [ %k.1, %for.inc ]
%idxprom = sext i32 %j.0 to i64
%arrayidx = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
br i1 %cmp.not, label %lor.rhs, label %for.body
lor.rhs: ; preds = %for.cond
%idxprom3 = sext i32 %k.0 to i64
%arrayidx4 = getelementptr inbounds [50 x i8], ptr %b, i64 0, i64 %idxprom3
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%cmp6.not = icmp eq i8 %1, 0
br i1 %cmp6.not, label %for.end, label %for.body
for.body: ; preds = %for.cond, %lor.rhs
%rem = and i32 %i.0, 1
%cmp8 = icmp eq i32 %rem, 0
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %j.0, 1
br label %for.inc
if.else: ; preds = %for.body
%inc14 = add nsw i32 %k.0, 1
%idxprom15 = sext i32 %k.0 to i64
%arrayidx16 = getelementptr inbounds [50 x i8], ptr %b, i64 0, i64 %idxprom15
%2 = load i8, ptr %arrayidx16, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%.sink = phi i8 [ %0, %if.then ], [ %2, %if.else ]
%j.1 = phi i32 [ %inc, %if.then ], [ %j.0, %if.else ]
%k.1 = phi i32 [ %k.0, %if.then ], [ %inc14, %if.else ]
%conv12 = sext i8 %.sink to i32
%putchar23 = call i32 @putchar(i32 %conv12)
%inc19 = add nuw nsw i32 %i.0, 1
br label %for.cond, !llvm.loop !8
for.end: ; preds = %lor.rhs
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
char a[51],b[51];
scanf("%s %s",a,b);
for(int i=0;i<strlen(a);i++){
printf("%c",a[i]);
if(b[i]!='\0')printf("%c",b[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228740/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228740/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [51 x i8], align 16
%b = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%char0 = load i8, ptr %a, align 16
%cmp22.not = icmp eq i8 %char0, 0
br i1 %cmp22.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %a) #5
ret i32 0
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv5 = sext i8 %0 to i32
%putchar = call i32 @putchar(i32 %conv5)
%arrayidx8 = getelementptr inbounds [51 x i8], ptr %b, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10.not = icmp eq i8 %1, 0
br i1 %cmp10.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%conv9 = sext i8 %1 to i32
%putchar20 = call i32 @putchar(i32 %conv9)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%cmp = icmp ugt i64 %call3, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char o[51],e[51];
scanf("%s%s",o,e);
for(int i=0;i<strlen(o);i++){
printf("%c",o[i]);
if(i<strlen(e))printf("%c",e[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228784/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228784/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%o = alloca [51 x i8], align 16
%e = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %o) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %e) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %o, ptr noundef nonnull %e)
%char0 = load i8, ptr %o, align 16
%cmp22.not = icmp eq i8 %char0, 0
br i1 %cmp22.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %e) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %o) #5
ret i32 0
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %o, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv5 = sext i8 %0 to i32
%putchar = call i32 @putchar(i32 %conv5)
%call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %e) #6
%cmp10 = icmp ugt i64 %call9, %indvars.iv
br i1 %cmp10, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx13 = getelementptr inbounds [51 x i8], ptr %e, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%conv14 = sext i8 %1 to i32
%putchar20 = call i32 @putchar(i32 %conv14)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %o) #6
%cmp = icmp ugt i64 %call3, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
char o[51],e[51],pass[101]={};
int i;
scanf("%s",o);
scanf("%s",e);
for(i=0;o[i]!='\0';i++){
pass[i*2]=o[i];
}
for(i=0;e[i]!='\0';i++){
pass[i*2+1]=e[i];
}
printf("%s\n",pass);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228827/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228827/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%o = alloca [51 x i8], align 16
%e = alloca [51 x i8], align 16
%pass = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %o) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %e) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %pass) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %pass, i8 0, i64 101, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %o)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%0 = load i8, ptr %o, align 16, !tbaa !5
%cmp.not32 = icmp eq i8 %0, 0
br i1 %cmp.not32, label %for.cond8.preheader, label %for.body
for.cond8.preheader: ; preds = %for.body, %entry
%1 = load i8, ptr %e, align 16, !tbaa !5
%cmp12.not34 = icmp eq i8 %1, 0
br i1 %cmp12.not34, label %for.end22, label %for.body14
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%2 = phi i8 [ %4, %for.body ], [ %0, %entry ]
%3 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [101 x i8], ptr %pass, i64 0, i64 %3
store i8 %2, ptr %arrayidx7, align 2, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [51 x i8], ptr %o, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %4, 0
br i1 %cmp.not, label %for.cond8.preheader, label %for.body, !llvm.loop !8
for.body14: ; preds = %for.cond8.preheader, %for.body14
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body14 ], [ 0, %for.cond8.preheader ]
%5 = phi i8 [ %8, %for.body14 ], [ %1, %for.cond8.preheader ]
%6 = shl nuw nsw i64 %indvars.iv37, 1
%7 = or i64 %6, 1
%arrayidx19 = getelementptr inbounds [101 x i8], ptr %pass, i64 0, i64 %7
store i8 %5, ptr %arrayidx19, align 1, !tbaa !5
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%arrayidx10 = getelementptr inbounds [51 x i8], ptr %e, i64 0, i64 %indvars.iv.next38
%8 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp12.not = icmp eq i8 %8, 0
br i1 %cmp12.not, label %for.end22, label %for.body14, !llvm.loop !10
for.end22: ; preds = %for.body14, %for.cond8.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %pass)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %pass) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %e) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %o) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
char O[51],E[51],ans[102];
int i,len1,len2;
scanf("%s",O);
scanf("%s",E);
len1 = strlen(O);
len2 = strlen(E);
for(i=0;i<len2;i++){
printf("%c",O[i]);
printf("%c",E[i]);
}
if(len1 > len2) printf("%c",O[len1-1]);
putchar('\n');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228885/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228885/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%O = alloca [51 x i8], align 16
%E = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %O) #4
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %E) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %O)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %E)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %O) #5
%conv = trunc i64 %call4 to i32
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %E) #5
%conv7 = trunc i64 %call6 to i32
%cmp32 = icmp sgt i32 %conv7, 0
br i1 %cmp32, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call6, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv9 = sext i8 %0 to i32
%1 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i = call noundef i32 @putc(i32 noundef %conv9, ptr noundef %1)
%arrayidx12 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%conv13 = sext i8 %2 to i32
%3 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i29 = call noundef i32 @putc(i32 noundef %conv13, ptr noundef %3)
%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 !10
for.end: ; preds = %for.body, %entry
%cmp15 = icmp sgt i32 %conv, %conv7
br i1 %cmp15, label %if.then, label %if.end
if.then: ; preds = %for.end
%sub = shl i64 %call4, 32
%sext = add i64 %sub, -4294967296
%idxprom17 = ashr exact i64 %sext, 32
%arrayidx18 = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %idxprom17
%4 = load i8, ptr %arrayidx18, align 1, !tbaa !5
%conv19 = sext i8 %4 to i32
%5 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i30 = call noundef i32 @putc(i32 noundef %conv19, ptr noundef %5)
br label %if.end
if.end: ; preds = %if.then, %for.end
%6 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i31 = call noundef i32 @putc(i32 noundef 10, ptr noundef %6)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %E) #4
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %O) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void){
char s[11];
int a = 0;
scanf("%d", &a);
scanf("%s", s);
if(a>=3200) printf("%s", s);
else printf("red");
//printf("%d", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228928/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228928/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n;
char s[11];
scanf("%d %s",&n,s);
if(n>=3200)
printf("%s\n",s);
else
printf("red\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\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 [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 11, 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"}
|
#include <stdio.h>
#include <string.h>
int main(){
int a;
char s[12];
scanf("%d",&a);
scanf("%s",s);
if(a<3200){
printf("red\n");
}
else{
printf("%s\n",s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229013/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229013/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.s = select i1 %cmp, ptr @str, ptr %s
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.s)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct alpha
{
char s[11];
};
int main()//void 없애버리기?
{
int a;
struct alpha s[11];
printf("\n");
if(scanf("%d", &a)==1&&scanf("%s", s[0].s))
{
printf("\n");
printf("\n");
if((2800)<=a<5000)
{
if(a>=3200)
{
//printf("%d\n", a);
printf("%s", s[0].s);
}
else
{
printf("red");
}
}
else
{
printf("error");
}
}
else
{
printf("error\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229057/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229057/source.c"
target datalayout = "e-m:e-p270: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.alpha = type { [11 x i8] }
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"red\00", align 1
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x %struct.alpha], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 121, ptr nonnull %s) #4
%putchar = tail call i32 @putchar(i32 10)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%cmp = icmp eq i32 %call1, 1
br i1 %cmp, label %land.lhs.true, label %if.else21
land.lhs.true: ; preds = %entry
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s)
%tobool.not = icmp eq i32 %call3, 0
br i1 %tobool.not, label %if.else21, label %if.then
if.then: ; preds = %land.lhs.true
%putchar24 = call i32 @putchar(i32 10)
%putchar25 = call i32 @putchar(i32 10)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 3199
br i1 %cmp10, label %if.then12, label %if.else
if.then12: ; preds = %if.then
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %s)
br label %if.end23
if.else: ; preds = %if.then
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end23
if.else21: ; preds = %land.lhs.true, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end23
if.end23: ; preds = %if.else, %if.then12, %if.else21
call void @llvm.lifetime.end.p0(i64 121, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(int argc, char const* argv[])
{
int a;
int s[10];
scanf("%d%s",&a,s);
if(a >= 3200)printf("%s",s);
else printf("red");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229107/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229107/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\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
%s = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %s) #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;
char s[11];
scanf("%d",&a);
scanf("%s",s);
if(a>=3200){
printf("%s\n",s);
}else{
printf("red\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229158/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229158/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (){
int a;
char s[100];
char r[] = "red";
scanf("%d",&a); // numero
scanf("%s", s ); // string
if (a > 3200 || a == 3200){
printf("%s\n",s );
} else{
printf("%s\n",r);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229200/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229200/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [100 x i8], align 16
%r = alloca [4 x i8], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
store i32 6579570, ptr %r, align 4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4
%or.cond = icmp sgt i32 %0, 3199
%s.r = select i1 %or.cond, ptr %s, ptr %r
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.r)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main()
{
int a;
char s[16];
scanf("%d%s", &a, s);
if (a >= 3200)
printf("%s\n", s);
else
printf("red\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229244/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [16 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a;
char s[10];
scanf("%d", &a);
scanf("%s", s);
if(a >= 3200){
printf("%s\n", s);
}
else{
printf("red\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229288/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a;
scanf("%d", &a);
char s[10];
scanf("%s", s);
if (a < 3200) {
printf("%s\n", "red");
return 0;
}
printf("%s\n", s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
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)
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%.str.3.s = select i1 %cmp, ptr @.str.3, ptr %s
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %.str.3.s)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
char s[20];
scanf("%d", &a);
scanf("%s", s);
if(a >= 3200){
printf("%s\n",s);
}else{
puts("red");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #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.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
long lun[100000];
int k, d, idx = 9;
scanf("%d", &k);
for(int i=0; i < 9; i++)
lun[i] = i + 1;
if(k <= idx) {
printf("%ld", lun[k-1]);
return 0;
}
for(int i=0; idx < k; i++) {
for(int j=-1; j <= 1; j++) {
d = lun[i]%10 + j;
if(d < 0 || d > 9)
continue;
lun[idx++] = 10*lun[i] + d;
}
}
printf("%ld", lun[k-1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229424/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229424/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%lun = alloca [100000 x i64], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %lun) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
store i64 1, ptr %lun, align 16, !tbaa !5
%arrayidx.1 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 1
store i64 2, ptr %arrayidx.1, align 8, !tbaa !5
%arrayidx.2 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 2
store i64 3, ptr %arrayidx.2, align 16, !tbaa !5
%arrayidx.3 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 3
store i64 4, ptr %arrayidx.3, align 8, !tbaa !5
%arrayidx.4 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 4
store i64 5, ptr %arrayidx.4, align 16, !tbaa !5
%arrayidx.5 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 5
store i64 6, ptr %arrayidx.5, align 8, !tbaa !5
%arrayidx.6 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 6
store i64 7, ptr %arrayidx.6, align 16, !tbaa !5
%arrayidx.7 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 7
store i64 8, ptr %arrayidx.7, align 8, !tbaa !5
%arrayidx.8 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 8
store i64 9, ptr %arrayidx.8, align 16, !tbaa !5
%0 = load i32, ptr %k, align 4, !tbaa !9
%cmp1 = icmp slt i32 %0, 10
br i1 %cmp1, label %cleanup, label %for.cond12.preheader
for.cond12.preheader: ; preds = %entry, %for.inc35.2
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc35.2 ], [ 0, %entry ]
%idx.063 = phi i32 [ %idx.2.2, %for.inc35.2 ], [ 9, %entry ]
%arrayidx18 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 %indvars.iv
%1 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%rem = srem i64 %1, 10
%2 = trunc i64 %rem to i32
%conv21 = add nsw i32 %2, -1
%or.cond = icmp ugt i32 %conv21, 9
br i1 %or.cond, label %for.inc35, label %if.end27
if.end27: ; preds = %for.cond12.preheader
%mul = mul nsw i64 %1, 10
%conv30 = zext i32 %conv21 to i64
%add31 = add nsw i64 %mul, %conv30
%inc32 = add nsw i32 %idx.063, 1
%idxprom33 = sext i32 %idx.063 to i64
%arrayidx34 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 %idxprom33
store i64 %add31, ptr %arrayidx34, align 8, !tbaa !5
%.pre = load i64, ptr %arrayidx18, align 8, !tbaa !5
%.pre68 = srem i64 %.pre, 10
%.pre69 = trunc i64 %.pre68 to i32
br label %for.inc35
for.inc35: ; preds = %for.cond12.preheader, %if.end27
%.pre-phi = phi i32 [ %2, %for.cond12.preheader ], [ %.pre69, %if.end27 ]
%3 = phi i64 [ %1, %for.cond12.preheader ], [ %.pre, %if.end27 ]
%idx.2 = phi i32 [ %idx.063, %for.cond12.preheader ], [ %inc32, %if.end27 ]
%or.cond.1 = icmp ugt i32 %.pre-phi, 9
br i1 %or.cond.1, label %for.inc35.1, label %if.end27.1
if.end27.1: ; preds = %for.inc35
%mul.1 = mul nsw i64 %3, 10
%conv30.1 = zext i32 %.pre-phi to i64
%add31.1 = add nsw i64 %mul.1, %conv30.1
%inc32.1 = add nsw i32 %idx.2, 1
%idxprom33.1 = sext i32 %idx.2 to i64
%arrayidx34.1 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 %idxprom33.1
store i64 %add31.1, ptr %arrayidx34.1, align 8, !tbaa !5
%.pre67 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%.pre70 = srem i64 %.pre67, 10
%.pre71 = trunc i64 %.pre70 to i32
br label %for.inc35.1
for.inc35.1: ; preds = %if.end27.1, %for.inc35
%.pre-phi72 = phi i32 [ %.pre71, %if.end27.1 ], [ %.pre-phi, %for.inc35 ]
%4 = phi i64 [ %.pre67, %if.end27.1 ], [ %3, %for.inc35 ]
%idx.2.1 = phi i32 [ %inc32.1, %if.end27.1 ], [ %idx.2, %for.inc35 ]
%conv21.2 = add nsw i32 %.pre-phi72, 1
%or.cond.2 = icmp ugt i32 %conv21.2, 9
br i1 %or.cond.2, label %for.inc35.2, label %if.end27.2
if.end27.2: ; preds = %for.inc35.1
%mul.2 = mul nsw i64 %4, 10
%conv30.2 = zext i32 %conv21.2 to i64
%add31.2 = add nsw i64 %mul.2, %conv30.2
%inc32.2 = add nsw i32 %idx.2.1, 1
%idxprom33.2 = sext i32 %idx.2.1 to i64
%arrayidx34.2 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 %idxprom33.2
store i64 %add31.2, ptr %arrayidx34.2, align 8, !tbaa !5
br label %for.inc35.2
for.inc35.2: ; preds = %if.end27.2, %for.inc35.1
%idx.2.2 = phi i32 [ %idx.2.1, %for.inc35.1 ], [ %inc32.2, %if.end27.2 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp8 = icmp slt i32 %idx.2.2, %0
br i1 %cmp8, label %for.cond12.preheader, label %cleanup, !llvm.loop !11
cleanup: ; preds = %for.inc35.2, %entry
%sub41 = add nsw i32 %0, -1
%idxprom42 = sext i32 %sub41 to i64
%arrayidx43 = getelementptr inbounds [100000 x i64], ptr %lun, i64 0, i64 %idxprom42
%5 = load i64, ptr %arrayidx43, align 8, !tbaa !5
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %lun) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int N,M,f[1000005]={0,1},i,r;
int main()
{
for(i=2;i<1000005;i++)
{
if((i%2==0&&f[i/2])||(i%3==0&&f[i/3])||(i%5==0&&f[i/5]))
f[i]=1;
}
for(;scanf("%d%d",&M,&N),M;)
{
for(i=0;M<=N;M++)
if(f[M])i++;
printf("%d\n",i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229475/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229475/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@f = dso_local local_unnamed_addr global <{ i32, i32, [1000003 x i32] }> <{ i32 0, i32 1, [1000003 x i32] zeroinitializer }>, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@M = dso_local global i32 0, align 4
@N = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@r = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %for.body
for.cond19.preheader: ; preds = %for.inc
store i32 1000005, ptr @i, align 4, !tbaa !5
%call45 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @M, ptr noundef nonnull @N)
%0 = load i32, ptr @M, align 4, !tbaa !5
%tobool20.not46 = icmp eq i32 %0, 0
br i1 %tobool20.not46, label %for.end35, label %for.body21
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.inc ]
%1 = trunc i64 %indvars.iv to i32
%2 = and i32 %1, 1
%cmp1 = icmp eq i32 %2, 0
br i1 %cmp1, label %land.lhs.true, label %lor.lhs.false
land.lhs.true: ; preds = %for.body
%div37 = lshr i64 %indvars.iv, 1
%idxprom = and i64 %div37, 2147483647
%arrayidx = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %lor.lhs.false, label %if.then
lor.lhs.false: ; preds = %land.lhs.true, %for.body
%rem2 = urem i32 %1, 3
%div5 = udiv i32 %1, 3
%cmp3 = icmp eq i32 %rem2, 0
br i1 %cmp3, label %land.lhs.true4, label %lor.lhs.false9
land.lhs.true4: ; preds = %lor.lhs.false
%idxprom6 = zext i32 %div5 to i64
%arrayidx7 = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %idxprom6
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%tobool8.not = icmp eq i32 %4, 0
br i1 %tobool8.not, label %lor.lhs.false9, label %if.then
lor.lhs.false9: ; preds = %land.lhs.true4, %lor.lhs.false
%rem10 = urem i32 %1, 5
%div13 = udiv i32 %1, 5
%cmp11 = icmp eq i32 %rem10, 0
br i1 %cmp11, label %land.lhs.true12, label %for.inc
land.lhs.true12: ; preds = %lor.lhs.false9
%idxprom14 = zext i32 %div13 to i64
%arrayidx15 = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %idxprom14
%5 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%tobool16.not = icmp eq i32 %5, 0
br i1 %tobool16.not, label %for.inc, label %if.then
if.then: ; preds = %land.lhs.true12, %land.lhs.true4, %land.lhs.true
%arrayidx18 = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx18, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %lor.lhs.false9, %land.lhs.true12, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1000005
br i1 %exitcond.not, label %for.cond19.preheader, label %for.body, !llvm.loop !9
for.body21: ; preds = %for.cond19.preheader, %for.end33
%M.promoted = phi i32 [ %16, %for.end33 ], [ %0, %for.cond19.preheader ]
store i32 0, ptr @i, align 4, !tbaa !5
%6 = load i32, ptr @N, align 4, !tbaa !5
%cmp23.not42 = icmp sgt i32 %M.promoted, %6
br i1 %cmp23.not42, label %for.end33, label %for.body24.preheader
for.body24.preheader: ; preds = %for.body21
%7 = sext i32 %M.promoted to i64
%8 = add i32 %6, 1
%9 = sub i32 %8, %M.promoted
%xtraiter = and i32 %9, 1
%10 = icmp eq i32 %6, %M.promoted
br i1 %10, label %for.cond22.for.end33_crit_edge.unr-lcssa, label %for.body24.preheader.new
for.body24.preheader.new: ; preds = %for.body24.preheader
%unroll_iter = and i32 %9, -2
br label %for.body24
for.body24: ; preds = %for.inc31.1, %for.body24.preheader.new
%indvars.iv48 = phi i64 [ %7, %for.body24.preheader.new ], [ %indvars.iv.next49.1, %for.inc31.1 ]
%inc294143 = phi i32 [ 0, %for.body24.preheader.new ], [ %inc2940.1, %for.inc31.1 ]
%niter = phi i32 [ 0, %for.body24.preheader.new ], [ %niter.next.1, %for.inc31.1 ]
%arrayidx26 = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %indvars.iv48
%11 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%tobool27.not = icmp eq i32 %11, 0
br i1 %tobool27.not, label %for.inc31, label %if.then28
if.then28: ; preds = %for.body24
%inc29 = add nsw i32 %inc294143, 1
store i32 %inc29, ptr @i, align 4, !tbaa !5
br label %for.inc31
for.inc31: ; preds = %for.body24, %if.then28
%inc2940 = phi i32 [ %inc294143, %for.body24 ], [ %inc29, %if.then28 ]
%indvars.iv.next49 = add nsw i64 %indvars.iv48, 1
%arrayidx26.1 = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %indvars.iv.next49
%12 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5
%tobool27.not.1 = icmp eq i32 %12, 0
br i1 %tobool27.not.1, label %for.inc31.1, label %if.then28.1
if.then28.1: ; preds = %for.inc31
%inc29.1 = add nsw i32 %inc2940, 1
store i32 %inc29.1, ptr @i, align 4, !tbaa !5
br label %for.inc31.1
for.inc31.1: ; preds = %if.then28.1, %for.inc31
%inc2940.1 = phi i32 [ %inc2940, %for.inc31 ], [ %inc29.1, %if.then28.1 ]
%indvars.iv.next49.1 = add nsw i64 %indvars.iv48, 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.cond22.for.end33_crit_edge.unr-lcssa, label %for.body24, !llvm.loop !11
for.cond22.for.end33_crit_edge.unr-lcssa: ; preds = %for.inc31.1, %for.body24.preheader
%inc2940.lcssa.ph = phi i32 [ undef, %for.body24.preheader ], [ %inc2940.1, %for.inc31.1 ]
%indvars.iv48.unr = phi i64 [ %7, %for.body24.preheader ], [ %indvars.iv.next49.1, %for.inc31.1 ]
%inc294143.unr = phi i32 [ 0, %for.body24.preheader ], [ %inc2940.1, %for.inc31.1 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond22.for.end33_crit_edge, label %for.body24.epil
for.body24.epil: ; preds = %for.cond22.for.end33_crit_edge.unr-lcssa
%arrayidx26.epil = getelementptr inbounds [1000005 x i32], ptr @f, i64 0, i64 %indvars.iv48.unr
%13 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !5
%tobool27.not.epil = icmp eq i32 %13, 0
br i1 %tobool27.not.epil, label %for.cond22.for.end33_crit_edge, label %if.then28.epil
if.then28.epil: ; preds = %for.body24.epil
%inc29.epil = add nsw i32 %inc294143.unr, 1
store i32 %inc29.epil, ptr @i, align 4, !tbaa !5
br label %for.cond22.for.end33_crit_edge
for.cond22.for.end33_crit_edge: ; preds = %for.body24.epil, %if.then28.epil, %for.cond22.for.end33_crit_edge.unr-lcssa
%inc2940.lcssa = phi i32 [ %inc2940.lcssa.ph, %for.cond22.for.end33_crit_edge.unr-lcssa ], [ %inc294143.unr, %for.body24.epil ], [ %inc29.epil, %if.then28.epil ]
%14 = add i32 %6, 1
store i32 %14, ptr @M, align 4, !tbaa !5
br label %for.end33
for.end33: ; preds = %for.cond22.for.end33_crit_edge, %for.body21
%15 = phi i32 [ %inc2940.lcssa, %for.cond22.for.end33_crit_edge ], [ 0, %for.body21 ]
%call34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @M, ptr noundef nonnull @N)
%16 = load i32, ptr @M, align 4, !tbaa !5
%tobool20.not = icmp eq i32 %16, 0
br i1 %tobool20.not, label %for.end35, label %for.body21, !llvm.loop !12
for.end35: ; preds = %for.end33, %for.cond19.preheader
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int i,j,k,n,m,mark[2000000];
int main(){
mark[1]=1;
for(i=1;i<=1000000;i++){
if(mark[i]==1){
if(i*2<=1000000)mark[i*2]=1;
if(i*3<=1000000)mark[i*3]=1;
if(i*5<=1000000)mark[i*5]=1;
}
mark[i]+=mark[i-1];
}
while(scanf("%d",&m)*m){
scanf("%d",&n);
printf("%d\n",mark[n]-mark[m-1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229518/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229518/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mark = dso_local local_unnamed_addr global [2000000 x i32] zeroinitializer, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@m = dso_local global i32 0, align 4
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@j = dso_local local_unnamed_addr global i32 0, align 4
@k = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
store i32 1, ptr getelementptr inbounds ([2000000 x i32], ptr @mark, i64 0, i64 1), align 4, !tbaa !5
br label %for.body
while.cond.preheader: ; preds = %if.end21
store i32 1000001, ptr @i, align 4, !tbaa !5
%call38 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
%0 = load i32, ptr @m, align 4, !tbaa !5
%mul2639 = mul nsw i32 %0, %call38
%tobool.not40 = icmp eq i32 %mul2639, 0
br i1 %tobool.not40, label %while.end, label %while.body
for.body: ; preds = %entry, %if.end21
%indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %if.end21 ]
%arrayidx = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %1, 1
%cmp2 = icmp ult i64 %indvars.iv, 500001
%or.cond = and i1 %cmp2, %cmp1
br i1 %or.cond, label %if.end, label %if.end21
if.end: ; preds = %for.body
%2 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %2
store i32 1, ptr %arrayidx6, align 8, !tbaa !5
%cmp8 = icmp ult i64 %indvars.iv, 333334
br i1 %cmp8, label %if.end13, label %if.end21
if.end13: ; preds = %if.end
%3 = mul nuw nsw i64 %indvars.iv, 3
%arrayidx12 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %3
store i32 1, ptr %arrayidx12, align 4, !tbaa !5
%cmp15 = icmp ult i64 %indvars.iv, 200001
br i1 %cmp15, label %if.then16, label %if.end21
if.then16: ; preds = %if.end13
%4 = mul nuw nsw i64 %indvars.iv, 5
%arrayidx19 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %4
store i32 1, ptr %arrayidx19, align 4, !tbaa !5
br label %if.end21
if.end21: ; preds = %if.end, %if.end13, %if.then16, %for.body
%5 = add nsw i64 %indvars.iv, -1
%arrayidx23 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %5
%6 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %7, %6
store i32 %add, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1000001
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !9
while.body: ; preds = %while.cond.preheader, %while.body
%call27 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%8 = load i32, ptr @n, align 4, !tbaa !5
%idxprom28 = sext i32 %8 to i64
%arrayidx29 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %idxprom28
%9 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%10 = load i32, ptr @m, align 4, !tbaa !5
%sub30 = add nsw i32 %10, -1
%idxprom31 = sext i32 %sub30 to i64
%arrayidx32 = getelementptr inbounds [2000000 x i32], ptr @mark, i64 0, i64 %idxprom31
%11 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%sub33 = sub nsw i32 %9, %11
%call34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub33)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
%12 = load i32, ptr @m, align 4, !tbaa !5
%mul26 = mul nsw i32 %12, %call
%tobool.not = icmp eq i32 %mul26, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %while.cond.preheader
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i = 0;i < n;i++)
#define PRN(n) printf("%d\n",n)
int sosu(int a){
if(a < 2)return 0;
for(int j = 2;j <= (int)pow(a,0.5);j++){
if(a % j < 1)return 0;
}
return 1;
}
int main(void){
int n,l,r,f[100001],cnt = 0,x[100001];
scanf("%d",&n);
FOR(100001){
f[i] = sosu(i);
}
FOR(100001){
if(f[i] && i % 2 > 0){
if(f[(i + 1) / 2]){
cnt++;
}
}
x[i] = cnt;
}
FOR(n){
scanf("%d %d",&l,&r);
PRN(x[r] - x[l - 1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @sosu(i32 noundef %a) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %a, 2
br i1 %cmp, label %return, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%conv = sitofp i32 %a to double
%sqrt12 = tail call double @sqrt(double %conv) #4
%abs13 = tail call double @llvm.fabs.f64(double %sqrt12)
%conv114 = fptosi double %abs13 to i32
%cmp2.not15 = icmp slt i32 %conv114, 2
br i1 %cmp2.not15, label %return, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %j.016, 1
%sqrt = tail call double @sqrt(double %conv) #4
%abs = tail call double @llvm.fabs.f64(double %sqrt)
%conv1 = fptosi double %abs to i32
%cmp2.not.not = icmp slt i32 %j.016, %conv1
br i1 %cmp2.not.not, label %for.body, label %cleanup.loopexit, !llvm.loop !5
for.body: ; preds = %for.cond.preheader, %for.cond
%j.016 = phi i32 [ %inc, %for.cond ], [ 2, %for.cond.preheader ]
%rem = srem i32 %a, %j.016
%cmp4 = icmp sgt i32 %rem, 0
br i1 %cmp4, label %for.cond, label %cleanup.loopexit
cleanup.loopexit: ; preds = %for.body, %for.cond
%0 = zext i1 %cmp4 to i32
br label %return
return: ; preds = %for.cond.preheader, %cleanup.loopexit, %entry
%retval.1 = phi i32 [ 0, %entry ], [ 1, %for.cond.preheader ], [ %0, %cleanup.loopexit ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
%f = alloca [100001 x i32], align 16
%x = alloca [100001 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 %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %f) #4
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
br label %for.body
for.body: ; preds = %entry, %sosu.exit
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %sosu.exit ]
%cmp.i = icmp ult i64 %indvars.iv, 2
br i1 %cmp.i, label %sosu.exit, label %for.cond.preheader.i
for.cond.preheader.i: ; preds = %for.body
%0 = trunc i64 %indvars.iv to i32
%conv.i = sitofp i32 %0 to double
%sqrt12.i = call double @sqrt(double %conv.i) #4
%abs13.i = call double @llvm.fabs.f64(double %sqrt12.i)
%conv114.i = fptosi double %abs13.i to i32
%cmp2.not15.i = icmp slt i32 %conv114.i, 2
br i1 %cmp2.not15.i, label %sosu.exit, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %j.016.i, 1
%sqrt.i = call double @sqrt(double %conv.i) #4
%abs.i = call double @llvm.fabs.f64(double %sqrt.i)
%conv1.i = fptosi double %abs.i to i32
%cmp2.not.not.i = icmp slt i32 %j.016.i, %conv1.i
br i1 %cmp2.not.not.i, label %for.body.i, label %cleanup.loopexit.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i
%j.016.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.cond.preheader.i ]
%rem.i = urem i32 %0, %j.016.i
%cmp4.i.not = icmp ne i32 %rem.i, 0
br i1 %cmp4.i.not, label %for.cond.i, label %cleanup.loopexit.i
cleanup.loopexit.i: ; preds = %for.body.i, %for.cond.i
%1 = zext i1 %cmp4.i.not to i32
br label %sosu.exit
sosu.exit: ; preds = %for.body, %for.cond.preheader.i, %cleanup.loopexit.i
%retval.1.i = phi i32 [ 0, %for.body ], [ 1, %for.cond.preheader.i ], [ %1, %cleanup.loopexit.i ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %f, i64 0, i64 %indvars.iv
store i32 %retval.1.i, ptr %arrayidx, align 4, !tbaa !7
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 100001
br i1 %exitcond.not, label %for.body6, label %for.body, !llvm.loop !11
for.cond22.preheader: ; preds = %if.end15
%2 = load i32, ptr %n, align 4, !tbaa !7
%cmp2351 = icmp sgt i32 %2, 0
br i1 %cmp2351, label %for.body25, label %for.cond.cleanup24
for.body6: ; preds = %sosu.exit, %if.end15
%indvars.iv54 = phi i64 [ %.pre, %if.end15 ], [ 0, %sosu.exit ]
%cnt.049 = phi i32 [ %cnt.1, %if.end15 ], [ 0, %sosu.exit ]
%arrayidx8 = getelementptr inbounds [100001 x i32], ptr %f, i64 0, i64 %indvars.iv54
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !7
%tobool.not = icmp eq i32 %3, 0
%rem59 = and i64 %indvars.iv54, 1
%cmp9.not = icmp eq i64 %rem59, 0
%or.cond = or i1 %cmp9.not, %tobool.not
%.pre = add nuw nsw i64 %indvars.iv54, 1
br i1 %or.cond, label %if.end15, label %if.then
if.then: ; preds = %for.body6
%div46 = lshr i64 %.pre, 1
%idxprom10 = and i64 %div46, 2147483647
%arrayidx11 = getelementptr inbounds [100001 x i32], ptr %f, i64 0, i64 %idxprom10
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !7
%tobool12.not = icmp ne i32 %4, 0
%inc14 = zext i1 %tobool12.not to i32
%spec.select = add nsw i32 %cnt.049, %inc14
br label %if.end15
if.end15: ; preds = %for.body6, %if.then
%cnt.1 = phi i32 [ %spec.select, %if.then ], [ %cnt.049, %for.body6 ]
%arrayidx17 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv54
store i32 %cnt.1, ptr %arrayidx17, align 4, !tbaa !7
%exitcond58.not = icmp eq i64 %.pre, 100001
br i1 %exitcond58.not, label %for.cond22.preheader, label %for.body6, !llvm.loop !12
for.cond.cleanup24: ; preds = %for.body25, %for.cond22.preheader
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %f) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body25: ; preds = %for.cond22.preheader, %for.body25
%i21.052 = phi i32 [ %inc34, %for.body25 ], [ 0, %for.cond22.preheader ]
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%5 = load i32, ptr %r, align 4, !tbaa !7
%idxprom27 = sext i32 %5 to i64
%arrayidx28 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %idxprom27
%6 = load i32, ptr %arrayidx28, align 4, !tbaa !7
%7 = load i32, ptr %l, align 4, !tbaa !7
%sub = add nsw i32 %7, -1
%idxprom29 = sext i32 %sub to i64
%arrayidx30 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %idxprom29
%8 = load i32, ptr %arrayidx30, align 4, !tbaa !7
%sub31 = sub nsw i32 %6, %8
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub31)
%inc34 = add nuw nsw i32 %i21.052, 1
%9 = load i32, ptr %n, align 4, !tbaa !7
%cmp23 = icmp slt i32 %inc34, %9
br i1 %cmp23, label %for.body25, label %for.cond.cleanup24, !llvm.loop !13
}
; 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
declare double @sqrt(double) local_unnamed_addr
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>
char buf[100001];
int buf2[100001];
int buf3[100001];
int main(void)
{
char s[1000];
int n,i,j,l,r,c,x;
fgets(s,1000,stdin);
sscanf(s,"%d",&n);
memset(buf,0,sizeof(buf));
memset(buf2,0,sizeof(buf2));
memset(buf3,0,sizeof(buf3));
for(i=3;i<=317;i+=2){
if(buf[i]==1) continue;
for(j=3*i;j<100001;j+=i*2){
buf[j]= 1;
}
}
buf2[3] = 1;
buf2[1] = 0;
int last_cnt=1;
for(i=5;i<=100000;i+=2){
buf2[i] = buf3[i] = last_cnt;
x = (i+1)/2;
if( (x&1)==1 ){
if( buf[i] == 0 && buf[x]==0 ){
last_cnt ++ ;
buf2[i] = last_cnt;
}
}
}
for(i=0;i<n;i++){
fgets(s,1000,stdin);
sscanf(s,"%d %d",&l,&r);
printf("%d\n",buf2[r] - buf3[l]);
}
return EXIT_SUCCESS;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@buf = dso_local local_unnamed_addr global [100001 x i8] zeroinitializer, align 16
@buf2 = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@buf3 = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [1000 x i8], align 16
%n = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 1000, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str, ptr noundef nonnull %n) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100001) @buf, i8 0, i64 100001, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @buf2, i8 0, i64 400004, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @buf3, i8 0, i64 400004, i1 false)
br label %for.body
for.body: ; preds = %for.inc12.1, %entry
%indvars.iv93 = phi i64 [ 3, %entry ], [ %indvars.iv.next94.1, %for.inc12.1 ]
%indvars.iv88 = phi i64 [ 6, %entry ], [ %indvars.iv.next89.1, %for.inc12.1 ]
%indvars.iv = phi i64 [ 9, %entry ], [ %indvars.iv.next.1, %for.inc12.1 ]
%arrayidx = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv93
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp3 = icmp eq i8 %1, 1
br i1 %cmp3, label %for.inc12, label %for.body8
for.body8: ; preds = %for.body, %for.body8
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body8 ], [ %indvars.iv, %for.body ]
%arrayidx10 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv90
store i8 1, ptr %arrayidx10, align 1, !tbaa !9
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, %indvars.iv88
%cmp6 = icmp ult i64 %indvars.iv.next91, 100001
br i1 %cmp6, label %for.body8, label %for.inc12, !llvm.loop !10
for.inc12: ; preds = %for.body8, %for.body
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 2
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 4
%arrayidx.1 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv.next94
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp3.1 = icmp eq i8 %2, 1
br i1 %cmp3.1, label %for.inc12.1, label %for.body8.preheader.1
for.body8.preheader.1: ; preds = %for.inc12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 6
br label %for.body8.1
for.body8.1: ; preds = %for.body8.1, %for.body8.preheader.1
%indvars.iv90.1 = phi i64 [ %indvars.iv.next91.1, %for.body8.1 ], [ %indvars.iv.next, %for.body8.preheader.1 ]
%arrayidx10.1 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv90.1
store i8 1, ptr %arrayidx10.1, align 1, !tbaa !9
%indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90.1, %indvars.iv.next89
%cmp6.1 = icmp ult i64 %indvars.iv.next91.1, 100001
br i1 %cmp6.1, label %for.body8.1, label %for.inc12.1, !llvm.loop !10
for.inc12.1: ; preds = %for.body8.1, %for.inc12
%indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 4
%cmp.1 = icmp ult i64 %indvars.iv93, 314
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 12
%indvars.iv.next89.1 = add nuw nsw i64 %indvars.iv88, 8
br i1 %cmp.1, label %for.body, label %for.end14, !llvm.loop !12
for.end14: ; preds = %for.inc12.1
store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @buf2, i64 0, i64 3), align 4, !tbaa !13
store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @buf2, i64 0, i64 1), align 4, !tbaa !13
br label %for.body18
for.cond45.preheader: ; preds = %for.inc42
%3 = load i32, ptr %n, align 4, !tbaa !13
%cmp4686 = icmp sgt i32 %3, 0
br i1 %cmp4686, label %for.body48, label %for.end60
for.body18: ; preds = %for.end14, %for.inc42
%indvars.iv96 = phi i64 [ 5, %for.end14 ], [ %indvars.iv.next97, %for.inc42 ]
%last_cnt.085 = phi i32 [ 1, %for.end14 ], [ %last_cnt.1, %for.inc42 ]
%arrayidx20 = getelementptr inbounds [100001 x i32], ptr @buf3, i64 0, i64 %indvars.iv96
store i32 %last_cnt.085, ptr %arrayidx20, align 4, !tbaa !13
%arrayidx22 = getelementptr inbounds [100001 x i32], ptr @buf2, i64 0, i64 %indvars.iv96
store i32 %last_cnt.085, ptr %arrayidx22, align 4, !tbaa !13
%4 = add nuw nsw i64 %indvars.iv96, 1
%5 = lshr i64 %4, 1
%6 = and i64 %4, 2
%cmp24.not = icmp eq i64 %6, 0
br i1 %cmp24.not, label %for.inc42, label %if.then26
if.then26: ; preds = %for.body18
%arrayidx28 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv96
%7 = load i8, ptr %arrayidx28, align 1, !tbaa !9
%cmp30 = icmp eq i8 %7, 0
br i1 %cmp30, label %land.lhs.true, label %for.inc42
land.lhs.true: ; preds = %if.then26
%arrayidx33 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %5
%8 = load i8, ptr %arrayidx33, align 1, !tbaa !9
%cmp35 = icmp eq i8 %8, 0
br i1 %cmp35, label %if.then37, label %for.inc42
if.then37: ; preds = %land.lhs.true
%inc = add nsw i32 %last_cnt.085, 1
store i32 %inc, ptr %arrayidx22, align 4, !tbaa !13
br label %for.inc42
for.inc42: ; preds = %for.body18, %if.then37, %land.lhs.true, %if.then26
%last_cnt.1 = phi i32 [ %inc, %if.then37 ], [ %last_cnt.085, %land.lhs.true ], [ %last_cnt.085, %if.then26 ], [ %last_cnt.085, %for.body18 ]
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 2
%cmp16 = icmp ult i64 %indvars.iv96, 99999
br i1 %cmp16, label %for.body18, label %for.cond45.preheader, !llvm.loop !15
for.body48: ; preds = %for.cond45.preheader, %for.body48
%i.287 = phi i32 [ %inc59, %for.body48 ], [ 0, %for.cond45.preheader ]
%9 = load ptr, ptr @stdin, align 8, !tbaa !5
%call50 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 1000, ptr noundef %9)
%call52 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r) #4
%10 = load i32, ptr %r, align 4, !tbaa !13
%idxprom53 = sext i32 %10 to i64
%arrayidx54 = getelementptr inbounds [100001 x i32], ptr @buf2, i64 0, i64 %idxprom53
%11 = load i32, ptr %arrayidx54, align 4, !tbaa !13
%12 = load i32, ptr %l, align 4, !tbaa !13
%idxprom55 = sext i32 %12 to i64
%arrayidx56 = getelementptr inbounds [100001 x i32], ptr @buf3, i64 0, i64 %idxprom55
%13 = load i32, ptr %arrayidx56, align 4, !tbaa !13
%sub = sub nsw i32 %11, %13
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
%inc59 = add nuw nsw i32 %i.287, 1
%14 = load i32, ptr %n, align 4, !tbaa !13
%cmp46 = icmp slt i32 %inc59, %14
br i1 %cmp46, label %for.body48, label %for.end60, !llvm.loop !16
for.end60: ; preds = %for.body48, %for.cond45.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) }
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 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
|
#include <stdio.h>
int main(){
int n,m,i,j,a[100000],maxv,tmp;
while(1){
scanf("%d %d", &n, &m);
if(n==0 && m==0) break;
for(i=0; i<n; i++){
scanf("%d", &a[i]);
}
maxv = 0; // answer
for(i = 0; i < n; i++){
for( j = 0; j < n; j++){
// i, j is integers
if (i!=j) {
tmp = a[i] + a[j];
if ( tmp > maxv && tmp <= m ) maxv = tmp;
}
}
}
if (maxv==0){printf("NONE\n");}
else{printf("%d\n", maxv);}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229648/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [5 x i8] c"NONE\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 [100000 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 %m) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #4
%call57 = 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
%cmp58 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp159 = icmp eq i32 %1, 0
%or.cond60 = select i1 %cmp58, i1 %cmp159, i1 false
br i1 %or.cond60, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end32
%2 = phi i32 [ %13, %if.end32 ], [ %0, %entry ]
%cmp247 = icmp sgt i32 %2, 0
br i1 %cmp247, label %for.body, label %if.then29
for.cond4.preheader: ; preds = %for.body
%cmp553 = icmp sgt i32 %11, 0
br i1 %cmp553, label %for.cond7.preheader.lr.ph, label %if.then29
for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader
%3 = load i32, ptr %m, align 4
%wide.trip.count69 = zext i32 %11 to i64
%xtraiter = and i64 %wide.trip.count69, 1
%4 = icmp eq i32 %11, 1
%unroll_iter = and i64 %wide.trip.count69, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.for.inc25_crit_edge.us, %for.cond7.preheader.lr.ph
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond7.for.inc25_crit_edge.us ], [ 0, %for.cond7.preheader.lr.ph ]
%maxv.054.us = phi i32 [ %maxv.2.us.lcssa, %for.cond7.for.inc25_crit_edge.us ], [ 0, %for.cond7.preheader.lr.ph ]
%arrayidx13.us = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv66
br i1 %4, label %for.cond7.for.inc25_crit_edge.us.unr-lcssa, label %for.body9.us
for.body9.us: ; preds = %for.cond7.preheader.us, %for.inc22.us.1
%indvars.iv63 = phi i64 [ %indvars.iv.next64.1, %for.inc22.us.1 ], [ 0, %for.cond7.preheader.us ]
%maxv.151.us = phi i32 [ %maxv.2.us.1, %for.inc22.us.1 ], [ %maxv.054.us, %for.cond7.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc22.us.1 ], [ 0, %for.cond7.preheader.us ]
%cmp10.not.us = icmp eq i64 %indvars.iv66, %indvars.iv63
br i1 %cmp10.not.us, label %for.inc22.us, label %if.then11.us
if.then11.us: ; preds = %for.body9.us
%5 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%arrayidx15.us = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv63
%6 = load i32, ptr %arrayidx15.us, align 8, !tbaa !5
%add.us = add nsw i32 %6, %5
%cmp16.us = icmp sle i32 %add.us, %maxv.151.us
%cmp18.not.us = icmp sgt i32 %add.us, %3
%or.cond46.us = select i1 %cmp16.us, i1 true, i1 %cmp18.not.us
%spec.select.us = select i1 %or.cond46.us, i32 %maxv.151.us, i32 %add.us
br label %for.inc22.us
for.inc22.us: ; preds = %if.then11.us, %for.body9.us
%maxv.2.us = phi i32 [ %maxv.151.us, %for.body9.us ], [ %spec.select.us, %if.then11.us ]
%indvars.iv.next64 = or i64 %indvars.iv63, 1
%cmp10.not.us.1 = icmp eq i64 %indvars.iv66, %indvars.iv.next64
br i1 %cmp10.not.us.1, label %for.inc22.us.1, label %if.then11.us.1
if.then11.us.1: ; preds = %for.inc22.us
%7 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%arrayidx15.us.1 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv.next64
%8 = load i32, ptr %arrayidx15.us.1, align 4, !tbaa !5
%add.us.1 = add nsw i32 %8, %7
%cmp16.us.1 = icmp sle i32 %add.us.1, %maxv.2.us
%cmp18.not.us.1 = icmp sgt i32 %add.us.1, %3
%or.cond46.us.1 = select i1 %cmp16.us.1, i1 true, i1 %cmp18.not.us.1
%spec.select.us.1 = select i1 %or.cond46.us.1, i32 %maxv.2.us, i32 %add.us.1
br label %for.inc22.us.1
for.inc22.us.1: ; preds = %if.then11.us.1, %for.inc22.us
%maxv.2.us.1 = phi i32 [ %maxv.2.us, %for.inc22.us ], [ %spec.select.us.1, %if.then11.us.1 ]
%indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond7.for.inc25_crit_edge.us.unr-lcssa, label %for.body9.us, !llvm.loop !9
for.cond7.for.inc25_crit_edge.us.unr-lcssa: ; preds = %for.inc22.us.1, %for.cond7.preheader.us
%maxv.2.us.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us ], [ %maxv.2.us.1, %for.inc22.us.1 ]
%indvars.iv63.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next64.1, %for.inc22.us.1 ]
%maxv.151.us.unr = phi i32 [ %maxv.054.us, %for.cond7.preheader.us ], [ %maxv.2.us.1, %for.inc22.us.1 ]
br i1 %lcmp.mod.not, label %for.cond7.for.inc25_crit_edge.us, label %for.body9.us.epil
for.body9.us.epil: ; preds = %for.cond7.for.inc25_crit_edge.us.unr-lcssa
%cmp10.not.us.epil = icmp eq i64 %indvars.iv66, %indvars.iv63.unr
br i1 %cmp10.not.us.epil, label %for.cond7.for.inc25_crit_edge.us, label %if.then11.us.epil
if.then11.us.epil: ; preds = %for.body9.us.epil
%9 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%arrayidx15.us.epil = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv63.unr
%10 = load i32, ptr %arrayidx15.us.epil, align 4, !tbaa !5
%add.us.epil = add nsw i32 %10, %9
%cmp16.us.epil = icmp sle i32 %add.us.epil, %maxv.151.us.unr
%cmp18.not.us.epil = icmp sgt i32 %add.us.epil, %3
%or.cond46.us.epil = select i1 %cmp16.us.epil, i1 true, i1 %cmp18.not.us.epil
%spec.select.us.epil = select i1 %or.cond46.us.epil, i32 %maxv.151.us.unr, i32 %add.us.epil
br label %for.cond7.for.inc25_crit_edge.us
for.cond7.for.inc25_crit_edge.us: ; preds = %for.body9.us.epil, %if.then11.us.epil, %for.cond7.for.inc25_crit_edge.us.unr-lcssa
%maxv.2.us.lcssa = phi i32 [ %maxv.2.us.lcssa.ph, %for.cond7.for.inc25_crit_edge.us.unr-lcssa ], [ %maxv.151.us.unr, %for.body9.us.epil ], [ %spec.select.us.epil, %if.then11.us.epil ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
br i1 %exitcond70.not, label %for.end27, label %for.cond7.preheader.us, !llvm.loop !11
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp2, label %for.body, label %for.cond4.preheader, !llvm.loop !12
for.end27: ; preds = %for.cond7.for.inc25_crit_edge.us
%cmp28 = icmp eq i32 %maxv.2.us.lcssa, 0
br i1 %cmp28, label %if.then29, label %if.else
if.then29: ; preds = %for.cond.preheader, %for.cond4.preheader, %for.end27
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end32
if.else: ; preds = %for.end27
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %maxv.2.us.lcssa)
br label %if.end32
if.end32: ; preds = %if.else, %if.then29
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %13, 0
%14 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %14, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end32, %entry
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include "stdio.h"
int main()
{
int n, m, i, j, num;
int max = 0;
int a[1001] = { 0 };
while (1) {
scanf("%d %d", &n, &m);
if (n == 0 && m == 0) {
break;
}
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (i = 0; i < n - 1; i++) {
for (j = i+1 ; j < n; j++) {
num = a[i] + a[j];
if (num <= m) {
if (num > max) {
max = num;
}
}
}
}
if (max == 0) {
printf("NONE\n");
}
else {
printf("%d\n", max);
}
max = 0;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229691/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229691/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [5 x i8] c"NONE\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 [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %a, i8 0, i64 4004, i1 false)
%call55 = 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
%cmp56 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp157 = icmp eq i32 %1, 0
%or.cond58 = select i1 %cmp56, i1 %cmp157, i1 false
br i1 %or.cond58, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end31
%2 = phi i32 [ %9, %if.end31 ], [ %0, %entry ]
%cmp245 = icmp sgt i32 %2, 0
br i1 %cmp245, label %for.body, label %if.then28
for.cond4.preheader: ; preds = %for.body
%cmp551 = icmp sgt i32 %5, 1
br i1 %cmp551, label %for.body6.lr.ph, label %if.then28
for.body6.lr.ph: ; preds = %for.cond4.preheader
%sub = add nsw i32 %5, -1
%3 = load i32, ptr %m, align 4
%4 = zext i32 %5 to i64
%wide.trip.count69 = zext i32 %sub to i64
%wide.trip.count = zext i32 %5 to i64
br label %for.body6
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp2, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond4.loopexit: ; preds = %for.body9, %for.body6
%max.2.lcssa = phi i32 [ %max.153, %for.body6 ], [ %max.3, %for.body9 ]
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
br i1 %exitcond70.not, label %for.end26, label %for.body6, !llvm.loop !11
for.body6: ; preds = %for.body6.lr.ph, %for.cond4.loopexit
%indvars.iv66 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next67, %for.cond4.loopexit ]
%indvars.iv61 = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next62, %for.cond4.loopexit ]
%max.153 = phi i32 [ 0, %for.body6.lr.ph ], [ %max.2.lcssa, %for.cond4.loopexit ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%cmp847 = icmp ult i64 %indvars.iv.next67, %4
br i1 %cmp847, label %for.body9.lr.ph, label %for.cond4.loopexit
for.body9.lr.ph: ; preds = %for.body6
%arrayidx11 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv66
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.body9
%indvars.iv63 = phi i64 [ %indvars.iv61, %for.body9.lr.ph ], [ %indvars.iv.next64, %for.body9 ]
%max.249 = phi i32 [ %max.153, %for.body9.lr.ph ], [ %max.3, %for.body9 ]
%arrayidx13 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv63
%8 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%add14 = add nsw i32 %8, %7
%cmp15.not = icmp sle i32 %add14, %3
%cmp17 = icmp sgt i32 %add14, %max.249
%or.cond44 = select i1 %cmp15.not, i1 %cmp17, i1 false
%max.3 = select i1 %or.cond44, i32 %add14, i32 %max.249
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
br i1 %exitcond.not, label %for.cond4.loopexit, label %for.body9, !llvm.loop !12
for.end26: ; preds = %for.cond4.loopexit
%cmp27 = icmp eq i32 %max.2.lcssa, 0
br i1 %cmp27, label %if.then28, label %if.else
if.then28: ; preds = %for.cond.preheader, %for.cond4.preheader, %for.end26
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end31
if.else: ; preds = %for.end26
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %max.2.lcssa)
br label %if.end31
if.end31: ; preds = %if.else, %if.then28
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end31, %entry
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main (){
int n,i,j,x;
scanf("%d",&n);
for(i=1;i<=n;i++){
x=i;
if(i%3==0){
printf(" %d",i);
}else{
while(x>0){
if(x%10==3){
printf(" %d",i);
break;
}else{
x=x/10;
}
}
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229734/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229734/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not19 = icmp slt i32 %0, 1
br i1 %cmp.not19, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.020 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.020, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.body
while.body: ; preds = %for.body, %if.else8
%x.018 = phi i32 [ %div, %if.else8 ], [ %i.020, %for.body ]
%rem4 = urem i32 %x.018, 10
%div = udiv i32 %x.018, 10
%cmp5 = icmp eq i32 %rem4, 3
br i1 %cmp5, label %for.inc.sink.split, label %if.else8
if.else8: ; preds = %while.body
%cmp3.not = icmp ult i32 %x.018, 10
br i1 %cmp3.not, label %for.inc, label %while.body, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.020)
br label %for.inc
for.inc: ; preds = %if.else8, %for.inc.sink.split
%inc = add nuw nsw i32 %i.020, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.020, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main() {
int x,i,n;
scanf("%d",&n);
for(i=1; i<=n; i++) {
x = i;
if(x %3 == 0) {
printf(" %d",i);
} else if(x % 10 == 3) {
printf(" %d",i);
} else {
while(x != 0) {
x /=10;
if(x % 10 == 3) {
printf(" %d",i);
break;
}
}
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229778/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229778/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not25 = icmp slt i32 %0, 1
br i1 %cmp.not25, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.026 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.026, 3
%cmp1 = icmp eq i32 %rem, 0
%rem3 = urem i32 %i.026, 10
%cmp4 = icmp eq i32 %rem3, 3
%or.cond = or i1 %cmp1, %cmp4
br i1 %or.cond, label %for.inc.sink.split, label %while.cond
while.cond: ; preds = %for.body, %while.body
%x.0 = phi i32 [ %div, %while.body ], [ %i.026, %for.body ]
%cmp8.not = icmp eq i32 %x.0, 0
br i1 %cmp8.not, label %for.inc, label %while.body
while.body: ; preds = %while.cond
%div = sdiv i32 %x.0, 10
%rem9 = srem i32 %div, 10
%cmp10 = icmp eq i32 %rem9, 3
br i1 %cmp10, label %for.inc.sink.split, label %while.cond, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.026)
br label %for.inc
for.inc: ; preds = %while.cond, %for.inc.sink.split
%inc = add nuw nsw i32 %i.026, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.026, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int n, x;
int i, j;
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
x = i;
if (x % 3 == 0)
printf(" %d", i);
else
{
while (1)
{
if (x % 10 == 3)
{
printf(" %d", i);
break;
}
if (x == x / 10)
break;
x /= 10;
}
}
}
putchar('\n');
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229864/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229864/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.022 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.022, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.cond
while.cond: ; preds = %for.body, %if.end
%x.0 = phi i32 [ %div, %if.end ], [ %i.022, %for.body ]
%rem3 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %for.inc.sink.split, label %if.end
if.end: ; preds = %while.cond
%cmp7 = icmp eq i32 %x.0, %div
br i1 %cmp7, label %for.inc, label %while.cond
for.inc.sink.split: ; preds = %while.cond, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.022)
br label %for.inc
for.inc: ; preds = %if.end, %for.inc.sink.split
%inc = add nuw nsw i32 %i.022, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.022, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%2 = load ptr, ptr @stdout, align 8, !tbaa !11
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
#define NEXT_NONE 0
#define NEXT_CHECK_NUM 1
#define NEXT_INCLUDE3 2
#define NEXT_END_CHECK_NUM 3
void call(int n){
int next;
int i,x;
i = 1;
next = NEXT_CHECK_NUM;
for(;;){
if( next == NEXT_CHECK_NUM ){
x = i;
if( x % 3 == 0 ){
printf(" %d",i);
next = NEXT_END_CHECK_NUM;
} else {
next = NEXT_INCLUDE3;
}
} else if(next == NEXT_INCLUDE3 ){
if( x % 10 == 3 ){
printf(" %d",i);
next = NEXT_END_CHECK_NUM;
} else {
x /= 10;
if( x ){
next = NEXT_INCLUDE3;
} else {
next = NEXT_END_CHECK_NUM;
}
}
} else if(next == NEXT_END_CHECK_NUM ){
if( ++i <= n ){
next = NEXT_CHECK_NUM;
} else {
printf("\n");
next = NEXT_NONE;
}
} else {
break;
}
}
}
int main(int argc, char **argv){
int n;
// Input
scanf("%d",&n);
// Call
call(n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229907/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229907/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @call(i32 noundef %n) local_unnamed_addr #0 {
entry:
br label %for.cond.outer
for.cond.outer: ; preds = %for.cond.outer.backedge, %entry
%next.0.ph = phi i32 [ 1, %entry ], [ %next.0.ph.be, %for.cond.outer.backedge ]
%i.0.ph = phi i32 [ 1, %entry ], [ %inc, %for.cond.outer.backedge ]
%x.0.ph = phi i32 [ undef, %entry ], [ %x.0.ph37, %for.cond.outer.backedge ]
%rem = urem i32 %i.0.ph, 3
%cmp1 = icmp eq i32 %rem, 0
br label %for.cond.outer35
for.cond.outer35: ; preds = %for.cond.outer35.backedge, %for.cond.outer
%next.0.ph36 = phi i32 [ %next.0.ph, %for.cond.outer ], [ %next.0.ph36.be, %for.cond.outer35.backedge ]
%x.0.ph37 = phi i32 [ %x.0.ph, %for.cond.outer ], [ %x.0.ph37.be, %for.cond.outer35.backedge ]
switch i32 %next.0.ph36, label %for.end [
i32 1, label %if.then
i32 2, label %if.then5.peel
i32 3, label %if.then17
]
if.then5.peel: ; preds = %for.cond.outer35
%rem6.peel = srem i32 %x.0.ph37, 10
%div = sdiv i32 %x.0.ph37, 10
%cmp7.peel = icmp eq i32 %rem6.peel, 3
br i1 %cmp7.peel, label %if.then8.peel, label %if.else10
if.then8.peel: ; preds = %if.then5.peel
%call9.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.ph)
br label %if.then17
if.then: ; preds = %for.cond.outer35
br i1 %cmp1, label %if.then2, label %for.cond.outer35.backedge
if.then2: ; preds = %if.then
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.ph)
br label %for.cond.outer35.backedge
for.cond.outer35.backedge: ; preds = %if.else10, %if.then2, %if.then
%next.0.ph36.be = phi i32 [ 2, %if.then ], [ 3, %if.then2 ], [ %spec.select, %if.else10 ]
%x.0.ph37.be = phi i32 [ %i.0.ph, %if.then ], [ %i.0.ph, %if.then2 ], [ %spec.select47, %if.else10 ]
br label %for.cond.outer35
if.else10: ; preds = %if.then5.peel
%x.0.off = add i32 %x.0.ph37, 9
%tobool.not = icmp ult i32 %x.0.off, 19
%spec.select = select i1 %tobool.not, i32 3, i32 2
%spec.select47 = select i1 %tobool.not, i32 0, i32 %div
br label %for.cond.outer35.backedge
if.then17: ; preds = %for.cond.outer35, %if.then8.peel
%inc = add nuw nsw i32 %i.0.ph, 1
%cmp18.not.not = icmp slt i32 %i.0.ph, %n
br i1 %cmp18.not.not, label %for.cond.outer.backedge, label %if.else20
if.else20: ; preds = %if.then17
%putchar = tail call i32 @putchar(i32 10)
br label %for.cond.outer.backedge
for.cond.outer.backedge: ; preds = %if.else20, %if.then17
%next.0.ph.be = phi i32 [ 1, %if.then17 ], [ 0, %if.else20 ]
br label %for.cond.outer
for.end: ; preds = %for.cond.outer35
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.i.outer
for.cond.i.outer: ; preds = %for.cond.i.outer.backedge, %entry
%next.0.i.ph = phi i32 [ 1, %entry ], [ %next.0.i.ph.be, %for.cond.i.outer.backedge ]
%i.0.i.ph = phi i32 [ 1, %entry ], [ %inc.i, %for.cond.i.outer.backedge ]
%x.0.i.ph = phi i32 [ undef, %entry ], [ %x.0.i.ph3, %for.cond.i.outer.backedge ]
%rem.i = urem i32 %i.0.i.ph, 3
%cmp1.i = icmp eq i32 %rem.i, 0
br label %for.cond.i.outer1
for.cond.i.outer1: ; preds = %for.cond.i.outer1.backedge, %for.cond.i.outer
%next.0.i.ph2 = phi i32 [ %next.0.i.ph, %for.cond.i.outer ], [ %next.0.i.ph2.be, %for.cond.i.outer1.backedge ]
%x.0.i.ph3 = phi i32 [ %x.0.i.ph, %for.cond.i.outer ], [ %x.0.i.ph3.be, %for.cond.i.outer1.backedge ]
switch i32 %next.0.i.ph2, label %call.exit [
i32 1, label %if.then.i
i32 2, label %if.then5.i.peel
i32 3, label %if.then17.i
]
if.then5.i.peel: ; preds = %for.cond.i.outer1
%rem6.i.peel = srem i32 %x.0.i.ph3, 10
%div.i = sdiv i32 %x.0.i.ph3, 10
%cmp7.i.peel = icmp eq i32 %rem6.i.peel, 3
br i1 %cmp7.i.peel, label %if.then8.i.peel, label %if.else10.i
if.then8.i.peel: ; preds = %if.then5.i.peel
%call9.i.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.i.ph)
br label %if.then17.i
if.then.i: ; preds = %for.cond.i.outer1
br i1 %cmp1.i, label %if.then2.i, label %for.cond.i.outer1.backedge
if.then2.i: ; preds = %if.then.i
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.i.ph)
br label %for.cond.i.outer1.backedge
for.cond.i.outer1.backedge: ; preds = %if.else10.i, %if.then2.i, %if.then.i
%next.0.i.ph2.be = phi i32 [ 2, %if.then.i ], [ 3, %if.then2.i ], [ %spec.select, %if.else10.i ]
%x.0.i.ph3.be = phi i32 [ %i.0.i.ph, %if.then.i ], [ %i.0.i.ph, %if.then2.i ], [ %spec.select13, %if.else10.i ]
br label %for.cond.i.outer1
if.else10.i: ; preds = %if.then5.i.peel
%x.0.off.i = add i32 %x.0.i.ph3, 9
%tobool.not.i = icmp ult i32 %x.0.off.i, 19
%spec.select = select i1 %tobool.not.i, i32 3, i32 2
%spec.select13 = select i1 %tobool.not.i, i32 0, i32 %div.i
br label %for.cond.i.outer1.backedge
if.then17.i: ; preds = %for.cond.i.outer1, %if.then8.i.peel
%inc.i = add nuw nsw i32 %i.0.i.ph, 1
%cmp18.not.not.i = icmp slt i32 %i.0.i.ph, %0
br i1 %cmp18.not.not.i, label %for.cond.i.outer.backedge, label %if.else20.i
if.else20.i: ; preds = %if.then17.i
%putchar.i = call i32 @putchar(i32 10)
br label %for.cond.i.outer.backedge
for.cond.i.outer.backedge: ; preds = %if.else20.i, %if.then17.i
%next.0.i.ph.be = phi i32 [ 1, %if.then17.i ], [ 0, %if.else20.i ]
br label %for.cond.i.outer
call.exit: ; preds = %for.cond.i.outer1
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int n = 0;
int i = 1;
int x = 0;
scanf("%d", &n);
do {
x = i;
if ((x % 3) == 0) {
printf(" %d", i);
continue;
}
do {
if ((x % 10) == 3) {
printf(" %d", i);
break;
}
x /= 10;
} while (x);
} while (++i <= n);
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229950/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229950/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
store i32 0, ptr %n, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
br label %do.body
do.body: ; preds = %do.cond8, %entry
%i.0 = phi i32 [ 1, %entry ], [ %inc, %do.cond8 ]
%rem = urem i32 %i.0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %do.cond8.sink.split, label %do.body2
do.body2: ; preds = %do.body, %if.end7
%x.0 = phi i32 [ %div, %if.end7 ], [ %i.0, %do.body ]
%rem3 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %do.cond8.sink.split, label %if.end7
if.end7: ; preds = %do.body2
%x.0.off = add i32 %x.0, 9
%tobool.not = icmp ult i32 %x.0.off, 19
br i1 %tobool.not, label %do.cond8, label %do.body2, !llvm.loop !9
do.cond8.sink.split: ; preds = %do.body2, %do.body
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
br label %do.cond8
do.cond8: ; preds = %if.end7, %do.cond8.sink.split
%inc = add nuw nsw i32 %i.0, 1
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9.not.not = icmp slt i32 %i.0, %0
br i1 %cmp9.not.not, label %do.body, label %do.end10, !llvm.loop !11
do.end10: ; preds = %do.cond8
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.