Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#define MAX 500000
#define INFTY 1000000000
int cnt,L[MAX/2+2],R[MAX/2+2];
void merge(int A[],int left,int mid,int right){
int i,k,j;
int n1 = mid - left;
int n2 = right - mid;
// L[0...n1], R[0...n2] を生成
for(i = 0;i<n1;i++){
L[i] = A[left + i];
}
for( i = 0;i< n2;i++){
R[i] = A[mid + i];
}
L[n1] = R[n2] = INFTY;
i = 0;
j = 0;
for (k = left;k<right;k++){
cnt++;
if( L[i] <= R[j]){
A[k] = L[i];
i = i + 1;
}else {
A[k] = R[j];
j = j + 1;
}
}
}
void mergeSort(int A[],int n,int left,int right){
int mid;
if (left+1 < right){
mid = (left + right)/2;
mergeSort(A,n, left, mid);
mergeSort(A,n, mid, right);
merge(A, left, mid, right);
}
}
int main(){
int A[MAX],n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
mergeSort(A,n,0,n);
for(i=0;i<n;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n");
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@L = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = 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
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A90 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp67 = icmp sgt i32 %sub, 0
br i1 %cmp67, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader108, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A90
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader108, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load91 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load91, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader108
for.body.preheader108: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader108, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader108 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader108 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader108
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader108 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp569 = icmp sgt i32 %sub1, 0
br i1 %cmp569, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count81 = zext i32 %sub1 to i64
%invariant.gep88 = getelementptr i32, ptr %A, i64 %13
%min.iters.check96 = icmp ult i32 %sub1, 12
br i1 %min.iters.check96, label %for.body6.preheader107, label %vector.memcheck92
vector.memcheck92: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A90
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check93 = icmp ult i64 %16, 32
br i1 %diff.check93, label %for.body6.preheader107, label %vector.ph97
vector.ph97: ; preds = %vector.memcheck92
%n.vec99 = and i64 %wide.trip.count81, 4294967288
br label %vector.body102
vector.body102: ; preds = %vector.body102, %vector.ph97
%index103 = phi i64 [ 0, %vector.ph97 ], [ %index.next106, %vector.body102 ]
%17 = getelementptr i32, ptr %invariant.gep88, i64 %index103
%wide.load104 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load105 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index103
store <4 x i32> %wide.load104, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load105, ptr %20, align 16, !tbaa !5
%index.next106 = add nuw i64 %index103, 8
%21 = icmp eq i64 %index.next106, %n.vec99
br i1 %21, label %middle.block94, label %vector.body102, !llvm.loop !15
middle.block94: ; preds = %vector.body102
%cmp.n101 = icmp eq i64 %n.vec99, %wide.trip.count81
br i1 %cmp.n101, label %for.end14, label %for.body6.preheader107
for.body6.preheader107: ; preds = %vector.memcheck92, %for.body6.preheader, %middle.block94
%indvars.iv77.ph = phi i64 [ 0, %vector.memcheck92 ], [ 0, %for.body6.preheader ], [ %n.vec99, %middle.block94 ]
%22 = xor i64 %indvars.iv77.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81
%xtraiter109 = and i64 %wide.trip.count81, 3
%lcmp.mod110.not = icmp eq i64 %xtraiter109, 0
br i1 %lcmp.mod110.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader107, %for.body6.prol
%indvars.iv77.prol = phi i64 [ %indvars.iv.next78.prol, %for.body6.prol ], [ %indvars.iv77.ph, %for.body6.preheader107 ]
%prol.iter111 = phi i64 [ %prol.iter111.next, %for.body6.prol ], [ 0, %for.body6.preheader107 ]
%gep89.prol = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv77.prol
%24 = load i32, ptr %gep89.prol, align 4, !tbaa !5
%arrayidx11.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.prol
store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5
%indvars.iv.next78.prol = add nuw nsw i64 %indvars.iv77.prol, 1
%prol.iter111.next = add i64 %prol.iter111, 1
%prol.iter111.cmp.not = icmp eq i64 %prol.iter111.next, %xtraiter109
br i1 %prol.iter111.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !16
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader107
%indvars.iv77.unr = phi i64 [ %indvars.iv77.ph, %for.body6.preheader107 ], [ %indvars.iv.next78.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !17
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv77 = phi i64 [ %indvars.iv.next78.3, %for.body6 ], [ %indvars.iv77.unr, %for.body6.prol.loopexit ]
%gep89 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv77
%30 = load i32, ptr %gep89, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77
store i32 %30, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%gep89.1 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78
%31 = load i32, ptr %gep89.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78
store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
%gep89.2 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78.1
%32 = load i32, ptr %gep89.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.1
store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5
%indvars.iv.next78.2 = add nuw nsw i64 %indvars.iv77, 3
%gep89.3 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78.2
%33 = load i32, ptr %gep89.3, align 4, !tbaa !5
%arrayidx11.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.2
store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5
%indvars.iv.next78.3 = add nuw nsw i64 %indvars.iv77, 4
%exitcond82.not.3 = icmp eq i64 %indvars.iv.next78.3, %wide.trip.count81
br i1 %exitcond82.not.3, label %for.end14, label %for.body6, !llvm.loop !18
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block94, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%arrayidx16 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom15
store i32 1000000000, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub to i64
%arrayidx18 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom17
store i32 1000000000, ptr %arrayidx18, align 4, !tbaa !5
%cmp2071 = icmp slt i32 %left, %right
br i1 %cmp2071, label %for.body21.preheader, label %for.end40
for.body21.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count86 = sext i32 %right to i64
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv83 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next84, %for.body21 ]
%i.274 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.body21 ]
%j.072 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.body21 ]
%35 = load i32, ptr @cnt, align 4, !tbaa !5
%inc22 = add nsw i32 %35, 1
store i32 %inc22, ptr @cnt, align 4, !tbaa !5
%idxprom23 = zext i32 %i.274 to i64
%arrayidx24 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23
%36 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %j.072 to i64
%arrayidx26 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25
%37 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %36, %37
%.sink = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%add37 = zext i1 %cmp27.not to i32
%j.1 = add nuw nsw i32 %j.072, %add37
%not.cmp27.not = xor i1 %cmp27.not, true
%add32 = zext i1 %not.cmp27.not to i32
%i.3 = add nuw nsw i32 %i.274, %add32
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv83
store i32 %.sink, ptr %38, align 4
%indvars.iv.next84 = add nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %for.end40, label %for.body21, !llvm.loop !19
for.end40: ; preds = %for.body21, %for.end14
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A13 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp67.i = icmp sgt i32 %sub.i, 0
br i1 %cmp67.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A13
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load14 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load14, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !21
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp569.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp569.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count81.i = zext i32 %sub1.i to i64
%invariant.gep88.i = getelementptr i32, ptr %A, i64 %13
%min.iters.check19 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check19, label %for.body6.i.preheader, label %vector.memcheck15
vector.memcheck15: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A13
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check16 = icmp ult i64 %16, 32
br i1 %diff.check16, label %for.body6.i.preheader, label %vector.ph20
vector.ph20: ; preds = %vector.memcheck15
%n.vec22 = and i64 %wide.trip.count81.i, 4294967288
br label %vector.body25
vector.body25: ; preds = %vector.body25, %vector.ph20
%index26 = phi i64 [ 0, %vector.ph20 ], [ %index.next29, %vector.body25 ]
%17 = getelementptr i32, ptr %invariant.gep88.i, i64 %index26
%wide.load27 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load28 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index26
store <4 x i32> %wide.load27, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load28, ptr %20, align 16, !tbaa !5
%index.next29 = add nuw i64 %index26, 8
%21 = icmp eq i64 %index.next29, %n.vec22
br i1 %21, label %middle.block17, label %vector.body25, !llvm.loop !22
middle.block17: ; preds = %vector.body25
%cmp.n24 = icmp eq i64 %n.vec22, %wide.trip.count81.i
br i1 %cmp.n24, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck15, %for.body6.preheader.i, %middle.block17
%indvars.iv77.i.ph = phi i64 [ 0, %vector.memcheck15 ], [ 0, %for.body6.preheader.i ], [ %n.vec22, %middle.block17 ]
%22 = xor i64 %indvars.iv77.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81.i
%xtraiter30 = and i64 %wide.trip.count81.i, 3
%lcmp.mod31.not = icmp eq i64 %xtraiter30, 0
br i1 %lcmp.mod31.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv77.i.prol = phi i64 [ %indvars.iv.next78.i.prol, %for.body6.i.prol ], [ %indvars.iv77.i.ph, %for.body6.i.preheader ]
%prol.iter32 = phi i64 [ %prol.iter32.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%gep89.i.prol = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv77.i.prol
%24 = load i32, ptr %gep89.i.prol, align 4, !tbaa !5
%arrayidx11.i.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.i.prol
store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5
%indvars.iv.next78.i.prol = add nuw nsw i64 %indvars.iv77.i.prol, 1
%prol.iter32.next = add i64 %prol.iter32, 1
%prol.iter32.cmp.not = icmp eq i64 %prol.iter32.next, %xtraiter30
br i1 %prol.iter32.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !23
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv77.i.unr = phi i64 [ %indvars.iv77.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next78.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !24
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv77.i = phi i64 [ %indvars.iv.next78.i.3, %for.body6.i ], [ %indvars.iv77.i.unr, %for.body6.i.prol.loopexit ]
%gep89.i = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv77.i
%30 = load i32, ptr %gep89.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.i
store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5
%indvars.iv.next78.i = add nuw nsw i64 %indvars.iv77.i, 1
%gep89.i.1 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i
%31 = load i32, ptr %gep89.i.1, align 4, !tbaa !5
%arrayidx11.i.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i
store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5
%indvars.iv.next78.i.1 = add nuw nsw i64 %indvars.iv77.i, 2
%gep89.i.2 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.1
%32 = load i32, ptr %gep89.i.2, align 4, !tbaa !5
%arrayidx11.i.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i.1
store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5
%indvars.iv.next78.i.2 = add nuw nsw i64 %indvars.iv77.i, 3
%gep89.i.3 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.2
%33 = load i32, ptr %gep89.i.3, align 4, !tbaa !5
%arrayidx11.i.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i.2
store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5
%indvars.iv.next78.i.3 = add nuw nsw i64 %indvars.iv77.i, 4
%exitcond82.not.i.3 = icmp eq i64 %indvars.iv.next78.i.3, %wide.trip.count81.i
br i1 %exitcond82.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !25
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block17, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%arrayidx16.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom15.i
store i32 1000000000, ptr %arrayidx16.i, align 4, !tbaa !5
%idxprom17.i = sext i32 %sub.i to i64
%arrayidx18.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom17.i
store i32 1000000000, ptr %arrayidx18.i, align 4, !tbaa !5
%34 = sext i32 %left to i64
%wide.trip.count86.i = sext i32 %right to i64
br label %for.body21.i
for.body21.i: ; preds = %for.body21.i, %for.end14.i
%indvars.iv83.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next84.i, %for.body21.i ]
%i.274.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body21.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body21.i ]
%35 = load i32, ptr @cnt, align 4, !tbaa !5
%inc22.i = add nsw i32 %35, 1
store i32 %inc22.i, ptr @cnt, align 4, !tbaa !5
%idxprom23.i = zext i32 %i.274.i to i64
%arrayidx24.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23.i
%36 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%idxprom25.i = zext i32 %j.072.i to i64
%arrayidx26.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25.i
%37 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%cmp27.not.i = icmp sgt i32 %36, %37
%.sink.i = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%add37.i = zext i1 %cmp27.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %add37.i
%not.cmp27.not.i = xor i1 %cmp27.not.i, true
%add32.i = zext i1 %not.cmp27.not.i to i32
%i.3.i = add nuw nsw i32 %i.274.i, %add32.i
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv83.i
store i32 %.sink.i, ptr %38, align 4
%indvars.iv.next84.i = add nsw i64 %indvars.iv83.i, 1
%exitcond87.not.i = icmp eq i64 %indvars.iv.next84.i, %wide.trip.count86.i
br i1 %exitcond87.not.i, label %if.end, label %for.body21.i, !llvm.loop !19
if.end: ; preds = %for.body21.i, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca [500000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %A) #6
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
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, 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 [500000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !26
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %3, 0
br i1 %cmp324, label %if.end.peel, label %for.end12
if.end.peel: ; preds = %for.end
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %4, 1
br i1 %cmp3.peel, label %if.end, label %for.end12
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %if.end ], [ 1, %if.end.peel ]
%putchar21 = call i32 @putchar(i32 32)
%arrayidx8 = getelementptr inbounds [500000 x i32], ptr %A, i64 0, i64 %indvars.iv28
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next29, %7
br i1 %cmp3, label %if.end, label %for.end12, !llvm.loop !27
for.end12: ; preds = %if.end, %if.end.peel, %for.end
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr @cnt, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %A) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10, !11}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10, !28}
!28 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#include<stdlib.h>
void merge(int*,int,int,int);
void mergeSort(int*,int,int);
int cnt=0;
int main(void) {
int n,l,m,r,i;
int *M;
scanf("%d",&n);
M=(int *)malloc(n * sizeof(int));
for(i = 0; i <n; i++) scanf("%d",&M[i]);
l = 0;
r = n;
mergeSort(M,l,r);
for(i=0;i<n;i++) {
if(i==n-1)printf("%d",M[i]);
else printf("%d ",M[i]);
}
printf("\n");
printf("%d\n",cnt);
free(M);
return 0;
}
void merge(int M[],int l ,int m, int r) {
int p = m-l;
int q = r-m;
int L[p],R[q];
int i;
for(i = 0; i<p;i++) L[i] = M[l+i];
for(i=0;i<q;i++) R[i] = M[m+i];
L[p] = 2000000000;
R[q] = 2000000000;
i=0;
int j=0;
for(int k = l; k < r; k++) {
if(L[i]<=R[j]) {
M[k]=L[i];
i+=1;
cnt++;
}
else {
M[k]=R[j];
j+=1;
cnt++;
}
}
}
void mergeSort(int M[],int l,int r) {
if(l+1 < r) {
int m=(l+r)/2;
mergeSort(M,l,m);
mergeSort(M,m,r);
merge(M,l,m,r);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, 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 %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergeSort(ptr noundef %call1, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp535 = icmp sgt i32 %3, 0
br i1 %cmp535, label %for.body7, label %for.end18
for.body7: ; preds = %for.end, %for.body7
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body7 ], [ 0, %for.end ]
%4 = phi i32 [ %7, %for.body7 ], [ %3, %for.end ]
%sub = add nsw i32 %4, -1
%5 = zext i32 %sub to i64
%cmp8 = icmp eq i64 %indvars.iv39, %5
%arrayidx11 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv39
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%.str..str.1 = select i1 %cmp8, ptr @.str, ptr @.str.1
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str..str.1, i32 noundef %6)
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp5 = icmp slt i64 %indvars.iv.next40, %8
br i1 %cmp5, label %for.body7, label %for.end18, !llvm.loop !11
for.end18: ; preds = %for.body7, %for.end
%putchar = call i32 @putchar(i32 10)
%9 = load i32, ptr @cnt, align 4, !tbaa !5
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %9)
call void @free(ptr noundef %call1) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %M, i32 noundef %l, i32 noundef %r) local_unnamed_addr #4 {
entry:
%add = add nsw i32 %l, 1
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %r, %l
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %M, i32 noundef %l, i32 noundef %div)
tail call void @mergeSort(ptr noundef %M, i32 noundef %div, i32 noundef %r)
tail call void @merge(ptr noundef %M, i32 noundef %l, i32 noundef %div, i32 noundef %r)
br label %common.ret12
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %M, i32 noundef %l, i32 noundef %m, i32 noundef %r) local_unnamed_addr #4 {
entry:
%sub = sub nsw i32 %m, %l
%sub1 = sub nsw i32 %r, %m
%0 = zext i32 %sub to i64
%vla = alloca i32, i64 %0, align 16
%1 = zext i32 %sub1 to i64
%vla2 = alloca i32, i64 %1, align 16
%cmp71 = icmp sgt i32 %sub, 0
br i1 %cmp71, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%2 = sext i32 %l to i64
%3 = shl nsw i64 %2, 2
%scevgep = getelementptr i8, ptr %M, i64 %3
%4 = xor i32 %l, -1
%5 = add i32 %4, %m
%6 = zext i32 %5 to i64
%7 = shl nuw nsw i64 %6, 2
%8 = add nuw nsw i64 %7, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %8, i1 false), !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body.preheader, %entry
%cmp673 = icmp sgt i32 %sub1, 0
br i1 %cmp673, label %for.body7.preheader, label %for.end15
for.body7.preheader: ; preds = %for.cond5.preheader
%9 = sext i32 %m to i64
%10 = shl nsw i64 %9, 2
%scevgep81 = getelementptr i8, ptr %M, i64 %10
%11 = xor i32 %m, -1
%12 = add i32 %11, %r
%13 = zext i32 %12 to i64
%14 = shl nuw nsw i64 %13, 2
%15 = add nuw nsw i64 %14, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla2, ptr noundef nonnull align 4 dereferenceable(1) %scevgep81, i64 %15, i1 false), !tbaa !5
br label %for.end15
for.end15: ; preds = %for.body7.preheader, %for.cond5.preheader
%idxprom16 = sext i32 %sub to i64
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %idxprom16
store i32 2000000000, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %sub1 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom18
store i32 2000000000, ptr %arrayidx19, align 4, !tbaa !5
%cmp2175 = icmp slt i32 %l, %r
br i1 %cmp2175, label %for.body22.preheader, label %for.cond.cleanup
for.body22.preheader: ; preds = %for.end15
%16 = sext i32 %l to i64
%wide.trip.count = sext i32 %r to i64
br label %for.body22
for.cond.cleanup: ; preds = %for.body22, %for.end15
ret void
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv = phi i64 [ %16, %for.body22.preheader ], [ %indvars.iv.next, %for.body22 ]
%j.077 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%i.276 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%idxprom23 = zext i32 %i.276 to i64
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %idxprom23
%17 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %j.077 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom25
%18 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sle i32 %17, %18
%.sink = tail call i32 @llvm.smin.i32(i32 %17, i32 %18)
%add32 = zext i1 %cmp27.not to i32
%i.3 = add nuw nsw i32 %i.276, %add32
%not.cmp27.not = xor i1 %cmp27.not, true
%add38 = zext i1 %not.cmp27.not to i32
%j.1 = add nuw nsw i32 %j.077, %add38
%19 = getelementptr inbounds i32, ptr %M, i64 %indvars.iv
store i32 %.sink, ptr %19, align 4
%storemerge.in = load i32, ptr @cnt, align 4, !tbaa !5
%storemerge = add nsw i32 %storemerge.in, 1
store i32 %storemerge, ptr @cnt, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body22, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; 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) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
//二次元の累積和で実装もしよう 以下
/*
500*500の二次元グリッド
列車をプロットしていく
終着点の座標を固定して累積和を取っていく
始点は動かさない
*/
int main(void){
int N,M,Q,counter = 0;
int i,j;
scanf("%d %d %d",&N,&M,&Q);
int L[M],R[M],p[Q],q[Q];
int grid[N+1][N+1];
for(i=0;i<=N;i++){
for(j=0;j<=N;j++){
grid[i][j] = 0;
}
}
for(i=0;i<M;i++){
scanf("%d %d",&L[i],&R[i]);
grid[L[i]][R[i]]++;
}
for(i=1;i<=N;i++){
for(j=1;j<=N;j++){
grid[i][j] += grid[i][j-1];
}
}
for(i=0;i<Q;i++){
scanf("%d %d",&p[i],&q[i]);
}
for(i=0;i<Q;i++){
for(j=p[i];j<=q[i];j++){
counter += grid[j][q[i]]-grid[j][p[i]-1];
}
printf("%d\n",counter);
counter = 0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%N = alloca i32, align 4
%M = alloca i32, align 4
%Q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M, ptr noundef nonnull %Q)
%0 = load i32, ptr %M, 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 %M, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%5 = load i32, ptr %Q, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%vla2 = alloca i32, i64 %6, align 16
%vla3 = alloca i32, i64 %6, align 16
%7 = load i32, ptr %N, align 4, !tbaa !5
%add = add i32 %7, 1
%8 = zext i32 %add to i64
%9 = mul nuw i64 %8, %8
%vla5 = alloca i32, i64 %9, align 16
%cmp.not133 = icmp slt i32 %7, 0
br i1 %cmp.not133, label %for.cond14.preheader, label %for.cond6.preheader.preheader
for.cond6.preheader.preheader: ; preds = %entry
%10 = shl i64 %9, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla5, i8 0, i64 %10, i1 false), !tbaa !5
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond6.preheader.preheader, %entry
%cmp15135 = icmp sgt i32 %3, 0
br i1 %cmp15135, label %for.body16, label %for.cond34.preheader
for.cond34.preheader.loopexit: ; preds = %for.body16
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond34.preheader
for.cond34.preheader: ; preds = %for.cond34.preheader.loopexit, %for.cond14.preheader
%11 = phi i32 [ %.pre, %for.cond34.preheader.loopexit ], [ %7, %for.cond14.preheader ]
%cmp35.not139 = icmp slt i32 %11, 1
br i1 %cmp35.not139, label %for.cond55.preheader, label %for.cond37.preheader.preheader
for.cond37.preheader.preheader: ; preds = %for.cond34.preheader
%12 = add nuw i32 %11, 1
%wide.trip.count158 = zext i32 %12 to i64
%13 = add nsw i64 %wide.trip.count158, -1
%14 = add nsw i64 %wide.trip.count158, -2
%xtraiter = and i64 %13, 3
%15 = icmp ult i64 %14, 3
%unroll_iter = and i64 %13, -4
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond37.preheader
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body16 ], [ 0, %for.cond14.preheader ]
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx20 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx18, ptr noundef nonnull %arrayidx20)
%16 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%idxprom24 = sext i32 %16 to i64
%17 = mul nsw i64 %idxprom24, %8
%arrayidx25 = getelementptr inbounds i32, ptr %vla5, i64 %17
%18 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%idxprom28 = sext i32 %18 to i64
%arrayidx29 = getelementptr inbounds i32, ptr %arrayidx25, i64 %idxprom28
%19 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%inc30 = add nsw i32 %19, 1
store i32 %inc30, ptr %arrayidx29, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%20 = load i32, ptr %M, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp15 = icmp slt i64 %indvars.iv.next, %21
br i1 %cmp15, label %for.body16, label %for.cond34.preheader.loopexit, !llvm.loop !9
for.cond37.preheader: ; preds = %for.cond37.preheader.preheader, %for.cond37.for.inc52_crit_edge
%indvars.iv155 = phi i64 [ 1, %for.cond37.preheader.preheader ], [ %indvars.iv.next156, %for.cond37.for.inc52_crit_edge ]
%22 = mul nuw nsw i64 %indvars.iv155, %8
%arrayidx41 = getelementptr inbounds i32, ptr %vla5, i64 %22
%.pre170 = load i32, ptr %arrayidx41, align 4, !tbaa !5
br i1 %15, label %for.cond37.for.inc52_crit_edge.unr-lcssa, label %for.cond37.preheader.new
for.cond37.preheader.new: ; preds = %for.cond37.preheader
%invariant.gep = getelementptr i32, ptr %arrayidx41, i64 1
%invariant.gep178 = getelementptr i32, ptr %arrayidx41, i64 2
%invariant.gep180 = getelementptr i32, ptr %arrayidx41, i64 3
br label %for.body39
for.cond55.preheader: ; preds = %for.cond37.for.inc52_crit_edge, %for.cond34.preheader
%23 = load i32, ptr %Q, align 4, !tbaa !5
%cmp56141 = icmp sgt i32 %23, 0
br i1 %cmp56141, label %for.body57, label %for.end97
for.body39: ; preds = %for.body39, %for.cond37.preheader.new
%24 = phi i32 [ %.pre170, %for.cond37.preheader.new ], [ %add48.3, %for.body39 ]
%indvars.iv151 = phi i64 [ 1, %for.cond37.preheader.new ], [ %indvars.iv.next152.3, %for.body39 ]
%niter = phi i64 [ 0, %for.cond37.preheader.new ], [ %niter.next.3, %for.body39 ]
%arrayidx47 = getelementptr inbounds i32, ptr %arrayidx41, i64 %indvars.iv151
%25 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%add48 = add nsw i32 %25, %24
store i32 %add48, ptr %arrayidx47, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv151
%26 = load i32, ptr %gep, align 4, !tbaa !5
%add48.1 = add nsw i32 %26, %add48
store i32 %add48.1, ptr %gep, align 4, !tbaa !5
%gep179 = getelementptr i32, ptr %invariant.gep178, i64 %indvars.iv151
%27 = load i32, ptr %gep179, align 4, !tbaa !5
%add48.2 = add nsw i32 %27, %add48.1
store i32 %add48.2, ptr %gep179, align 4, !tbaa !5
%gep181 = getelementptr i32, ptr %invariant.gep180, i64 %indvars.iv151
%28 = load i32, ptr %gep181, align 4, !tbaa !5
%add48.3 = add nsw i32 %28, %add48.2
store i32 %add48.3, ptr %gep181, align 4, !tbaa !5
%indvars.iv.next152.3 = add nuw nsw i64 %indvars.iv151, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond37.for.inc52_crit_edge.unr-lcssa, label %for.body39, !llvm.loop !11
for.cond37.for.inc52_crit_edge.unr-lcssa: ; preds = %for.body39, %for.cond37.preheader
%.unr = phi i32 [ %.pre170, %for.cond37.preheader ], [ %add48.3, %for.body39 ]
%indvars.iv151.unr = phi i64 [ 1, %for.cond37.preheader ], [ %indvars.iv.next152.3, %for.body39 ]
br i1 %lcmp.mod.not, label %for.cond37.for.inc52_crit_edge, label %for.body39.epil
for.body39.epil: ; preds = %for.cond37.for.inc52_crit_edge.unr-lcssa, %for.body39.epil
%29 = phi i32 [ %add48.epil, %for.body39.epil ], [ %.unr, %for.cond37.for.inc52_crit_edge.unr-lcssa ]
%indvars.iv151.epil = phi i64 [ %indvars.iv.next152.epil, %for.body39.epil ], [ %indvars.iv151.unr, %for.cond37.for.inc52_crit_edge.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body39.epil ], [ 0, %for.cond37.for.inc52_crit_edge.unr-lcssa ]
%arrayidx47.epil = getelementptr inbounds i32, ptr %arrayidx41, i64 %indvars.iv151.epil
%30 = load i32, ptr %arrayidx47.epil, align 4, !tbaa !5
%add48.epil = add nsw i32 %30, %29
store i32 %add48.epil, ptr %arrayidx47.epil, align 4, !tbaa !5
%indvars.iv.next152.epil = add nuw nsw i64 %indvars.iv151.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond37.for.inc52_crit_edge, label %for.body39.epil, !llvm.loop !12
for.cond37.for.inc52_crit_edge: ; preds = %for.body39.epil, %for.cond37.for.inc52_crit_edge.unr-lcssa
%indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
%exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158
br i1 %exitcond159.not, label %for.cond55.preheader, label %for.cond37.preheader, !llvm.loop !14
for.cond66.preheader: ; preds = %for.body57
%31 = icmp sgt i32 %32, 0
br i1 %31, label %for.body68, label %for.end97
for.body57: ; preds = %for.cond55.preheader, %for.body57
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.body57 ], [ 0, %for.cond55.preheader ]
%arrayidx59 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv160
%arrayidx61 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv160
%call62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx59, ptr noundef nonnull %arrayidx61)
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%32 = load i32, ptr %Q, align 4, !tbaa !5
%33 = sext i32 %32 to i64
%cmp56 = icmp slt i64 %indvars.iv.next161, %33
br i1 %cmp56, label %for.body57, label %for.cond66.preheader, !llvm.loop !15
for.body68: ; preds = %for.cond66.preheader, %for.end93
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.end93 ], [ 0, %for.cond66.preheader ]
%arrayidx70 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv167
%34 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%arrayidx73 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv167
%35 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%cmp74.not143 = icmp sgt i32 %34, %35
br i1 %cmp74.not143, label %for.end93, label %for.body75.lr.ph
for.body75.lr.ph: ; preds = %for.body68
%idxprom80 = sext i32 %35 to i64
%sub86 = add nsw i32 %34, -1
%idxprom87 = sext i32 %sub86 to i64
%36 = sext i32 %34 to i64
%37 = add i32 %35, 1
%38 = sub i32 %37, %34
%39 = sub i32 %35, %34
%xtraiter172 = and i32 %38, 3
%40 = icmp ult i32 %39, 3
br i1 %40, label %for.end93.loopexit.unr-lcssa, label %for.body75.lr.ph.new
for.body75.lr.ph.new: ; preds = %for.body75.lr.ph
%unroll_iter176 = and i32 %38, -4
br label %for.body75
for.body75: ; preds = %for.body75, %for.body75.lr.ph.new
%indvars.iv163 = phi i64 [ %36, %for.body75.lr.ph.new ], [ %indvars.iv.next164.3, %for.body75 ]
%counter.1145 = phi i32 [ 0, %for.body75.lr.ph.new ], [ %add90.3, %for.body75 ]
%niter177 = phi i32 [ 0, %for.body75.lr.ph.new ], [ %niter177.next.3, %for.body75 ]
%41 = mul nsw i64 %indvars.iv163, %8
%arrayidx77 = getelementptr inbounds i32, ptr %vla5, i64 %41
%arrayidx81 = getelementptr inbounds i32, ptr %arrayidx77, i64 %idxprom80
%42 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%arrayidx88 = getelementptr inbounds i32, ptr %arrayidx77, i64 %idxprom87
%43 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%sub89 = add i32 %42, %counter.1145
%indvars.iv.next164 = add nsw i64 %indvars.iv163, 1
%44 = mul nsw i64 %indvars.iv.next164, %8
%arrayidx77.1 = getelementptr inbounds i32, ptr %vla5, i64 %44
%arrayidx81.1 = getelementptr inbounds i32, ptr %arrayidx77.1, i64 %idxprom80
%45 = load i32, ptr %arrayidx81.1, align 4, !tbaa !5
%arrayidx88.1 = getelementptr inbounds i32, ptr %arrayidx77.1, i64 %idxprom87
%46 = load i32, ptr %arrayidx88.1, align 4, !tbaa !5
%47 = add i32 %sub89, %45
%48 = add i32 %43, %46
%indvars.iv.next164.1 = add nsw i64 %indvars.iv163, 2
%49 = mul nsw i64 %indvars.iv.next164.1, %8
%arrayidx77.2 = getelementptr inbounds i32, ptr %vla5, i64 %49
%arrayidx81.2 = getelementptr inbounds i32, ptr %arrayidx77.2, i64 %idxprom80
%50 = load i32, ptr %arrayidx81.2, align 4, !tbaa !5
%arrayidx88.2 = getelementptr inbounds i32, ptr %arrayidx77.2, i64 %idxprom87
%51 = load i32, ptr %arrayidx88.2, align 4, !tbaa !5
%52 = add i32 %47, %50
%53 = add i32 %48, %51
%indvars.iv.next164.2 = add nsw i64 %indvars.iv163, 3
%54 = mul nsw i64 %indvars.iv.next164.2, %8
%arrayidx77.3 = getelementptr inbounds i32, ptr %vla5, i64 %54
%arrayidx81.3 = getelementptr inbounds i32, ptr %arrayidx77.3, i64 %idxprom80
%55 = load i32, ptr %arrayidx81.3, align 4, !tbaa !5
%arrayidx88.3 = getelementptr inbounds i32, ptr %arrayidx77.3, i64 %idxprom87
%56 = load i32, ptr %arrayidx88.3, align 4, !tbaa !5
%57 = add i32 %52, %55
%58 = add i32 %53, %56
%add90.3 = sub i32 %57, %58
%indvars.iv.next164.3 = add nsw i64 %indvars.iv163, 4
%niter177.next.3 = add i32 %niter177, 4
%niter177.ncmp.3 = icmp eq i32 %niter177.next.3, %unroll_iter176
br i1 %niter177.ncmp.3, label %for.end93.loopexit.unr-lcssa, label %for.body75, !llvm.loop !16
for.end93.loopexit.unr-lcssa: ; preds = %for.body75, %for.body75.lr.ph
%add90.lcssa.ph = phi i32 [ undef, %for.body75.lr.ph ], [ %add90.3, %for.body75 ]
%indvars.iv163.unr = phi i64 [ %36, %for.body75.lr.ph ], [ %indvars.iv.next164.3, %for.body75 ]
%counter.1145.unr = phi i32 [ 0, %for.body75.lr.ph ], [ %add90.3, %for.body75 ]
%lcmp.mod174.not = icmp eq i32 %xtraiter172, 0
br i1 %lcmp.mod174.not, label %for.end93, label %for.body75.epil
for.body75.epil: ; preds = %for.end93.loopexit.unr-lcssa, %for.body75.epil
%indvars.iv163.epil = phi i64 [ %indvars.iv.next164.epil, %for.body75.epil ], [ %indvars.iv163.unr, %for.end93.loopexit.unr-lcssa ]
%counter.1145.epil = phi i32 [ %add90.epil, %for.body75.epil ], [ %counter.1145.unr, %for.end93.loopexit.unr-lcssa ]
%epil.iter173 = phi i32 [ %epil.iter173.next, %for.body75.epil ], [ 0, %for.end93.loopexit.unr-lcssa ]
%59 = mul nsw i64 %indvars.iv163.epil, %8
%arrayidx77.epil = getelementptr inbounds i32, ptr %vla5, i64 %59
%arrayidx81.epil = getelementptr inbounds i32, ptr %arrayidx77.epil, i64 %idxprom80
%60 = load i32, ptr %arrayidx81.epil, align 4, !tbaa !5
%arrayidx88.epil = getelementptr inbounds i32, ptr %arrayidx77.epil, i64 %idxprom87
%61 = load i32, ptr %arrayidx88.epil, align 4, !tbaa !5
%sub89.epil = add i32 %60, %counter.1145.epil
%add90.epil = sub i32 %sub89.epil, %61
%indvars.iv.next164.epil = add nsw i64 %indvars.iv163.epil, 1
%epil.iter173.next = add i32 %epil.iter173, 1
%epil.iter173.cmp.not = icmp eq i32 %epil.iter173.next, %xtraiter172
br i1 %epil.iter173.cmp.not, label %for.end93, label %for.body75.epil, !llvm.loop !17
for.end93: ; preds = %for.end93.loopexit.unr-lcssa, %for.body75.epil, %for.body68
%counter.1.lcssa = phi i32 [ 0, %for.body68 ], [ %add90.lcssa.ph, %for.end93.loopexit.unr-lcssa ], [ %add90.epil, %for.body75.epil ]
%call94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %counter.1.lcssa)
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%62 = load i32, ptr %Q, align 4, !tbaa !5
%63 = sext i32 %62 to i64
%cmp67 = icmp slt i64 %indvars.iv.next168, %63
br i1 %cmp67, label %for.body68, label %for.end97, !llvm.loop !18
for.end97: ; preds = %for.end93, %for.cond55.preheader, %for.cond66.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
int main()
{
int a;
int n;
int m;
int x;
int y;
int cnt = 0;
int sum;
int tmp;
int i;
scanf("%d%d%d", &a, &n, &m);
for(y = 1; y <= 72; y++)
{
x = 1;
for(i = 0; i < n; i++)
{
x = x * (y + a);
}
sum = 0;
tmp = x;
while(tmp > 0)
{
sum = sum + tmp % 10;
tmp = tmp / 10;
}
if((x <= m) && (sum == y))
{
cnt++;
}
}
printf("%d\n", cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%n = alloca i32, align 4
%m = 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 %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp223 = icmp sgt i32 %0, 0
%1 = load i32, ptr %m, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4
br i1 %cmp223, label %for.cond1.preheader.us.preheader, label %vector.body
for.cond1.preheader.us.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %0, 8
%n.vec = and i32 %0, -8
%cmp.n = icmp eq i32 %0, %n.vec
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %while.end.us
%cnt.031.us = phi i32 [ %cnt.1.us, %while.end.us ], [ 0, %for.cond1.preheader.us.preheader ]
%y.030.us = phi i32 [ %inc10.us, %while.end.us ], [ 1, %for.cond1.preheader.us.preheader ]
%add.us = add nsw i32 %2, %y.030.us
br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.ph39
vector.ph39: ; preds = %for.cond1.preheader.us
%broadcast.splatinsert45 = insertelement <4 x i32> poison, i32 %add.us, i64 0
%broadcast.splat46 = shufflevector <4 x i32> %broadcast.splatinsert45, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body41
vector.body41: ; preds = %vector.body41, %vector.ph39
%index42 = phi i32 [ 0, %vector.ph39 ], [ %index.next47, %vector.body41 ]
%vec.phi43 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph39 ], [ %3, %vector.body41 ]
%vec.phi44 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph39 ], [ %4, %vector.body41 ]
%3 = mul <4 x i32> %broadcast.splat46, %vec.phi43
%4 = mul <4 x i32> %broadcast.splat46, %vec.phi44
%index.next47 = add nuw i32 %index42, 8
%5 = icmp eq i32 %index.next47, %n.vec
br i1 %5, label %middle.block37, label %vector.body41, !llvm.loop !9
middle.block37: ; preds = %vector.body41
%bin.rdx = mul <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond1.while.cond.preheader_crit_edge.us, label %for.body3.us.preheader
for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block37
%i.025.us.ph = phi i32 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block37 ]
%x.024.us.ph = phi i32 [ 1, %for.cond1.preheader.us ], [ %6, %middle.block37 ]
br label %for.body3.us
while.end.us: ; preds = %while.body.us, %for.cond1.while.cond.preheader_crit_edge.us
%sum.0.lcssa.us = phi i32 [ 0, %for.cond1.while.cond.preheader_crit_edge.us ], [ %add5.us, %while.body.us ]
%cmp6.not.us = icmp sle i32 %mul.us.lcssa, %1
%cmp7.us = icmp eq i32 %sum.0.lcssa.us, %y.030.us
%or.cond.us = select i1 %cmp6.not.us, i1 %cmp7.us, i1 false
%inc8.us = zext i1 %or.cond.us to i32
%cnt.1.us = add nuw nsw i32 %cnt.031.us, %inc8.us
%inc10.us = add nuw nsw i32 %y.030.us, 1
%exitcond34.not = icmp eq i32 %inc10.us, 73
br i1 %exitcond34.not, label %for.end11, label %for.cond1.preheader.us, !llvm.loop !13
while.body.us: ; preds = %for.cond1.while.cond.preheader_crit_edge.us, %while.body.us
%tmp.028.us = phi i32 [ %div.us, %while.body.us ], [ %mul.us.lcssa, %for.cond1.while.cond.preheader_crit_edge.us ]
%sum.027.us = phi i32 [ %add5.us, %while.body.us ], [ 0, %for.cond1.while.cond.preheader_crit_edge.us ]
%rem.us = urem i32 %tmp.028.us, 10
%add5.us = add nuw nsw i32 %rem.us, %sum.027.us
%div.us = udiv i32 %tmp.028.us, 10
%cmp4.us.not = icmp ult i32 %tmp.028.us, 10
br i1 %cmp4.us.not, label %while.end.us, label %while.body.us, !llvm.loop !14
for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us
%i.025.us = phi i32 [ %inc.us, %for.body3.us ], [ %i.025.us.ph, %for.body3.us.preheader ]
%x.024.us = phi i32 [ %mul.us, %for.body3.us ], [ %x.024.us.ph, %for.body3.us.preheader ]
%mul.us = mul nsw i32 %add.us, %x.024.us
%inc.us = add nuw nsw i32 %i.025.us, 1
%exitcond33.not = icmp eq i32 %inc.us, %0
br i1 %exitcond33.not, label %for.cond1.while.cond.preheader_crit_edge.us, label %for.body3.us, !llvm.loop !15
for.cond1.while.cond.preheader_crit_edge.us: ; preds = %for.body3.us, %middle.block37
%mul.us.lcssa = phi i32 [ %6, %middle.block37 ], [ %mul.us, %for.body3.us ]
%cmp426.us = icmp sgt i32 %mul.us.lcssa, 0
br i1 %cmp426.us, label %while.body.us, label %while.end.us
vector.body: ; preds = %entry
%cmp6.not = icmp sgt i32 %1, 0
%broadcast.splatinsert = insertelement <4 x i1> poison, i1 %cmp6.not, i64 0
%broadcast.splat = shufflevector <4 x i1> %broadcast.splatinsert, <4 x i1> poison, <4 x i32> zeroinitializer
%7 = and <4 x i1> %broadcast.splat, <i1 true, i1 false, i1 false, i1 false>
%8 = bitcast <4 x i1> %7 to i4
%9 = zext i4 %8 to i32
br label %for.end11
for.end11: ; preds = %while.end.us, %vector.body
%.us-phi = phi i32 [ %9, %vector.body ], [ %cnt.1.us, %while.end.us ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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.vector.reduce.mul.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}
!15 = distinct !{!15, !10, !12, !11}
|
#include<stdio.h>
#include<math.h>
int main(void){
double A,B;
scanf("%lf %lf",&A,&B);
double AMin=A/8*100,AMax=(A+1)/8*100;
double BMin=B*10,BMax=(B+1)*10;
if(AMin>BMax-1 || ceil(AMax-1)<BMin) printf("-1\n");
else if(BMin<=ceil(AMin-1)) printf("%d\n",(int)ceil(AMin));
else printf("%d\n",(int)BMin);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148741/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.2 = 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:
%A = alloca double, align 8
%B = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load double, ptr %A, align 8, !tbaa !5
%div = fmul double %0, 1.250000e-01
%mul = fmul double %div, 1.000000e+02
%1 = load double, ptr %B, align 8, !tbaa !5
%mul3 = fmul double %1, 1.000000e+01
%add4 = fadd double %1, 1.000000e+00
%mul5 = fmul double %add4, 1.000000e+01
%sub = fadd double %mul5, -1.000000e+00
%cmp = fcmp ogt double %mul, %sub
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%add = fadd double %0, 1.000000e+00
%div1 = fmul double %add, 1.250000e-01
%mul2 = fmul double %div1, 1.000000e+02
%sub6 = fadd double %mul2, -1.000000e+00
%2 = call double @llvm.ceil.f64(double %sub6)
%cmp7 = fcmp olt double %2, %mul3
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %lor.lhs.false, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end16
if.else: ; preds = %lor.lhs.false
%sub9 = fadd double %mul, -1.000000e+00
%3 = call double @llvm.ceil.f64(double %sub9)
%cmp10 = fcmp ugt double %mul3, %3
br i1 %cmp10, label %if.else13, label %if.then11
if.then11: ; preds = %if.else
%4 = call double @llvm.ceil.f64(double %mul)
%conv = fptosi double %4 to i32
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv)
br label %if.end16
if.else13: ; preds = %if.else
%conv14 = fptosi double %mul3 to i32
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv14)
br label %if.end16
if.end16: ; preds = %if.then11, %if.else13, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, non_taxed_price_a, max_non_taxed_price_a, min_non_taxed_price_a,
b, non_taxed_price_b, max_non_taxed_price_b, min_non_taxed_price_b,
i, ans;
// 標準入力からの値取得
scanf("%d %d", &a, &b);
// 計算
max_non_taxed_price_a = (int)((float)a / 8.0 * 100.0);
for (i = max_non_taxed_price_a; ; i++) {
if (((int)((float)i / 100.0 * 8.0)) > a) {
max_non_taxed_price_a = i - 1;
break;
}
}
min_non_taxed_price_a = (int)((float)a / 8.0 * 100.0);
for (i = min_non_taxed_price_a; ; i--) {
if (((int)((float)i / 100.0 * 8.0)) < a) {
min_non_taxed_price_a = i + 1;
break;
}
}
max_non_taxed_price_b = (int)((float)b / 10.0 * 100.0);
for (i = max_non_taxed_price_b; ; i++) {
if (((int)((float)i / 100.0 * 10.0)) > b) {
max_non_taxed_price_b = i - 1;
break;
}
}
min_non_taxed_price_b = (int)((float)b / 10.0 * 100.0);
for (i = min_non_taxed_price_b; ; i--) {
if (((int)((float)i / 100.0 * 10.0)) < b) {
min_non_taxed_price_b = i + 1;
break;
}
}
ans = -1;
if (min_non_taxed_price_b <= max_non_taxed_price_a &&
min_non_taxed_price_a <= min_non_taxed_price_b) {
ans = min_non_taxed_price_b;
} else if (min_non_taxed_price_a <= max_non_taxed_price_b &&
min_non_taxed_price_b <= min_non_taxed_price_a) {
ans = min_non_taxed_price_a;
}
// 出力
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %0 to float
%conv1 = fpext float %conv to double
%div = fmul double %conv1, 1.250000e-01
%mul = fmul double %div, 1.000000e+02
%conv2 = fptosi double %mul to i32
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%i.0 = phi i32 [ %conv2, %entry ], [ %inc, %for.cond ]
%conv3 = sitofp i32 %i.0 to float
%conv4 = fpext float %conv3 to double
%div5 = fdiv double %conv4, 1.000000e+02
%mul6 = fmul double %div5, 8.000000e+00
%conv7 = fptosi double %mul6 to i32
%cmp = icmp slt i32 %0, %conv7
%inc = add nsw i32 %i.0, 1
br i1 %cmp, label %for.cond14, label %for.cond
for.cond14: ; preds = %for.cond, %for.cond14
%i.1 = phi i32 [ %dec, %for.cond14 ], [ %conv2, %for.cond ]
%conv15 = sitofp i32 %i.1 to float
%conv16 = fpext float %conv15 to double
%div17 = fdiv double %conv16, 1.000000e+02
%mul18 = fmul double %div17, 8.000000e+00
%conv19 = fptosi double %mul18 to i32
%cmp20 = icmp sgt i32 %0, %conv19
%dec = add nsw i32 %i.1, -1
br i1 %cmp20, label %if.then22, label %for.cond14
if.then22: ; preds = %for.cond14
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv26 = sitofp i32 %1 to float
%conv27 = fpext float %conv26 to double
%div28 = fdiv double %conv27, 1.000000e+01
%mul29 = fmul double %div28, 1.000000e+02
%conv30 = fptosi double %mul29 to i32
br label %for.cond31
for.cond31: ; preds = %for.cond31, %if.then22
%i.2 = phi i32 [ %conv30, %if.then22 ], [ %inc43, %for.cond31 ]
%conv32 = sitofp i32 %i.2 to float
%conv33 = fpext float %conv32 to double
%div34 = fdiv double %conv33, 1.000000e+02
%mul35 = fmul double %div34, 1.000000e+01
%conv36 = fptosi double %mul35 to i32
%cmp37 = icmp slt i32 %1, %conv36
%inc43 = add nsw i32 %i.2, 1
br i1 %cmp37, label %for.cond50, label %for.cond31
for.cond50: ; preds = %for.cond31, %for.cond50
%i.3 = phi i32 [ %dec62, %for.cond50 ], [ %conv30, %for.cond31 ]
%conv51 = sitofp i32 %i.3 to float
%conv52 = fpext float %conv51 to double
%div53 = fdiv double %conv52, 1.000000e+02
%mul54 = fmul double %div53, 1.000000e+01
%conv55 = fptosi double %mul54 to i32
%cmp56 = icmp sgt i32 %1, %conv55
%dec62 = add nsw i32 %i.3, -1
br i1 %cmp56, label %if.then58, label %for.cond50
if.then58: ; preds = %for.cond50
%sub40 = add nsw i32 %i.2, -1
%add = add nsw i32 %i.1, 1
%sub = add nsw i32 %i.0, -1
%add59 = add nsw i32 %i.3, 1
%cmp64.not.not = icmp sge i32 %i.3, %sub
%cmp66.not = icmp sgt i32 %i.1, %i.3
%or.cond = or i1 %cmp64.not.not, %cmp66.not
%cmp69.not.not = icmp sge i32 %i.1, %sub40
%cmp72.not = icmp sgt i32 %i.3, %i.1
%or.cond100 = or i1 %cmp69.not.not, %cmp72.not
%spec.select = select i1 %or.cond100, i32 -1, i32 %add
%ans.0 = select i1 %or.cond, i32 %spec.select, i32 %add59
%call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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, price;
scanf("%d%d", &A, &B);
price = 0;
while((int)(price*0.08) <= A && (int)(price*0.1) <= B){
if((int)(price*0.08) == A && (int)(price*0.1) == B){
printf("%d\n", price);
return 0;
}
price ++;
}
printf("-1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148842/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148842/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@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:
%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
%cmp.not29 = icmp slt i32 %0, 0
br i1 %cmp.not29, label %while.end, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %entry
%1 = load i32, ptr %B, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %land.rhs.lr.ph, %if.end
%conv132 = phi i32 [ 0, %land.rhs.lr.ph ], [ %conv1, %if.end ]
%conv31 = phi double [ 0.000000e+00, %land.rhs.lr.ph ], [ %conv, %if.end ]
%price.030 = phi i32 [ 0, %land.rhs.lr.ph ], [ %inc, %if.end ]
%mul4 = fmul double %conv31, 1.000000e-01
%conv5 = fptosi double %mul4 to i32
%cmp6.not = icmp slt i32 %1, %conv5
br i1 %cmp6.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp11 = icmp eq i32 %0, %conv132
%cmp16 = icmp eq i32 %1, %conv5
%or.cond = and i1 %cmp11, %cmp16
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %price.030)
br label %cleanup
if.end: ; preds = %while.body
%inc = add nuw nsw i32 %price.030, 1
%conv = sitofp i32 %inc to double
%mul = fmul double %conv, 8.000000e-02
%conv1 = fptosi double %mul to i32
%cmp.not = icmp slt i32 %0, %conv1
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !9
while.end: ; preds = %land.rhs, %if.end, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef 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"}
|
#include<stdio.h>
int main()
{
// 入力 A B
int a, b, ret;
scanf("%d %d", &a, &b);
for (ret = 0; ret <= 10000; ret++) {
if ((ret * 8) / 100 == a // 8%
&& (ret * 10) / 100 == b) {
printf("%d\n", ret);
return 0;
}
}
printf("-1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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:
%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
br label %for.body
for.body: ; preds = %entry, %for.inc
%ret.015 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%mul = shl nuw nsw i32 %ret.015, 3
%div = udiv i32 %mul, 100
%cmp1 = icmp eq i32 %div, %0
br i1 %cmp1, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%div3.lhs.trunc = trunc i32 %ret.015 to i16
%div313 = udiv i16 %div3.lhs.trunc, 10
%div3.zext = zext i16 %div313 to i32
%cmp4 = icmp eq i32 %1, %div3.zext
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ret.015)
br label %cleanup
for.inc: ; preds = %for.body, %land.lhs.true
%inc = add nuw nsw i32 %ret.015, 1
%exitcond.not = icmp eq i32 %inc, 10001
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef 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"}
|
#include<stdio.h>
#include<string.h>
int main(){
int n,i;
scanf("%d",&n);
const char c[2][2]={"#","."};
char s[2][110]={0};
char t[110],w[10];
for(i=0;i<4;i++){
printf("%s%s\n%s%s\n",s[0],c[i/2],s[1],c[i%2]);
fflush(stdout);
scanf("%s",w);
if(w[0]=='e')return 0;
if(w[0]=='T'){
strcat(s[0],c[i/2]);
strcat(s[1],c[i%2]);
i=-1;
}
}
for(i=0;i<4;i++){
printf("%s%s\n%s%s\n",c[i/2],s[0],c[i%2],s[1]);
fflush(stdout);
scanf("%s",w);
if(w[0]=='e')return 0;
if(w[0]=='T'){
strcpy(t,c[i/2]);
strcat(t,s[0]);
strcpy(s[0],t);
strcpy(t,c[i%2]);
strcat(t,s[1]);
strcpy(s[1],t);
i=-1;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148929/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%s%s\0A%s%s\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = 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:
%n = alloca i32, align 4
%c = alloca [2 x [2 x i8]], align 4
%s = alloca [2 x [110 x i8]], align 16
%t = alloca [110 x i8], align 16
%w = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
store i32 3014691, ptr %c, align 4
call void @llvm.lifetime.start.p0(i64 220, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(220) %s, i8 0, i64 220, i1 false)
call void @llvm.lifetime.start.p0(i64 110, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %w) #5
%arrayidx3 = getelementptr inbounds [2 x [110 x i8]], ptr %s, i64 0, i64 1
br label %for.body
for.body: ; preds = %entry, %for.inc
%i.0115 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
%div = sdiv i32 %i.0115, 2
%idxprom = sext i32 %div to i64
%arrayidx1 = getelementptr inbounds [2 x [2 x i8]], ptr %c, i64 0, i64 %idxprom
%rem = srem i32 %i.0115, 2
%idxprom5 = sext i32 %rem to i64
%arrayidx6 = getelementptr inbounds [2 x [2 x i8]], ptr %c, i64 0, i64 %idxprom5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx6)
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%call9 = call i32 @fflush(ptr noundef %0)
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %w)
%1 = load i8, ptr %w, align 1, !tbaa !9
switch i8 %1, label %for.inc [
i8 101, label %cleanup
i8 84, label %if.then19
]
if.then19: ; preds = %for.body
%call26 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %arrayidx1) #5
%call33 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %arrayidx3, ptr noundef nonnull dereferenceable(1) %arrayidx6) #5
br label %for.inc
for.inc: ; preds = %for.body, %if.then19
%i.1 = phi i32 [ -1, %if.then19 ], [ %i.0115, %for.body ]
%inc = add nsw i32 %i.1, 1
%cmp = icmp slt i32 %i.1, 3
br i1 %cmp, label %for.body, label %for.body38, !llvm.loop !10
for.body38: ; preds = %for.inc, %for.inc95
%i.2116 = phi i32 [ %inc96, %for.inc95 ], [ 0, %for.inc ]
%div39 = sdiv i32 %i.2116, 2
%idxprom40 = sext i32 %div39 to i64
%arrayidx41 = getelementptr inbounds [2 x [2 x i8]], ptr %c, i64 0, i64 %idxprom40
%rem45 = srem i32 %i.2116, 2
%idxprom46 = sext i32 %rem45 to i64
%arrayidx47 = getelementptr inbounds [2 x [2 x i8]], ptr %c, i64 0, i64 %idxprom46
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %arrayidx41, ptr noundef nonnull %s, ptr noundef nonnull %arrayidx47, ptr noundef nonnull %arrayidx3)
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%call52 = call i32 @fflush(ptr noundef %2)
%call54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %w)
%3 = load i8, ptr %w, align 1, !tbaa !9
switch i8 %3, label %for.inc95 [
i8 101, label %cleanup
i8 84, label %if.then65
]
if.then65: ; preds = %for.body38
%call71 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %arrayidx41) #5
%call75 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %s) #5
%call79 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %t) #5
%call85 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %arrayidx47) #5
%call89 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %arrayidx3) #5
%call93 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx3, ptr noundef nonnull dereferenceable(1) %t) #5
br label %for.inc95
for.inc95: ; preds = %for.body38, %if.then65
%i.3 = phi i32 [ -1, %if.then65 ], [ %i.2116, %for.body38 ]
%inc96 = add nsw i32 %i.3, 1
%cmp36 = icmp slt i32 %i.3, 3
br i1 %cmp36, label %for.body38, label %cleanup, !llvm.loop !12
cleanup: ; preds = %for.body, %for.inc95, %for.body38
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 110, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 220, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias 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 #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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}
|
// cd Desktop/Prog_Contest
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define rep(i,n) for(i=0;i<(n);i++)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
int main(){
int i,n,a[100002]={},ans[100002]={},tmp=0;
scanf("%d",&n);
rep(i,n){
scanf("%d",&a[i]);
ans[a[i]-1]=i;
}
rep(i,n){
tmp=ans[i];
printf("%d ",tmp+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_148972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_148972/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [100002 x i32], align 16
%ans = alloca [100002 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400008, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400008) %a, i8 0, i64 400008, i1 false)
call void @llvm.lifetime.start.p0(i64 400008, ptr nonnull %ans) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400008) %ans, i8 0, i64 400008, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.end14
for.cond6.preheader: ; preds = %for.body
%1 = icmp sgt i32 %4, 0
br i1 %1, label %for.body8, label %for.end14
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %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)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom4 = sext i32 %sub to i64
%arrayidx5 = getelementptr inbounds [100002 x i32], ptr %ans, i64 0, i64 %idxprom4
%3 = trunc i64 %indvars.iv to i32
store i32 %3, ptr %arrayidx5, align 4, !tbaa !5
%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.cond6.preheader, !llvm.loop !9
for.body8: ; preds = %for.cond6.preheader, %for.body8
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body8 ], [ 0, %for.cond6.preheader ]
%arrayidx10 = getelementptr inbounds [100002 x i32], ptr %ans, i64 0, i64 %indvars.iv27
%6 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%add = add nsw i32 %6, 1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp7 = icmp slt i64 %indvars.iv.next28, %8
br i1 %cmp7, label %for.body8, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.body8, %entry, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 400008, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 400008, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
long long N,a[150000],b[150000],i,x;
scanf("%lld",&N);
for(i=1; i<=N; i++)
{
scanf("%lld",&a[i]);
x=a[i];
b[x-1]=i;
}
for(i=0; i<N; i++)
{
printf("%lld ",b[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149014/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%a = alloca [150000 x i64], align 16
%b = alloca [150000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not19 = icmp slt i64 %0, 1
br i1 %cmp.not19, label %for.end11, label %for.body
for.cond4.preheader: ; preds = %for.body
%1 = icmp sgt i64 %3, 0
br i1 %1, label %for.body6, label %for.end11
for.body: ; preds = %entry, %for.body
%i.020 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [150000 x i64], ptr %a, i64 0, i64 %i.020
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i64 %2, -1
%arrayidx3 = getelementptr inbounds [150000 x i64], ptr %b, i64 0, i64 %sub
store i64 %i.020, ptr %arrayidx3, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.020, 1
%3 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.020, %3
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.cond4.preheader, %for.body6
%i.122 = phi i64 [ %inc10, %for.body6 ], [ 0, %for.cond4.preheader ]
%arrayidx7 = getelementptr inbounds [150000 x i64], ptr %b, i64 0, i64 %i.122
%4 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4)
%inc10 = add nuw nsw i64 %i.122, 1
%5 = load i64, ptr %N, align 8, !tbaa !5
%cmp5 = icmp slt i64 %inc10, %5
br i1 %cmp5, label %for.body6, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.body6, %entry, %for.cond4.preheader
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
int x[10000000];
int y[10000000];
int z[10000000];
int main()
{
int a=0,b,c,d=0,e,f,g=0,i,j;
scanf("%d",&f);
for(i=0;i<f;i++)
{
scanf("%d",&x[i]);
y[i]=x[i];
}
for(i=0;i<f;i++)
{
a=x[i];
b=y[a-1];
z[b]=x[i];
}
for(i=1;i<=f;i++)
{
printf("%d\n",z[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@x = dso_local global [10000000 x i32] zeroinitializer, align 16
@y = dso_local local_unnamed_addr global [10000000 x i32] zeroinitializer, align 16
@z = dso_local local_unnamed_addr global [10000000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%f = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f)
%0 = load i32, ptr %f, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.body, label %for.end28
for.cond6.preheader: ; preds = %for.body
%cmp742 = icmp sgt i32 %3, 0
br i1 %cmp742, label %for.body8.preheader, label %for.end28
for.body8.preheader: ; preds = %for.cond6.preheader
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %3, 1
br i1 %1, label %for.cond20.preheader.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000000 x i32], ptr @x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds [10000000 x i32], ptr @y, i64 0, i64 %indvars.iv
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %f, 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.cond20.preheader.unr-lcssa: ; preds = %for.body8, %for.body8.preheader
%indvars.iv48.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next49.1, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond20.preheader, label %for.body8.epil
for.body8.epil: ; preds = %for.cond20.preheader.unr-lcssa
%arrayidx10.epil = getelementptr inbounds [10000000 x i32], ptr @x, i64 0, i64 %indvars.iv48.unr
%5 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%sub.epil = add nsw i32 %5, -1
%idxprom11.epil = sext i32 %sub.epil to i64
%arrayidx12.epil = getelementptr inbounds [10000000 x i32], ptr @y, i64 0, i64 %idxprom11.epil
%6 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5
%idxprom15.epil = sext i32 %6 to i64
%arrayidx16.epil = getelementptr inbounds [10000000 x i32], ptr @z, i64 0, i64 %idxprom15.epil
store i32 %5, ptr %arrayidx16.epil, align 4, !tbaa !5
br label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.cond20.preheader.unr-lcssa, %for.body8.epil
%cmp21.not44 = icmp slt i32 %3, 1
br i1 %cmp21.not44, label %for.end28, label %for.body22
for.body8: ; preds = %for.body8, %for.body8.preheader.new
%indvars.iv48 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next49.1, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ]
%arrayidx10 = getelementptr inbounds [10000000 x i32], ptr @x, i64 0, i64 %indvars.iv48
%7 = load i32, ptr %arrayidx10, align 8, !tbaa !5
%sub = add nsw i32 %7, -1
%idxprom11 = sext i32 %sub to i64
%arrayidx12 = getelementptr inbounds [10000000 x i32], ptr @y, i64 0, i64 %idxprom11
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%idxprom15 = sext i32 %8 to i64
%arrayidx16 = getelementptr inbounds [10000000 x i32], ptr @z, i64 0, i64 %idxprom15
store i32 %7, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next49 = or i64 %indvars.iv48, 1
%arrayidx10.1 = getelementptr inbounds [10000000 x i32], ptr @x, i64 0, i64 %indvars.iv.next49
%9 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%sub.1 = add nsw i32 %9, -1
%idxprom11.1 = sext i32 %sub.1 to i64
%arrayidx12.1 = getelementptr inbounds [10000000 x i32], ptr @y, i64 0, i64 %idxprom11.1
%10 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%idxprom15.1 = sext i32 %10 to i64
%arrayidx16.1 = getelementptr inbounds [10000000 x i32], ptr @z, i64 0, i64 %idxprom15.1
store i32 %9, ptr %arrayidx16.1, align 4, !tbaa !5
%indvars.iv.next49.1 = add nuw nsw i64 %indvars.iv48, 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.cond20.preheader.unr-lcssa, label %for.body8, !llvm.loop !11
for.body22: ; preds = %for.cond20.preheader, %for.body22
%indvars.iv51 = phi i64 [ %indvars.iv.next52, %for.body22 ], [ 1, %for.cond20.preheader ]
%arrayidx24 = getelementptr inbounds [10000000 x i32], ptr @z, i64 0, i64 %indvars.iv51
%11 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%12 = load i32, ptr %f, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp21.not.not = icmp slt i64 %indvars.iv51, %13
br i1 %cmp21.not.not, label %for.body22, label %for.end28, !llvm.loop !12
for.end28: ; preds = %for.body22, %entry, %for.cond6.preheader, %for.cond20.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int a,b,c,d,i,j,f[250000];
scanf("%d",&a);
for(i=1;i<=a;i++)
{
scanf("%d",&b);
f[b]=i;
}
for(i=1;i<=a;i++)
{
printf("%d",f[i]);
if(i!=a)printf(" ");
else printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149100/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149100/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%f = alloca [250000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %f) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %for.end13, label %for.body
for.cond2.preheader: ; preds = %for.body
%1 = icmp slt i32 %3, 1
br i1 %1, label %for.end13, label %for.body4
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%2 = load i32, ptr %b, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [250000 x i32], ptr %f, i64 0, i64 %idxprom
store i32 %i.022, ptr %arrayidx, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.022, 1
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.022, %3
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [250000 x i32], ptr %f, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
%5 = load i32, ptr %a, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%cmp8.not = icmp eq i64 %indvars.iv, %6
%. = select i1 %cmp8.not, i32 10, i32 32
%putchar20 = call i32 @putchar(i32 %.)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv, %8
br i1 %cmp3.not.not, label %for.body4, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.body4, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %f) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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,l,i;scanf("%d",&N);int A[N],E[N+1];for(i=0;i<=N-1;i++){scanf("%d",&A[i]);E[A[i]]=i+1;}for(l=1;l<=N;l++)printf("%d ",E[l]);return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149144/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149144/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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
%add = add nsw i32 %3, 1
%4 = zext i32 %add to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp.not.not23 = icmp sgt i32 %3, 0
br i1 %cmp.not.not23, label %for.body, label %for.end16
for.cond8.preheader: ; preds = %for.body
%5 = icmp slt i32 %8, 1
br i1 %5, label %for.end16, label %for.body10
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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom6 = sext i32 %6 to i64
%arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom6
%7 = trunc i64 %indvars.iv.next to i32
store i32 %7, ptr %arrayidx7, align 4, !tbaa !5
%8 = load i32, ptr %N, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp.not.not = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp.not.not, label %for.body, label %for.cond8.preheader, !llvm.loop !9
for.body10: ; preds = %for.cond8.preheader, %for.body10
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body10 ], [ 1, %for.cond8.preheader ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv28
%10 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp9.not.not = icmp slt i64 %indvars.iv28, %12
br i1 %cmp9.not.not, label %for.body10, label %for.end16, !llvm.loop !11
for.end16: ; preds = %for.body10, %entry, %for.cond8.preheader
call void @llvm.stackrestore.p0(ptr %2)
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
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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>
void swap(int *p, int *q){
int tmp;
tmp = *p;
*p = *q;
*q = tmp;
}
/*
A[0], A[1], ..., A[n-1] をソートして昇順に書き換える関数
*/
void quick_sort(int A[], int B[], int n){
int i, j,pivot, ax;
// 真ん中の要素をピボットとする
if(n <= 1) return ;
pivot = A[n/2];
A[n/2] = A[0];
A[0] = pivot;
ax = B[n/2];
B[n/2] = B[0];
B[0] = ax;
for(i = j = 1; i < n; i++){
if(A[i] <= pivot){
swap(A+i, A+j);
swap(B+i, B+j);
j++;
}
}
A[0] = A[j-1];
B[0] = B[j-1];
A[j-1] = pivot;
B[j-1] = ax;
quick_sort(A, B, j-1);
quick_sort(A+j, B+j, n-j);
}
int main(){
int n, k, i, c;
scanf("%d", &n);
int A[n];
int B[n];
for (i=0; i<n; i++) scanf("%d", &A[i]);
for (i=0; i<n; i++) {
B[i] = i+1;
}
quick_sort(A, B, n);
for (i=0; i<n; i++){
printf("%d ", B[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149188/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149188/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %p, ptr nocapture noundef %q) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = load i32, ptr %q, align 4, !tbaa !5
store i32 %1, ptr %p, align 4, !tbaa !5
store i32 %0, ptr %q, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quick_sort(ptr nocapture noundef %A, ptr nocapture noundef %B, i32 noundef %n) local_unnamed_addr #2 {
entry:
%cmp96 = icmp slt i32 %n, 2
br i1 %cmp96, label %cleanup, label %if.end
if.end: ; preds = %entry, %for.end
%n.tr99 = phi i32 [ %sub45, %for.end ], [ %n, %entry ]
%B.tr98 = phi ptr [ %add.ptr44, %for.end ], [ %B, %entry ]
%A.tr97 = phi ptr [ %add.ptr42, %for.end ], [ %A, %entry ]
%div93 = lshr i32 %n.tr99, 1
%idxprom = zext i32 %div93 to i64
%arrayidx = getelementptr inbounds i32, ptr %A.tr97, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr %A.tr97, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr %A.tr97, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds i32, ptr %B.tr98, i64 %idxprom
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%3 = load i32, ptr %B.tr98, align 4, !tbaa !5
store i32 %3, ptr %arrayidx8, align 4, !tbaa !5
store i32 %2, ptr %B.tr98, align 4, !tbaa !5
%wide.trip.count = zext i32 %n.tr99 to i64
br label %for.body
for.body: ; preds = %if.end, %for.inc
%indvars.iv = phi i64 [ 1, %if.end ], [ %indvars.iv.next, %for.inc ]
%j.094 = phi i32 [ 1, %if.end ], [ %j.1, %for.inc ]
%arrayidx16 = getelementptr inbounds i32, ptr %A.tr97, i64 %indvars.iv
%4 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17.not = icmp sgt i32 %4, %0
br i1 %cmp17.not, label %for.inc, label %if.then18
if.then18: ; preds = %for.body
%idx.ext19 = sext i32 %j.094 to i64
%add.ptr20 = getelementptr inbounds i32, ptr %A.tr97, i64 %idx.ext19
%5 = load i32, ptr %add.ptr20, align 4, !tbaa !5
store i32 %5, ptr %arrayidx16, align 4, !tbaa !5
store i32 %4, ptr %add.ptr20, align 4, !tbaa !5
%add.ptr22 = getelementptr inbounds i32, ptr %B.tr98, i64 %indvars.iv
%add.ptr24 = getelementptr inbounds i32, ptr %B.tr98, i64 %idx.ext19
%6 = load i32, ptr %add.ptr22, align 4, !tbaa !5
%7 = load i32, ptr %add.ptr24, align 4, !tbaa !5
store i32 %7, ptr %add.ptr22, align 4, !tbaa !5
store i32 %6, ptr %add.ptr24, align 4, !tbaa !5
%inc = add nsw i32 %j.094, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then18
%j.1 = phi i32 [ %inc, %if.then18 ], [ %j.094, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc
%sub = add nsw i32 %j.1, -1
%idxprom27 = sext i32 %sub to i64
%arrayidx28 = getelementptr inbounds i32, ptr %A.tr97, i64 %idxprom27
%8 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %8, ptr %A.tr97, align 4, !tbaa !5
%arrayidx32 = getelementptr inbounds i32, ptr %B.tr98, i64 %idxprom27
%9 = load i32, ptr %arrayidx32, align 4, !tbaa !5
store i32 %9, ptr %B.tr98, align 4, !tbaa !5
store i32 %0, ptr %arrayidx28, align 4, !tbaa !5
store i32 %2, ptr %arrayidx32, align 4, !tbaa !5
tail call void @quick_sort(ptr noundef nonnull %A.tr97, ptr noundef nonnull %B.tr98, i32 noundef %sub)
%idx.ext41 = sext i32 %j.1 to i64
%add.ptr42 = getelementptr inbounds i32, ptr %A.tr97, i64 %idx.ext41
%add.ptr44 = getelementptr inbounds i32, ptr %B.tr98, i64 %idx.ext41
%sub45 = sub nsw i32 %n.tr99, %j.1
%cmp = icmp slt i32 %sub45, 2
br i1 %cmp, label %cleanup, label %if.end
cleanup: ; preds = %for.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp29 = icmp sgt i32 %3, 0
br i1 %cmp29, label %for.body, label %for.end10.thread
for.cond3.preheader: ; preds = %for.body
%cmp431 = icmp sgt i32 %12, 0
br i1 %cmp431, label %for.body5.preheader, label %for.end10.thread
for.body5.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %12 to i64
%min.iters.check = icmp ult i32 %12, 8
br i1 %min.iters.check, label %for.body5.preheader47, label %vector.ph
vector.ph: ; preds = %for.body5.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%5 = getelementptr inbounds i32, ptr %vla1, i64 %index
%6 = trunc <4 x i64> %vec.ind to <4 x i32>
%7 = add <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1>
%8 = trunc <4 x i64> %vec.ind to <4 x i32>
%9 = add <4 x i32> %8, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %7, ptr %5, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %5, i64 4
store <4 x i32> %9, ptr %10, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end10, label %for.body5.preheader47
for.body5.preheader47: ; preds = %for.body5.preheader, %middle.block
%indvars.iv37.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ]
br label %for.body5
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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !14
for.body5: ; preds = %for.body5.preheader47, %for.body5
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body5 ], [ %indvars.iv37.ph, %for.body5.preheader47 ]
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv37
%14 = trunc i64 %indvars.iv.next38 to i32
store i32 %14, ptr %arrayidx7, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !15
for.end10.thread: ; preds = %for.cond3.preheader, %entry
%.ph = phi i32 [ %12, %for.cond3.preheader ], [ %3, %entry ]
call void @quick_sort(ptr noundef nonnull %vla, ptr noundef nonnull %vla1, i32 noundef %.ph)
br label %for.end19
for.end10: ; preds = %for.body5, %middle.block
call void @quick_sort(ptr noundef nonnull %vla, ptr noundef nonnull %vla1, i32 noundef %12)
br i1 %cmp431, label %for.body13, label %for.end19
for.body13: ; preds = %for.end10, %for.body13
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body13 ], [ 0, %for.end10 ]
%arrayidx15 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv40
%15 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp12 = icmp slt i64 %indvars.iv.next41, %17
br i1 %cmp12, label %for.body13, label %for.end19, !llvm.loop !16
for.end19: ; preds = %for.body13, %for.end10.thread, %for.end10
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <string.h>
int main(){
int students[100005], n, temp, nfirst = 0;
memset(students, -1, sizeof students);
scanf("%d", &n);
for (int i = 0; i < n; ++i){
scanf("%d", &temp);
students[temp-1] = i+1;
}
for (int i = 0; i < n; ++i){
if (nfirst){
printf(" ");
}else nfirst = 1;
printf("%d", students[i]);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149230/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149230/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%students = alloca [100005 x i32], align 16
%n = alloca i32, align 4
%temp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %students) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) %students, i8 -1, i64 400020, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%1 = icmp sgt i32 %5, 0
br i1 %1, label %if.end.peel, label %for.cond.cleanup5
if.end.peel: ; preds = %for.cond3.preheader
%2 = load i32, ptr %students, align 16, !tbaa !5
%call10.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %3, 1
br i1 %cmp4.peel, label %if.end, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%i.021 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%add = add nuw nsw i32 %i.021, 1
%4 = load i32, ptr %temp, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr %students, i64 0, i64 %idxprom
store i32 %add, ptr %arrayidx, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %add, %5
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %if.end, %entry, %if.end.peel, %for.cond3.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %students) #5
ret i32 0
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar19 = call i32 @putchar(i32 32)
%arrayidx9 = getelementptr inbounds [100005 x i32], ptr %students, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp4, label %if.end, label %for.cond.cleanup5, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int compare(int C1[2], int C2[2])
{
if (C1[0] < C2[0]) return 1;
else if (C1[0] == C2[0]) {
if (C1[1] < C2[1]) return 1;
}
return 0;
}
void insertionSort(int A[][2], int n, int g)
{
int i;
int C[2];
for (i = g; i < n; i++) {
int x, y, j;
C[0] = A[i][0];
C[1] = A[i][1];
j = i - g;
while (j >= 0 && compare(C, A[j])) {
A[j + g][0] = A[j][0];
A[j + g][1] = A[j][1];
j -= g;
}
A[j + g][0] = C[0];
A[j + g][1] = C[1];
}
}
void shellSort(int A[][2], int n)
{
int i, m = 0;
int G[10] = {262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1};
for (i = 0; i < 10; i++) {
if (G[i] <= n) {
m++;
insertionSort(A, n, G[i]);
}
}
}
int main(void)
{
int n;
scanf("%d", &n);
int A[100000][2];
int i;
for (i = 0; i < n; i++) scanf("%d %d", &A[i][0], &A[i][1]);
shellSort(A, n);
for (i = 0; i < n; i++) printf("%d %d\n", A[i][0], A[i][1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149274/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149274/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.shellSort.G = private unnamed_addr constant [10 x i32] [i32 262913, i32 65921, i32 16577, i32 4193, i32 1073, i32 281, i32 77, i32 23, i32 8, i32 1], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %C1, ptr nocapture noundef readonly %C2) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %C1, align 4, !tbaa !5
%1 = load i32, ptr %C2, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%cmp4 = icmp eq i32 %0, %1
br i1 %cmp4, label %if.then5, label %if.end11
if.then5: ; preds = %if.else
%arrayidx6 = getelementptr inbounds i32, ptr %C1, i64 1
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds i32, ptr %C2, i64 1
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp slt i32 %2, %3
br i1 %cmp8, label %return, label %if.end11
if.end11: ; preds = %if.else, %if.then5
br label %return
return: ; preds = %if.then5, %entry, %if.end11
%retval.0 = phi i32 [ 0, %if.end11 ], [ 1, %entry ], [ 1, %if.then5 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #1 {
entry:
%cmp71 = icmp slt i32 %g, %n
br i1 %cmp71, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%3 = trunc i64 %indvars.iv to i32
%4 = trunc i64 %indvars.iv to i32
%5 = sub i32 %4, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.068 = phi i32 [ %j.0, %while.body ], [ %5, %land.rhs.preheader ]
%i.0.pn67 = phi i32 [ %j.068, %while.body ], [ %3, %land.rhs.preheader ]
%idxprom8 = zext i32 %j.068 to i64
%arrayidx9 = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp.i = icmp slt i32 %1, %6
br i1 %cmp.i, label %land.rhs.while.body_crit_edge, label %if.else.i
land.rhs.while.body_crit_edge: ; preds = %land.rhs
%arrayidx19.phi.trans.insert = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8, i64 1
%.pre = load i32, ptr %arrayidx19.phi.trans.insert, align 4, !tbaa !5
br label %while.body
if.else.i: ; preds = %land.rhs
%cmp4.i = icmp eq i32 %1, %6
br i1 %cmp4.i, label %if.then5.i, label %while.end
if.then5.i: ; preds = %if.else.i
%arrayidx7.i = getelementptr inbounds i32, ptr %arrayidx9, i64 1
%7 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%cmp8.i = icmp slt i32 %2, %7
br i1 %cmp8.i, label %while.body, label %while.end
while.body: ; preds = %land.rhs.while.body_crit_edge, %if.then5.i
%8 = phi i32 [ %.pre, %land.rhs.while.body_crit_edge ], [ %7, %if.then5.i ]
%idxprom14 = sext i32 %i.0.pn67 to i64
%arrayidx15 = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14
store i32 %6, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14, i64 1
store i32 %8, ptr %arrayidx23, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.068, %g
%cmp7 = icmp sgt i32 %j.0, -1
br i1 %cmp7, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %if.else.i, %if.then5.i
%i.0.pn.lcssa.ph = phi i32 [ %j.068, %while.body ], [ %i.0.pn67, %if.else.i ], [ %i.0.pn67, %if.then5.i ]
%idxprom27 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx28 = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27
store i32 %1, ptr %arrayidx28, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27, i64 1
store i32 %2, ptr %arrayidx34, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #1 {
entry:
%wide.trip.count.i = sext i32 %n to i64
br label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [10 x i32], ptr @__const.shellSort.G, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp71.i = icmp slt i32 %0, %n
br i1 %cmp71.i, label %for.body.preheader.i, label %for.inc
for.body.preheader.i: ; preds = %for.body
%1 = sext i32 %0 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx5.i = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv.i, i64 1
%3 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%4 = trunc i64 %indvars.iv.i to i32
%5 = sub i32 %4, %0
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.068.i = phi i32 [ %j.0.i, %while.body.i ], [ %5, %land.rhs.preheader.i ]
%i.0.pn67.i = phi i32 [ %j.068.i, %while.body.i ], [ %4, %land.rhs.preheader.i ]
%idxprom8.i = zext i32 %j.068.i to i64
%arrayidx9.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8.i
%6 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5
%cmp.i.i = icmp slt i32 %2, %6
br i1 %cmp.i.i, label %land.rhs.while.body_crit_edge.i, label %if.else.i.i
land.rhs.while.body_crit_edge.i: ; preds = %land.rhs.i
%arrayidx19.phi.trans.insert.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8.i, i64 1
%.pre.i = load i32, ptr %arrayidx19.phi.trans.insert.i, align 4, !tbaa !5
br label %while.body.i
if.else.i.i: ; preds = %land.rhs.i
%cmp4.i.i = icmp eq i32 %2, %6
br i1 %cmp4.i.i, label %if.then5.i.i, label %while.end.i
if.then5.i.i: ; preds = %if.else.i.i
%arrayidx7.i.i = getelementptr inbounds i32, ptr %arrayidx9.i, i64 1
%7 = load i32, ptr %arrayidx7.i.i, align 4, !tbaa !5
%cmp8.i.i = icmp slt i32 %3, %7
br i1 %cmp8.i.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %if.then5.i.i, %land.rhs.while.body_crit_edge.i
%8 = phi i32 [ %.pre.i, %land.rhs.while.body_crit_edge.i ], [ %7, %if.then5.i.i ]
%idxprom14.i = sext i32 %i.0.pn67.i to i64
%arrayidx15.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14.i
store i32 %6, ptr %arrayidx15.i, align 4, !tbaa !5
%arrayidx23.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14.i, i64 1
store i32 %8, ptr %arrayidx23.i, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.068.i, %0
%cmp7.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp7.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9
while.end.i: ; preds = %while.body.i, %if.then5.i.i, %if.else.i.i
%i.0.pn.lcssa.ph.i = phi i32 [ %j.068.i, %while.body.i ], [ %i.0.pn67.i, %if.else.i.i ], [ %i.0.pn67.i, %if.then5.i.i ]
%idxprom27.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx28.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27.i
store i32 %2, ptr %arrayidx28.i, align 4, !tbaa !5
%arrayidx34.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27.i, i64 1
store i32 %3, ptr %arrayidx34.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.inc, label %land.rhs.preheader.i, !llvm.loop !11
for.inc: ; preds = %while.end.i, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.inc
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%A = alloca [100000 x [2 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, 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 ]
%arrayidx = getelementptr inbounds [100000 x [2 x i32]], ptr %A, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [100000 x [2 x i32]], ptr %A, i64 0, i64 %indvars.iv, i64 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%wide.trip.count.i.i.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
%3 = phi i32 [ %0, %entry.for.end_crit_edge ], [ %1, %for.body ]
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.end
%indvars.iv.i = phi i64 [ 0, %for.end ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds [10 x i32], ptr @__const.shellSort.G, i64 0, i64 %indvars.iv.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp71.i.i = icmp slt i32 %4, %3
br i1 %cmp71.i.i, label %for.body.preheader.i.i, label %for.inc.i
for.body.preheader.i.i: ; preds = %for.body.i
%5 = sext i32 %4 to i64
br label %land.rhs.preheader.i.i
land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i
%indvars.iv.i.i = phi i64 [ %5, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ]
%arrayidx.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv.i.i
%6 = load i32, ptr %arrayidx.i.i, align 8, !tbaa !5
%arrayidx5.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv.i.i, i64 1
%7 = load i32, ptr %arrayidx5.i.i, align 4, !tbaa !5
%8 = trunc i64 %indvars.iv.i.i to i32
%9 = sub i32 %8, %4
br label %land.rhs.i.i
land.rhs.i.i: ; preds = %while.body.i.i, %land.rhs.preheader.i.i
%j.068.i.i = phi i32 [ %j.0.i.i, %while.body.i.i ], [ %9, %land.rhs.preheader.i.i ]
%i.0.pn67.i.i = phi i32 [ %j.068.i.i, %while.body.i.i ], [ %8, %land.rhs.preheader.i.i ]
%idxprom8.i.i = zext i32 %j.068.i.i to i64
%arrayidx9.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8.i.i
%10 = load i32, ptr %arrayidx9.i.i, align 8, !tbaa !5
%cmp.i.i.i = icmp slt i32 %6, %10
br i1 %cmp.i.i.i, label %land.rhs.while.body_crit_edge.i.i, label %if.else.i.i.i
land.rhs.while.body_crit_edge.i.i: ; preds = %land.rhs.i.i
%arrayidx19.phi.trans.insert.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom8.i.i, i64 1
%.pre.i.i = load i32, ptr %arrayidx19.phi.trans.insert.i.i, align 4, !tbaa !5
br label %while.body.i.i
if.else.i.i.i: ; preds = %land.rhs.i.i
%cmp4.i.i.i = icmp eq i32 %6, %10
br i1 %cmp4.i.i.i, label %if.then5.i.i.i, label %while.end.i.i
if.then5.i.i.i: ; preds = %if.else.i.i.i
%arrayidx7.i.i.i = getelementptr inbounds i32, ptr %arrayidx9.i.i, i64 1
%11 = load i32, ptr %arrayidx7.i.i.i, align 4, !tbaa !5
%cmp8.i.i.i = icmp slt i32 %7, %11
br i1 %cmp8.i.i.i, label %while.body.i.i, label %while.end.i.i
while.body.i.i: ; preds = %if.then5.i.i.i, %land.rhs.while.body_crit_edge.i.i
%12 = phi i32 [ %.pre.i.i, %land.rhs.while.body_crit_edge.i.i ], [ %11, %if.then5.i.i.i ]
%idxprom14.i.i = sext i32 %i.0.pn67.i.i to i64
%arrayidx15.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14.i.i
store i32 %10, ptr %arrayidx15.i.i, align 8, !tbaa !5
%arrayidx23.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom14.i.i, i64 1
store i32 %12, ptr %arrayidx23.i.i, align 4, !tbaa !5
%j.0.i.i = sub nsw i32 %j.068.i.i, %4
%cmp7.i.i = icmp sgt i32 %j.0.i.i, -1
br i1 %cmp7.i.i, label %land.rhs.i.i, label %while.end.i.i, !llvm.loop !9
while.end.i.i: ; preds = %while.body.i.i, %if.then5.i.i.i, %if.else.i.i.i
%i.0.pn.lcssa.ph.i.i = phi i32 [ %j.068.i.i, %while.body.i.i ], [ %i.0.pn67.i.i, %if.else.i.i.i ], [ %i.0.pn67.i.i, %if.then5.i.i.i ]
%idxprom27.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64
%arrayidx28.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27.i.i
store i32 %6, ptr %arrayidx28.i.i, align 8, !tbaa !5
%arrayidx34.i.i = getelementptr inbounds [2 x i32], ptr %A, i64 %idxprom27.i.i, i64 1
store i32 %7, ptr %arrayidx34.i.i, align 4, !tbaa !5
%indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i.pre-phi
br i1 %exitcond.not.i.i, label %for.inc.i, label %land.rhs.preheader.i.i, !llvm.loop !11
for.inc.i: ; preds = %while.end.i.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, 10
br i1 %exitcond.not.i, label %for.cond6.preheader, label %for.body.i, !llvm.loop !12
for.cond6.preheader: ; preds = %for.inc.i
%cmp728 = icmp sgt i32 %3, 0
br i1 %cmp728, label %for.body8, label %for.end18
for.body8: ; preds = %for.cond6.preheader, %for.body8
%indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.body8 ], [ 0, %for.cond6.preheader ]
%arrayidx10 = getelementptr inbounds [100000 x [2 x i32]], ptr %A, i64 0, i64 %indvars.iv32
%13 = load i32, ptr %arrayidx10, align 8, !tbaa !5
%arrayidx14 = getelementptr inbounds [100000 x [2 x i32]], ptr %A, i64 0, i64 %indvars.iv32, i64 1
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13, i32 noundef %14)
%indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp7 = icmp slt i64 %indvars.iv.next33, %16
br i1 %cmp7, label %for.body8, label %for.end18, !llvm.loop !14
for.end18: ; preds = %for.body8, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdlib.h>
int fun(char *,char *);
int fun(char *s1,char *s2)
{
if(s1[0]!=s2[2]||s1[1]!=s2[1]||s1[2]!=s2[0])
{return 0;}
return 1;
}
int main()
{
char a[4];
char b[4];
scanf("%s%s",a,b);
printf((fun(a,b)==1)?"YES\n":"NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149324/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149324/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"YES\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"NO\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @fun(ptr nocapture noundef readonly %s1, ptr nocapture noundef readonly %s2) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %s1, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds i8, ptr %s2, i64 2
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, %1
br i1 %cmp.not, label %lor.lhs.false, label %return
lor.lhs.false: ; preds = %entry
%arrayidx4 = getelementptr inbounds i8, ptr %s1, i64 1
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%arrayidx6 = getelementptr inbounds i8, ptr %s2, i64 1
%3 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp eq i8 %2, %3
br i1 %cmp8.not, label %lor.lhs.false10, label %return
lor.lhs.false10: ; preds = %lor.lhs.false
%arrayidx11 = getelementptr inbounds i8, ptr %s1, i64 2
%4 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%5 = load i8, ptr %s2, align 1, !tbaa !5
%cmp15.not = icmp eq i8 %4, %5
%spec.select = zext i1 %cmp15.not to i32
br label %return
return: ; preds = %lor.lhs.false10, %entry, %lor.lhs.false
%retval.0 = phi i32 [ 0, %lor.lhs.false ], [ 0, %entry ], [ %spec.select, %lor.lhs.false10 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca [4 x i8], align 1
%b = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i8, ptr %a, align 1, !tbaa !5
%arrayidx1.i = getelementptr inbounds i8, ptr %b, i64 2
%1 = load i8, ptr %arrayidx1.i, align 1, !tbaa !5
%cmp.not.i = icmp eq i8 %0, %1
br i1 %cmp.not.i, label %lor.lhs.false.i, label %fun.exit.thread
lor.lhs.false.i: ; preds = %entry
%arrayidx4.i = getelementptr inbounds i8, ptr %a, i64 1
%2 = load i8, ptr %arrayidx4.i, align 1, !tbaa !5
%arrayidx6.i = getelementptr inbounds i8, ptr %b, i64 1
%3 = load i8, ptr %arrayidx6.i, align 1, !tbaa !5
%cmp8.not.i = icmp eq i8 %2, %3
br i1 %cmp8.not.i, label %fun.exit, label %fun.exit.thread
fun.exit: ; preds = %lor.lhs.false.i
%arrayidx11.i = getelementptr inbounds i8, ptr %a, i64 2
%4 = load i8, ptr %arrayidx11.i, align 1, !tbaa !5
%5 = load i8, ptr %b, align 1, !tbaa !5
%cmp15.not.i = icmp ne i8 %4, %5
%cond.fr = freeze i1 %cmp15.not.i
br i1 %cond.fr, label %fun.exit.thread, label %6
fun.exit.thread: ; preds = %entry, %lor.lhs.false.i, %fun.exit
br label %6
6: ; preds = %fun.exit, %fun.exit.thread
%7 = phi ptr [ @.str.2, %fun.exit.thread ], [ @.str.1, %fun.exit ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %7)
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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[3],s2[3];
scanf("%s%s",s1,s2);
if(s1[0] == s2[2] && s1[1] == s2[1] && s1[2] == s2[0])
{printf("YES");}
else
{printf("NO");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149375/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149375/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [3 x i8], align 1
%s2 = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2)
%0 = load i8, ptr %s1, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds [3 x i8], ptr %s2, i64 0, i64 2
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%arrayidx5 = getelementptr inbounds [3 x i8], ptr %s1, i64 0, i64 1
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%arrayidx7 = getelementptr inbounds [3 x i8], ptr %s2, i64 0, i64 1
%3 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%cmp9 = icmp eq i8 %2, %3
br i1 %cmp9, label %land.lhs.true11, label %if.else
land.lhs.true11: ; preds = %land.lhs.true
%arrayidx12 = getelementptr inbounds [3 x i8], ptr %s1, i64 0, i64 2
%4 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%5 = load i8, ptr %s2, align 1, !tbaa !5
%cmp16 = icmp eq i8 %4, %5
br i1 %cmp16, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true11, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true11, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true11 ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 3, 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int digits(int n)
{
int count=0,dig;
while(n>0)
{
dig=n%10;
if(dig!=0)
{
count++;
}
n=n/10;
}
return count;
}
int pow(int n,int p)
{
int temp=n;
if(p==0)
{
return 1;
}
for(int i=1;i<p;i++)
{
n=n*temp;
}
return n;
}
int digCount(int n)
{
int c=0;
while(n>0)
{
n=n/10;
c++;
}
return c;
}
int main()
{
int t;
scanf("%d",&t);
for(int z=0;z<t;z++)
{
int n,temp,j=0,d;
scanf("%d",&n);
temp=n;
printf("%d\n",digits(n));
for(int i=0;i<digCount(n);i++)
{
d=temp%10;
if(d!=0)
{
d=d*pow(10,j);
printf("%d\t",d);
}
temp=temp/10;
j++;
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14944/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14944/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\09\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @digits(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp5 = icmp sgt i32 %n, 0
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.addr.07 = phi i32 [ %div, %while.body ], [ %n, %entry ]
%count.06 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%rem = urem i32 %n.addr.07, 10
%cmp1.not = icmp ne i32 %rem, 0
%inc = zext i1 %cmp1.not to i32
%spec.select = add nuw nsw i32 %count.06, %inc
%div = udiv i32 %n.addr.07, 10
%cmp.not = icmp ult i32 %n.addr.07, 10
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %count.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %n, i32 noundef %p) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %p, 0
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp16 = icmp sgt i32 %p, 1
br i1 %cmp16, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%0 = add i32 %p, -1
%min.iters.check = icmp ult i32 %p, 9
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %0, -8
%ind.end = or i32 %n.vec, 1
%1 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %n, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %n, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %1, %vector.ph ], [ %2, %vector.body ]
%vec.phi9 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %3, %vector.body ]
%2 = mul <4 x i32> %vec.phi, %broadcast.splat
%3 = mul <4 x i32> %vec.phi9, %broadcast.splat
%index.next = add nuw i32 %index, 8
%4 = icmp eq i32 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !7
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %3, %2
%5 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %0, %n.vec
br i1 %cmp.n, label %cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.08.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%n.addr.07.ph = phi i32 [ %n, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader10, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ %i.08.ph, %for.body.preheader10 ]
%n.addr.07 = phi i32 [ %mul, %for.body ], [ %n.addr.07.ph, %for.body.preheader10 ]
%mul = mul nsw i32 %n.addr.07, %n
%inc = add nuw nsw i32 %i.08, 1
%exitcond.not = icmp eq i32 %inc, %p
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !10
cleanup: ; preds = %for.body, %middle.block, %for.cond.preheader, %entry
%retval.0 = phi i32 [ 1, %entry ], [ %n, %for.cond.preheader ], [ %5, %middle.block ], [ %mul, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @digCount(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i32 %n, 0
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%c.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%n.addr.04 = phi i32 [ %div, %while.body ], [ %n, %entry ]
%div = udiv i32 %n.addr.04, 10
%inc = add nuw nsw i32 %c.05, 1
%cmp.not = icmp ult i32 %n.addr.04, 10
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
ret i32 %c.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !12
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup7, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
for.body: ; preds = %entry, %for.cond.cleanup7
%z.030 = phi i32 [ %inc15, %for.cond.cleanup7 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !12
%cmp5.i = icmp sgt i32 %1, 0
br i1 %cmp5.i, label %while.body.i, label %digits.exit
while.body.i: ; preds = %for.body, %while.body.i
%n.addr.07.i = phi i32 [ %div.i, %while.body.i ], [ %1, %for.body ]
%count.06.i = phi i32 [ %spec.select.i, %while.body.i ], [ 0, %for.body ]
%rem.i = urem i32 %n.addr.07.i, 10
%cmp1.not.i = icmp ne i32 %rem.i, 0
%inc.i = zext i1 %cmp1.not.i to i32
%spec.select.i = add nuw nsw i32 %count.06.i, %inc.i
%div.i = udiv i32 %n.addr.07.i, 10
%cmp.not.i = icmp ult i32 %n.addr.07.i, 10
br i1 %cmp.not.i, label %digits.exit, label %while.body.i, !llvm.loop !5
digits.exit: ; preds = %while.body.i, %for.body
%count.0.lcssa.i = phi i32 [ 0, %for.body ], [ %spec.select.i, %while.body.i ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa.i)
br label %for.cond4
for.cond4: ; preds = %if.end, %digits.exit
%temp.0 = phi i32 [ %1, %digits.exit ], [ %div, %if.end ]
%j.0 = phi i32 [ 0, %digits.exit ], [ %inc, %if.end ]
%2 = add i32 %j.0, -1
%3 = load i32, ptr %n, align 4, !tbaa !12
%cmp3.i = icmp sgt i32 %3, 0
br i1 %cmp3.i, label %while.body.i23, label %digCount.exit
while.body.i23: ; preds = %for.cond4, %while.body.i23
%c.05.i = phi i32 [ %inc.i25, %while.body.i23 ], [ 0, %for.cond4 ]
%n.addr.04.i = phi i32 [ %div.i24, %while.body.i23 ], [ %3, %for.cond4 ]
%div.i24 = udiv i32 %n.addr.04.i, 10
%inc.i25 = add nuw nsw i32 %c.05.i, 1
%cmp.not.i26 = icmp ult i32 %n.addr.04.i, 10
br i1 %cmp.not.i26, label %digCount.exit, label %while.body.i23, !llvm.loop !11
digCount.exit: ; preds = %while.body.i23, %for.cond4
%c.0.lcssa.i = phi i32 [ 0, %for.cond4 ], [ %inc.i25, %while.body.i23 ]
%cmp6 = icmp slt i32 %j.0, %c.0.lcssa.i
br i1 %cmp6, label %for.body8, label %for.cond.cleanup7
for.cond.cleanup7: ; preds = %digCount.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
%inc15 = add nuw nsw i32 %z.030, 1
%4 = load i32, ptr %t, align 4, !tbaa !12
%cmp = icmp slt i32 %inc15, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !16
for.body8: ; preds = %digCount.exit
%rem = srem i32 %temp.0, 10
%div = sdiv i32 %temp.0, 10
%cmp9.not = icmp eq i32 %rem, 0
br i1 %cmp9.not, label %if.end, label %if.then
if.then: ; preds = %for.body8
switch i32 %j.0, label %for.body.i.preheader [
i32 0, label %pow.exit
i32 1, label %pow.exit.fold.split
]
for.body.i.preheader: ; preds = %if.then
%min.iters.check = icmp ult i32 %2, 8
br i1 %min.iters.check, label %for.body.i.preheader32, label %vector.ph
vector.ph: ; preds = %for.body.i.preheader
%n.vec = and i32 %2, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 10, i32 1, i32 1, i32 1>, %vector.ph ], [ %5, %vector.body ]
%vec.phi31 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %6, %vector.body ]
%5 = mul <4 x i32> %vec.phi, <i32 10, i32 10, i32 10, i32 10>
%6 = mul <4 x i32> %vec.phi31, <i32 10, i32 10, i32 10, i32 10>
%index.next = add nuw i32 %index, 8
%7 = icmp eq i32 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %6, %5
%8 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %2, %n.vec
br i1 %cmp.n, label %pow.exit, label %for.body.i.preheader32
for.body.i.preheader32: ; preds = %for.body.i.preheader, %middle.block
%i.08.i.ph = phi i32 [ 1, %for.body.i.preheader ], [ %ind.end, %middle.block ]
%n.addr.07.i27.ph = phi i32 [ 10, %for.body.i.preheader ], [ %8, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader32, %for.body.i
%i.08.i = phi i32 [ %inc.i28, %for.body.i ], [ %i.08.i.ph, %for.body.i.preheader32 ]
%n.addr.07.i27 = phi i32 [ %mul.i, %for.body.i ], [ %n.addr.07.i27.ph, %for.body.i.preheader32 ]
%mul.i = mul nsw i32 %n.addr.07.i27, 10
%inc.i28 = add nuw nsw i32 %i.08.i, 1
%exitcond.not.i = icmp eq i32 %inc.i28, %j.0
br i1 %exitcond.not.i, label %pow.exit, label %for.body.i, !llvm.loop !18
pow.exit.fold.split: ; preds = %if.then
br label %pow.exit
pow.exit: ; preds = %for.body.i, %middle.block, %if.then, %pow.exit.fold.split
%retval.0.i = phi i32 [ 1, %if.then ], [ 10, %pow.exit.fold.split ], [ %8, %middle.block ], [ %mul.i, %for.body.i ]
%mul = mul nsw i32 %retval.0.i, %rem
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %pow.exit, %for.body8
%inc = add i32 %j.0, 1
br label %for.cond4, !llvm.loop !19
}
; 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #5
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 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6, !8, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !6, !9, !8}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C/C++ TBAA"}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6, !8, !9}
!18 = distinct !{!18, !6, !9, !8}
!19 = distinct !{!19, !6}
|
#include<stdio.h>
int main(void)
{
int i;
char c[3],d[3];
scanf("%s",c);
scanf("%s",d);
if((c[0]==d[2] && c[1]==d[1])&&c[2]==d[0]){
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca [3 x i8], align 1
%d = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i8, ptr %c, align 1, !tbaa !5
%arrayidx3 = getelementptr inbounds [3 x i8], ptr %d, i64 0, i64 2
%1 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%arrayidx6 = getelementptr inbounds [3 x i8], ptr %c, i64 0, i64 1
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%arrayidx8 = getelementptr inbounds [3 x i8], ptr %d, i64 0, i64 1
%3 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %2, %3
br i1 %cmp10, label %land.lhs.true12, label %if.else
land.lhs.true12: ; preds = %land.lhs.true
%arrayidx13 = getelementptr inbounds [3 x i8], ptr %c, i64 0, i64 2
%4 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%5 = load i8, ptr %d, align 1, !tbaa !5
%cmp17 = icmp eq i8 %4, %5
br i1 %cmp17, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true12, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true12, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true12 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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>
typedef struct {
char name[20];
int start,max;
} era_t;
int era_max,query_max;
era_t era[1000];
int main(void) {
int i,j;
int query;
int found;
while(1) {
scanf("%d%d",&era_max,&query_max);
if(era_max==0 && query_max==0)break;
for(i=0;i<era_max;i++) {
scanf("%s%d%d",&era[i].name,&era[i].max,&era[i].start);
era[i].start-=era[i].max-1;
}
for(i=0;i<query_max;i++) {
scanf("%d",&query);
found=0;
for(j=0;j<era_max;j++) {
if(era[j].start<=query && query-era[j].start+1<=era[j].max) {
printf("%s %d\n",era[j].name,query-era[j].start+1);
found=1;
break;
}
}
if(!found)puts("Unknown");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149533/source.c"
target datalayout = "e-m:e-p270: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.era_t = type { [20 x i8], i32, i32 }
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@era_max = dso_local global i32 0, align 4
@query_max = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c"%s%d%d\00", align 1
@era = dso_local global [1000 x %struct.era_t] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [8 x i8] c"Unknown\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%query = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %query) #3
%call76 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @era_max, ptr noundef nonnull @query_max)
%0 = load i32, ptr @era_max, align 4, !tbaa !5
%cmp77 = icmp eq i32 %0, 0
%1 = load i32, ptr @query_max, align 4
%cmp178 = icmp eq i32 %1, 0
%or.cond79 = select i1 %cmp77, i1 %cmp178, i1 false
br i1 %or.cond79, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.inc52, %for.cond15.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @era_max, ptr noundef nonnull @query_max)
%2 = load i32, ptr @era_max, align 4, !tbaa !5
%cmp = icmp eq i32 %2, 0
%3 = load i32, ptr @query_max, align 4
%cmp1 = icmp eq i32 %3, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%4 = phi i32 [ %3, %while.cond.loopexit ], [ %1, %entry ]
%5 = phi i32 [ %2, %while.cond.loopexit ], [ %0, %entry ]
%cmp270 = icmp sgt i32 %5, 0
br i1 %cmp270, label %for.body, label %for.cond15.preheader
for.cond15.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr @query_max, align 4, !tbaa !5
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond.preheader
%6 = phi i32 [ %.pre, %for.cond15.preheader.loopexit ], [ %4, %for.cond.preheader ]
%cmp1674 = icmp sgt i32 %6, 0
br i1 %cmp1674, label %for.body17, label %while.cond.loopexit
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv
%max = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv, i32 2
%start = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv, i32 1
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %max, ptr noundef nonnull %start)
%7 = load i32, ptr %max, align 4, !tbaa !9
%8 = load i32, ptr %start, align 4, !tbaa !11
%reass.sub = sub i32 %8, %7
%sub14 = add i32 %reass.sub, 1
store i32 %sub14, ptr %start, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr @era_max, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp2, label %for.body, label %for.cond15.preheader.loopexit, !llvm.loop !12
for.body17: ; preds = %for.cond15.preheader, %for.inc52
%i.175 = phi i32 [ %inc53, %for.inc52 ], [ 0, %for.cond15.preheader ]
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %query)
%11 = load i32, ptr @era_max, align 4, !tbaa !5
%cmp20.not72 = icmp sgt i32 %11, 0
br i1 %cmp20.not72, label %for.body21.lr.ph, label %if.then49
for.body21.lr.ph: ; preds = %for.body17
%12 = load i32, ptr %query, align 4, !tbaa !5
%wide.trip.count = zext i32 %11 to i64
br label %for.body21
for.body21: ; preds = %for.body21.lr.ph, %for.inc46
%indvars.iv82 = phi i64 [ 0, %for.body21.lr.ph ], [ %indvars.iv.next83, %for.inc46 ]
%start24 = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv82, i32 1
%13 = load i32, ptr %start24, align 4, !tbaa !11
%cmp25.not = icmp sgt i32 %13, %12
br i1 %cmp25.not, label %for.inc46, label %land.lhs.true26
land.lhs.true26: ; preds = %for.body21
%sub30 = sub nsw i32 %12, %13
%max33 = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv82, i32 2
%14 = load i32, ptr %max33, align 4, !tbaa !9
%cmp34.not.not = icmp slt i32 %sub30, %14
br i1 %cmp34.not.not, label %if.then35, label %for.inc46
if.then35: ; preds = %land.lhs.true26
%arrayidx23.le = getelementptr inbounds [1000 x %struct.era_t], ptr @era, i64 0, i64 %indvars.iv82
%add = add nsw i32 %sub30, 1
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %arrayidx23.le, i32 noundef %add)
br label %for.inc52
for.inc46: ; preds = %for.body21, %land.lhs.true26
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%exitcond.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count
br i1 %exitcond.not, label %if.then49, label %for.body21, !llvm.loop !14
if.then49: ; preds = %for.inc46, %for.body17
%call50 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %for.inc52
for.inc52: ; preds = %if.then35, %if.then49
%inc53 = add nuw nsw i32 %i.175, 1
%15 = load i32, ptr @query_max, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc53, %15
br i1 %cmp16, label %for.body17, label %while.cond.loopexit, !llvm.loop !15
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %query) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"", !7, i64 0, !6, i64 20, !6, i64 24}
!11 = !{!10, !6, i64 20}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
long int N;
scanf("%ld",&N);
long int **A=malloc(N*sizeof(long int*));
long int **B=malloc(N*sizeof(long int*));
int error=0;
long int sum=0;
int i,j,k;
for (i=0;i<N;i++){
A[i]=malloc(N*sizeof(long int));
B[i]=malloc(N*sizeof(long int));
for (j=0;j<N;j++){
scanf("%ld",&A[i][j]);
B[i][j]=1;
}
}
for (i=0;i<N;i++){
for (j=0;j<i;j++){
for (k=0;k<N;k++){
if (A[i][j]>A[i][k]+A[k][j]){
error=-1;
}
if (i!=k && j!=k && A[i][j]==A[i][k]+A[k][j]){
B[i][j]=B[j][i]=0;
}
}
}
}
if (error==-1){
printf("-1\n");
}
if (error==0){
for (i=0;i<N;i++){
for (j=0;j<i;j++){
if (B[i][j]==1){
sum+=A[i][j];
}
}
}
printf("%ld\n",sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149584/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149584/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\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:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%mul = shl i64 %0, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #6
%call3 = call noalias ptr @malloc(i64 noundef %mul) #6
%cmp195 = icmp sgt i64 %0, 0
br i1 %cmp195, label %for.body, label %for.end130
for.cond28.preheader: ; preds = %for.inc25
%cmp30206 = icmp sgt i64 %3, 0
br i1 %cmp30206, label %for.cond33.preheader, label %for.end130
for.body: ; preds = %entry, %for.inc25
%1 = phi i64 [ %3, %for.inc25 ], [ %0, %entry ]
%indvars.iv230 = phi i64 [ %indvars.iv.next231, %for.inc25 ], [ 0, %entry ]
%mul5 = shl i64 %1, 3
%call6 = call noalias ptr @malloc(i64 noundef %mul5) #6
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv230
store ptr %call6, ptr %arrayidx, align 8, !tbaa !9
%call8 = call noalias ptr @malloc(i64 noundef %mul5) #6
%arrayidx10 = getelementptr inbounds ptr, ptr %call3, i64 %indvars.iv230
store ptr %call8, ptr %arrayidx10, align 8, !tbaa !9
%cmp13192 = icmp sgt i64 %1, 0
br i1 %cmp13192, label %for.body15, label %for.inc25
for.body15: ; preds = %for.body, %for.body15
%indvars.iv227 = phi i64 [ %indvars.iv.next228, %for.body15 ], [ 0, %for.body ]
%arrayidx19 = getelementptr inbounds i64, ptr %call6, i64 %indvars.iv227
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx19)
%arrayidx24 = getelementptr inbounds i64, ptr %call8, i64 %indvars.iv227
store i64 1, ptr %arrayidx24, align 8, !tbaa !5
%indvars.iv.next228 = add nuw nsw i64 %indvars.iv227, 1
%2 = load i64, ptr %N, align 8, !tbaa !5
%cmp13 = icmp sgt i64 %2, %indvars.iv.next228
br i1 %cmp13, label %for.body15, label %for.inc25, !llvm.loop !11
for.inc25: ; preds = %for.body15, %for.body
%3 = phi i64 [ %1, %for.body ], [ %2, %for.body15 ]
%indvars.iv.next231 = add nuw nsw i64 %indvars.iv230, 1
%cmp = icmp sgt i64 %3, %indvars.iv.next231
br i1 %cmp, label %for.body, label %for.cond28.preheader, !llvm.loop !13
for.cond33.preheader: ; preds = %for.cond28.preheader, %for.inc92
%4 = phi i64 [ %23, %for.inc92 ], [ %3, %for.cond28.preheader ]
%indvars.iv240 = phi i64 [ %indvars.iv.next241, %for.inc92 ], [ 0, %for.cond28.preheader ]
%error.0207 = phi i32 [ %error.1.lcssa, %for.inc92 ], [ 0, %for.cond28.preheader ]
%cmp34202.not = icmp eq i64 %indvars.iv240, 0
br i1 %cmp34202.not, label %for.inc92, label %for.cond37.preheader.lr.ph
for.cond37.preheader.lr.ph: ; preds = %for.cond33.preheader
%arrayidx43 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv240
%arrayidx82 = getelementptr inbounds ptr, ptr %call3, i64 %indvars.iv240
%5 = icmp sgt i64 %4, 0
br i1 %5, label %for.cond37.preheader, label %for.inc92
for.cond37.preheader: ; preds = %for.cond37.preheader.lr.ph, %for.inc89
%6 = phi i64 [ %20, %for.inc89 ], [ %4, %for.cond37.preheader.lr.ph ]
%7 = phi i64 [ %21, %for.inc89 ], [ %4, %for.cond37.preheader.lr.ph ]
%8 = phi i64 [ %22, %for.inc89 ], [ %4, %for.cond37.preheader.lr.ph ]
%indvars.iv236 = phi i64 [ %indvars.iv.next237, %for.inc89 ], [ 0, %for.cond37.preheader.lr.ph ]
%error.1203 = phi i32 [ %error.2.lcssa, %for.inc89 ], [ %error.0207, %for.cond37.preheader.lr.ph ]
%cmp39198 = icmp sgt i64 %8, 0
br i1 %cmp39198, label %for.body41.lr.ph, label %for.inc89
for.body41.lr.ph: ; preds = %for.cond37.preheader
%9 = load ptr, ptr %arrayidx43, align 8, !tbaa !9
%arrayidx45 = getelementptr inbounds i64, ptr %9, i64 %indvars.iv236
%arrayidx78 = getelementptr inbounds ptr, ptr %call3, i64 %indvars.iv236
br label %for.body41
for.body41: ; preds = %for.body41.lr.ph, %for.inc86
%10 = phi i64 [ %6, %for.body41.lr.ph ], [ %18, %for.inc86 ]
%11 = phi i64 [ %7, %for.body41.lr.ph ], [ %19, %for.inc86 ]
%indvars.iv233 = phi i64 [ 0, %for.body41.lr.ph ], [ %indvars.iv.next234, %for.inc86 ]
%error.2199 = phi i32 [ %error.1203, %for.body41.lr.ph ], [ %spec.select, %for.inc86 ]
%12 = load i64, ptr %arrayidx45, align 8, !tbaa !5
%arrayidx49 = getelementptr inbounds i64, ptr %9, i64 %indvars.iv233
%13 = load i64, ptr %arrayidx49, align 8, !tbaa !5
%arrayidx51 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv233
%14 = load ptr, ptr %arrayidx51, align 8, !tbaa !9
%arrayidx53 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv236
%15 = load i64, ptr %arrayidx53, align 8, !tbaa !5
%add = add nsw i64 %15, %13
%cmp54 = icmp sgt i64 %12, %add
%spec.select = select i1 %cmp54, i32 -1, i32 %error.2199
%cmp56.not = icmp ne i64 %indvars.iv240, %indvars.iv233
%cmp58.not = icmp ne i64 %indvars.iv236, %indvars.iv233
%or.cond.not191 = and i1 %cmp56.not, %cmp58.not
%cmp74 = icmp eq i64 %12, %add
%or.cond190 = select i1 %or.cond.not191, i1 %cmp74, i1 false
br i1 %or.cond190, label %if.then76, label %for.inc86
if.then76: ; preds = %for.body41
%16 = load ptr, ptr %arrayidx78, align 8, !tbaa !9
%arrayidx80 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv240
store i64 0, ptr %arrayidx80, align 8, !tbaa !5
%17 = load ptr, ptr %arrayidx82, align 8, !tbaa !9
%arrayidx84 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv236
store i64 0, ptr %arrayidx84, align 8, !tbaa !5
%.pre = load i64, ptr %N, align 8, !tbaa !5
br label %for.inc86
for.inc86: ; preds = %for.body41, %if.then76
%18 = phi i64 [ %10, %for.body41 ], [ %.pre, %if.then76 ]
%19 = phi i64 [ %11, %for.body41 ], [ %.pre, %if.then76 ]
%indvars.iv.next234 = add nuw nsw i64 %indvars.iv233, 1
%cmp39 = icmp sgt i64 %19, %indvars.iv.next234
br i1 %cmp39, label %for.body41, label %for.inc89, !llvm.loop !15
for.inc89: ; preds = %for.inc86, %for.cond37.preheader
%20 = phi i64 [ %6, %for.cond37.preheader ], [ %18, %for.inc86 ]
%21 = phi i64 [ %7, %for.cond37.preheader ], [ %19, %for.inc86 ]
%22 = phi i64 [ %8, %for.cond37.preheader ], [ %19, %for.inc86 ]
%error.2.lcssa = phi i32 [ %error.1203, %for.cond37.preheader ], [ %spec.select, %for.inc86 ]
%indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1
%exitcond239.not = icmp eq i64 %indvars.iv.next237, %indvars.iv240
br i1 %exitcond239.not, label %for.inc92, label %for.cond37.preheader, !llvm.loop !16
for.inc92: ; preds = %for.inc89, %for.cond37.preheader.lr.ph, %for.cond33.preheader
%23 = phi i64 [ %4, %for.cond33.preheader ], [ %4, %for.cond37.preheader.lr.ph ], [ %20, %for.inc89 ]
%error.1.lcssa = phi i32 [ %error.0207, %for.cond33.preheader ], [ %error.0207, %for.cond37.preheader.lr.ph ], [ %error.2.lcssa, %for.inc89 ]
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%cmp30 = icmp sgt i64 %23, %indvars.iv.next241
br i1 %cmp30, label %for.cond33.preheader, label %for.end94, !llvm.loop !17
for.end94: ; preds = %for.inc92
switch i32 %error.1.lcssa, label %if.end132 [
i32 -1, label %if.then97
i32 0, label %for.cond103.preheader
]
for.cond103.preheader: ; preds = %for.end94
%cmp105217 = icmp sgt i64 %23, 0
br i1 %cmp105217, label %for.cond108.preheader, label %for.end130
if.then97: ; preds = %for.end94
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end132
for.cond108.preheader: ; preds = %for.cond103.preheader, %for.inc128
%indvars.iv247 = phi i64 [ %indvars.iv.next248, %for.inc128 ], [ 0, %for.cond103.preheader ]
%sum.0218 = phi i64 [ %sum.1.lcssa, %for.inc128 ], [ 0, %for.cond103.preheader ]
%cmp109213.not = icmp eq i64 %indvars.iv247, 0
br i1 %cmp109213.not, label %for.inc128, label %for.body111.lr.ph
for.body111.lr.ph: ; preds = %for.cond108.preheader
%arrayidx113 = getelementptr inbounds ptr, ptr %call3, i64 %indvars.iv247
%24 = load ptr, ptr %arrayidx113, align 8, !tbaa !9
%arrayidx120 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv247
%xtraiter = and i64 %indvars.iv247, 1
%25 = icmp eq i64 %indvars.iv247, 1
br i1 %25, label %for.inc128.loopexit.unr-lcssa, label %for.body111.lr.ph.new
for.body111.lr.ph.new: ; preds = %for.body111.lr.ph
%unroll_iter = and i64 %indvars.iv247, 9223372036854775806
br label %for.body111
for.body111: ; preds = %for.inc125.1, %for.body111.lr.ph.new
%indvars.iv243 = phi i64 [ 0, %for.body111.lr.ph.new ], [ %indvars.iv.next244.1, %for.inc125.1 ]
%sum.1214 = phi i64 [ %sum.0218, %for.body111.lr.ph.new ], [ %sum.2.1, %for.inc125.1 ]
%niter = phi i64 [ 0, %for.body111.lr.ph.new ], [ %niter.next.1, %for.inc125.1 ]
%arrayidx115 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv243
%26 = load i64, ptr %arrayidx115, align 8, !tbaa !5
%cmp116 = icmp eq i64 %26, 1
br i1 %cmp116, label %if.then118, label %for.inc125
if.then118: ; preds = %for.body111
%27 = load ptr, ptr %arrayidx120, align 8, !tbaa !9
%arrayidx122 = getelementptr inbounds i64, ptr %27, i64 %indvars.iv243
%28 = load i64, ptr %arrayidx122, align 8, !tbaa !5
%add123 = add nsw i64 %28, %sum.1214
br label %for.inc125
for.inc125: ; preds = %for.body111, %if.then118
%sum.2 = phi i64 [ %add123, %if.then118 ], [ %sum.1214, %for.body111 ]
%indvars.iv.next244 = or i64 %indvars.iv243, 1
%arrayidx115.1 = getelementptr inbounds i64, ptr %24, i64 %indvars.iv.next244
%29 = load i64, ptr %arrayidx115.1, align 8, !tbaa !5
%cmp116.1 = icmp eq i64 %29, 1
br i1 %cmp116.1, label %if.then118.1, label %for.inc125.1
if.then118.1: ; preds = %for.inc125
%30 = load ptr, ptr %arrayidx120, align 8, !tbaa !9
%arrayidx122.1 = getelementptr inbounds i64, ptr %30, i64 %indvars.iv.next244
%31 = load i64, ptr %arrayidx122.1, align 8, !tbaa !5
%add123.1 = add nsw i64 %31, %sum.2
br label %for.inc125.1
for.inc125.1: ; preds = %if.then118.1, %for.inc125
%sum.2.1 = phi i64 [ %add123.1, %if.then118.1 ], [ %sum.2, %for.inc125 ]
%indvars.iv.next244.1 = add nuw nsw i64 %indvars.iv243, 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.inc128.loopexit.unr-lcssa, label %for.body111, !llvm.loop !18
for.inc128.loopexit.unr-lcssa: ; preds = %for.inc125.1, %for.body111.lr.ph
%sum.2.lcssa.ph = phi i64 [ undef, %for.body111.lr.ph ], [ %sum.2.1, %for.inc125.1 ]
%indvars.iv243.unr = phi i64 [ 0, %for.body111.lr.ph ], [ %indvars.iv.next244.1, %for.inc125.1 ]
%sum.1214.unr = phi i64 [ %sum.0218, %for.body111.lr.ph ], [ %sum.2.1, %for.inc125.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc128, label %for.body111.epil
for.body111.epil: ; preds = %for.inc128.loopexit.unr-lcssa
%arrayidx115.epil = getelementptr inbounds i64, ptr %24, i64 %indvars.iv243.unr
%32 = load i64, ptr %arrayidx115.epil, align 8, !tbaa !5
%cmp116.epil = icmp eq i64 %32, 1
br i1 %cmp116.epil, label %if.then118.epil, label %for.inc128
if.then118.epil: ; preds = %for.body111.epil
%33 = load ptr, ptr %arrayidx120, align 8, !tbaa !9
%arrayidx122.epil = getelementptr inbounds i64, ptr %33, i64 %indvars.iv243.unr
%34 = load i64, ptr %arrayidx122.epil, align 8, !tbaa !5
%add123.epil = add nsw i64 %34, %sum.1214.unr
br label %for.inc128
for.inc128: ; preds = %for.inc128.loopexit.unr-lcssa, %if.then118.epil, %for.body111.epil, %for.cond108.preheader
%sum.1.lcssa = phi i64 [ %sum.0218, %for.cond108.preheader ], [ %sum.2.lcssa.ph, %for.inc128.loopexit.unr-lcssa ], [ %add123.epil, %if.then118.epil ], [ %sum.1214.unr, %for.body111.epil ]
%indvars.iv.next248 = add nuw nsw i64 %indvars.iv247, 1
%exitcond250.not = icmp eq i64 %indvars.iv.next248, %23
br i1 %exitcond250.not, label %for.end130, label %for.cond108.preheader, !llvm.loop !19
for.end130: ; preds = %for.inc128, %for.cond28.preheader, %entry, %for.cond103.preheader
%sum.0.lcssa = phi i64 [ 0, %for.cond103.preheader ], [ 0, %entry ], [ 0, %for.cond28.preheader ], [ %sum.1.lcssa, %for.inc128 ]
%call131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sum.0.lcssa)
br label %if.end132
if.end132: ; preds = %if.then97, %for.end94, %for.end130
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
|
#include <stdio.h>
int main ()
{
int A, B;
scanf("%d %d", &A, &B);
if(A > 0 && A <= 8 && B > 0 &&B <= 8)
{
printf("Yay!\n");
}
else
{
printf(":(\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149627/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149627/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c":(\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Yay!\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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 8
%2 = load i32, ptr %B, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 9
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
%str.3.str = select i1 %or.cond9, 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)"}
|
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(a<=8&&b<=8){
printf("Yay!");
}
else{
printf(":(");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149670/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149670/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%cmp = icmp slt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 9
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%.str.1..str.2 = select i1 %or.cond, 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(){
int a, b;
scanf("%d%d", &a, &b);
if (a >= 9 || b >= 9){
printf(":(");
return 0;
}
printf("Yay!");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149713/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149713/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\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
%cmp = icmp sgt i32 %0, 8
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 8
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%.str.1..str.2 = select i1 %or.cond, 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(){
int a,b;
scanf("%d%d",&a,&b);
(a<9&&b<9)?puts("Yay!"):puts(":(");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149757/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149757/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%cmp = icmp slt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 9
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call3 = 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(){
int t, w, h, max, n;
scanf("%d", &t);
for( ; t-- ; ){
scanf("%d%d%d", &w, &h, &n);
max = 1;
while( w % 2 == 0 ){
max <<= 1;
w >>= 1;
}
while( h % 2 == 0 ){
max <<= 1;
h >>= 1;
}
if( max >= n )
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec24 = add nsw i32 %0, -1
store i32 %dec24, ptr %t, align 4, !tbaa !5
%tobool.not25 = icmp eq i32 %0, 0
br i1 %tobool.not25, label %for.end, label %for.body
for.body: ; preds = %entry, %while.end8
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%w.promoted = load i32, ptr %w, align 4, !tbaa !5
%1 = and i32 %w.promoted, 1
%cmp16 = icmp eq i32 %1, 0
br i1 %cmp16, label %while.body, label %while.cond2.preheader
while.cond.while.cond2.preheader_crit_edge: ; preds = %while.body
store i32 %shr, ptr %w, align 4, !tbaa !5
br label %while.cond2.preheader
while.cond2.preheader: ; preds = %while.cond.while.cond2.preheader_crit_edge, %for.body
%max.0.lcssa = phi i32 [ %shl, %while.cond.while.cond2.preheader_crit_edge ], [ 1, %for.body ]
%h.promoted = load i32, ptr %h, align 4, !tbaa !5
%2 = and i32 %h.promoted, 1
%cmp420 = icmp eq i32 %2, 0
br i1 %cmp420, label %while.body5, label %while.end8
while.body: ; preds = %for.body, %while.body
%max.018 = phi i32 [ %shl, %while.body ], [ 1, %for.body ]
%shr1517 = phi i32 [ %shr, %while.body ], [ %w.promoted, %for.body ]
%shl = shl i32 %max.018, 1
%shr = ashr i32 %shr1517, 1
%3 = and i32 %shr1517, 2
%cmp = icmp eq i32 %3, 0
br i1 %cmp, label %while.body, label %while.cond.while.cond2.preheader_crit_edge, !llvm.loop !9
while.body5: ; preds = %while.cond2.preheader, %while.body5
%max.122 = phi i32 [ %shl6, %while.body5 ], [ %max.0.lcssa, %while.cond2.preheader ]
%shr71921 = phi i32 [ %shr7, %while.body5 ], [ %h.promoted, %while.cond2.preheader ]
%shl6 = shl i32 %max.122, 1
%shr7 = ashr i32 %shr71921, 1
%4 = and i32 %shr71921, 2
%cmp4 = icmp eq i32 %4, 0
br i1 %cmp4, label %while.body5, label %while.cond2.while.end8_crit_edge, !llvm.loop !11
while.cond2.while.end8_crit_edge: ; preds = %while.body5
store i32 %shr7, ptr %h, align 4, !tbaa !5
br label %while.end8
while.end8: ; preds = %while.cond2.while.end8_crit_edge, %while.cond2.preheader
%max.1.lcssa = phi i32 [ %shl6, %while.cond2.while.end8_crit_edge ], [ %max.0.lcssa, %while.cond2.preheader ]
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp9.not = icmp slt i32 %max.1.lcssa, %5
%str.str.4 = select i1 %cmp9.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
%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 %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %while.end8, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
typedef long long int ll;
#define mod 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define m0(x) memset(x,0,sizeof(x))
//組み合わせ(nとrが少ないとき)
int combination_low(ll n,ll r){
const ll N = 500;
ll C[N][N];
memset(C, 0, sizeof(C));
C[0][0]=1;
for(ll n=1; n<N; n++){
C[n][0]=C[n-1][0];
for(ll r=1; r<N; r++){
C[n][r] = C[n-1][r-1] + C[n-1][r];
}
}
return C[n][r];
}
//二分累乗法
int powa(ll a, ll n){
ll res = 1;
while(n>0) {
if(n&1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
//逆元
int inverse(ll a){
ll n = mod-2;
return powa(a, n);
}
/*組み合わせ(いちばんうまくいったやつ)*/
int combination(ll n,ll r){
ll x=1,y=1;
for(int i=1;i<=r;i++){
x = x * (n-i+1) % mod;
y = y * i % mod;
}
return x * inverse(y) % mod;
}
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a>8 || b>8) printf(":(");
else printf("Yay!");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149843/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149843/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @combination_low(i64 noundef %n, i64 noundef %r) local_unnamed_addr #0 {
entry:
%vla36 = alloca [250000 x i64], align 16
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000000) %vla36, i8 0, i64 2000000, i1 false)
store i64 1, ptr %vla36, align 16, !tbaa !5
br label %for.body
for.cond.cleanup: ; preds = %for.body11
%0 = mul nsw i64 %n, 500
%arrayidx24 = getelementptr inbounds i64, ptr %vla36, i64 %0
%arrayidx25 = getelementptr inbounds i64, ptr %arrayidx24, i64 %r
%1 = load i64, ptr %arrayidx25, align 8, !tbaa !5
%conv = trunc i64 %1 to i32
ret i32 %conv
for.body: ; preds = %entry, %for.body11
%n2.038 = phi i64 [ 1, %entry ], [ %inc22, %for.body11 ]
%2 = mul nuw nsw i64 %n2.038, 500
%3 = getelementptr i64, ptr %vla36, i64 %2
%arrayidx3 = getelementptr i64, ptr %3, i64 -500
%4 = load i64, ptr %arrayidx3, align 16, !tbaa !5
store i64 %4, ptr %3, align 16, !tbaa !5
br label %vector.body
vector.body: ; preds = %vector.body, %for.body
%index = phi i64 [ 0, %for.body ], [ %index.next.1, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr i64, ptr %arrayidx3, i64 %offset.idx
%6 = getelementptr i64, ptr %5, i64 -1
%wide.load = load <2 x i64>, ptr %6, align 16, !tbaa !5
%7 = getelementptr i64, ptr %5, i64 1
%wide.load40 = load <2 x i64>, ptr %7, align 16, !tbaa !5
%wide.load41 = load <2 x i64>, ptr %5, align 8, !tbaa !5
%8 = getelementptr i64, ptr %5, i64 2
%wide.load42 = load <2 x i64>, ptr %8, align 8, !tbaa !5
%9 = add nsw <2 x i64> %wide.load41, %wide.load
%10 = add nsw <2 x i64> %wide.load42, %wide.load40
%11 = getelementptr inbounds i64, ptr %3, i64 %offset.idx
store <2 x i64> %9, ptr %11, align 8, !tbaa !5
%12 = getelementptr inbounds i64, ptr %11, i64 2
store <2 x i64> %10, ptr %12, align 8, !tbaa !5
%offset.idx.1 = or i64 %index, 5
%13 = getelementptr i64, ptr %arrayidx3, i64 %offset.idx.1
%14 = getelementptr i64, ptr %13, i64 -1
%wide.load.1 = load <2 x i64>, ptr %14, align 16, !tbaa !5
%15 = getelementptr i64, ptr %13, i64 1
%wide.load40.1 = load <2 x i64>, ptr %15, align 16, !tbaa !5
%wide.load41.1 = load <2 x i64>, ptr %13, align 8, !tbaa !5
%16 = getelementptr i64, ptr %13, i64 2
%wide.load42.1 = load <2 x i64>, ptr %16, align 8, !tbaa !5
%17 = add nsw <2 x i64> %wide.load41.1, %wide.load.1
%18 = add nsw <2 x i64> %wide.load42.1, %wide.load40.1
%19 = getelementptr inbounds i64, ptr %3, i64 %offset.idx.1
store <2 x i64> %17, ptr %19, align 8, !tbaa !5
%20 = getelementptr inbounds i64, ptr %19, i64 2
store <2 x i64> %18, ptr %20, align 8, !tbaa !5
%index.next.1 = add nuw nsw i64 %index, 8
%21 = icmp eq i64 %index.next.1, 496
br i1 %21, label %for.body11, label %vector.body, !llvm.loop !9
for.body11: ; preds = %vector.body
%22 = getelementptr i64, ptr %3, i64 -3
%arrayidx15 = getelementptr i64, ptr %3, i64 -4
%23 = load i64, ptr %arrayidx15, align 16, !tbaa !5
%24 = load i64, ptr %22, align 8, !tbaa !5
%add = add nsw i64 %24, %23
%arrayidx20 = getelementptr inbounds i64, ptr %3, i64 497
store i64 %add, ptr %arrayidx20, align 8, !tbaa !5
%25 = getelementptr i64, ptr %3, i64 -2
%26 = load i64, ptr %25, align 16, !tbaa !5
%add.1 = add nsw i64 %26, %24
%arrayidx20.1 = getelementptr inbounds i64, ptr %3, i64 498
store i64 %add.1, ptr %arrayidx20.1, align 16, !tbaa !5
%27 = getelementptr i64, ptr %3, i64 -1
%28 = load i64, ptr %27, align 8, !tbaa !5
%add.2 = add nsw i64 %28, %26
%arrayidx20.2 = getelementptr inbounds i64, ptr %3, i64 499
store i64 %add.2, ptr %arrayidx20.2, align 8, !tbaa !5
%inc22 = add nuw nsw i64 %n2.038, 1
%exitcond39.not = icmp eq i64 %inc22, 500
br i1 %exitcond39.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @powa(i64 noundef %a, i64 noundef %n) local_unnamed_addr #3 {
entry:
%cmp8 = icmp sgt i64 %n, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%res.011 = phi i64 [ %res.1, %if.end ], [ 1, %entry ]
%n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ]
%a.addr.09 = phi i64 [ %rem2, %if.end ], [ %a, %entry ]
%and = and i64 %n.addr.010, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i64 %res.011, %a.addr.09
%rem = srem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%res.1 = phi i64 [ %rem, %if.then ], [ %res.011, %while.body ]
%mul1 = mul nsw i64 %a.addr.09, %a.addr.09
%rem2 = urem i64 %mul1, 1000000007
%shr = lshr i64 %n.addr.010, 1
%cmp.not = icmp ult i64 %n.addr.010, 2
br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !14
while.end.loopexit: ; preds = %if.end
%0 = trunc i64 %res.1 to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%res.0.lcssa = phi i32 [ 1, %entry ], [ %0, %while.end.loopexit ]
ret i32 %res.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @inverse(i64 noundef %a) local_unnamed_addr #3 {
entry:
br label %while.body.i
while.body.i: ; preds = %if.end.i, %entry
%res.011.i = phi i64 [ %res.1.i, %if.end.i ], [ 1, %entry ]
%n.addr.010.i = phi i64 [ %shr.i, %if.end.i ], [ 1000000005, %entry ]
%a.addr.09.i = phi i64 [ %rem2.i, %if.end.i ], [ %a, %entry ]
%and.i = and i64 %n.addr.010.i, 1
%tobool.not.i = icmp eq i64 %and.i, 0
br i1 %tobool.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul nsw i64 %a.addr.09.i, %res.011.i
%rem.i = srem i64 %mul.i, 1000000007
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%res.1.i = phi i64 [ %rem.i, %if.then.i ], [ %res.011.i, %while.body.i ]
%mul1.i = mul nsw i64 %a.addr.09.i, %a.addr.09.i
%rem2.i = urem i64 %mul1.i, 1000000007
%shr.i = lshr i64 %n.addr.010.i, 1
%cmp.not.i = icmp ult i64 %n.addr.010.i, 2
br i1 %cmp.not.i, label %powa.exit, label %while.body.i, !llvm.loop !14
powa.exit: ; preds = %if.end.i
%0 = trunc i64 %res.1.i to i32
ret i32 %0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @combination(i64 noundef %n, i64 noundef %r) local_unnamed_addr #3 {
entry:
%cmp.not15 = icmp slt i64 %r, 1
br i1 %cmp.not15, label %while.body.i.i.preheader, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%sub = add i64 %n, 1
%xtraiter = and i64 %r, 1
%0 = icmp eq i64 %r, 1
br i1 %0, label %while.body.i.i.preheader.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %r, -2
br label %for.body
while.body.i.i.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%rem.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem.1, %for.body ]
%rem5.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem5.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.body ]
%y.017.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem5.1, %for.body ]
%x.016.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.body.i.i.preheader, label %for.body.epil
for.body.epil: ; preds = %while.body.i.i.preheader.loopexit.unr-lcssa
%add.epil = sub i64 %sub, %indvars.iv.unr
%mul.epil = mul nsw i64 %add.epil, %x.016.unr
%rem.epil = srem i64 %mul.epil, 1000000007
%mul4.epil = mul nsw i64 %indvars.iv.unr, %y.017.unr
%rem5.epil = srem i64 %mul4.epil, 1000000007
br label %while.body.i.i.preheader
while.body.i.i.preheader: ; preds = %for.body.epil, %while.body.i.i.preheader.loopexit.unr-lcssa, %entry
%x.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %while.body.i.i.preheader.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%y.0.lcssa = phi i64 [ 1, %entry ], [ %rem5.lcssa.ph, %while.body.i.i.preheader.loopexit.unr-lcssa ], [ %rem5.epil, %for.body.epil ]
br label %while.body.i.i
while.body.i.i: ; preds = %while.body.i.i.preheader, %if.end.i.i
%res.011.i.i = phi i64 [ %res.1.i.i, %if.end.i.i ], [ 1, %while.body.i.i.preheader ]
%n.addr.010.i.i = phi i64 [ %shr.i.i, %if.end.i.i ], [ 1000000005, %while.body.i.i.preheader ]
%a.addr.09.i.i = phi i64 [ %rem2.i.i, %if.end.i.i ], [ %y.0.lcssa, %while.body.i.i.preheader ]
%and.i.i = and i64 %n.addr.010.i.i, 1
%tobool.not.i.i = icmp eq i64 %and.i.i, 0
br i1 %tobool.not.i.i, label %if.end.i.i, label %if.then.i.i
if.then.i.i: ; preds = %while.body.i.i
%mul.i.i = mul nsw i64 %a.addr.09.i.i, %res.011.i.i
%rem.i.i = srem i64 %mul.i.i, 1000000007
br label %if.end.i.i
if.end.i.i: ; preds = %if.then.i.i, %while.body.i.i
%res.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %res.011.i.i, %while.body.i.i ]
%mul1.i.i = mul nsw i64 %a.addr.09.i.i, %a.addr.09.i.i
%rem2.i.i = urem i64 %mul1.i.i, 1000000007
%shr.i.i = lshr i64 %n.addr.010.i.i, 1
%cmp.not.i.i = icmp ult i64 %n.addr.010.i.i, 2
br i1 %cmp.not.i.i, label %inverse.exit, label %while.body.i.i, !llvm.loop !14
inverse.exit: ; preds = %if.end.i.i
%sext = shl i64 %res.1.i.i, 32
%conv6 = ashr exact i64 %sext, 32
%mul7 = mul nsw i64 %conv6, %x.0.lcssa
%rem8 = srem i64 %mul7, 1000000007
%conv9 = trunc i64 %rem8 to i32
ret i32 %conv9
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.body ]
%y.017 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem5.1, %for.body ]
%x.016 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%add = sub i64 %sub, %indvars.iv
%mul = mul nsw i64 %add, %x.016
%rem = srem i64 %mul, 1000000007
%mul4 = mul nsw i64 %indvars.iv, %y.017
%rem5 = srem i64 %mul4, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%add.1 = sub i64 %sub, %indvars.iv.next
%mul.1 = mul nsw i64 %add.1, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%mul4.1 = mul nsw i64 %indvars.iv.next, %rem5
%rem5.1 = srem i64 %mul4.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %while.body.i.i.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !15
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
%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 !16
%cmp = icmp sgt i32 %0, 8
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 8
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%.str.1..str.2 = select i1 %or.cond, 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) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { nofree 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main()
{
int A, B;
scanf("%d %d", &A, &B);
if(A > 8 || B > 8){
printf(":(\n");
}else{
printf("Yay!\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149944/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149944/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%cmp = icmp sgt i32 %0, 8
%1 = load i32, ptr %B, align 4
%cmp1 = icmp sgt i32 %1, 8
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 argc, char** argv) {
int a, b;
scanf("%d %d", &a, &b);
if (a > 8 || b > 8) {
printf(":(\n");
return 0;
}
printf("Yay!\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_149995/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_149995/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%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
%cmp = icmp sgt i32 %0, 8
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 8
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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;
int B;
scanf("%d",&A);
scanf("%d",&B);
if(A<=8&&B<=8)
printf("Yay!");
else
puts(":(");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150036/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150036/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%cmp = icmp slt i32 %0, 9
%1 = load i32, ptr %B, align 4
%cmp2 = icmp slt i32 %1, 9
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 @puts(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 %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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int t,i;
scanf("%d",&t);
for(i=0;i<t;++i){
int n,count1=0,count2=0;
scanf("%d",&n);
int a[n];
for(int j=0;j<n;++j){
scanf("%d",&a[j]);
if(a[j]==1) count1++;
else count2++;
}
if(count1%2==0&&count2%2==0){
printf("YES\n");
}
else if(count1%2==0&&count2%2!=0&&count1>=2){
printf("YES\n");
}
else printf("NO\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15008/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15008/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = 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
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
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end32
for.body: ; preds = %entry, %if.end29
%i.051 = phi i32 [ %inc31, %if.end29 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp345 = icmp sgt i32 %4, 0
br i1 %cmp345, label %for.body4, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body4, %for.body
%count2.0.lcssa = phi i32 [ 0, %for.body ], [ %count2.1, %for.body4 ]
%count1.0.lcssa = phi i32 [ 0, %for.body ], [ %count1.1, %for.body4 ]
%5 = and i32 %count1.0.lcssa, 1
%cmp11 = icmp eq i32 %5, 0
%6 = and i32 %count2.0.lcssa, 1
%cmp13 = icmp eq i32 %6, 0
%or.cond44 = select i1 %cmp11, i1 %cmp13, i1 false
br i1 %or.cond44, label %if.end29, label %if.else16
for.body4: ; preds = %for.body, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ]
%count1.047 = phi i32 [ %count1.1, %for.body4 ], [ 0, %for.body ]
%count2.046 = phi i32 [ %count2.1, %for.body4 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp8 = icmp ne i32 %7, 1
%inc9 = zext i1 %cmp8 to i32
%count2.1 = add nuw nsw i32 %count2.046, %inc9
%not.cmp8 = xor i1 %cmp8, true
%inc = zext i1 %not.cmp8 to i32
%count1.1 = add nuw nsw i32 %count1.047, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp3, label %for.body4, label %for.cond.cleanup, !llvm.loop !9
if.else16: ; preds = %for.cond.cleanup
br i1 %cmp11, label %land.lhs.true19, label %if.else26
land.lhs.true19: ; preds = %if.else16
%cmp21 = icmp ne i32 %6, 0
%cmp23 = icmp sgt i32 %count1.0.lcssa, 1
%or.cond = and i1 %cmp21, %cmp23
br i1 %or.cond, label %if.end29, label %if.else26
if.else26: ; preds = %land.lhs.true19, %if.else16
br label %if.end29
if.end29: ; preds = %land.lhs.true19, %for.cond.cleanup, %if.else26
%str.3.sink = phi ptr [ @str, %if.else26 ], [ @str.4, %for.cond.cleanup ], [ @str.4, %land.lhs.true19 ]
%puts42 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
%inc31 = add nuw nsw i32 %i.051, 1
%10 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc31, %10
br i1 %cmp, label %for.body, label %for.end32, !llvm.loop !11
for.end32: ; preds = %if.end29, %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: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int i;
int n;
int a,b;
int A,B;
while(scanf("%d", &n), n!=0){
A=0; B=0;
for(i=0; i<n; i++){
scanf("%d %d", &a,&b);
if(a>b)
A+=a+b;
else if(a==b)
A+=a, B+=b;
else
B+=a+b;
}
printf("%d %d\n", A, B);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150122/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150122/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not27 = icmp eq i32 %0, 0
br i1 %cmp.not27, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %5, %for.end ], [ %0, %entry ]
%cmp121 = icmp sgt i32 %1, 0
br i1 %cmp121, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.inc
%B.024 = phi i32 [ %B.1, %for.inc ], [ 0, %for.cond.preheader ]
%A.023 = phi i32 [ %A.1, %for.inc ], [ 0, %for.cond.preheader ]
%i.022 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %2, %3
br i1 %cmp3, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add i32 %2, %A.023
%add4 = add i32 %add, %3
br label %for.inc
if.else: ; preds = %for.body
%cmp5 = icmp eq i32 %2, %3
br i1 %cmp5, label %if.then6, label %if.else9
if.then6: ; preds = %if.else
%add7 = add nsw i32 %2, %A.023
%add8 = add nsw i32 %2, %B.024
br label %for.inc
if.else9: ; preds = %if.else
%add10 = add i32 %3, %B.024
%add11 = add i32 %add10, %2
br label %for.inc
for.inc: ; preds = %if.then, %if.else9, %if.then6
%A.1 = phi i32 [ %add4, %if.then ], [ %add7, %if.then6 ], [ %A.023, %if.else9 ]
%B.1 = phi i32 [ %B.024, %if.then ], [ %add8, %if.then6 ], [ %add11, %if.else9 ]
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %for.cond.preheader
%A.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %A.1, %for.inc ]
%B.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %B.1, %for.inc ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %A.0.lcssa, i32 noundef %B.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %5, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %for.end, %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
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>
#include <math.h>
#define swap(a,b) a^=b^=a^=b
int main(){
int n, i, a, b, A=0, B=0;
while(1){
scanf("%d", &n);
if(n == 0) break;
A=0, B=0;
for(i=0; i<n; i++){
scanf("%d %d", &a, &b);
if(a > b) A += a+b;
if(a < b) B += a+b;
if(a == b){
A += a;
B += b;
}
}
printf("%d %d\n", A, B);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150166/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150166/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp eq i32 %0, 0
br i1 %cmp34, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %5, %for.end ], [ %0, %entry ]
%cmp128 = icmp sgt i32 %1, 0
br i1 %cmp128, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%B.031 = phi i32 [ %B.2, %for.body ], [ 0, %for.cond.preheader ]
%A.030 = phi i32 [ %A.2, %for.body ], [ 0, %for.cond.preheader ]
%i.029 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %2, %3
%add = add nsw i32 %3, %2
%add5 = select i1 %cmp3, i32 %add, i32 0
%A.1 = add nsw i32 %add5, %A.030
%cmp7 = icmp slt i32 %2, %3
%add10 = select i1 %cmp7, i32 %add, i32 0
%B.1 = add nsw i32 %add10, %B.031
%cmp12 = icmp eq i32 %2, %3
%add14 = select i1 %cmp12, i32 %2, i32 0
%A.2 = add nsw i32 %A.1, %add14
%add15 = select i1 %cmp12, i32 %3, i32 0
%B.2 = add nsw i32 %B.1, %add15
%inc = add nuw nsw i32 %i.029, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond.preheader
%A.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %A.2, %for.body ]
%B.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %B.2, %for.body ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %A.0.lcssa, i32 noundef %B.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %5, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %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
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)
{
while (1) {
int n, a, b; scanf("%d", &n);
if (n == 0) break;
a = b = 0;
while (n--) {
int x, y; scanf("%d%d", &x, &y);
if (x > y) a += (x + y);
else if (x < y) b += (x + y);
else { a += x; b += y; }
}
printf("%d %d\n", a, b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150223/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150223/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp eq i32 %0, 0
br i1 %cmp32, label %while.end19, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %cleanup
%1 = phi i32 [ %4, %cleanup ], [ %0, %entry ]
%dec28 = add nsw i32 %1, -1
store i32 %dec28, ptr %n, align 4, !tbaa !5
br label %while.body2
while.body2: ; preds = %while.cond1.preheader, %if.end15
%b.030 = phi i32 [ 0, %while.cond1.preheader ], [ %b.1, %if.end15 ]
%a.029 = phi i32 [ 0, %while.cond1.preheader ], [ %a.1, %if.end15 ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%2 = load i32, ptr %x, align 4, !tbaa !5
%3 = load i32, ptr %y, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %2, %3
br i1 %cmp4, label %if.then5, label %if.else
if.then5: ; preds = %while.body2
%add = add i32 %2, %a.029
%add6 = add i32 %add, %3
br label %if.end15
if.else: ; preds = %while.body2
%cmp7 = icmp slt i32 %2, %3
br i1 %cmp7, label %if.then8, label %if.else11
if.then8: ; preds = %if.else
%add9 = add i32 %3, %b.030
%add10 = add i32 %add9, %2
br label %if.end15
if.else11: ; preds = %if.else
%add12 = add nsw i32 %2, %a.029
%add13 = add nsw i32 %3, %b.030
br label %if.end15
if.end15: ; preds = %if.then8, %if.else11, %if.then5
%a.1 = phi i32 [ %add6, %if.then5 ], [ %a.029, %if.then8 ], [ %add12, %if.else11 ]
%b.1 = phi i32 [ %b.030, %if.then5 ], [ %add10, %if.then8 ], [ %add13, %if.else11 ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
%.pr = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %.pr, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %.pr, 0
br i1 %tobool.not, label %cleanup, label %while.body2, !llvm.loop !9
cleanup: ; preds = %if.end15
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a.1, i32 noundef %b.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
br i1 %cmp, label %while.end19, label %while.cond1.preheader
while.end19: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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"}
|
#include <stdio.h>
int main(){
int n,h,i,j,x,apoint,bpoint;
int a[10000],b[10000];
for(h=0;h<10000;h++){
a[h]=0;
b[h]=0;
}
apoint=0;
bpoint=0;
for(j=0;j>=0;j++){
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d %d",&a[i],&b[i]);
if(a[i]<b[i]){
bpoint += a[i]+b[i];
}else if(a[i]>b[i]){
apoint += a[i]+b[i];
}else{
apoint += a[i];
bpoint += b[i];
}
}
printf("%d",apoint);
printf(" %d\n",bpoint);
apoint =0;
bpoint =0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150267/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150267/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c" %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [10000 x i32], align 16
%b = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %a, i8 0, i64 40000, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %b, i8 0, i64 40000, i1 false), !tbaa !5
%call84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp685 = icmp eq i32 %0, 0
br i1 %cmp685, label %for.end54, label %for.cond7.preheader
for.cond7.preheader: ; preds = %entry, %for.end49
%1 = phi i32 [ %6, %for.end49 ], [ %0, %entry ]
%cmp879 = icmp sgt i32 %1, 0
br i1 %cmp879, label %for.body9, label %for.end49
for.body9: ; preds = %for.cond7.preheader, %for.inc47
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc47 ], [ 0, %for.cond7.preheader ]
%bpoint.182 = phi i32 [ %bpoint.2, %for.inc47 ], [ 0, %for.cond7.preheader ]
%apoint.181 = phi i32 [ %apoint.2, %for.inc47 ], [ 0, %for.cond7.preheader ]
%arrayidx11 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx13 = getelementptr inbounds [10000 x i32], ptr %b, i64 0, i64 %indvars.iv
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11, ptr noundef nonnull %arrayidx13)
%2 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp19 = icmp slt i32 %2, %3
br i1 %cmp19, label %if.then20, label %if.else
if.then20: ; preds = %for.body9
%add = add i32 %3, %bpoint.182
%add25 = add i32 %add, %2
br label %for.inc47
if.else: ; preds = %for.body9
%cmp30 = icmp sgt i32 %2, %3
%add36 = add i32 %2, %apoint.181
br i1 %cmp30, label %if.then31, label %if.else38
if.then31: ; preds = %if.else
%add37 = add i32 %add36, %3
br label %for.inc47
if.else38: ; preds = %if.else
%add44 = add nsw i32 %3, %bpoint.182
br label %for.inc47
for.inc47: ; preds = %if.then20, %if.else38, %if.then31
%apoint.2 = phi i32 [ %apoint.181, %if.then20 ], [ %add37, %if.then31 ], [ %add36, %if.else38 ]
%bpoint.2 = phi i32 [ %add25, %if.then20 ], [ %bpoint.182, %if.then31 ], [ %add44, %if.else38 ]
%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
%cmp8 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp8, label %for.body9, label %for.end49, !llvm.loop !9
for.end49: ; preds = %for.inc47, %for.cond7.preheader
%apoint.1.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ %apoint.2, %for.inc47 ]
%bpoint.1.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ %bpoint.2, %for.inc47 ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %apoint.1.lcssa)
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %bpoint.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp eq i32 %6, 0
br i1 %cmp6, label %for.end54, label %for.cond7.preheader, !llvm.loop !11
for.end54: ; preds = %for.end49, %entry
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, 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 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 = !{!"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 t,w,h,n,c,count,sum;
scanf("%d",&c);
while(c--)
{
count = 0;sum = 1;
scanf("%d %d %d",&w,&h,&n);
t = w * h;
if(w%2==1&&h%2==1&&n>1)
sum = 1;
else if(w%2==0&&h%2!=0)
{
while(w>0&&w%2==0)
{
w = w / 2;
count++;
sum = sum * 2;
}
}
else if(h%2==0&&w%2!=0)
{
while(h!=0&&h%2==0)
{
h = h / 2;
count++;
sum = sum * 2;
}
}
else {
while(t!=0&&t%2==0)
{
t = t / 2;
count++;
sum = sum * 2;
}
}
if(sum>=n)printf("Yes\n");
else printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15031/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15031/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%dec93 = add nsw i32 %0, -1
store i32 %dec93, ptr %c, align 4, !tbaa !5
%tobool.not94 = icmp eq i32 %0, 0
br i1 %tobool.not94, label %while.end56, label %while.body
while.body: ; preds = %entry, %if.end49
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%1 = load i32, ptr %w, align 4, !tbaa !5
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %2, %1
%3 = and i32 %1, -2147483647
%cmp = icmp eq i32 %3, 1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %while.body
%4 = and i32 %2, -2147483647
%cmp3 = icmp eq i32 %4, 1
%5 = load i32, ptr %n, align 4
%cmp5 = icmp sgt i32 %5, 1
%or.cond = select i1 %cmp3, i1 %cmp5, i1 false
br i1 %or.cond, label %if.end49, label %if.else
if.else: ; preds = %land.lhs.true, %while.body
%6 = and i32 %1, 1
%cmp7 = icmp eq i32 %6, 0
%7 = and i32 %2, 1
%cmp10.not = icmp ne i32 %7, 0
%or.cond70.not = select i1 %cmp7, i1 %cmp10.not, i1 false
br i1 %or.cond70.not, label %while.cond12.preheader, label %if.else18
while.cond12.preheader: ; preds = %if.else
%cmp1386 = icmp sgt i32 %1, 0
br i1 %cmp1386, label %while.body16, label %if.end49
while.body16: ; preds = %while.cond12.preheader, %while.body16
%sum.091 = phi i32 [ %mul17, %while.body16 ], [ 1, %while.cond12.preheader ]
%div658590 = phi i32 [ %div65, %while.body16 ], [ %1, %while.cond12.preheader ]
%div65 = lshr i32 %div658590, 1
%mul17 = shl nsw i32 %sum.091, 1
%cmp13 = icmp ugt i32 %div658590, 1
%8 = and i32 %div658590, 2
%cmp15 = icmp eq i32 %8, 0
%or.cond67 = and i1 %cmp13, %cmp15
br i1 %or.cond67, label %while.body16, label %while.cond12.if.end49.loopexit_crit_edge, !llvm.loop !9
if.else18: ; preds = %if.else
%brmerge = or i1 %cmp7, %cmp10.not
br i1 %brmerge, label %while.cond37.preheader, label %while.cond25.preheader
while.cond25.preheader: ; preds = %if.else18
%cmp26.not74.not = icmp eq i32 %2, 0
br i1 %cmp26.not74.not, label %if.end49, label %while.body31
while.cond37.preheader: ; preds = %if.else18
%cmp38.not79 = icmp ne i32 %mul, 0
%9 = and i32 %mul, 1
%cmp4180 = icmp eq i32 %9, 0
%or.cond6981 = and i1 %cmp38.not79, %cmp4180
br i1 %or.cond6981, label %while.body43, label %if.end49
while.body31: ; preds = %while.cond25.preheader, %while.body31
%sum.178 = phi i32 [ %mul34, %while.body31 ], [ 1, %while.cond25.preheader ]
%div327377 = phi i32 [ %div32, %while.body31 ], [ %2, %while.cond25.preheader ]
%div32 = sdiv i32 %div327377, 2
%mul34 = shl nsw i32 %sum.178, 1
%10 = add i32 %div327377, -2
%cmp26.not = icmp ult i32 %10, -3
%11 = and i32 %div32, 1
%cmp29 = icmp eq i32 %11, 0
%or.cond68 = and i1 %cmp26.not, %cmp29
br i1 %or.cond68, label %while.body31, label %while.cond25.if.end49.loopexit72_crit_edge, !llvm.loop !11
while.body43: ; preds = %while.cond37.preheader, %while.body43
%sum.283 = phi i32 [ %mul46, %while.body43 ], [ 1, %while.cond37.preheader ]
%t.082 = phi i32 [ %div44, %while.body43 ], [ %mul, %while.cond37.preheader ]
%div44 = sdiv i32 %t.082, 2
%mul46 = shl nsw i32 %sum.283, 1
%12 = add i32 %t.082, -2
%cmp38.not = icmp ult i32 %12, -3
%13 = and i32 %div44, 1
%cmp41 = icmp eq i32 %13, 0
%or.cond69 = and i1 %cmp38.not, %cmp41
br i1 %or.cond69, label %while.body43, label %if.end49, !llvm.loop !12
while.cond12.if.end49.loopexit_crit_edge: ; preds = %while.body16
store i32 %div65, ptr %w, align 4, !tbaa !5
br label %if.end49
while.cond25.if.end49.loopexit72_crit_edge: ; preds = %while.body31
store i32 %div32, ptr %h, align 4, !tbaa !5
br label %if.end49
if.end49: ; preds = %while.body43, %while.cond25.preheader, %while.cond25.if.end49.loopexit72_crit_edge, %while.cond37.preheader, %while.cond12.preheader, %while.cond12.if.end49.loopexit_crit_edge, %land.lhs.true
%sum.3 = phi i32 [ 1, %land.lhs.true ], [ %mul17, %while.cond12.if.end49.loopexit_crit_edge ], [ 1, %while.cond12.preheader ], [ 1, %while.cond37.preheader ], [ %mul34, %while.cond25.if.end49.loopexit72_crit_edge ], [ 1, %while.cond25.preheader ], [ %mul46, %while.body43 ]
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp50.not = icmp slt i32 %sum.3, %14
%str.str.4 = select i1 %cmp50.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
%15 = load i32, ptr %c, align 4, !tbaa !5
%dec = add nsw i32 %15, -1
store i32 %dec, ptr %c, align 4, !tbaa !5
%tobool.not = icmp eq i32 %15, 0
br i1 %tobool.not, label %while.end56, label %while.body, !llvm.loop !13
while.end56: ; preds = %if.end49, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
int x[100000], y[100000];
int cnt[100000], cnts[100000], *tree[100000];
int dfs(int a, int b){
int ans = 0, i;
for(i = 0; i < cnt[a]; i++){
if(tree[a][i] == b){
continue;
}
ans ^= dfs(tree[a][i], a) + 1;
}
return ans;
}
int main(void){
int n, i, j;
scanf("%d",&n);
for(i = 0; i < n; i++){
cnt[i] = 0;
cnts[i] = 0;
}
for(i = 0; i < n-1; i++){
scanf("%d%d", &x[i], &y[i]);
x[i]--;
y[i]--;
cnt[x[i]]++;
cnt[y[i]]++;
}
for(i = 0; i < n; i++){
tree[i] = malloc((cnt[i] + 1) * sizeof(int));
}
for(i = 0; i < n-1; i++){
tree[x[i]][cnts[x[i]]++] = y[i];
tree[y[i]][cnts[y[i]]++] = x[i];
}
int ans = dfs(0, -1);
if(ans == 0){
printf("Bob\n");
}else{
printf("Alice\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150353/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150353/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@tree = dso_local local_unnamed_addr global [100000 x ptr] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@cnts = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@x = dso_local global [100000 x i32] zeroinitializer, align 16
@y = dso_local global [100000 x i32] zeroinitializer, align 16
@str = private unnamed_addr constant [6 x i8] c"Alice\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %a to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @cnt, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%arrayidx2 = getelementptr inbounds [100000 x ptr], ptr @tree, i64 0, i64 %idxprom
%1 = load ptr, ptr %arrayidx2, align 8, !tbaa !9
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%ans.018 = phi i32 [ 0, %for.body.lr.ph ], [ %ans.1, %for.inc ]
%arrayidx4 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %2, %b
br i1 %cmp5, label %for.inc, label %if.end
if.end: ; preds = %for.body
%call = tail call i32 @dfs(i32 noundef %2, i32 noundef %a)
%add = add nsw i32 %call, 1
%xor = xor i32 %add, %ans.018
br label %for.inc
for.inc: ; preds = %for.body, %if.end
%ans.1 = phi i32 [ %ans.018, %for.body ], [ %xor, %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 !11
for.end: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1, %for.inc ]
ret i32 %ans.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp103 = icmp sgt i32 %0, 0
br i1 %cmp103, label %for.cond3.preheader, label %for.end73
for.cond3.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @cnt, i8 0, i64 %2, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr nonnull align 16 @cnts, i8 0, i64 %2, i1 false), !tbaa !5
%cmp4106.not = icmp eq i32 %0, 1
br i1 %cmp4106.not, label %for.body31.preheader, label %for.body5
for.cond29.preheader: ; preds = %for.body5
%cmp30108 = icmp sgt i32 %8, 0
br i1 %cmp30108, label %for.body31.preheader, label %for.end73
for.body31.preheader: ; preds = %for.cond3.preheader, %for.cond29.preheader
%3 = phi i32 [ %8, %for.cond29.preheader ], [ 1, %for.cond3.preheader ]
%wide.trip.count = zext i32 %3 to i64
br label %for.body31
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr @x, i64 0, i64 %indvars.iv
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr @y, i64 0, i64 %indvars.iv
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9)
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%dec15 = add nsw i32 %5, -1
store i32 %dec15, ptr %arrayidx9, align 4, !tbaa !5
%idxprom18 = sext i32 %dec to i64
%arrayidx19 = getelementptr inbounds [100000 x i32], ptr @cnt, i64 0, i64 %idxprom18
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%inc20 = add nsw i32 %6, 1
store i32 %inc20, ptr %arrayidx19, align 4, !tbaa !5
%idxprom23 = sext i32 %dec15 to i64
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr @cnt, i64 0, i64 %idxprom23
%7 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%inc25 = add nsw i32 %7, 1
store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %8, -1
%9 = sext i32 %sub to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp4, label %for.body5, label %for.cond29.preheader, !llvm.loop !13
for.cond40.preheader: ; preds = %for.body31
%cmp42111 = icmp ugt i32 %3, 1
br i1 %cmp42111, label %for.body44, label %for.end73
for.body31: ; preds = %for.body31.preheader, %for.body31
%indvars.iv116 = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next117, %for.body31 ]
%arrayidx33 = getelementptr inbounds [100000 x i32], ptr @cnt, i64 0, i64 %indvars.iv116
%10 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%add = add nsw i32 %10, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 2
%call34 = call noalias ptr @malloc(i64 noundef %mul) #8
%arrayidx36 = getelementptr inbounds [100000 x ptr], ptr @tree, i64 0, i64 %indvars.iv116
store ptr %call34, ptr %arrayidx36, align 8, !tbaa !9
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%exitcond.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count
br i1 %exitcond.not, label %for.cond40.preheader, label %for.body31, !llvm.loop !14
for.body44: ; preds = %for.cond40.preheader, %for.body44
%indvars.iv119 = phi i64 [ %indvars.iv.next120, %for.body44 ], [ 0, %for.cond40.preheader ]
%arrayidx46 = getelementptr inbounds [100000 x i32], ptr @y, i64 0, i64 %indvars.iv119
%11 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%arrayidx48 = getelementptr inbounds [100000 x i32], ptr @x, i64 0, i64 %indvars.iv119
%12 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%idxprom49 = sext i32 %12 to i64
%arrayidx50 = getelementptr inbounds [100000 x ptr], ptr @tree, i64 0, i64 %idxprom49
%13 = load ptr, ptr %arrayidx50, align 8, !tbaa !9
%arrayidx54 = getelementptr inbounds [100000 x i32], ptr @cnts, i64 0, i64 %idxprom49
%14 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%inc55 = add nsw i32 %14, 1
store i32 %inc55, ptr %arrayidx54, align 4, !tbaa !5
%idxprom56 = sext i32 %14 to i64
%arrayidx57 = getelementptr inbounds i32, ptr %13, i64 %idxprom56
store i32 %11, ptr %arrayidx57, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%idxprom62 = sext i32 %16 to i64
%arrayidx63 = getelementptr inbounds [100000 x ptr], ptr @tree, i64 0, i64 %idxprom62
%17 = load ptr, ptr %arrayidx63, align 8, !tbaa !9
%arrayidx67 = getelementptr inbounds [100000 x i32], ptr @cnts, i64 0, i64 %idxprom62
%18 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%inc68 = add nsw i32 %18, 1
store i32 %inc68, ptr %arrayidx67, align 4, !tbaa !5
%idxprom69 = sext i32 %18 to i64
%arrayidx70 = getelementptr inbounds i32, ptr %17, i64 %idxprom69
store i32 %15, ptr %arrayidx70, align 4, !tbaa !5
%indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%sub41 = add nsw i32 %19, -1
%20 = sext i32 %sub41 to i64
%cmp42 = icmp slt i64 %indvars.iv.next120, %20
br i1 %cmp42, label %for.body44, label %for.end73, !llvm.loop !15
for.end73: ; preds = %for.body44, %entry, %for.cond29.preheader, %for.cond40.preheader
%call74 = call i32 @dfs(i32 noundef 0, i32 noundef -1)
%cmp75 = icmp eq i32 %call74, 0
%str.4.str = select i1 %cmp75, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
attributes #0 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!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}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
#include <string.h>
int is_substr(char s[], char t[], int i){
int flag = 1;
if(s[i] == '\0') flag = 0;
for(int j = 0; j < strlen(t); ++j, ++i){
if(s[i] != t[j]){
flag = 0;
break;
}
}
return flag;
}
int main(){
char s[100010];
int dp[100010] = {0};
char t[4][8]={"dream","dreamer","erase","eraser"};
scanf("%s", s);
dp[0] = 1;
for(int i = 0; i < strlen(s); ++i){
if(dp[i] == 0) continue;
for(int j = 0; j < 4; ++j){
if(is_substr(s, t[j], i) == 1) dp[i + strlen(t[j])] = 1;
}
}
puts(dp[strlen(s)] ? "YES" : "NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150403/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150403/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i32 @is_substr(ptr nocapture noundef readonly %s, ptr nocapture noundef readonly %t, i32 noundef %i) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp ne i8 %0, 0
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6
%cmp323.not = icmp eq i64 %call, 0
br i1 %cmp323.not, label %cleanup, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.inc ], [ %idxprom, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv28
%1 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%arrayidx9 = getelementptr inbounds i8, ptr %t, i64 %indvars.iv
%2 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11.not = icmp eq i8 %1, %2
br i1 %cmp11.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next29 = add i64 %indvars.iv28, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8
cleanup: ; preds = %for.inc, %for.body, %entry
%flag.0.shrunk = phi i1 [ %cmp, %entry ], [ false, %for.body ], [ %cmp, %for.inc ]
%flag.0 = zext i1 %flag.0.shrunk to i32
ret i32 %flag.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: 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 #3 {
entry:
%s = alloca [100010 x i8], align 16
%dp = alloca [100010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #7
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %dp) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400040) %dp, i8 0, i64 400040, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
store i32 1, ptr %dp, align 16, !tbaa !10
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp45.not = icmp eq i64 %call2, 0
br i1 %cmp45.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %s, i64 1
%invariant.gep82 = getelementptr i8, ptr %s, i64 2
%invariant.gep84 = getelementptr i8, ptr %s, i64 3
%invariant.gep86 = getelementptr i8, ptr %s, i64 4
%invariant.gep88 = getelementptr i8, ptr %s, i64 1
%invariant.gep90 = getelementptr i8, ptr %s, i64 2
%invariant.gep92 = getelementptr i8, ptr %s, i64 3
%invariant.gep94 = getelementptr i8, ptr %s, i64 4
%invariant.gep96 = getelementptr i8, ptr %s, i64 5
%invariant.gep98 = getelementptr i8, ptr %s, i64 6
%invariant.gep100 = getelementptr i8, ptr %s, i64 1
%invariant.gep102 = getelementptr i8, ptr %s, i64 2
%invariant.gep104 = getelementptr i8, ptr %s, i64 3
%invariant.gep106 = getelementptr i8, ptr %s, i64 4
%invariant.gep108 = getelementptr i8, ptr %s, i64 1
%invariant.gep110 = getelementptr i8, ptr %s, i64 2
%invariant.gep112 = getelementptr i8, ptr %s, i64 3
%invariant.gep114 = getelementptr i8, ptr %s, i64 4
%invariant.gep116 = getelementptr i8, ptr %s, i64 5
br label %for.body
for.cond.cleanup: ; preds = %for.inc27, %entry
%arrayidx32 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %call2
%0 = load i32, ptr %arrayidx32, align 4, !tbaa !10
%tobool.not = icmp eq i32 %0, 0
%cond = select i1 %tobool.not, ptr @.str.2, ptr @.str.1
%call33 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %dp) #7
call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #7
ret i32 0
for.body: ; preds = %for.body.preheader, %for.inc27
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc27 ], [ 0, %for.body.preheader ]
%arrayidx4 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !10
%cmp5 = icmp eq i32 %1, 0
br i1 %cmp5, label %for.inc27, label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.body
%arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%.fr = freeze i8 %2
%cmp.i.not = icmp eq i8 %.fr, 0
br i1 %cmp.i.not, label %for.inc27, label %for.body.i
for.body.i: ; preds = %for.cond7.preheader
%arrayidx6.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%3 = load i8, ptr %arrayidx6.i, align 1, !tbaa !5
%cmp11.not.i = icmp eq i8 %3, 100
br i1 %cmp11.not.i, label %for.inc.i, label %for.body.i.1
for.inc.i: ; preds = %for.body.i
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
%4 = load i8, ptr %gep, align 1, !tbaa !5
%cmp11.not.i.156 = icmp eq i8 %4, 114
br i1 %cmp11.not.i.156, label %for.inc.i.161, label %for.body.i.1
for.inc.i.161: ; preds = %for.inc.i
%gep83 = getelementptr i8, ptr %invariant.gep82, i64 %indvars.iv
%5 = load i8, ptr %gep83, align 1, !tbaa !5
%cmp11.not.i.266 = icmp eq i8 %5, 101
br i1 %cmp11.not.i.266, label %for.inc.i.271, label %for.body.i.1
for.inc.i.271: ; preds = %for.inc.i.161
%gep85 = getelementptr i8, ptr %invariant.gep84, i64 %indvars.iv
%6 = load i8, ptr %gep85, align 1, !tbaa !5
%cmp11.not.i.376 = icmp eq i8 %6, 97
br i1 %cmp11.not.i.376, label %for.inc.i.381, label %for.body.i.1
for.inc.i.381: ; preds = %for.inc.i.271
%gep87 = getelementptr i8, ptr %invariant.gep86, i64 %indvars.iv
%7 = load i8, ptr %gep87, align 1, !tbaa !5
%cmp11.not.i.4 = icmp eq i8 %7, 109
br i1 %cmp11.not.i.4, label %for.inc.i.4, label %for.body.i.1
for.inc.i.4: ; preds = %for.inc.i.381
%add = add nuw i64 %indvars.iv, 5
%arrayidx25 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %add
store i32 1, ptr %arrayidx25, align 4, !tbaa !10
br label %for.body.i.1
for.body.i.1: ; preds = %for.inc.i.4, %for.inc.i.381, %for.inc.i.271, %for.inc.i.161, %for.inc.i, %for.body.i
%arrayidx6.i.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%8 = load i8, ptr %arrayidx6.i.1, align 1, !tbaa !5
%cmp11.not.i.1 = icmp eq i8 %8, 100
br i1 %cmp11.not.i.1, label %for.inc.i.1, label %for.body.i.2
for.inc.i.1: ; preds = %for.body.i.1
%gep89 = getelementptr i8, ptr %invariant.gep88, i64 %indvars.iv
%9 = load i8, ptr %gep89, align 1, !tbaa !5
%cmp11.not.i.1.1 = icmp eq i8 %9, 114
br i1 %cmp11.not.i.1.1, label %for.inc.i.1.1, label %for.body.i.2
for.inc.i.1.1: ; preds = %for.inc.i.1
%gep91 = getelementptr i8, ptr %invariant.gep90, i64 %indvars.iv
%10 = load i8, ptr %gep91, align 1, !tbaa !5
%cmp11.not.i.1.2 = icmp eq i8 %10, 101
br i1 %cmp11.not.i.1.2, label %for.inc.i.1.2, label %for.body.i.2
for.inc.i.1.2: ; preds = %for.inc.i.1.1
%gep93 = getelementptr i8, ptr %invariant.gep92, i64 %indvars.iv
%11 = load i8, ptr %gep93, align 1, !tbaa !5
%cmp11.not.i.1.3 = icmp eq i8 %11, 97
br i1 %cmp11.not.i.1.3, label %for.inc.i.1.3, label %for.body.i.2
for.inc.i.1.3: ; preds = %for.inc.i.1.2
%gep95 = getelementptr i8, ptr %invariant.gep94, i64 %indvars.iv
%12 = load i8, ptr %gep95, align 1, !tbaa !5
%cmp11.not.i.1.4 = icmp eq i8 %12, 109
br i1 %cmp11.not.i.1.4, label %for.inc.i.1.4, label %for.body.i.2
for.inc.i.1.4: ; preds = %for.inc.i.1.3
%gep97 = getelementptr i8, ptr %invariant.gep96, i64 %indvars.iv
%13 = load i8, ptr %gep97, align 1, !tbaa !5
%cmp11.not.i.1.5 = icmp eq i8 %13, 101
br i1 %cmp11.not.i.1.5, label %for.inc.i.1.5, label %for.body.i.2
for.inc.i.1.5: ; preds = %for.inc.i.1.4
%gep99 = getelementptr i8, ptr %invariant.gep98, i64 %indvars.iv
%14 = load i8, ptr %gep99, align 1, !tbaa !5
%cmp11.not.i.1.6 = icmp eq i8 %14, 114
br i1 %cmp11.not.i.1.6, label %for.inc.i.1.6, label %for.body.i.2
for.inc.i.1.6: ; preds = %for.inc.i.1.5
%add.1 = add nuw i64 %indvars.iv, 7
%arrayidx25.1 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %add.1
store i32 1, ptr %arrayidx25.1, align 4, !tbaa !10
br label %for.body.i.2
for.body.i.2: ; preds = %for.inc.i.1.6, %for.inc.i.1.5, %for.inc.i.1.4, %for.inc.i.1.3, %for.inc.i.1.2, %for.inc.i.1.1, %for.inc.i.1, %for.body.i.1
%arrayidx6.i.2 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%15 = load i8, ptr %arrayidx6.i.2, align 1, !tbaa !5
%cmp11.not.i.2 = icmp eq i8 %15, 101
br i1 %cmp11.not.i.2, label %for.inc.i.2, label %for.body.i.3
for.inc.i.2: ; preds = %for.body.i.2
%gep101 = getelementptr i8, ptr %invariant.gep100, i64 %indvars.iv
%16 = load i8, ptr %gep101, align 1, !tbaa !5
%cmp11.not.i.2.1 = icmp eq i8 %16, 114
br i1 %cmp11.not.i.2.1, label %for.inc.i.2.1, label %for.body.i.3
for.inc.i.2.1: ; preds = %for.inc.i.2
%gep103 = getelementptr i8, ptr %invariant.gep102, i64 %indvars.iv
%17 = load i8, ptr %gep103, align 1, !tbaa !5
%cmp11.not.i.2.2 = icmp eq i8 %17, 97
br i1 %cmp11.not.i.2.2, label %for.inc.i.2.2, label %for.body.i.3
for.inc.i.2.2: ; preds = %for.inc.i.2.1
%gep105 = getelementptr i8, ptr %invariant.gep104, i64 %indvars.iv
%18 = load i8, ptr %gep105, align 1, !tbaa !5
%cmp11.not.i.2.3 = icmp eq i8 %18, 115
br i1 %cmp11.not.i.2.3, label %for.inc.i.2.3, label %for.body.i.3
for.inc.i.2.3: ; preds = %for.inc.i.2.2
%gep107 = getelementptr i8, ptr %invariant.gep106, i64 %indvars.iv
%19 = load i8, ptr %gep107, align 1, !tbaa !5
%cmp11.not.i.2.4 = icmp eq i8 %19, 101
br i1 %cmp11.not.i.2.4, label %for.inc.i.2.4, label %for.body.i.3
for.inc.i.2.4: ; preds = %for.inc.i.2.3
%add.2 = add nuw i64 %indvars.iv, 5
%arrayidx25.2 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %add.2
store i32 1, ptr %arrayidx25.2, align 4, !tbaa !10
br label %for.body.i.3
for.body.i.3: ; preds = %for.inc.i.2.4, %for.inc.i.2.3, %for.inc.i.2.2, %for.inc.i.2.1, %for.inc.i.2, %for.body.i.2
%arrayidx6.i.3 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%20 = load i8, ptr %arrayidx6.i.3, align 1, !tbaa !5
%cmp11.not.i.3 = icmp eq i8 %20, 101
br i1 %cmp11.not.i.3, label %for.inc.i.3, label %for.inc27
for.inc.i.3: ; preds = %for.body.i.3
%gep109 = getelementptr i8, ptr %invariant.gep108, i64 %indvars.iv
%21 = load i8, ptr %gep109, align 1, !tbaa !5
%cmp11.not.i.3.1 = icmp eq i8 %21, 114
br i1 %cmp11.not.i.3.1, label %for.inc.i.3.1, label %for.inc27
for.inc.i.3.1: ; preds = %for.inc.i.3
%gep111 = getelementptr i8, ptr %invariant.gep110, i64 %indvars.iv
%22 = load i8, ptr %gep111, align 1, !tbaa !5
%cmp11.not.i.3.2 = icmp eq i8 %22, 97
br i1 %cmp11.not.i.3.2, label %for.inc.i.3.2, label %for.inc27
for.inc.i.3.2: ; preds = %for.inc.i.3.1
%gep113 = getelementptr i8, ptr %invariant.gep112, i64 %indvars.iv
%23 = load i8, ptr %gep113, align 1, !tbaa !5
%cmp11.not.i.3.3 = icmp eq i8 %23, 115
br i1 %cmp11.not.i.3.3, label %for.inc.i.3.3, label %for.inc27
for.inc.i.3.3: ; preds = %for.inc.i.3.2
%gep115 = getelementptr i8, ptr %invariant.gep114, i64 %indvars.iv
%24 = load i8, ptr %gep115, align 1, !tbaa !5
%cmp11.not.i.3.4 = icmp eq i8 %24, 101
br i1 %cmp11.not.i.3.4, label %for.inc.i.3.4, label %for.inc27
for.inc.i.3.4: ; preds = %for.inc.i.3.3
%gep117 = getelementptr i8, ptr %invariant.gep116, i64 %indvars.iv
%25 = load i8, ptr %gep117, align 1, !tbaa !5
%cmp11.not.i.3.5 = icmp eq i8 %25, 114
br i1 %cmp11.not.i.3.5, label %for.inc.i.3.5, label %for.inc27
for.inc.i.3.5: ; preds = %for.inc.i.3.4
%add.3 = add nuw i64 %indvars.iv, 6
%arrayidx25.3 = getelementptr inbounds [100010 x i32], ptr %dp, i64 0, i64 %add.3
store i32 1, ptr %arrayidx25.3, align 4, !tbaa !10
br label %for.inc27
for.inc27: ; preds = %for.body.i.3, %for.inc.i.3, %for.inc.i.3.1, %for.inc.i.3.2, %for.inc.i.3.3, %for.inc.i.3.4, %for.inc.i.3.5, %for.cond7.preheader, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call2
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define BUF_SIZE 100100
char* strmap[] = {
"dream",
"dreamer",
"eraser",
"erase",
};
int main(void) {
char line[BUF_SIZE];
FILE* fp = stdin;
if(!fgets(line, BUF_SIZE, fp)) return 0;
char *tmp;
int len = 0;
for(tmp = line; *tmp != '\n'; tmp++, len++) ;
int i, j;
int flag = 1;
for(i = len-1; i >= 0;) {
int step = 0;
int size = sizeof(strmap)/sizeof(char*);
for(j = 0; j < size; j++) {
int len = strlen(strmap[j]);
if(i-len+1>=0 && !strncmp(&line[i-len+1], strmap[j], len)) {
step = len;
break;
}
}
if(!step) {
flag = 0; break;
}
i -= step;
}
printf("%s\n", flag ? "YES" : "NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150447/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150447/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"dream\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"dreamer\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"eraser\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"erase\00", align 1
@strmap = dso_local local_unnamed_addr global [4 x ptr] [ptr @.str, ptr @.str.1, ptr @.str.2, ptr @.str.3], align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%line = alloca [100100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100100, ptr nonnull %line) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 100100, ptr noundef %0)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup47, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%1 = load i8, ptr %line, align 16, !tbaa !9
%cmp.not73 = icmp eq i8 %1, 10
br i1 %cmp.not73, label %for.end, label %for.inc
for.inc: ; preds = %for.cond.preheader, %for.inc
%len.075 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%tmp.074 = phi ptr [ %incdec.ptr, %for.inc ], [ %line, %for.cond.preheader ]
%incdec.ptr = getelementptr inbounds i8, ptr %tmp.074, i64 1
%inc = add nuw nsw i32 %len.075, 1
%2 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp.not = icmp eq i8 %2, 10
br i1 %cmp.not, label %for.end, label %for.inc, !llvm.loop !10
for.end: ; preds = %for.inc, %for.cond.preheader
%len.0.lcssa = phi i32 [ -1, %for.cond.preheader ], [ %len.075, %for.inc ]
%3 = load ptr, ptr @strmap, align 16
%4 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @strmap, i64 0, i64 1), align 8
%5 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @strmap, i64 0, i64 2), align 16
%6 = load ptr, ptr getelementptr inbounds ([4 x ptr], ptr @strmap, i64 0, i64 3), align 8
br label %for.cond3
for.cond3: ; preds = %for.end30, %for.end
%i.0 = phi i32 [ %len.0.lcssa, %for.end ], [ %sub34.pre-phi, %for.end30 ]
%cmp4 = icmp sgt i32 %i.0, -1
br i1 %cmp4, label %for.body10.preheader, label %.critedge
for.body10.preheader: ; preds = %for.cond3
%call12 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #6
%conv13 = trunc i64 %call12 to i32
%sub14 = sub nsw i32 %i.0, %conv13
%cmp15 = icmp sgt i32 %sub14, -2
br i1 %cmp15, label %land.lhs.true, label %for.inc28
land.lhs.true: ; preds = %for.body10.preheader
%add = add nsw i32 %sub14, 1
%idxprom19 = zext i32 %add to i64
%arrayidx20 = getelementptr inbounds [100100 x i8], ptr %line, i64 0, i64 %idxprom19
%sext = shl i64 %call12, 32
%conv23 = ashr exact i64 %sext, 32
%call24 = call i32 @strncmp(ptr noundef nonnull %arrayidx20, ptr noundef %3, i64 noundef %conv23) #6
%tobool25.not = icmp eq i32 %call24, 0
br i1 %tobool25.not, label %for.end30, label %for.inc28
for.inc28: ; preds = %for.body10.preheader, %land.lhs.true
%call12.1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #6
%conv13.1 = trunc i64 %call12.1 to i32
%sub14.1 = sub nsw i32 %i.0, %conv13.1
%cmp15.1 = icmp sgt i32 %sub14.1, -2
br i1 %cmp15.1, label %land.lhs.true.1, label %for.inc28.1
land.lhs.true.1: ; preds = %for.inc28
%add.1 = add nsw i32 %sub14.1, 1
%idxprom19.1 = zext i32 %add.1 to i64
%arrayidx20.1 = getelementptr inbounds [100100 x i8], ptr %line, i64 0, i64 %idxprom19.1
%sext.1 = shl i64 %call12.1, 32
%conv23.1 = ashr exact i64 %sext.1, 32
%call24.1 = call i32 @strncmp(ptr noundef nonnull %arrayidx20.1, ptr noundef %4, i64 noundef %conv23.1) #6
%tobool25.not.1 = icmp eq i32 %call24.1, 0
br i1 %tobool25.not.1, label %for.end30, label %for.inc28.1
for.inc28.1: ; preds = %land.lhs.true.1, %for.inc28
%call12.2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #6
%conv13.2 = trunc i64 %call12.2 to i32
%sub14.2 = sub nsw i32 %i.0, %conv13.2
%cmp15.2 = icmp sgt i32 %sub14.2, -2
br i1 %cmp15.2, label %land.lhs.true.2, label %for.inc28.2
land.lhs.true.2: ; preds = %for.inc28.1
%add.2 = add nsw i32 %sub14.2, 1
%idxprom19.2 = zext i32 %add.2 to i64
%arrayidx20.2 = getelementptr inbounds [100100 x i8], ptr %line, i64 0, i64 %idxprom19.2
%sext.2 = shl i64 %call12.2, 32
%conv23.2 = ashr exact i64 %sext.2, 32
%call24.2 = call i32 @strncmp(ptr noundef nonnull %arrayidx20.2, ptr noundef %5, i64 noundef %conv23.2) #6
%tobool25.not.2 = icmp eq i32 %call24.2, 0
br i1 %tobool25.not.2, label %for.end30, label %for.inc28.2
for.inc28.2: ; preds = %land.lhs.true.2, %for.inc28.1
%call12.3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %6) #6
%conv13.3 = trunc i64 %call12.3 to i32
%sub14.3 = sub nsw i32 %i.0, %conv13.3
%cmp15.3 = icmp sgt i32 %sub14.3, -2
br i1 %cmp15.3, label %land.lhs.true.3, label %.critedge
land.lhs.true.3: ; preds = %for.inc28.2
%add.3 = add nsw i32 %sub14.3, 1
%idxprom19.3 = zext i32 %add.3 to i64
%arrayidx20.3 = getelementptr inbounds [100100 x i8], ptr %line, i64 0, i64 %idxprom19.3
%sext.3 = shl i64 %call12.3, 32
%conv23.3 = ashr exact i64 %sext.3, 32
%call24.3 = call i32 @strncmp(ptr noundef nonnull %arrayidx20.3, ptr noundef %6, i64 noundef %conv23.3) #6
%tobool25.not.3 = icmp eq i32 %call24.3, 0
br i1 %tobool25.not.3, label %for.end30, label %.critedge
for.end30: ; preds = %land.lhs.true.3, %land.lhs.true.2, %land.lhs.true.1, %land.lhs.true
%sub34.pre-phi = phi i32 [ %sub14.3, %land.lhs.true.3 ], [ %sub14.2, %land.lhs.true.2 ], [ %sub14.1, %land.lhs.true.1 ], [ %sub14, %land.lhs.true ]
%conv13.lcssa = phi i32 [ %conv13.3, %land.lhs.true.3 ], [ %conv13.2, %land.lhs.true.2 ], [ %conv13.1, %land.lhs.true.1 ], [ %conv13, %land.lhs.true ]
%tobool31.not = icmp eq i32 %conv13.lcssa, 0
br i1 %tobool31.not, label %.critedge, label %for.cond3
.critedge: ; preds = %for.cond3, %for.end30, %for.inc28.2, %land.lhs.true.3
%7 = phi ptr [ @.str.6, %land.lhs.true.3 ], [ @.str.6, %for.inc28.2 ], [ @.str.5, %for.cond3 ], [ @.str.6, %for.end30 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %7)
br label %cleanup47
cleanup47: ; preds = %entry, %.critedge
call void @llvm.lifetime.end.p0(i64 100100, ptr nonnull %line) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = !{!"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"}
|
#include<stdio.h>
#include<string.h>
int main(){
char s[100000],s5[6],s6[7],s7[8];
int i,n,flag;
scanf("%s",s);
n=strlen(s);
s7[7]=s6[6]=s5[5]='\0';
for(i=n-1;i>=0;i-=flag){
for(int j=0;j<7;j++){
s7[j]=s[i-6+j];
if(j>0)
s6[j-1]=s[i-6+j];
if(j>1)
s5[j-2]=s[i-6+j];
}
if(strcmp(s7,"dreamer")==0)
flag=7;
else if(strcmp(s6,"eraser")==0)
flag=6;
else if(strcmp(s5,"dream")==0||strcmp(s5,"erase")==0)
flag=5;
else{
printf("NO\n");
return 0;
}
}
printf("YES\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"dreamer\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"eraser\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"dream\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"erase\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100000 x i8], align 16
%s5 = alloca [6 x i8], align 1
%s6 = alloca [7 x i8], align 1
%s7 = alloca [8 x i8], align 1
call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #7
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s5) #7
call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %s6) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s7) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #8
%conv = trunc i64 %call2 to i32
%arrayidx = getelementptr inbounds [6 x i8], ptr %s5, i64 0, i64 5
store i8 0, ptr %arrayidx, align 1, !tbaa !5
%arrayidx3 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 6
store i8 0, ptr %arrayidx3, align 1, !tbaa !5
%arrayidx4 = getelementptr inbounds [8 x i8], ptr %s7, i64 0, i64 7
store i8 0, ptr %arrayidx4, align 1, !tbaa !5
%cmp88 = icmp sgt i32 %conv, 0
br i1 %cmp88, label %for.cond6.preheader.preheader, label %cleanup
for.cond6.preheader.preheader: ; preds = %entry
%sub = add nsw i32 %conv, -1
%scevgep = getelementptr i8, ptr %s, i64 -6
%arrayidx22.2 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 1
%arrayidx22.3 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 2
%arrayidx32.3 = getelementptr inbounds [6 x i8], ptr %s5, i64 0, i64 1
%arrayidx22.4 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 3
%arrayidx32.4 = getelementptr inbounds [6 x i8], ptr %s5, i64 0, i64 2
%arrayidx22.5 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 4
%arrayidx32.5 = getelementptr inbounds [6 x i8], ptr %s5, i64 0, i64 3
%arrayidx22.6 = getelementptr inbounds [7 x i8], ptr %s6, i64 0, i64 5
%arrayidx32.6 = getelementptr inbounds [6 x i8], ptr %s5, i64 0, i64 4
br label %for.inc.6
for.inc.6: ; preds = %for.cond6.preheader.preheader, %for.inc59
%i.089 = phi i32 [ %sub60, %for.inc59 ], [ %sub, %for.cond6.preheader.preheader ]
%sub10 = add nsw i32 %i.089, -6
%0 = zext i32 %i.089 to i64
%scevgep90 = getelementptr i8, ptr %scevgep, i64 %0
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %s7, ptr noundef nonnull align 1 dereferenceable(7) %scevgep90, i64 7, i1 false), !tbaa !5
%1 = sext i32 %sub10 to i64
%2 = add nsw i64 %1, 1
%arrayidx11.1 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %2
%3 = load i8, ptr %arrayidx11.1, align 1, !tbaa !5
store i8 %3, ptr %s6, align 1, !tbaa !5
%4 = add nsw i64 %1, 2
%arrayidx11.2 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %4
%5 = load i8, ptr %arrayidx11.2, align 1, !tbaa !5
store i8 %5, ptr %arrayidx22.2, align 1, !tbaa !5
store i8 %5, ptr %s5, align 1, !tbaa !5
%6 = add nsw i64 %1, 3
%arrayidx11.3 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %6
%7 = load i8, ptr %arrayidx11.3, align 1, !tbaa !5
store i8 %7, ptr %arrayidx22.3, align 1, !tbaa !5
store i8 %7, ptr %arrayidx32.3, align 1, !tbaa !5
%8 = add nsw i64 %1, 4
%arrayidx11.4 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %8
%9 = load i8, ptr %arrayidx11.4, align 1, !tbaa !5
store i8 %9, ptr %arrayidx22.4, align 1, !tbaa !5
store i8 %9, ptr %arrayidx32.4, align 1, !tbaa !5
%10 = add nsw i64 %1, 5
%arrayidx11.5 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %10
%11 = load i8, ptr %arrayidx11.5, align 1, !tbaa !5
store i8 %11, ptr %arrayidx22.5, align 1, !tbaa !5
store i8 %11, ptr %arrayidx32.5, align 1, !tbaa !5
%12 = add nsw i64 %1, 6
%arrayidx11.6 = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %12
%13 = load i8, ptr %arrayidx11.6, align 1, !tbaa !5
store i8 %13, ptr %arrayidx22.6, align 1, !tbaa !5
store i8 %13, ptr %arrayidx32.6, align 1, !tbaa !5
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %s7, ptr noundef nonnull dereferenceable(8) @.str.1, i64 8)
%cmp36 = icmp eq i32 %bcmp, 0
br i1 %cmp36, label %for.inc59, label %if.else
if.else: ; preds = %for.inc.6
%bcmp82 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %s6, ptr noundef nonnull dereferenceable(7) @.str.2, i64 7)
%cmp41 = icmp eq i32 %bcmp82, 0
br i1 %cmp41, label %for.inc59, label %if.else44
if.else44: ; preds = %if.else
%bcmp83 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %s5, ptr noundef nonnull dereferenceable(6) @.str.3, i64 6)
%cmp47 = icmp eq i32 %bcmp83, 0
br i1 %cmp47, label %for.inc59, label %lor.lhs.false
lor.lhs.false: ; preds = %if.else44
%bcmp84 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %s5, ptr noundef nonnull dereferenceable(6) @.str.4, i64 6)
%cmp51 = icmp eq i32 %bcmp84, 0
br i1 %cmp51, label %for.inc59, label %cleanup
for.inc59: ; preds = %if.else44, %lor.lhs.false, %if.else, %for.inc.6
%flag.0.neg = phi i32 [ -7, %for.inc.6 ], [ -6, %if.else ], [ -5, %lor.lhs.false ], [ -5, %if.else44 ]
%sub60 = add nsw i32 %flag.0.neg, %i.089
%cmp = icmp sgt i32 %sub60, -1
br i1 %cmp, label %for.inc.6, label %cleanup, !llvm.loop !8
cleanup: ; preds = %for.inc59, %lor.lhs.false, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str.7, %lor.lhs.false ], [ @str, %for.inc59 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s7) #7
call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %s6) #7
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s5) #7
call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5
; 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) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#define ll_int long long int
typedef struct data_t{
ll_int data;
struct data_t *next;
}DATA_T;
DATA_T *BOX;
DATA_T **LAST_IN;
// 配列の初期化
void Init(int n)
{
int i;
for(i = 0; i < n; i++)
LAST_IN[i] = &BOX[i];
}
// 指定した添え字の箱の末尾へデータを追加
void Push_back(int t, ll_int x)
{
DATA_T *p;
if( (p = (DATA_T *)malloc(sizeof(DATA_T))) == NULL){
printf("malloc error\n");
exit(1);
}
p->data = x;
p->next = NULL;
LAST_IN[t]->next = p;
LAST_IN[t] = p;
}
// 内容の表示
void Dump(int t)
{
DATA_T *p;
if(LAST_IN[t] == &BOX[t]){
printf("\n");
return;
}
for(p = BOX[t].next; p != NULL; p = p->next){
printf("%lld", p->data);
if(p->next != NULL)
printf(" ");
}
printf("\n");
}
// 指定した配列の内容をクリア
void Clear(int t)
{
LAST_IN[t] = &BOX[t];
}
// LsをLtの末尾に接合する
void Splice(int s, int t)
{
LAST_IN[t]->next = BOX[s].next;
LAST_IN[t] = LAST_IN[s];
Clear(s);
}
int main()
{
int n, q;
int query, s, t;
ll_int x;
int i;
scanf("%d %d", &n, &q);
BOX = (DATA_T *)malloc(sizeof(DATA_T) * n);
LAST_IN = (DATA_T **)malloc(sizeof(DATA_T *) * n);
Init(n);
for(i = 0; i < q; i++){
scanf("%d", &query);
if(query == 0){
scanf("%d %lld", &t, &x);
Push_back(t, x);
}else if(query == 1){
scanf("%d", &t);
Dump(t);
}else if(query == 2){
scanf("%d %d", &s, &t);
Splice(s, t);
}
}
return 0;
}
/*
topic1のVector2を改良して、
新たな機能を持たせただけ
*/
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150533/source.c"
target datalayout = "e-m:e-p270: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.data_t = type { i64, ptr }
@BOX = dso_local local_unnamed_addr global ptr null, align 8
@LAST_IN = dso_local local_unnamed_addr global ptr null, align 8
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.6 = private unnamed_addr constant [8 x i8] c"%d %lld\00", align 1
@str = private unnamed_addr constant [13 x i8] c"malloc error\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @Init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp6 = icmp sgt i32 %n, 0
br i1 %cmp6, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 3
%0 = icmp ult i32 %n, 4
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%1 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx = getelementptr inbounds %struct.data_t, ptr %1, i64 %indvars.iv
%2 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv
store ptr %arrayidx, ptr %arrayidx2, align 8, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%3 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.1 = getelementptr inbounds %struct.data_t, ptr %3, i64 %indvars.iv.next
%4 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.1 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next
store ptr %arrayidx.1, ptr %arrayidx2.1, align 8, !tbaa !5
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%5 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.2 = getelementptr inbounds %struct.data_t, ptr %5, i64 %indvars.iv.next.1
%6 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.2 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next.1
store ptr %arrayidx.2, ptr %arrayidx2.2, align 8, !tbaa !5
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%7 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.3 = getelementptr inbounds %struct.data_t, ptr %7, i64 %indvars.iv.next.2
%8 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.3 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv.next.2
store ptr %arrayidx.3, ptr %arrayidx2.3, align 8, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%9 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.epil = getelementptr inbounds %struct.data_t, ptr %9, i64 %indvars.iv.epil
%10 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.epil = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv.epil
store ptr %arrayidx.epil, ptr %arrayidx2.epil, align 8, !tbaa !5
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %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: nounwind uwtable
define dso_local void @Push_back(i32 noundef %t, i64 noundef %x) local_unnamed_addr #2 {
entry:
%call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #10
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
tail call void @exit(i32 noundef 1) #11
unreachable
if.end: ; preds = %entry
store i64 %x, ptr %call, align 8, !tbaa !13
%next = getelementptr inbounds %struct.data_t, ptr %call, i64 0, i32 1
store ptr null, ptr %next, align 8, !tbaa !16
%0 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom = sext i32 %t to i64
%arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom
%1 = load ptr, ptr %arrayidx, align 8, !tbaa !5
%next2 = getelementptr inbounds %struct.data_t, ptr %1, i64 0, i32 1
store ptr %call, ptr %next2, align 8, !tbaa !16
store ptr %call, ptr %arrayidx, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @Dump(i32 noundef %t) local_unnamed_addr #6 {
entry:
%0 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom = sext i32 %t to i64
%arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom
%1 = load ptr, ptr %arrayidx, align 8, !tbaa !5
%2 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds %struct.data_t, ptr %2, i64 %idxprom
%cmp = icmp eq ptr %1, %arrayidx2
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%next = getelementptr inbounds %struct.data_t, ptr %2, i64 %idxprom, i32 1
%p.021 = load ptr, ptr %next, align 8, !tbaa !16
%cmp5.not22 = icmp eq ptr %p.021, null
br i1 %cmp5.not22, label %cleanup, label %for.body
for.body: ; preds = %if.end, %for.inc
%p.023 = phi ptr [ %p.0.pre, %for.inc ], [ %p.021, %if.end ]
%3 = load i64, ptr %p.023, align 8, !tbaa !13
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %3)
%next7 = getelementptr inbounds %struct.data_t, ptr %p.023, i64 0, i32 1
%4 = load ptr, ptr %next7, align 8, !tbaa !16
%cmp8.not = icmp eq ptr %4, null
br i1 %cmp8.not, label %cleanup, label %for.inc
for.inc: ; preds = %for.body
%putchar19 = tail call i32 @putchar(i32 32)
%p.0.pre = load ptr, ptr %next7, align 8, !tbaa !16
%cmp5.not = icmp eq ptr %p.0.pre, null
br i1 %cmp5.not, label %cleanup, label %for.body, !llvm.loop !17
cleanup: ; preds = %for.inc, %for.body, %if.end, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @Clear(i32 noundef %t) local_unnamed_addr #7 {
entry:
%0 = load ptr, ptr @BOX, align 8, !tbaa !5
%idxprom = sext i32 %t to i64
%arrayidx = getelementptr inbounds %struct.data_t, ptr %0, i64 %idxprom
%1 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds ptr, ptr %1, i64 %idxprom
store ptr %arrayidx, ptr %arrayidx2, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @Splice(i32 noundef %s, i32 noundef %t) local_unnamed_addr #8 {
entry:
%0 = load ptr, ptr @BOX, align 8, !tbaa !5
%idxprom = sext i32 %s to i64
%next = getelementptr inbounds %struct.data_t, ptr %0, i64 %idxprom, i32 1
%1 = load ptr, ptr %next, align 8, !tbaa !16
%2 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom1 = sext i32 %t to i64
%arrayidx2 = getelementptr inbounds ptr, ptr %2, i64 %idxprom1
%3 = load ptr, ptr %arrayidx2, align 8, !tbaa !5
%next3 = getelementptr inbounds %struct.data_t, ptr %3, i64 0, i32 1
store ptr %1, ptr %next3, align 8, !tbaa !16
%arrayidx5 = getelementptr inbounds ptr, ptr %2, i64 %idxprom
%4 = load ptr, ptr %arrayidx5, align 8, !tbaa !5
store ptr %4, ptr %arrayidx2, align 8, !tbaa !5
%5 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i = getelementptr inbounds %struct.data_t, ptr %5, i64 %idxprom
%6 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i = getelementptr inbounds ptr, ptr %6, i64 %idxprom
store ptr %arrayidx.i, ptr %arrayidx2.i, align 8, !tbaa !5
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%query = alloca i32, align 4
%s = alloca i32, align 4
%t = alloca i32, align 4
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %query) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #12
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i32, ptr %n, align 4, !tbaa !18
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 4
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
store ptr %call1, ptr @BOX, align 8, !tbaa !5
%mul3 = shl nsw i64 %conv, 3
%call4 = call noalias ptr @malloc(i64 noundef %mul3) #10
store ptr %call4, ptr @LAST_IN, align 8, !tbaa !5
%cmp6.i = icmp sgt i32 %0, 0
br i1 %cmp6.i, label %for.body.preheader.i, label %Init.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count.i, 3
%1 = icmp ult i32 %0, 4
br i1 %1, label %Init.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %wide.trip.count.i, 4294967292
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.3, %for.body.i ]
%2 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i = getelementptr inbounds %struct.data_t, ptr %2, i64 %indvars.iv.i
%3 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv.i
store ptr %arrayidx.i, ptr %arrayidx2.i, align 8, !tbaa !5
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%4 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i.1 = getelementptr inbounds %struct.data_t, ptr %4, i64 %indvars.iv.next.i
%5 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i.1 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv.next.i
store ptr %arrayidx.i.1, ptr %arrayidx2.i.1, align 8, !tbaa !5
%indvars.iv.next.i.1 = or i64 %indvars.iv.i, 2
%6 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i.2 = getelementptr inbounds %struct.data_t, ptr %6, i64 %indvars.iv.next.i.1
%7 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i.2 = getelementptr inbounds ptr, ptr %7, i64 %indvars.iv.next.i.1
store ptr %arrayidx.i.2, ptr %arrayidx2.i.2, align 8, !tbaa !5
%indvars.iv.next.i.2 = or i64 %indvars.iv.i, 3
%8 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i.3 = getelementptr inbounds %struct.data_t, ptr %8, i64 %indvars.iv.next.i.2
%9 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i.3 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv.next.i.2
store ptr %arrayidx.i.3, ptr %arrayidx2.i.3, align 8, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %Init.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9
Init.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %Init.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %Init.exit.loopexit.unr-lcssa, %for.body.i.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %for.body.i.epil ], [ %indvars.iv.i.unr, %Init.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %Init.exit.loopexit.unr-lcssa ]
%10 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i.epil = getelementptr inbounds %struct.data_t, ptr %10, i64 %indvars.iv.i.epil
%11 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i.epil = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv.i.epil
store ptr %arrayidx.i.epil, ptr %arrayidx2.i.epil, align 8, !tbaa !5
%indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %Init.exit, label %for.body.i.epil, !llvm.loop !20
Init.exit: ; preds = %Init.exit.loopexit.unr-lcssa, %for.body.i.epil, %entry
%12 = load i32, ptr %q, align 4, !tbaa !18
%cmp32 = icmp sgt i32 %12, 0
br i1 %cmp32, label %for.body, label %for.end
for.body: ; preds = %Init.exit, %for.inc
%i.033 = phi i32 [ %inc, %for.inc ], [ 0, %Init.exit ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %query)
%13 = load i32, ptr %query, align 4, !tbaa !18
switch i32 %13, label %for.inc [
i32 0, label %if.then
i32 1, label %if.then12
i32 2, label %if.then17
]
if.then: ; preds = %for.body
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %t, ptr noundef nonnull %x)
%14 = load i32, ptr %t, align 4, !tbaa !18
%15 = load i64, ptr %x, align 8, !tbaa !21
%call.i = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #10
%cmp.i = icmp eq ptr %call.i, null
br i1 %cmp.i, label %if.then.i, label %Push_back.exit
if.then.i: ; preds = %if.then
%puts.i = call i32 @puts(ptr nonnull dereferenceable(1) @str)
call void @exit(i32 noundef 1) #11
unreachable
Push_back.exit: ; preds = %if.then
store i64 %15, ptr %call.i, align 8, !tbaa !13
%next.i = getelementptr inbounds %struct.data_t, ptr %call.i, i64 0, i32 1
store ptr null, ptr %next.i, align 8, !tbaa !16
%16 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom.i = sext i32 %14 to i64
%arrayidx.i22 = getelementptr inbounds ptr, ptr %16, i64 %idxprom.i
%17 = load ptr, ptr %arrayidx.i22, align 8, !tbaa !5
%next2.i = getelementptr inbounds %struct.data_t, ptr %17, i64 0, i32 1
store ptr %call.i, ptr %next2.i, align 8, !tbaa !16
store ptr %call.i, ptr %arrayidx.i22, align 8, !tbaa !5
br label %for.inc
if.then12: ; preds = %for.body
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %t)
%18 = load i32, ptr %t, align 4, !tbaa !18
%19 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom.i23 = sext i32 %18 to i64
%arrayidx.i24 = getelementptr inbounds ptr, ptr %19, i64 %idxprom.i23
%20 = load ptr, ptr %arrayidx.i24, align 8, !tbaa !5
%21 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx2.i25 = getelementptr inbounds %struct.data_t, ptr %21, i64 %idxprom.i23
%cmp.i26 = icmp eq ptr %20, %arrayidx2.i25
br i1 %cmp.i26, label %Dump.exit, label %if.end.i
if.end.i: ; preds = %if.then12
%next.i27 = getelementptr inbounds %struct.data_t, ptr %21, i64 %idxprom.i23, i32 1
%p.021.i = load ptr, ptr %next.i27, align 8, !tbaa !16
%cmp5.not22.i = icmp eq ptr %p.021.i, null
br i1 %cmp5.not22.i, label %Dump.exit, label %for.body.i28
for.body.i28: ; preds = %if.end.i, %for.inc.i
%p.023.i = phi ptr [ %p.0.pre.i, %for.inc.i ], [ %p.021.i, %if.end.i ]
%22 = load i64, ptr %p.023.i, align 8, !tbaa !13
%call6.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %22)
%next7.i = getelementptr inbounds %struct.data_t, ptr %p.023.i, i64 0, i32 1
%23 = load ptr, ptr %next7.i, align 8, !tbaa !16
%cmp8.not.i = icmp eq ptr %23, null
br i1 %cmp8.not.i, label %Dump.exit, label %for.inc.i
for.inc.i: ; preds = %for.body.i28
%putchar19.i = call i32 @putchar(i32 32)
%p.0.pre.i = load ptr, ptr %next7.i, align 8, !tbaa !16
%cmp5.not.i = icmp eq ptr %p.0.pre.i, null
br i1 %cmp5.not.i, label %Dump.exit, label %for.body.i28, !llvm.loop !17
Dump.exit: ; preds = %for.body.i28, %for.inc.i, %if.then12, %if.end.i
%putchar.i = call i32 @putchar(i32 10)
br label %for.inc
if.then17: ; preds = %for.body
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %s, ptr noundef nonnull %t)
%24 = load i32, ptr %s, align 4, !tbaa !18
%25 = load i32, ptr %t, align 4, !tbaa !18
%26 = load ptr, ptr @BOX, align 8, !tbaa !5
%idxprom.i29 = sext i32 %24 to i64
%next.i30 = getelementptr inbounds %struct.data_t, ptr %26, i64 %idxprom.i29, i32 1
%27 = load ptr, ptr %next.i30, align 8, !tbaa !16
%28 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%idxprom1.i = sext i32 %25 to i64
%arrayidx2.i31 = getelementptr inbounds ptr, ptr %28, i64 %idxprom1.i
%29 = load ptr, ptr %arrayidx2.i31, align 8, !tbaa !5
%next3.i = getelementptr inbounds %struct.data_t, ptr %29, i64 0, i32 1
store ptr %27, ptr %next3.i, align 8, !tbaa !16
%arrayidx5.i = getelementptr inbounds ptr, ptr %28, i64 %idxprom.i29
%30 = load ptr, ptr %arrayidx5.i, align 8, !tbaa !5
store ptr %30, ptr %arrayidx2.i31, align 8, !tbaa !5
%31 = load ptr, ptr @BOX, align 8, !tbaa !5
%arrayidx.i.i = getelementptr inbounds %struct.data_t, ptr %31, i64 %idxprom.i29
%32 = load ptr, ptr @LAST_IN, align 8, !tbaa !5
%arrayidx2.i.i = getelementptr inbounds ptr, ptr %32, i64 %idxprom.i29
store ptr %arrayidx.i.i, ptr %arrayidx2.i.i, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %Push_back.exit, %if.then17, %Dump.exit
%inc = add nuw nsw i32 %i.033, 1
%33 = load i32, ptr %q, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %33
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %Init.exit
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %query) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #9
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = !{!14, !15, i64 0}
!14 = !{!"data_t", !15, i64 0, !6, i64 8}
!15 = !{!"long long", !7, i64 0}
!16 = !{!14, !6, i64 8}
!17 = distinct !{!17, !10}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = distinct !{!20, !12}
!21 = !{!15, !15, i64 0}
!22 = distinct !{!22, !10}
|
#include <stdio.h>
int main(void)
{
int a,b,x;
scanf("%d%d%d",&a,&b,&x);
if(a<=x && a+b>=x)printf("YES\n");
else printf("NO\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%x = 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 %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %0
%cmp1.not = icmp slt i32 %add, %1
br i1 %cmp1.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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(){
long long int t;
scanf("%lld",&t);
while(t--){
int w,h,n,c=1;
scanf("%d%d%d",&w,&h,&n);
if(w%2!=0&&h%2!=0){
c=1;
}else{
while(w%2==0 && w>1){
c*=2;
w/=2;
}
while(h%2==0 && h>1){
c*=2;
h/=2;
}
}
if(c>=n){
printf("YES\n");
}else{
printf("NO\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec43 = add nsw i64 %0, -1
store i64 %dec43, ptr %t, align 8, !tbaa !5
%tobool.not44 = icmp eq i64 %0, 0
br i1 %tobool.not44, label %while.end25, label %while.body
while.body: ; preds = %entry, %if.end
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%1 = load i32, ptr %w, align 4
%2 = and i32 %1, 1
%cmp.not = icmp eq i32 %2, 0
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %while.body
%3 = load i32, ptr %h, align 4, !tbaa !9
%4 = and i32 %3, 1
%cmp3.not = icmp eq i32 %4, 0
br i1 %cmp3.not, label %while.cond9.preheader, label %if.end
if.else: ; preds = %while.body
%cmp734 = icmp sgt i32 %1, 1
%5 = and i1 %cmp734, %cmp.not
br i1 %5, label %while.body8, label %while.cond9.preheader
while.cond4.while.cond9.preheader_crit_edge: ; preds = %while.body8
store i32 %div30, ptr %w, align 4, !tbaa !9
br label %while.cond9.preheader
while.cond9.preheader: ; preds = %land.lhs.true, %while.cond4.while.cond9.preheader_crit_edge, %if.else
%c.0.lcssa = phi i32 [ %mul, %while.cond4.while.cond9.preheader_crit_edge ], [ 1, %if.else ], [ 1, %land.lhs.true ]
%h.promoted = load i32, ptr %h, align 4
%6 = and i32 %h.promoted, 1
%cmp1138 = icmp eq i32 %6, 0
%cmp1339 = icmp sgt i32 %h.promoted, 1
%7 = and i1 %cmp1339, %cmp1138
br i1 %7, label %while.body15, label %if.end
while.body8: ; preds = %if.else, %while.body8
%c.036 = phi i32 [ %mul, %while.body8 ], [ 1, %if.else ]
%div303235 = phi i32 [ %div30, %while.body8 ], [ %1, %if.else ]
%mul = shl nsw i32 %c.036, 1
%div30 = lshr i32 %div303235, 1
%8 = and i32 %div303235, 2
%cmp6 = icmp eq i32 %8, 0
%cmp7 = icmp ugt i32 %div303235, 3
%9 = and i1 %cmp7, %cmp6
br i1 %9, label %while.body8, label %while.cond4.while.cond9.preheader_crit_edge, !llvm.loop !11
while.body15: ; preds = %while.cond9.preheader, %while.body15
%c.141 = phi i32 [ %mul16, %while.body15 ], [ %c.0.lcssa, %while.cond9.preheader ]
%div17293740 = phi i32 [ %div1729, %while.body15 ], [ %h.promoted, %while.cond9.preheader ]
%mul16 = shl nsw i32 %c.141, 1
%div1729 = lshr i32 %div17293740, 1
%10 = and i32 %div17293740, 2
%cmp11 = icmp eq i32 %10, 0
%cmp13 = icmp ugt i32 %div17293740, 3
%11 = and i1 %cmp13, %cmp11
br i1 %11, label %while.body15, label %while.cond9.if.end.loopexit_crit_edge, !llvm.loop !13
while.cond9.if.end.loopexit_crit_edge: ; preds = %while.body15
store i32 %div1729, ptr %h, align 4, !tbaa !9
br label %if.end
if.end: ; preds = %while.cond9.preheader, %while.cond9.if.end.loopexit_crit_edge, %land.lhs.true
%c.2 = phi i32 [ 1, %land.lhs.true ], [ %mul16, %while.cond9.if.end.loopexit_crit_edge ], [ %c.0.lcssa, %while.cond9.preheader ]
%12 = load i32, ptr %n, align 4, !tbaa !9
%cmp19.not = icmp slt i32 %c.2, %12
%str.str.4 = select i1 %cmp19.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
%13 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %13, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %13, 0
br i1 %tobool.not, label %while.end25, label %while.body, !llvm.loop !14
while.end25: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main (void){
int a,b,x;
scanf("%d%d%d",&a,&b,&x);
if(a <= x && x <= a + b){
printf("YES");
} else {
printf("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150663/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150663/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = 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 %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %0
%cmp1.not = icmp sgt i32 %1, %add
br i1 %cmp1.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ]
%call3 = 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 %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 %d",&a,&b,&x);
if(x>=a && x<=a+b)
printf("YES");
else
printf("NO");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150706/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150706/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = 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 %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%cmp1.not = icmp sgt i32 %0, %add
br i1 %cmp1.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ]
%call3 = 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 %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<math.h>
#include<string.h>
int main()
{
int x;
scanf("%d",&x);
while(x--)
{
int w,h,n,ans=0,i=1;
scanf("%d%d%d",&w,&h,&n);
if(n==1)
printf("YES\n");
else
{
while(w%2==0 || h%2==0)
{
if(w%2==0)
{
w=w/2;
ans=pow(2,i);
}
else if(h%2==0)
{
h=h/2;
ans=pow(2,i);
}
i++;
}
if(ans>=n)
printf("YES\n");
else
printf("NO\n");
//printf("%d\n",ans);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15075/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15075/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.5 = 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:
%x = alloca i32, align 4
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%dec37 = add nsw i32 %0, -1
store i32 %dec37, ptr %x, align 4, !tbaa !5
%tobool.not38 = icmp eq i32 %0, 0
br i1 %tobool.not38, label %while.end31, label %while.body
while.body: ; preds = %entry, %if.end30
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %1, 1
br i1 %cmp, label %if.end30, label %while.cond3
while.cond3: ; preds = %while.body, %if.end22
%ans.0 = phi i32 [ %ans.1, %if.end22 ], [ 0, %while.body ]
%i.0 = phi i32 [ %inc, %if.end22 ], [ 1, %while.body ]
%2 = load i32, ptr %w, align 4, !tbaa !5
%3 = and i32 %2, 1
%cmp4 = icmp eq i32 %3, 0
br i1 %cmp4, label %if.then10, label %lor.rhs
lor.rhs: ; preds = %while.cond3
%4 = load i32, ptr %h, align 4, !tbaa !5
%5 = and i32 %4, 1
%cmp6 = icmp eq i32 %5, 0
br i1 %cmp6, label %if.then17, label %while.end
if.then10: ; preds = %while.cond3
%div = sdiv i32 %2, 2
store i32 %div, ptr %w, align 4, !tbaa !5
br label %if.end22
if.then17: ; preds = %lor.rhs
%div18 = sdiv i32 %4, 2
store i32 %div18, ptr %h, align 4, !tbaa !5
br label %if.end22
if.end22: ; preds = %if.then17, %if.then10
%ldexp = call double @ldexp(double 1.000000e+00, i32 %i.0) #5
%ans.1 = fptosi double %ldexp to i32
%inc = add nuw nsw i32 %i.0, 1
br label %while.cond3, !llvm.loop !9
while.end: ; preds = %lor.rhs
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp23.not = icmp slt i32 %ans.0, %6
%str.str.4 = select i1 %cmp23.not, ptr @str, ptr @str.5
br label %if.end30
if.end30: ; preds = %while.end, %while.body
%str.4.sink = phi ptr [ @str.5, %while.body ], [ %str.str.4, %while.end ]
%puts34 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
%7 = load i32, ptr %x, align 4, !tbaa !5
%dec = add nsw i32 %7, -1
store i32 %dec, ptr %x, align 4, !tbaa !5
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %while.end31, label %while.body, !llvm.loop !11
while.end31: ; preds = %if.end30, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 willreturn
declare double @ldexp(double, i32) 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 = { nofree nounwind }
attributes #4 = { nofree willreturn }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main() {
int a, b, x;
scanf("%d %d %d", &a, &b, &x);
if (a <= x && x <= a + b)
printf("YES");
else
printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150807/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150807/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = 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 %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %0
%cmp1.not = icmp sgt i32 %1, %add
br i1 %cmp1.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ]
%call3 = 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 %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 %d",&A,&B,&X);
if(X-A>B || A>X){
printf("NO");
}else{
printf("YES");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150850/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150850/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"NO\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = 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 %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %B, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%cmp1 = icmp sgt i32 %1, %0
%or.cond = or i1 %cmp1, %cmp
%.str.1..str.2 = select i1 %or.cond, 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 %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int n,a,b;
scanf("%d %d %d",&n,&a,&b);
int max,min;
if(a>b){
max=b;
min=a-(n-b);
}else{
max=a;
min=b-(n-a);
}
if(min<0)min=0;
printf("%d %d",max,min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_150995/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_150995/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%d %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 i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub.neg = add i32 %1, %0
%sub1 = sub i32 %sub.neg, %2
%. = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%spec.store.select = call i32 @llvm.smax.i32(i32 %sub1, i32 0)
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %., i32 noundef %spec.store.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char T[1000],P[1000];
scanf("%s %s",T,P);
//printf("%s ,%s\n\n",T,P);
int Tlen = strlen(T),Plen = strlen(P),iC;
//printf("check 1,Tlen=%d,Plen=%d\n",Tlen,Plen);
for(int i=0;i<=Tlen-Plen;i++)
{
//printf("check count=%d\n",i);
if(T[i] == P[0])
{
iC = i;
for(int m=0;m<Plen;m++)
{
if(T[iC] != P[m]) break;
if(m == Plen-1)
{
printf("%d\n",i);
break;
}
iC += 1;
}
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151044/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151044/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca [1000 x i8], align 16
%P = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %T) #4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %P) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T, ptr noundef nonnull %P)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #5
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %P) #5
%call5.fr = freeze i64 %call5
%conv6 = trunc i64 %call5.fr to i32
%cmp.not51 = icmp sge i32 %conv, %conv6
%cmp1448 = icmp sgt i32 %conv6, 0
%or.cond = and i1 %cmp.not51, %cmp1448
br i1 %or.cond, label %for.body.us.preheader, label %for.cond.cleanup
for.body.us.preheader: ; preds = %entry
%sub27 = add i64 %call5.fr, 4294967295
%0 = and i64 %sub27, 4294967295
%1 = add i64 %call3, 1
%2 = sub i64 %1, %call5.fr
%wide.trip.count = and i64 %2, 4294967295
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %for.inc34.us
%indvars.iv55 = phi i64 [ 0, %for.body.us.preheader ], [ %indvars.iv.next56, %for.inc34.us ]
%arrayidx.us = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv55
%3 = load i8, ptr %arrayidx.us, align 1, !tbaa !5
%4 = load i8, ptr %P, align 16, !tbaa !5
%cmp11.us = icmp eq i8 %3, %4
br i1 %cmp11.us, label %for.body17.us.preheader, label %for.inc34.us
for.body17.us.preheader: ; preds = %for.body.us
%arrayidx19.us63 = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv55
%5 = load i8, ptr %arrayidx19.us63, align 1, !tbaa !5
%6 = load i8, ptr %P, align 16, !tbaa !5
%cmp24.not.us64 = icmp eq i8 %5, %6
br i1 %cmp24.not.us64, label %if.end.us, label %for.inc34.us
if.end.us: ; preds = %for.body17.us.preheader, %if.end32.us
%indvars.iv66 = phi i64 [ %indvars.iv.next, %if.end32.us ], [ 0, %for.body17.us.preheader ]
%indvars.iv5765 = phi i64 [ %indvars.iv.next58, %if.end32.us ], [ %indvars.iv55, %for.body17.us.preheader ]
%cmp28.us = icmp eq i64 %indvars.iv66, %0
br i1 %cmp28.us, label %if.then30.us, label %if.end32.us
if.end32.us: ; preds = %if.end.us
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv5765, 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv66, 1
%arrayidx19.us = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv.next58
%7 = load i8, ptr %arrayidx19.us, align 1, !tbaa !5
%arrayidx22.us = getelementptr inbounds [1000 x i8], ptr %P, i64 0, i64 %indvars.iv.next
%8 = load i8, ptr %arrayidx22.us, align 1, !tbaa !5
%cmp24.not.us = icmp eq i8 %7, %8
br i1 %cmp24.not.us, label %if.end.us, label %for.inc34.us
if.then30.us: ; preds = %if.end.us
%9 = trunc i64 %indvars.iv55 to i32
%call31.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
br label %for.inc34.us
for.inc34.us: ; preds = %if.end32.us, %for.body17.us.preheader, %if.then30.us, %for.body.us
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body.us, !llvm.loop !8
for.cond.cleanup: ; preds = %for.inc34.us, %entry
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %P) #4
call void @llvm.lifetime.end.p0(i64 1000, 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main() {
char T[1000], P[1000];
int i, j;
int a;
scanf("%s", T);
scanf("%s", P);
for (i = 0; i < strlen(T); i++)
{
a = 0;
if (T[i] == P[0])
{
a = 1;
for (j = 0; j < strlen(P); j++)
{
if (T[i+j] != P[j])
{
a = 0;
break;
}
}
}
if (a == 1)
{
printf("%d\n", i);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151088/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151088/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca [1000 x i8], align 16
%P = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %T) #4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %P) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %P)
%char0 = load i8, ptr %T, align 16
%cmp47.not = icmp eq i8 %char0, 0
br i1 %cmp47.not, label %for.end35, label %for.body
for.body: ; preds = %entry, %for.inc33
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.inc33 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %indvars.iv52
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = load i8, ptr %P, align 16, !tbaa !5
%cmp9 = icmp eq i8 %0, %1
br i1 %cmp9, label %for.cond11.preheader, label %for.inc33
for.cond11.preheader: ; preds = %for.body
%call14 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %P) #5
%cmp1543.not = icmp eq i64 %call14, 0
br i1 %cmp1543.not, label %if.then30.critedge, label %for.body17
for.cond11: ; preds = %for.body17
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call14
br i1 %exitcond.not, label %if.then30.critedge, label %for.body17, !llvm.loop !8
for.body17: ; preds = %for.cond11.preheader, %for.cond11
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond11 ], [ 0, %for.cond11.preheader ]
%2 = add nuw nsw i64 %indvars.iv, %indvars.iv52
%arrayidx19 = getelementptr inbounds [1000 x i8], ptr %T, i64 0, i64 %2
%3 = load i8, ptr %arrayidx19, align 1, !tbaa !5
%arrayidx22 = getelementptr inbounds [1000 x i8], ptr %P, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%cmp24.not = icmp eq i8 %3, %4
br i1 %cmp24.not, label %for.cond11, label %for.inc33
if.then30.critedge: ; preds = %for.cond11, %for.cond11.preheader
%5 = trunc i64 %indvars.iv52 to i32
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
br label %for.inc33
for.inc33: ; preds = %for.body17, %for.body, %if.then30.critedge
%indvars.iv.next53 = add nuw i64 %indvars.iv52, 1
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #5
%cmp = icmp ugt i64 %call4, %indvars.iv.next53
br i1 %cmp, label %for.body, label %for.end35, !llvm.loop !10
for.end35: ; preds = %for.inc33, %entry
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %P) #4
call void @llvm.lifetime.end.p0(i64 1000, 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
int main(void)
{
int n,m,i,j,k,x,y,co;
int a[5000],b[5000],cost[5000];
int size[100],root[100];
int wk,sum;
while(1) {
scanf("%d %d",&n,&m);
if(n==0 && m==0) break;
for(i=0;i<m;i++) {
scanf("%d %d %d",&a[i],&b[i],&cost[i]);
}
for(i=0;i<m-1;i++) {
for(j=i+1;j<m;j++) {
if(cost[i]>cost[j]) {
wk=cost[i]; cost[i]=cost[j]; cost[j]=wk;
wk=a[i]; a[i]=a[j]; a[j]=wk;
wk=b[i]; b[i]=b[j]; b[j]=wk;
}
}
}
for(i=0;i<n;i++) {
root[i]=i;
size[i]=1;
}
sum=0;
for(i=0;i<m;i++) {
x=a[i]; y=b[i]; co=cost[i];
while(root[x]!=x) x=root[x];
while(root[y]!=y) y=root[y];
if(x!=y) {
sum+=co;
if(size[x]>size[y]) {
root[y]=x;
}
else if(size[x]<size[y]) {
root[x]=y;
}
else {
root[x]=y;
size[y]++;
}
}
}
printf("%d\n",sum);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151130/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151130/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%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:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [5000 x i32], align 16
%b = alloca [5000 x i32], align 16
%cost = alloca [5000 x i32], align 16
%size = alloca [100 x i32], align 16
%root = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %cost) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %size) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %root) #3
%call189 = 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
%cmp190 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp1191 = icmp eq i32 %1, 0
%or.cond192 = select i1 %cmp190, i1 %cmp1191, i1 false
br i1 %or.cond192, label %while.end117, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end115
%2 = phi i32 [ %27, %for.end115 ], [ %1, %entry ]
%cmp2175 = icmp sgt i32 %2, 0
br i1 %cmp2175, label %for.body, label %for.cond51.preheader
for.cond8.preheader: ; preds = %for.body
%cmp9179 = icmp sgt i32 %4, 1
br i1 %cmp9179, label %for.body10.preheader, label %for.cond51.preheader
for.body10.preheader: ; preds = %for.cond8.preheader
%sub = add nsw i32 %4, -1
%3 = zext i32 %4 to i64
%wide.trip.count203 = zext i32 %sub to i64
%wide.trip.count = zext i32 %4 to i64
br label %for.body10
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [5000 x i32], ptr %b, i64 0, i64 %indvars.iv
%arrayidx6 = getelementptr inbounds [5000 x i32], ptr %cost, i64 0, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %m, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp2, label %for.body, label %for.cond8.preheader, !llvm.loop !9
for.cond8.loopexit: ; preds = %for.inc45, %for.body10
%indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
%exitcond204.not = icmp eq i64 %indvars.iv.next201, %wide.trip.count203
br i1 %exitcond204.not, label %for.cond51.preheader, label %for.body10, !llvm.loop !11
for.cond51.preheader: ; preds = %for.cond8.loopexit, %for.cond.preheader, %for.cond8.preheader
%.lcssa217 = phi i32 [ %4, %for.cond8.preheader ], [ %2, %for.cond.preheader ], [ %4, %for.cond8.loopexit ]
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp52181 = icmp sgt i32 %6, 0
br i1 %cmp52181, label %for.body53.preheader, label %for.cond61.preheader
for.body53.preheader: ; preds = %for.cond51.preheader
%wide.trip.count208 = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body53.preheader221, label %vector.ph
vector.ph: ; preds = %for.body53.preheader
%n.vec = and i64 %wide.trip.count208, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%7 = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> %step.add, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds [100 x i32], ptr %size, i64 0, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %10, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count208
br i1 %cmp.n, label %for.cond61.preheader, label %for.body53.preheader221
for.body53.preheader221: ; preds = %for.body53.preheader, %middle.block
%indvars.iv205.ph = phi i64 [ 0, %for.body53.preheader ], [ %n.vec, %middle.block ]
br label %for.body53
for.body10: ; preds = %for.body10.preheader, %for.cond8.loopexit
%indvars.iv200 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next201, %for.cond8.loopexit ]
%indvars.iv195 = phi i64 [ 1, %for.body10.preheader ], [ %indvars.iv.next196, %for.cond8.loopexit ]
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%cmp12177 = icmp ult i64 %indvars.iv.next201, %3
br i1 %cmp12177, label %for.body13.lr.ph, label %for.cond8.loopexit
for.body13.lr.ph: ; preds = %for.body10
%arrayidx15 = getelementptr inbounds [5000 x i32], ptr %cost, i64 0, i64 %indvars.iv200
%arrayidx29 = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv200
%arrayidx37 = getelementptr inbounds [5000 x i32], ptr %b, i64 0, i64 %indvars.iv200
br label %for.body13
for.body13: ; preds = %for.body13.lr.ph, %for.inc45
%indvars.iv197 = phi i64 [ %indvars.iv195, %for.body13.lr.ph ], [ %indvars.iv.next198, %for.inc45 ]
%12 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [5000 x i32], ptr %cost, i64 0, i64 %indvars.iv197
%13 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %12, %13
br i1 %cmp18, label %if.then19, label %for.inc45
if.then19: ; preds = %for.body13
store i32 %13, ptr %arrayidx15, align 4, !tbaa !5
store i32 %12, ptr %arrayidx17, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%arrayidx31 = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv197
%15 = load i32, ptr %arrayidx31, align 4, !tbaa !5
store i32 %15, ptr %arrayidx29, align 4, !tbaa !5
store i32 %14, ptr %arrayidx31, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%arrayidx39 = getelementptr inbounds [5000 x i32], ptr %b, i64 0, i64 %indvars.iv197
%17 = load i32, ptr %arrayidx39, align 4, !tbaa !5
store i32 %17, ptr %arrayidx37, align 4, !tbaa !5
store i32 %16, ptr %arrayidx39, align 4, !tbaa !5
br label %for.inc45
for.inc45: ; preds = %for.body13, %if.then19
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%exitcond.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count
br i1 %exitcond.not, label %for.cond8.loopexit, label %for.body13, !llvm.loop !15
for.cond61.preheader: ; preds = %for.body53, %middle.block, %for.cond51.preheader
%cmp62185 = icmp sgt i32 %.lcssa217, 0
br i1 %cmp62185, label %for.body63.preheader, label %for.end115
for.body63.preheader: ; preds = %for.cond61.preheader
%wide.trip.count213 = zext i32 %.lcssa217 to i64
br label %for.body63
for.body53: ; preds = %for.body53.preheader221, %for.body53
%indvars.iv205 = phi i64 [ %indvars.iv.next206, %for.body53 ], [ %indvars.iv205.ph, %for.body53.preheader221 ]
%arrayidx55 = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %indvars.iv205
%18 = trunc i64 %indvars.iv205 to i32
store i32 %18, ptr %arrayidx55, align 4, !tbaa !5
%arrayidx57 = getelementptr inbounds [100 x i32], ptr %size, i64 0, i64 %indvars.iv205
store i32 1, ptr %arrayidx57, align 4, !tbaa !5
%indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
%exitcond209.not = icmp eq i64 %indvars.iv.next206, %wide.trip.count208
br i1 %exitcond209.not, label %for.cond61.preheader, label %for.body53, !llvm.loop !16
for.body63: ; preds = %for.body63.preheader, %for.inc113
%indvars.iv210 = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next211, %for.inc113 ]
%sum.0187 = phi i32 [ 0, %for.body63.preheader ], [ %sum.1, %for.inc113 ]
%arrayidx65 = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv210
%19 = load i32, ptr %arrayidx65, align 4, !tbaa !5
%arrayidx67 = getelementptr inbounds [5000 x i32], ptr %b, i64 0, i64 %indvars.iv210
%20 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%arrayidx69 = getelementptr inbounds [5000 x i32], ptr %cost, i64 0, i64 %indvars.iv210
%21 = load i32, ptr %arrayidx69, align 4, !tbaa !5
br label %while.cond70
while.cond70: ; preds = %while.cond70, %for.body63
%x.0 = phi i32 [ %19, %for.body63 ], [ %22, %while.cond70 ]
%idxprom71 = sext i32 %x.0 to i64
%arrayidx72 = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %idxprom71
%22 = load i32, ptr %arrayidx72, align 4, !tbaa !5
%cmp73.not = icmp eq i32 %22, %x.0
br i1 %cmp73.not, label %while.cond77.preheader, label %while.cond70, !llvm.loop !17
while.cond77.preheader: ; preds = %while.cond70
%arrayidx72.le = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %idxprom71
br label %while.cond77
while.cond77: ; preds = %while.cond77.preheader, %while.cond77
%y.0 = phi i32 [ %23, %while.cond77 ], [ %20, %while.cond77.preheader ]
%idxprom78 = sext i32 %y.0 to i64
%arrayidx79 = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %idxprom78
%23 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%cmp80.not = icmp eq i32 %23, %y.0
br i1 %cmp80.not, label %while.end84, label %while.cond77, !llvm.loop !18
while.end84: ; preds = %while.cond77
%arrayidx79.le = getelementptr inbounds [100 x i32], ptr %root, i64 0, i64 %idxprom78
%cmp85.not = icmp eq i32 %x.0, %y.0
br i1 %cmp85.not, label %for.inc113, label %if.then86
if.then86: ; preds = %while.end84
%add87 = add nsw i32 %21, %sum.0187
%arrayidx89 = getelementptr inbounds [100 x i32], ptr %size, i64 0, i64 %idxprom71
%24 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%arrayidx91 = getelementptr inbounds [100 x i32], ptr %size, i64 0, i64 %idxprom78
%25 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%cmp92 = icmp sgt i32 %24, %25
br i1 %cmp92, label %if.then93, label %if.else
if.then93: ; preds = %if.then86
store i32 %x.0, ptr %arrayidx79.le, align 4, !tbaa !5
br label %for.inc113
if.else: ; preds = %if.then86
%cmp100 = icmp slt i32 %24, %25
store i32 %y.0, ptr %arrayidx72.le, align 4, !tbaa !5
br i1 %cmp100, label %for.inc113, label %if.else104
if.else104: ; preds = %if.else
%inc109 = add nsw i32 %25, 1
store i32 %inc109, ptr %arrayidx91, align 4, !tbaa !5
br label %for.inc113
for.inc113: ; preds = %if.else, %while.end84, %if.else104, %if.then93
%sum.1 = phi i32 [ %add87, %if.then93 ], [ %add87, %if.else104 ], [ %sum.0187, %while.end84 ], [ %add87, %if.else ]
%indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
%exitcond214.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count213
br i1 %exitcond214.not, label %for.end115, label %for.body63, !llvm.loop !19
for.end115: ; preds = %for.inc113, %for.cond61.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ %sum.1, %for.inc113 ]
%call116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%26 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %26, 0
%27 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %27, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end117, label %for.cond.preheader
while.end117: ; preds = %for.end115, %entry
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %root) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %size) #3
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %cost) #3
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
// AOJ 1060: No Story
// 2017.10.7 bal4u@uu
// 2017.12.15
#include <stdio.h>
#include <math.h>
#define MAX 1000004
int power[100], sz;
char tbl[1000006];
int psz;
int ptbl[78500] = { // ptbl[166] = 997, ptbl[78498] = 999983
3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
947, 953, 967, 971, 977, 983, 991, 997 };
void sieve()
{
int i, j, k;
for (i = 0; i < 167; i++) {
k = ptbl[i];
for (j = k*k; j < MAX; j += k) tbl[j] = 1;
}
for (psz = 166, i = 997; i <= MAX; i += 2) if (!tbl[i]) ptbl[psz++] = i;
ptbl[psz] = 0;
}
void prime_factor(long long n)
{
int a, k;
int *pp;
sz = 0;
if (!(n & 1)) {
power[sz] = 0;
do n >>= 1, power[sz]++;
while (!(n & 1));
sz++;
}
if (n <= 1) return;
if (n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
k = (int)sqrt((double)n);
for (pp = ptbl; n > 1; pp++) {
if (*pp > k || n <= MAX && !tbl[n]) { power[sz++] = 1; break; }
if (n % *pp) continue;
a = *pp, power[sz] = 0;
do n /= a, power[sz]++;
while (n % a == 0);
sz++;
}
}
int main()
{
long long n, ans;
int i;
sieve();
while (scanf("%lld", &n) && n > 0) {
if (n == 1) { puts("1"); continue; }
if (n <= MAX && (n & 1) && !tbl[n]) { puts("2"); continue; }
prime_factor(n);
for (ans = 1, i = 0; i < sz; i++) ans = ans * (1 + (power[i] << 1));
printf("%lld\n", (ans+1)>>1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ptbl = dso_local local_unnamed_addr global <{ [167 x i32], [78333 x i32] }> <{ [167 x i32] [i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 37, i32 41, i32 43, i32 47, i32 53, i32 59, i32 61, i32 67, i32 71, i32 73, i32 79, i32 83, i32 89, i32 97, i32 101, i32 103, i32 107, i32 109, i32 113, i32 127, i32 131, i32 137, i32 139, i32 149, i32 151, i32 157, i32 163, i32 167, i32 173, i32 179, i32 181, i32 191, i32 193, i32 197, i32 199, i32 211, i32 223, i32 227, i32 229, i32 233, i32 239, i32 241, i32 251, i32 257, i32 263, i32 269, i32 271, i32 277, i32 281, i32 283, i32 293, i32 307, i32 311, i32 313, i32 317, i32 331, i32 337, i32 347, i32 349, i32 353, i32 359, i32 367, i32 373, i32 379, i32 383, i32 389, i32 397, i32 401, i32 409, i32 419, i32 421, i32 431, i32 433, i32 439, i32 443, i32 449, i32 457, i32 461, i32 463, i32 467, i32 479, i32 487, i32 491, i32 499, i32 503, i32 509, i32 521, i32 523, i32 541, i32 547, i32 557, i32 563, i32 569, i32 571, i32 577, i32 587, i32 593, i32 599, i32 601, i32 607, i32 613, i32 617, i32 619, i32 631, i32 641, i32 643, i32 647, i32 653, i32 659, i32 661, i32 673, i32 677, i32 683, i32 691, i32 701, i32 709, i32 719, i32 727, i32 733, i32 739, i32 743, i32 751, i32 757, i32 761, i32 769, i32 773, i32 787, i32 797, i32 809, i32 811, i32 821, i32 823, i32 827, i32 829, i32 839, i32 853, i32 857, i32 859, i32 863, i32 877, i32 881, i32 883, i32 887, i32 907, i32 911, i32 919, i32 929, i32 937, i32 941, i32 947, i32 953, i32 967, i32 971, i32 977, i32 983, i32 991, i32 997], [78333 x i32] zeroinitializer }>, align 16
@tbl = dso_local local_unnamed_addr global [1000006 x i8] zeroinitializer, align 16
@psz = dso_local local_unnamed_addr global i32 0, align 4
@sz = dso_local local_unnamed_addr global i32 0, align 4
@power = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"1\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"2\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @sieve() local_unnamed_addr #0 {
entry:
br label %for.body
for.body: ; preds = %for.inc6.1, %entry
%indvars.iv39 = phi i64 [ 0, %entry ], [ %indvars.iv.next40.1, %for.inc6.1 ]
%arrayidx = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %indvars.iv39
%0 = load i32, ptr %arrayidx, align 8, !tbaa !5
%mul = mul nsw i32 %0, %0
%cmp231 = icmp ult i32 %mul, 1000004
br i1 %cmp231, label %for.body3.preheader, label %for.inc6
for.body3.preheader: ; preds = %for.body
%1 = zext i32 %mul to i64
%2 = sext i32 %0 to i64
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv = phi i64 [ %1, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx5 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv
store i8 1, ptr %arrayidx5, align 1, !tbaa !9
%indvars.iv.next = add i64 %indvars.iv, %2
%cmp2 = icmp slt i64 %indvars.iv.next, 1000004
br i1 %cmp2, label %for.body3, label %for.inc6, !llvm.loop !10
for.inc6: ; preds = %for.body3, %for.body
%indvars.iv.next40 = or i64 %indvars.iv39, 1
%exitcond.not = icmp eq i64 %indvars.iv.next40, 167
br i1 %exitcond.not, label %for.end7, label %for.body.1, !llvm.loop !12
for.body.1: ; preds = %for.inc6
%arrayidx.1 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %indvars.iv.next40
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %3, %3
%cmp231.1 = icmp ult i32 %mul.1, 1000004
br i1 %cmp231.1, label %for.body3.preheader.1, label %for.inc6.1
for.body3.preheader.1: ; preds = %for.body.1
%4 = zext i32 %mul.1 to i64
%5 = sext i32 %3 to i64
br label %for.body3.1
for.body3.1: ; preds = %for.body3.1, %for.body3.preheader.1
%indvars.iv.1 = phi i64 [ %4, %for.body3.preheader.1 ], [ %indvars.iv.next.1, %for.body3.1 ]
%arrayidx5.1 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv.1
store i8 1, ptr %arrayidx5.1, align 1, !tbaa !9
%indvars.iv.next.1 = add i64 %indvars.iv.1, %5
%cmp2.1 = icmp slt i64 %indvars.iv.next.1, 1000004
br i1 %cmp2.1, label %for.body3.1, label %for.inc6.1, !llvm.loop !10
for.inc6.1: ; preds = %for.body3.1, %for.body.1
%indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39, 2
br label %for.body
for.end7: ; preds = %for.inc6
store i32 166, ptr @psz, align 4, !tbaa !5
br label %for.body10
for.body10: ; preds = %for.inc16.1, %for.end7
%indvars.iv42 = phi i64 [ 997, %for.end7 ], [ %indvars.iv.next43.1, %for.inc16.1 ]
%inc133536 = phi i32 [ 166, %for.end7 ], [ %11, %for.inc16.1 ]
%arrayidx12 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv42
%6 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%tobool.not = icmp eq i8 %6, 0
br i1 %tobool.not, label %if.then, label %for.inc16
if.then: ; preds = %for.body10
%inc13 = add nsw i32 %inc133536, 1
store i32 %inc13, ptr @psz, align 4, !tbaa !5
%idxprom14 = sext i32 %inc133536 to i64
%arrayidx15 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom14
%7 = trunc i64 %indvars.iv42 to i32
store i32 %7, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc16
for.inc16: ; preds = %for.body10, %if.then
%8 = phi i32 [ %inc133536, %for.body10 ], [ %inc13, %if.then ]
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 2
%arrayidx12.1 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv.next43
%9 = load i8, ptr %arrayidx12.1, align 1, !tbaa !9
%tobool.not.1 = icmp eq i8 %9, 0
br i1 %tobool.not.1, label %if.then.1, label %for.inc16.1
if.then.1: ; preds = %for.inc16
%inc13.1 = add nsw i32 %8, 1
store i32 %inc13.1, ptr @psz, align 4, !tbaa !5
%idxprom14.1 = sext i32 %8 to i64
%arrayidx15.1 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom14.1
%10 = trunc i64 %indvars.iv.next43 to i32
store i32 %10, ptr %arrayidx15.1, align 4, !tbaa !5
br label %for.inc16.1
for.inc16.1: ; preds = %if.then.1, %for.inc16
%11 = phi i32 [ %8, %for.inc16 ], [ %inc13.1, %if.then.1 ]
%indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 4
%cmp9.1 = icmp ult i64 %indvars.iv42, 1000001
br i1 %cmp9.1, label %for.body10, label %for.end18, !llvm.loop !13
for.end18: ; preds = %for.inc16.1
%idxprom19 = sext i32 %11 to i64
%arrayidx20 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom19
store i32 0, ptr %arrayidx20, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @prime_factor(i64 noundef %n) local_unnamed_addr #2 {
entry:
store i32 0, ptr @sz, align 4, !tbaa !5
%and = and i64 %n, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %do.body, label %if.end
do.body: ; preds = %entry, %do.body
%0 = phi i32 [ %inc, %do.body ], [ 0, %entry ]
%n.addr.0 = phi i64 [ %shr, %do.body ], [ %n, %entry ]
%shr = ashr i64 %n.addr.0, 1
%inc = add nuw nsw i32 %0, 1
%1 = and i64 %n.addr.0, 2
%tobool4.not = icmp eq i64 %1, 0
br i1 %tobool4.not, label %do.body, label %do.end, !llvm.loop !14
do.end: ; preds = %do.body
store i32 %inc, ptr @power, align 16, !tbaa !5
store i32 1, ptr @sz, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %do.end, %entry
%2 = phi i32 [ 0, %entry ], [ 1, %do.end ]
%n.addr.1 = phi i64 [ %n, %entry ], [ %shr, %do.end ]
%cmp = icmp slt i64 %n.addr.1, 2
br i1 %cmp, label %cleanup, label %if.end7
if.end7: ; preds = %if.end
%cmp8 = icmp ult i64 %n.addr.1, 1000005
br i1 %cmp8, label %land.lhs.true, label %for.body.preheader
land.lhs.true: ; preds = %if.end7
%arrayidx9 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %n.addr.1
%3 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%tobool10.not = icmp eq i8 %3, 0
br i1 %tobool10.not, label %if.then11, label %for.body.preheader
if.then11: ; preds = %land.lhs.true
%inc12 = add nuw nsw i32 %2, 1
store i32 %inc12, ptr @sz, align 4, !tbaa !5
%idxprom13 = zext i32 %2 to i64
br label %cleanup.sink.split
for.body.preheader: ; preds = %if.end7, %land.lhs.true
%conv = sitofp i64 %n.addr.1 to double
%call = tail call double @sqrt(double noundef %conv) #7
%conv16 = fptosi double %call to i32
%sz.promoted = load i32, ptr @sz, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%pp.072 = phi ptr [ %incdec.ptr, %for.inc ], [ @ptbl, %for.body.preheader ]
%n.addr.271 = phi i64 [ %n.addr.4, %for.inc ], [ %n.addr.1, %for.body.preheader ]
%4 = phi i32 [ %inc4867, %for.inc ], [ %sz.promoted, %for.body.preheader ]
%5 = load i32, ptr %pp.072, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %5, %conv16
br i1 %cmp19, label %if.then26, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%cmp21 = icmp ult i64 %n.addr.271, 1000005
br i1 %cmp21, label %land.lhs.true23, label %if.end30
land.lhs.true23: ; preds = %lor.lhs.false
%arrayidx24 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %n.addr.271
%6 = load i8, ptr %arrayidx24, align 1, !tbaa !9
%tobool25.not = icmp eq i8 %6, 0
br i1 %tobool25.not, label %if.then26, label %if.end30
if.then26: ; preds = %land.lhs.true23, %for.body
%inc27 = add nsw i32 %4, 1
store i32 %inc27, ptr @sz, align 4, !tbaa !5
%idxprom28 = sext i32 %4 to i64
br label %cleanup.sink.split
if.end30: ; preds = %land.lhs.true23, %lor.lhs.false
%conv31 = sext i32 %5 to i64
%rem = srem i64 %n.addr.271, %conv31
%tobool32.not = icmp eq i64 %rem, 0
br i1 %tobool32.not, label %if.end34, label %for.inc
if.end34: ; preds = %if.end30
%idxprom35 = sext i32 %4 to i64
%arrayidx36 = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %idxprom35
br label %do.body37
do.body37: ; preds = %do.body37, %if.end34
%7 = phi i32 [ 0, %if.end34 ], [ %inc41, %do.body37 ]
%n.addr.3 = phi i64 [ %n.addr.271, %if.end34 ], [ %div, %do.body37 ]
%div = sdiv i64 %n.addr.3, %conv31
%inc41 = add nuw nsw i32 %7, 1
%rem44 = srem i64 %div, %conv31
%cmp45 = icmp eq i64 %rem44, 0
br i1 %cmp45, label %do.body37, label %do.end47, !llvm.loop !15
do.end47: ; preds = %do.body37
store i32 %inc41, ptr %arrayidx36, align 4, !tbaa !5
%inc48 = add nsw i32 %4, 1
store i32 %inc48, ptr @sz, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end30, %do.end47
%inc4867 = phi i32 [ %4, %if.end30 ], [ %inc48, %do.end47 ]
%n.addr.4 = phi i64 [ %n.addr.271, %if.end30 ], [ %div, %do.end47 ]
%incdec.ptr = getelementptr inbounds i32, ptr %pp.072, i64 1
%cmp17 = icmp sgt i64 %n.addr.4, 1
br i1 %cmp17, label %for.body, label %cleanup, !llvm.loop !16
cleanup.sink.split: ; preds = %if.then11, %if.then26
%idxprom28.sink = phi i64 [ %idxprom28, %if.then26 ], [ %idxprom13, %if.then11 ]
%arrayidx29 = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %idxprom28.sink
store i32 1, ptr %arrayidx29, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %for.inc, %cleanup.sink.split, %if.end
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7
br label %for.body.i
for.body.i: ; preds = %for.inc6.i.1, %entry
%indvars.iv39.i = phi i64 [ 0, %entry ], [ %indvars.iv.next40.i.1, %for.inc6.i.1 ]
%arrayidx.i = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %indvars.iv39.i
%0 = load i32, ptr %arrayidx.i, align 8, !tbaa !5
%mul.i = mul nsw i32 %0, %0
%cmp231.i = icmp ult i32 %mul.i, 1000004
br i1 %cmp231.i, label %for.body3.preheader.i, label %for.inc6.i
for.body3.preheader.i: ; preds = %for.body.i
%1 = zext i32 %mul.i to i64
%2 = sext i32 %0 to i64
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i, %for.body3.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.body3.i ]
%arrayidx5.i = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv.i
store i8 1, ptr %arrayidx5.i, align 1, !tbaa !9
%indvars.iv.next.i = add i64 %indvars.iv.i, %2
%cmp2.i = icmp slt i64 %indvars.iv.next.i, 1000004
br i1 %cmp2.i, label %for.body3.i, label %for.inc6.i, !llvm.loop !10
for.inc6.i: ; preds = %for.body3.i, %for.body.i
%indvars.iv.next40.i = or i64 %indvars.iv39.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next40.i, 167
br i1 %exitcond.not.i, label %for.end7.i, label %for.body.i.1, !llvm.loop !12
for.body.i.1: ; preds = %for.inc6.i
%arrayidx.i.1 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %indvars.iv.next40.i
%3 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
%mul.i.1 = mul nsw i32 %3, %3
%cmp231.i.1 = icmp ult i32 %mul.i.1, 1000004
br i1 %cmp231.i.1, label %for.body3.preheader.i.1, label %for.inc6.i.1
for.body3.preheader.i.1: ; preds = %for.body.i.1
%4 = zext i32 %mul.i.1 to i64
%5 = sext i32 %3 to i64
br label %for.body3.i.1
for.body3.i.1: ; preds = %for.body3.i.1, %for.body3.preheader.i.1
%indvars.iv.i.1 = phi i64 [ %4, %for.body3.preheader.i.1 ], [ %indvars.iv.next.i.1, %for.body3.i.1 ]
%arrayidx5.i.1 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv.i.1
store i8 1, ptr %arrayidx5.i.1, align 1, !tbaa !9
%indvars.iv.next.i.1 = add i64 %indvars.iv.i.1, %5
%cmp2.i.1 = icmp slt i64 %indvars.iv.next.i.1, 1000004
br i1 %cmp2.i.1, label %for.body3.i.1, label %for.inc6.i.1, !llvm.loop !10
for.inc6.i.1: ; preds = %for.body3.i.1, %for.body.i.1
%indvars.iv.next40.i.1 = add nuw nsw i64 %indvars.iv39.i, 2
br label %for.body.i
for.end7.i: ; preds = %for.inc6.i
store i32 166, ptr @psz, align 4, !tbaa !5
br label %for.body10.i
for.body10.i: ; preds = %for.inc16.i.1, %for.end7.i
%indvars.iv42.i = phi i64 [ 997, %for.end7.i ], [ %indvars.iv.next43.i.1, %for.inc16.i.1 ]
%inc133536.i = phi i32 [ 166, %for.end7.i ], [ %11, %for.inc16.i.1 ]
%arrayidx12.i = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv42.i
%6 = load i8, ptr %arrayidx12.i, align 1, !tbaa !9
%tobool.not.i = icmp eq i8 %6, 0
br i1 %tobool.not.i, label %if.then.i, label %for.inc16.i
if.then.i: ; preds = %for.body10.i
%inc13.i = add nsw i32 %inc133536.i, 1
store i32 %inc13.i, ptr @psz, align 4, !tbaa !5
%idxprom14.i = sext i32 %inc133536.i to i64
%arrayidx15.i = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom14.i
%7 = trunc i64 %indvars.iv42.i to i32
store i32 %7, ptr %arrayidx15.i, align 4, !tbaa !5
br label %for.inc16.i
for.inc16.i: ; preds = %if.then.i, %for.body10.i
%8 = phi i32 [ %inc133536.i, %for.body10.i ], [ %inc13.i, %if.then.i ]
%indvars.iv.next43.i = add nuw nsw i64 %indvars.iv42.i, 2
%arrayidx12.i.1 = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %indvars.iv.next43.i
%9 = load i8, ptr %arrayidx12.i.1, align 1, !tbaa !9
%tobool.not.i.1 = icmp eq i8 %9, 0
br i1 %tobool.not.i.1, label %if.then.i.1, label %for.inc16.i.1
if.then.i.1: ; preds = %for.inc16.i
%inc13.i.1 = add nsw i32 %8, 1
store i32 %inc13.i.1, ptr @psz, align 4, !tbaa !5
%idxprom14.i.1 = sext i32 %8 to i64
%arrayidx15.i.1 = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom14.i.1
%10 = trunc i64 %indvars.iv.next43.i to i32
store i32 %10, ptr %arrayidx15.i.1, align 4, !tbaa !5
br label %for.inc16.i.1
for.inc16.i.1: ; preds = %if.then.i.1, %for.inc16.i
%11 = phi i32 [ %8, %for.inc16.i ], [ %inc13.i.1, %if.then.i.1 ]
%indvars.iv.next43.i.1 = add nuw nsw i64 %indvars.iv42.i, 4
%cmp9.i.1 = icmp ult i64 %indvars.iv42.i, 1000001
br i1 %cmp9.i.1, label %for.body10.i, label %sieve.exit, !llvm.loop !13
sieve.exit: ; preds = %for.inc16.i.1
%idxprom19.i = sext i32 %11 to i64
%arrayidx20.i = getelementptr inbounds [78500 x i32], ptr @ptbl, i64 0, i64 %idxprom19.i
store i32 0, ptr %arrayidx20.i, align 4, !tbaa !5
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool32 = icmp ne i32 %call31, 0
%12 = load i64, ptr %n, align 8
%cmp33 = icmp sgt i64 %12, 0
%13 = select i1 %tobool32, i1 %cmp33, i1 false
br i1 %13, label %while.body, label %while.end
while.body: ; preds = %sieve.exit, %while.cond.backedge
%14 = phi i64 [ %15, %while.cond.backedge ], [ %12, %sieve.exit ]
%cmp1 = icmp eq i64 %14, 1
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %while.body
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.then, %if.then7, %for.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool = icmp ne i32 %call, 0
%15 = load i64, ptr %n, align 8
%cmp = icmp sgt i64 %15, 0
%16 = select i1 %tobool, i1 %cmp, i1 false
br i1 %16, label %while.body, label %while.end, !llvm.loop !17
if.end: ; preds = %while.body
%cmp3 = icmp ugt i64 %14, 1000004
%and = and i64 %14, 1
%tobool4.not = icmp eq i64 %and, 0
%or.cond = or i1 %cmp3, %tobool4.not
br i1 %or.cond, label %if.end9, label %land.lhs.true5
land.lhs.true5: ; preds = %if.end
%arrayidx = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %14
%17 = load i8, ptr %arrayidx, align 1, !tbaa !9
%tobool6.not = icmp eq i8 %17, 0
br i1 %tobool6.not, label %if.then7, label %land.lhs.true.i.thread
land.lhs.true.i.thread: ; preds = %land.lhs.true5
store i32 0, ptr @sz, align 4, !tbaa !5
br label %for.body.preheader.i
if.then7: ; preds = %land.lhs.true5
%call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %while.cond.backedge
if.end9: ; preds = %if.end
store i32 0, ptr @sz, align 4, !tbaa !5
br i1 %tobool4.not, label %do.body.i, label %if.end7.i
do.body.i: ; preds = %if.end9, %do.body.i
%18 = phi i32 [ %inc.i, %do.body.i ], [ 0, %if.end9 ]
%n.addr.0.i = phi i64 [ %shr.i, %do.body.i ], [ %14, %if.end9 ]
%shr.i = ashr i64 %n.addr.0.i, 1
%inc.i = add nuw nsw i32 %18, 1
%19 = and i64 %n.addr.0.i, 2
%tobool4.not.i = icmp eq i64 %19, 0
br i1 %tobool4.not.i, label %do.body.i, label %if.end.i, !llvm.loop !14
if.end.i: ; preds = %do.body.i
store i32 %inc.i, ptr @power, align 16, !tbaa !5
store i32 1, ptr @sz, align 4, !tbaa !5
%cmp.i = icmp slt i64 %n.addr.0.i, 4
br i1 %cmp.i, label %for.body.preheader, label %if.end7.i
if.end7.i: ; preds = %if.end9, %if.end.i
%n.addr.1.i21 = phi i64 [ %shr.i, %if.end.i ], [ %14, %if.end9 ]
%20 = phi i32 [ 1, %if.end.i ], [ 0, %if.end9 ]
%cmp8.i = icmp ult i64 %n.addr.1.i21, 1000005
br i1 %cmp8.i, label %land.lhs.true.i, label %for.body.preheader.i
land.lhs.true.i: ; preds = %if.end7.i
%arrayidx9.i.phi.trans.insert = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %n.addr.1.i21
%.pre = load i8, ptr %arrayidx9.i.phi.trans.insert, align 1, !tbaa !9
%tobool10.not.i = icmp eq i8 %.pre, 0
br i1 %tobool10.not.i, label %if.then11.i, label %for.body.preheader.i
if.then11.i: ; preds = %land.lhs.true.i
%inc12.i = add nuw nsw i32 %20, 1
store i32 %inc12.i, ptr @sz, align 4, !tbaa !5
%idxprom13.i = zext i32 %20 to i64
br label %cleanup.sink.split.i
for.body.preheader.i: ; preds = %land.lhs.true.i.thread, %land.lhs.true.i, %if.end7.i
%n.addr.1.i2124 = phi i64 [ %n.addr.1.i21, %land.lhs.true.i ], [ %n.addr.1.i21, %if.end7.i ], [ %14, %land.lhs.true.i.thread ]
%conv.i = sitofp i64 %n.addr.1.i2124 to double
%call.i = call double @sqrt(double noundef %conv.i) #7
%conv16.i = fptosi double %call.i to i32
%sz.promoted.i = load i32, ptr @sz, align 4, !tbaa !5
br label %for.body.i18
for.body.i18: ; preds = %for.inc.i, %for.body.preheader.i
%pp.072.i = phi ptr [ %incdec.ptr.i, %for.inc.i ], [ @ptbl, %for.body.preheader.i ]
%n.addr.271.i = phi i64 [ %n.addr.4.i, %for.inc.i ], [ %n.addr.1.i2124, %for.body.preheader.i ]
%21 = phi i32 [ %inc4867.i, %for.inc.i ], [ %sz.promoted.i, %for.body.preheader.i ]
%22 = load i32, ptr %pp.072.i, align 4, !tbaa !5
%cmp19.i = icmp sgt i32 %22, %conv16.i
br i1 %cmp19.i, label %if.then26.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %for.body.i18
%cmp21.i = icmp ult i64 %n.addr.271.i, 1000005
br i1 %cmp21.i, label %land.lhs.true23.i, label %if.end30.i
land.lhs.true23.i: ; preds = %lor.lhs.false.i
%arrayidx24.i = getelementptr inbounds [1000006 x i8], ptr @tbl, i64 0, i64 %n.addr.271.i
%23 = load i8, ptr %arrayidx24.i, align 1, !tbaa !9
%tobool25.not.i = icmp eq i8 %23, 0
br i1 %tobool25.not.i, label %if.then26.i, label %if.end30.i
if.then26.i: ; preds = %land.lhs.true23.i, %for.body.i18
%inc27.i = add nsw i32 %21, 1
store i32 %inc27.i, ptr @sz, align 4, !tbaa !5
%idxprom28.i = sext i32 %21 to i64
br label %cleanup.sink.split.i
if.end30.i: ; preds = %land.lhs.true23.i, %lor.lhs.false.i
%conv31.i = sext i32 %22 to i64
%rem.i = srem i64 %n.addr.271.i, %conv31.i
%tobool32.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool32.not.i, label %if.end34.i, label %for.inc.i
if.end34.i: ; preds = %if.end30.i
%idxprom35.i = sext i32 %21 to i64
br label %do.body37.i
do.body37.i: ; preds = %do.body37.i, %if.end34.i
%24 = phi i32 [ 0, %if.end34.i ], [ %inc41.i, %do.body37.i ]
%n.addr.3.i = phi i64 [ %n.addr.271.i, %if.end34.i ], [ %div.i, %do.body37.i ]
%div.i = sdiv i64 %n.addr.3.i, %conv31.i
%inc41.i = add nuw nsw i32 %24, 1
%rem44.i = srem i64 %div.i, %conv31.i
%cmp45.i = icmp eq i64 %rem44.i, 0
br i1 %cmp45.i, label %do.body37.i, label %do.end47.i, !llvm.loop !15
do.end47.i: ; preds = %do.body37.i
%arrayidx36.i = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %idxprom35.i
store i32 %inc41.i, ptr %arrayidx36.i, align 4, !tbaa !5
%inc48.i = add nsw i32 %21, 1
store i32 %inc48.i, ptr @sz, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %do.end47.i, %if.end30.i
%inc4867.i = phi i32 [ %21, %if.end30.i ], [ %inc48.i, %do.end47.i ]
%n.addr.4.i = phi i64 [ %n.addr.271.i, %if.end30.i ], [ %div.i, %do.end47.i ]
%incdec.ptr.i = getelementptr inbounds i32, ptr %pp.072.i, i64 1
%cmp17.i = icmp sgt i64 %n.addr.4.i, 1
br i1 %cmp17.i, label %for.body.i18, label %prime_factor.exit, !llvm.loop !16
cleanup.sink.split.i: ; preds = %if.then26.i, %if.then11.i
%25 = phi i32 [ %inc27.i, %if.then26.i ], [ %inc12.i, %if.then11.i ]
%idxprom28.sink.i = phi i64 [ %idxprom28.i, %if.then26.i ], [ %idxprom13.i, %if.then11.i ]
%arrayidx29.i = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %idxprom28.sink.i
store i32 1, ptr %arrayidx29.i, align 4, !tbaa !5
br label %prime_factor.exit
prime_factor.exit: ; preds = %for.inc.i, %cleanup.sink.split.i
%26 = phi i32 [ %25, %cleanup.sink.split.i ], [ %inc4867.i, %for.inc.i ]
%cmp1028 = icmp sgt i32 %26, 0
br i1 %cmp1028, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.end.i, %prime_factor.exit
%27 = phi i32 [ %26, %prime_factor.exit ], [ 1, %if.end.i ]
%wide.trip.count = zext i32 %27 to i64
%min.iters.check = icmp ult i32 %27, 4
br i1 %min.iters.check, label %for.body.preheader46, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 2147483644
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1, i64 1>, %vector.ph ], [ %36, %vector.body ]
%vec.phi44 = phi <2 x i64> [ <i64 1, i64 1>, %vector.ph ], [ %37, %vector.body ]
%28 = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %28, align 16, !tbaa !5
%29 = getelementptr inbounds i32, ptr %28, i64 2
%wide.load45 = load <2 x i32>, ptr %29, align 8, !tbaa !5
%30 = shl <2 x i32> %wide.load, <i32 1, i32 1>
%31 = shl <2 x i32> %wide.load45, <i32 1, i32 1>
%32 = or <2 x i32> %30, <i32 1, i32 1>
%33 = or <2 x i32> %31, <i32 1, i32 1>
%34 = sext <2 x i32> %32 to <2 x i64>
%35 = sext <2 x i32> %33 to <2 x i64>
%36 = mul <2 x i64> %vec.phi, %34
%37 = mul <2 x i64> %vec.phi44, %35
%index.next = add nuw i64 %index, 4
%38 = icmp eq i64 %index.next, %n.vec
br i1 %38, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%bin.rdx = mul <2 x i64> %37, %36
%39 = call i64 @llvm.vector.reduce.mul.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader46
for.body.preheader46: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.029.ph = phi i64 [ 1, %for.body.preheader ], [ %39, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader46, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader46 ]
%ans.029 = phi i64 [ %mul, %for.body ], [ %ans.029.ph, %for.body.preheader46 ]
%arrayidx11 = getelementptr inbounds [100 x i32], ptr @power, i64 0, i64 %indvars.iv
%40 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%shl = shl i32 %40, 1
%add = or i32 %shl, 1
%conv = sext i32 %add to i64
%mul = mul nsw i64 %ans.029, %conv
%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 !21
for.end: ; preds = %for.body, %middle.block, %prime_factor.exit
%ans.0.lcssa = phi i64 [ 1, %prime_factor.exit ], [ %39, %middle.block ], [ %mul, %for.body ]
%add12 = add nsw i64 %ans.0.lcssa, 1
%shr = ashr i64 %add12, 1
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %shr)
br label %while.cond.backedge
while.end: ; preds = %while.cond.backedge, %sieve.exit
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.mul.v2i64(<2 x i64>) #6
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !11, !20, !19}
|
// AtCoder AGC095 C - Many Medians
// 2020.1.22 bal4u
#include <stdio.h>
#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in() { // 非負整数の入力
int n = 0; int c = gc();
do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
return n;
}
void outs(char *s) { while (*s) pc(*s++); }
char *out(char *b, int n) { // 非負整数の表示(出力)
int i;
i = 15, b[i] = 0;
b[--i] = '\n';
while (n) b[--i] = n % 10 + '0', n /= 10;
return b+i;
}
// n番目に小さい値を算出する n:0-index
int selection(int *a, int sz, int n) {
int i, j, p, l, r, t;
l = 0, r = sz-1;
while (l < r) {
p = a[(l+r)/2];
i = l-1, j = r+1;
while (1) {
while (a[++i] < p);
while (a[--j] > p);
if (i > j) break;
t = a[i], a[i] = a[j], a[j] = t;
}
if (n < i) r = j;
if (n > j) l = i;
}
return a[n];
}
int N;
int a[200005];
int b[200005];
int main()
{
int i, n, a1, a2;
char *p1, *p2, s1[20], s2[20];
N = in(), n = N / 2;
for (i = 0; i < N; ++i) a[i] = b[i] = in();
a1 = selection(b, N, n-1);
a2 = selection(b, N, n);
//printf("a1=%d, a2=%d\n", a1, a2);
p1 = out(s1, a1), p2 = out(s2, a2);
for (i = 0; i < N; ++i) outs((a[i] >= a2)? p1: p2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151239/source.c"
target datalayout = "e-m:e-p270: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._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@N = dso_local local_unnamed_addr global i32 0, align 4
@b = dso_local local_unnamed_addr global [200005 x i32] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [200005 x i32] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #5
%.pre13.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre13.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit12
%4 = phi ptr [ %8, %getchar_unlocked.exit12 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit12 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i8, %getchar_unlocked.exit12 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i3 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i3, align 8, !tbaa !9
%_IO_read_end.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i4, align 8, !tbaa !14
%cmp.not.i5 = icmp ult ptr %5, %6
br i1 %cmp.not.i5, label %cond.false.i9, label %cond.true.i6, !prof !15
cond.true.i6: ; preds = %do.body
%call.i7 = tail call i32 @__uflow(ptr noundef nonnull %4) #5
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12
cond.false.i9: ; preds = %do.body
%incdec.ptr.i10 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i10, ptr %_IO_read_ptr.i3, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i11 = zext i8 %7 to i32
br label %getchar_unlocked.exit12
getchar_unlocked.exit12: ; preds = %cond.true.i6, %cond.false.i9
%8 = phi ptr [ %.pre, %cond.true.i6 ], [ %4, %cond.false.i9 ]
%cond.i8 = phi i32 [ %call.i7, %cond.true.i6 ], [ %conv3.i11, %cond.false.i9 ]
%cmp = icmp sgt i32 %cond.i8, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17
do.end: ; preds = %getchar_unlocked.exit12
ret i32 %add
}
; 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 void @outs(ptr nocapture noundef readonly %s) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %s, align 1, !tbaa !16
%tobool.not2 = icmp eq i8 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %putchar_unlocked.exit
%1 = phi i8 [ %5, %putchar_unlocked.exit ], [ %0, %entry ]
%s.addr.03 = phi ptr [ %incdec.ptr, %putchar_unlocked.exit ], [ %s, %entry ]
%incdec.ptr = getelementptr inbounds i8, ptr %s.addr.03, i64 1
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %2, i64 0, i32 5
%3 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !19
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %2, i64 0, i32 6
%4 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !20
%cmp.not.i = icmp ult ptr %3, %4
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %while.body
%conv = zext i8 %1 to i32
%call.i = tail call i32 @__overflow(ptr noundef nonnull %2, i32 noundef %conv) #5
br label %putchar_unlocked.exit
cond.false.i: ; preds = %while.body
%incdec.ptr.i = getelementptr inbounds i8, ptr %3, i64 1
store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !19
store i8 %1, ptr %3, align 1, !tbaa !16
br label %putchar_unlocked.exit
putchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%5 = load i8, ptr %incdec.ptr, align 1, !tbaa !16
%tobool.not = icmp eq i8 %5, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21
while.end: ; preds = %putchar_unlocked.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local ptr @out(ptr noundef writeonly %b, i32 noundef %n) local_unnamed_addr #2 {
entry:
%arrayidx = getelementptr inbounds i8, ptr %b, i64 15
store i8 0, ptr %arrayidx, align 1, !tbaa !16
%arrayidx2 = getelementptr inbounds i8, ptr %b, i64 14
store i8 10, ptr %arrayidx2, align 1, !tbaa !16
%tobool.not14 = icmp eq i32 %n, 0
br i1 %tobool.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 14, %entry ]
%n.addr.015 = phi i32 [ %div, %while.body ], [ %n, %entry ]
%rem = srem i32 %n.addr.015, 10
%0 = trunc i32 %rem to i8
%conv = add nsw i8 %0, 48
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx5 = getelementptr inbounds i8, ptr %b, i64 %indvars.iv.next
store i8 %conv, ptr %arrayidx5, align 1, !tbaa !16
%div = sdiv i32 %n.addr.015, 10
%n.addr.015.off = add i32 %n.addr.015, 9
%tobool.not = icmp ult i32 %n.addr.015.off, 19
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !22
while.end.loopexit: ; preds = %while.body
%sext = shl i64 %indvars.iv.next, 32
%1 = ashr exact i64 %sext, 32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%i.0.lcssa = phi i64 [ 14, %entry ], [ %1, %while.end.loopexit ]
%add.ptr = getelementptr inbounds i8, ptr %b, i64 %i.0.lcssa
ret ptr %add.ptr
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @selection(ptr nocapture noundef %a, i32 noundef %sz, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp60 = icmp sgt i32 %sz, 1
br i1 %cmp60, label %while.body.preheader, label %while.end32
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %sz, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.end25
%r.062 = phi i32 [ %spec.select, %while.end25 ], [ %sub, %while.body.preheader ]
%l.061 = phi i32 [ %l.1, %while.end25 ], [ 0, %while.body.preheader ]
%add = add nsw i32 %r.062, %l.061
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !23
%sub1 = add nsw i32 %l.061, -1
%add2 = add nsw i32 %r.062, 1
br label %while.cond3
while.cond3: ; preds = %if.end, %while.body
%j.0 = phi i32 [ %add2, %while.body ], [ %7, %if.end ]
%i.0 = phi i32 [ %sub1, %while.body ], [ %3, %if.end ]
%1 = sext i32 %i.0 to i64
br label %while.cond5
while.cond5: ; preds = %while.cond5, %while.cond3
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond5 ], [ %1, %while.cond3 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !23
%cmp8 = icmp slt i32 %2, %0
br i1 %cmp8, label %while.cond5, label %while.cond10.preheader, !llvm.loop !24
while.cond10.preheader: ; preds = %while.cond5
%arrayidx7.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next
%3 = trunc i64 %indvars.iv.next to i32
%4 = sext i32 %j.0 to i64
br label %while.cond10
while.cond10: ; preds = %while.cond10.preheader, %while.cond10
%indvars.iv65 = phi i64 [ %4, %while.cond10.preheader ], [ %indvars.iv.next66, %while.cond10 ]
%indvars.iv.next66 = add i64 %indvars.iv65, -1
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next66
%5 = load i32, ptr %arrayidx12, align 4, !tbaa !23
%cmp13 = icmp sgt i32 %5, %0
br i1 %cmp13, label %while.cond10, label %while.end15, !llvm.loop !25
while.end15: ; preds = %while.cond10
%6 = trunc i64 %indvars.iv to i32
%7 = trunc i64 %indvars.iv.next66 to i32
%cmp16.not = icmp slt i32 %6, %7
br i1 %cmp16.not, label %if.end, label %while.end25
if.end: ; preds = %while.end15
%arrayidx12.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next66
store i32 %5, ptr %arrayidx7.le, align 4, !tbaa !23
store i32 %2, ptr %arrayidx12.le, align 4, !tbaa !23
br label %while.cond3
while.end25: ; preds = %while.end15
%8 = trunc i64 %indvars.iv65 to i32
%cmp26.not = icmp slt i32 %6, %n
%spec.select = select i1 %cmp26.not, i32 %r.062, i32 %7
%cmp29.not = icmp sgt i32 %8, %n
%l.1 = select i1 %cmp29.not, i32 %l.061, i32 %3
%cmp = icmp slt i32 %l.1, %spec.select
br i1 %cmp, label %while.body, label %while.end32, !llvm.loop !26
while.end32: ; preds = %while.end25, %entry
%idxprom33 = sext i32 %n to i64
%arrayidx34 = getelementptr inbounds i32, ptr %a, i64 %idxprom33
%9 = load i32, ptr %arrayidx34, align 4, !tbaa !23
ret i32 %9
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [20 x i8], align 16
%s2 = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s1) #5
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s2) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #5
%.pre13.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph195 = phi ptr [ %0, %cond.false.i.i ], [ %.pre13.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit12.i
%4 = phi ptr [ %8, %getchar_unlocked.exit12.i ], [ %.ph195, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit12.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i8.i, %getchar_unlocked.exit12.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i3.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i3.i, align 8, !tbaa !9
%_IO_read_end.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i4.i, align 8, !tbaa !14
%cmp.not.i5.i = icmp ult ptr %5, %6
br i1 %cmp.not.i5.i, label %cond.false.i9.i, label %cond.true.i6.i, !prof !15
cond.true.i6.i: ; preds = %do.body.i
%call.i7.i = tail call i32 @__uflow(ptr noundef nonnull %4) #5
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i
cond.false.i9.i: ; preds = %do.body.i
%incdec.ptr.i10.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i10.i, ptr %_IO_read_ptr.i3.i, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i11.i = zext i8 %7 to i32
br label %getchar_unlocked.exit12.i
getchar_unlocked.exit12.i: ; preds = %cond.false.i9.i, %cond.true.i6.i
%8 = phi ptr [ %.pre.i, %cond.true.i6.i ], [ %4, %cond.false.i9.i ]
%cond.i8.i = phi i32 [ %call.i7.i, %cond.true.i6.i ], [ %conv3.i11.i, %cond.false.i9.i ]
%cmp.i = icmp sgt i32 %cond.i8.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17
in.exit: ; preds = %getchar_unlocked.exit12.i
store i32 %add.i, ptr @N, align 4, !tbaa !23
%div = sdiv i32 %add.i, 2
%cmp142 = icmp sgt i32 %add.i, 0
br i1 %cmp142, label %for.body, label %for.end.thread
for.end.thread: ; preds = %in.exit
%sub159 = add nsw i32 %div, -1
br label %selection.exit.thread
for.body: ; preds = %in.exit, %in.exit56
%9 = phi ptr [ %18, %in.exit56 ], [ %8, %in.exit ]
%indvars.iv = phi i64 [ %indvars.iv.next, %in.exit56 ], [ 0, %in.exit ]
%_IO_read_ptr.i.i26 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1
%10 = load ptr, ptr %_IO_read_ptr.i.i26, align 8, !tbaa !9
%_IO_read_end.i.i27 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2
%11 = load ptr, ptr %_IO_read_end.i.i27, align 8, !tbaa !14
%cmp.not.i.i28 = icmp ult ptr %10, %11
br i1 %cmp.not.i.i28, label %cond.false.i.i53, label %cond.true.i.i29, !prof !15
cond.true.i.i29: ; preds = %for.body
%call.i.i30 = tail call i32 @__uflow(ptr noundef nonnull %9) #5
%.pre13.pre.i31 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i35.preheader
cond.false.i.i53: ; preds = %for.body
%incdec.ptr.i.i54 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i.i54, ptr %_IO_read_ptr.i.i26, align 8, !tbaa !9
%12 = load i8, ptr %10, align 1, !tbaa !16
%conv3.i.i55 = zext i8 %12 to i32
br label %do.body.i35.preheader
do.body.i35.preheader: ; preds = %cond.false.i.i53, %cond.true.i.i29
%.ph193 = phi ptr [ %9, %cond.false.i.i53 ], [ %.pre13.pre.i31, %cond.true.i.i29 ]
%c.0.i37.ph = phi i32 [ %conv3.i.i55, %cond.false.i.i53 ], [ %call.i.i30, %cond.true.i.i29 ]
br label %do.body.i35
do.body.i35: ; preds = %do.body.i35.preheader, %getchar_unlocked.exit12.i47
%13 = phi ptr [ %18, %getchar_unlocked.exit12.i47 ], [ %.ph193, %do.body.i35.preheader ]
%14 = phi ptr [ %19, %getchar_unlocked.exit12.i47 ], [ %.ph193, %do.body.i35.preheader ]
%n.0.i36 = phi i32 [ %add.i40, %getchar_unlocked.exit12.i47 ], [ 0, %do.body.i35.preheader ]
%c.0.i37 = phi i32 [ %cond.i8.i48, %getchar_unlocked.exit12.i47 ], [ %c.0.i37.ph, %do.body.i35.preheader ]
%mul.i38 = mul nsw i32 %n.0.i36, 10
%and.i39 = and i32 %c.0.i37, 15
%add.i40 = add nsw i32 %and.i39, %mul.i38
%_IO_read_ptr.i3.i41 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 1
%15 = load ptr, ptr %_IO_read_ptr.i3.i41, align 8, !tbaa !9
%_IO_read_end.i4.i42 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 2
%16 = load ptr, ptr %_IO_read_end.i4.i42, align 8, !tbaa !14
%cmp.not.i5.i43 = icmp ult ptr %15, %16
br i1 %cmp.not.i5.i43, label %cond.false.i9.i50, label %cond.true.i6.i44, !prof !15
cond.true.i6.i44: ; preds = %do.body.i35
%call.i7.i45 = tail call i32 @__uflow(ptr noundef nonnull %14) #5
%.pre.i46 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit12.i47
cond.false.i9.i50: ; preds = %do.body.i35
%incdec.ptr.i10.i51 = getelementptr inbounds i8, ptr %15, i64 1
store ptr %incdec.ptr.i10.i51, ptr %_IO_read_ptr.i3.i41, align 8, !tbaa !9
%17 = load i8, ptr %15, align 1, !tbaa !16
%conv3.i11.i52 = zext i8 %17 to i32
br label %getchar_unlocked.exit12.i47
getchar_unlocked.exit12.i47: ; preds = %cond.false.i9.i50, %cond.true.i6.i44
%18 = phi ptr [ %.pre.i46, %cond.true.i6.i44 ], [ %13, %cond.false.i9.i50 ]
%19 = phi ptr [ %.pre.i46, %cond.true.i6.i44 ], [ %14, %cond.false.i9.i50 ]
%cond.i8.i48 = phi i32 [ %call.i7.i45, %cond.true.i6.i44 ], [ %conv3.i11.i52, %cond.false.i9.i50 ]
%cmp.i49 = icmp sgt i32 %cond.i8.i48, 47
br i1 %cmp.i49, label %do.body.i35, label %in.exit56, !llvm.loop !17
in.exit56: ; preds = %getchar_unlocked.exit12.i47
%arrayidx = getelementptr inbounds [200005 x i32], ptr @b, i64 0, i64 %indvars.iv
store i32 %add.i40, ptr %arrayidx, align 4, !tbaa !23
%arrayidx3 = getelementptr inbounds [200005 x i32], ptr @a, i64 0, i64 %indvars.iv
store i32 %add.i40, ptr %arrayidx3, align 4, !tbaa !23
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr @N, align 4, !tbaa !23
%20 = sext i32 %.pr to i64
%cmp = icmp slt i64 %indvars.iv.next, %20
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !27
for.end: ; preds = %in.exit56
%sub = add nsw i32 %div, -1
%cmp60.i = icmp sgt i32 %.pr, 1
br i1 %cmp60.i, label %while.body.preheader.i, label %selection.exit.thread
selection.exit.thread: ; preds = %for.end.thread, %for.end
%sub161 = phi i32 [ %sub159, %for.end.thread ], [ %sub, %for.end ]
%21 = phi i32 [ %add.i, %for.end.thread ], [ %.pr, %for.end ]
%idxprom33.i130 = sext i32 %sub161 to i64
%arrayidx34.i131 = getelementptr inbounds i32, ptr @b, i64 %idxprom33.i130
%22 = load i32, ptr %arrayidx34.i131, align 4, !tbaa !23
br label %selection.exit98
while.body.preheader.i: ; preds = %for.end
%sub.i = add nsw i32 %.pr, -1
br label %while.body.i
while.body.i: ; preds = %while.end25.i, %while.body.preheader.i
%r.062.i = phi i32 [ %spec.select.i, %while.end25.i ], [ %sub.i, %while.body.preheader.i ]
%l.061.i = phi i32 [ %l.1.i, %while.end25.i ], [ 0, %while.body.preheader.i ]
%add.i57 = add nsw i32 %l.061.i, %r.062.i
%div.i = sdiv i32 %add.i57, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr @b, i64 %idxprom.i
%23 = load i32, ptr %arrayidx.i, align 4, !tbaa !23
%sub1.i = add nsw i32 %l.061.i, -1
%add2.i = add nsw i32 %r.062.i, 1
br label %while.cond3.i
while.cond3.i: ; preds = %if.end.i, %while.body.i
%j.0.i = phi i32 [ %add2.i, %while.body.i ], [ %30, %if.end.i ]
%i.0.i = phi i32 [ %sub1.i, %while.body.i ], [ %28, %if.end.i ]
%24 = sext i32 %i.0.i to i64
br label %while.cond5.i
while.cond5.i: ; preds = %while.cond5.i, %while.cond3.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond5.i ], [ %24, %while.cond3.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%arrayidx7.i = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.next.i
%25 = load i32, ptr %arrayidx7.i, align 4, !tbaa !23
%cmp8.i = icmp slt i32 %25, %23
br i1 %cmp8.i, label %while.cond5.i, label %while.cond10.preheader.i, !llvm.loop !24
while.cond10.preheader.i: ; preds = %while.cond5.i
%26 = sext i32 %j.0.i to i64
br label %while.cond10.i
while.cond10.i: ; preds = %while.cond10.i, %while.cond10.preheader.i
%indvars.iv65.i = phi i64 [ %26, %while.cond10.preheader.i ], [ %indvars.iv.next66.i, %while.cond10.i ]
%indvars.iv.next66.i = add i64 %indvars.iv65.i, -1
%arrayidx12.i = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.next66.i
%27 = load i32, ptr %arrayidx12.i, align 4, !tbaa !23
%cmp13.i = icmp sgt i32 %27, %23
br i1 %cmp13.i, label %while.cond10.i, label %while.end15.i, !llvm.loop !25
while.end15.i: ; preds = %while.cond10.i
%28 = trunc i64 %indvars.iv.next.i to i32
%29 = trunc i64 %indvars.iv.i to i32
%30 = trunc i64 %indvars.iv.next66.i to i32
%cmp16.not.i = icmp slt i32 %29, %30
br i1 %cmp16.not.i, label %if.end.i, label %while.end25.i
if.end.i: ; preds = %while.end15.i
store i32 %27, ptr %arrayidx7.i, align 4, !tbaa !23
store i32 %25, ptr %arrayidx12.i, align 4, !tbaa !23
br label %while.cond3.i
while.end25.i: ; preds = %while.end15.i
%31 = trunc i64 %indvars.iv65.i to i32
%cmp26.not.i = icmp sgt i32 %sub, %29
%spec.select.i = select i1 %cmp26.not.i, i32 %r.062.i, i32 %30
%cmp29.not.i.not = icmp sgt i32 %div, %31
%l.1.i = select i1 %cmp29.not.i.not, i32 %28, i32 %l.061.i
%cmp.i58 = icmp slt i32 %l.1.i, %spec.select.i
br i1 %cmp.i58, label %while.body.i, label %selection.exit, !llvm.loop !26
selection.exit: ; preds = %while.end25.i
%idxprom33.i = sext i32 %sub to i64
%arrayidx34.i = getelementptr inbounds i32, ptr @b, i64 %idxprom33.i
%32 = load i32, ptr %arrayidx34.i, align 4, !tbaa !23
br label %while.body.i64
while.body.i64: ; preds = %while.end25.i90, %selection.exit
%r.062.i65 = phi i32 [ %spec.select.i92, %while.end25.i90 ], [ %sub.i, %selection.exit ]
%l.061.i66 = phi i32 [ %l.1.i94, %while.end25.i90 ], [ 0, %selection.exit ]
%add.i67 = add nsw i32 %l.061.i66, %r.062.i65
%div.i68 = sdiv i32 %add.i67, 2
%idxprom.i69 = sext i32 %div.i68 to i64
%arrayidx.i70 = getelementptr inbounds i32, ptr @b, i64 %idxprom.i69
%33 = load i32, ptr %arrayidx.i70, align 4, !tbaa !23
%sub1.i71 = add nsw i32 %l.061.i66, -1
%add2.i72 = add nsw i32 %r.062.i65, 1
br label %while.cond3.i73
while.cond3.i73: ; preds = %if.end.i96, %while.body.i64
%j.0.i74 = phi i32 [ %add2.i72, %while.body.i64 ], [ %40, %if.end.i96 ]
%i.0.i75 = phi i32 [ %sub1.i71, %while.body.i64 ], [ %38, %if.end.i96 ]
%34 = sext i32 %i.0.i75 to i64
br label %while.cond5.i76
while.cond5.i76: ; preds = %while.cond5.i76, %while.cond3.i73
%indvars.iv.i77 = phi i64 [ %indvars.iv.next.i78, %while.cond5.i76 ], [ %34, %while.cond3.i73 ]
%indvars.iv.next.i78 = add nsw i64 %indvars.iv.i77, 1
%arrayidx7.i79 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.next.i78
%35 = load i32, ptr %arrayidx7.i79, align 4, !tbaa !23
%cmp8.i80 = icmp slt i32 %35, %33
br i1 %cmp8.i80, label %while.cond5.i76, label %while.cond10.preheader.i81, !llvm.loop !24
while.cond10.preheader.i81: ; preds = %while.cond5.i76
%36 = sext i32 %j.0.i74 to i64
br label %while.cond10.i83
while.cond10.i83: ; preds = %while.cond10.i83, %while.cond10.preheader.i81
%indvars.iv65.i84 = phi i64 [ %36, %while.cond10.preheader.i81 ], [ %indvars.iv.next66.i85, %while.cond10.i83 ]
%indvars.iv.next66.i85 = add i64 %indvars.iv65.i84, -1
%arrayidx12.i86 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv.next66.i85
%37 = load i32, ptr %arrayidx12.i86, align 4, !tbaa !23
%cmp13.i87 = icmp sgt i32 %37, %33
br i1 %cmp13.i87, label %while.cond10.i83, label %while.end15.i88, !llvm.loop !25
while.end15.i88: ; preds = %while.cond10.i83
%38 = trunc i64 %indvars.iv.next.i78 to i32
%39 = trunc i64 %indvars.iv.i77 to i32
%40 = trunc i64 %indvars.iv.next66.i85 to i32
%cmp16.not.i89 = icmp slt i32 %39, %40
br i1 %cmp16.not.i89, label %if.end.i96, label %while.end25.i90
if.end.i96: ; preds = %while.end15.i88
store i32 %37, ptr %arrayidx7.i79, align 4, !tbaa !23
store i32 %35, ptr %arrayidx12.i86, align 4, !tbaa !23
br label %while.cond3.i73
while.end25.i90: ; preds = %while.end15.i88
%41 = trunc i64 %indvars.iv65.i84 to i32
%cmp26.not.i91 = icmp sgt i32 %div, %39
%spec.select.i92 = select i1 %cmp26.not.i91, i32 %r.062.i65, i32 %40
%cmp29.not.i93 = icmp slt i32 %div, %41
%l.1.i94 = select i1 %cmp29.not.i93, i32 %l.061.i66, i32 %38
%cmp.i95 = icmp slt i32 %l.1.i94, %spec.select.i92
br i1 %cmp.i95, label %while.body.i64, label %selection.exit98, !llvm.loop !26
selection.exit98: ; preds = %while.end25.i90, %selection.exit.thread
%42 = phi i32 [ %21, %selection.exit.thread ], [ %.pr, %while.end25.i90 ]
%43 = phi i32 [ %22, %selection.exit.thread ], [ %32, %while.end25.i90 ]
%idxprom33.i60 = sext i32 %div to i64
%arrayidx34.i61 = getelementptr inbounds i32, ptr @b, i64 %idxprom33.i60
%44 = load i32, ptr %arrayidx34.i61, align 4, !tbaa !23
%arrayidx.i99 = getelementptr inbounds i8, ptr %s1, i64 15
store i8 0, ptr %arrayidx.i99, align 1, !tbaa !16
%arrayidx2.i = getelementptr inbounds i8, ptr %s1, i64 14
store i8 10, ptr %arrayidx2.i, align 2, !tbaa !16
%tobool.not14.i = icmp eq i32 %43, 0
br i1 %tobool.not14.i, label %out.exit, label %while.body.i100
while.body.i100: ; preds = %selection.exit98, %while.body.i100
%indvars.iv.i101 = phi i64 [ %indvars.iv.next.i102, %while.body.i100 ], [ 14, %selection.exit98 ]
%n.addr.015.i = phi i32 [ %div.i103, %while.body.i100 ], [ %43, %selection.exit98 ]
%rem.i = srem i32 %n.addr.015.i, 10
%45 = trunc i32 %rem.i to i8
%conv.i = add nsw i8 %45, 48
%indvars.iv.next.i102 = add nsw i64 %indvars.iv.i101, -1
%arrayidx5.i = getelementptr inbounds i8, ptr %s1, i64 %indvars.iv.next.i102
store i8 %conv.i, ptr %arrayidx5.i, align 1, !tbaa !16
%div.i103 = sdiv i32 %n.addr.015.i, 10
%n.addr.015.off.i = add i32 %n.addr.015.i, 9
%tobool.not.i = icmp ult i32 %n.addr.015.off.i, 19
br i1 %tobool.not.i, label %while.end.loopexit.i, label %while.body.i100, !llvm.loop !22
while.end.loopexit.i: ; preds = %while.body.i100
%sext.i = shl i64 %indvars.iv.next.i102, 32
%46 = ashr exact i64 %sext.i, 32
br label %out.exit
out.exit: ; preds = %selection.exit98, %while.end.loopexit.i
%i.0.lcssa.i = phi i64 [ 14, %selection.exit98 ], [ %46, %while.end.loopexit.i ]
%add.ptr.i = getelementptr inbounds i8, ptr %s1, i64 %i.0.lcssa.i
%arrayidx.i104 = getelementptr inbounds i8, ptr %s2, i64 15
store i8 0, ptr %arrayidx.i104, align 1, !tbaa !16
%arrayidx2.i105 = getelementptr inbounds i8, ptr %s2, i64 14
store i8 10, ptr %arrayidx2.i105, align 2, !tbaa !16
%tobool.not14.i106 = icmp eq i32 %44, 0
br i1 %tobool.not14.i106, label %out.exit121, label %while.body.i107
while.body.i107: ; preds = %out.exit, %while.body.i107
%indvars.iv.i108 = phi i64 [ %indvars.iv.next.i112, %while.body.i107 ], [ 14, %out.exit ]
%n.addr.015.i109 = phi i32 [ %div.i114, %while.body.i107 ], [ %44, %out.exit ]
%rem.i110 = srem i32 %n.addr.015.i109, 10
%47 = trunc i32 %rem.i110 to i8
%conv.i111 = add nsw i8 %47, 48
%indvars.iv.next.i112 = add nsw i64 %indvars.iv.i108, -1
%arrayidx5.i113 = getelementptr inbounds i8, ptr %s2, i64 %indvars.iv.next.i112
store i8 %conv.i111, ptr %arrayidx5.i113, align 1, !tbaa !16
%div.i114 = sdiv i32 %n.addr.015.i109, 10
%n.addr.015.off.i115 = add i32 %n.addr.015.i109, 9
%tobool.not.i116 = icmp ult i32 %n.addr.015.off.i115, 19
br i1 %tobool.not.i116, label %while.end.loopexit.i117, label %while.body.i107, !llvm.loop !22
while.end.loopexit.i117: ; preds = %while.body.i107
%sext.i118 = shl i64 %indvars.iv.next.i112, 32
%48 = ashr exact i64 %sext.i118, 32
br label %out.exit121
out.exit121: ; preds = %out.exit, %while.end.loopexit.i117
%i.0.lcssa.i119 = phi i64 [ 14, %out.exit ], [ %48, %while.end.loopexit.i117 ]
%add.ptr.i120 = getelementptr inbounds i8, ptr %s2, i64 %i.0.lcssa.i119
%cmp10144 = icmp sgt i32 %42, 0
br i1 %cmp10144, label %for.body11, label %for.end17
for.body11: ; preds = %out.exit121, %outs.exit
%49 = phi i32 [ %57, %outs.exit ], [ %42, %out.exit121 ]
%indvars.iv156 = phi i64 [ %indvars.iv.next157, %outs.exit ], [ 0, %out.exit121 ]
%arrayidx13 = getelementptr inbounds [200005 x i32], ptr @a, i64 0, i64 %indvars.iv156
%50 = load i32, ptr %arrayidx13, align 4, !tbaa !23
%cmp14.not = icmp slt i32 %50, %44
%cond = select i1 %cmp14.not, ptr %add.ptr.i120, ptr %add.ptr.i
%51 = load i8, ptr %cond, align 1, !tbaa !16
%tobool.not2.i = icmp eq i8 %51, 0
br i1 %tobool.not2.i, label %outs.exit, label %while.body.i122
while.body.i122: ; preds = %for.body11, %putchar_unlocked.exit.i
%52 = phi i8 [ %56, %putchar_unlocked.exit.i ], [ %51, %for.body11 ]
%s.addr.03.i = phi ptr [ %incdec.ptr.i, %putchar_unlocked.exit.i ], [ %cond, %for.body11 ]
%incdec.ptr.i = getelementptr inbounds i8, ptr %s.addr.03.i, i64 1
%53 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 5
%54 = load ptr, ptr %_IO_write_ptr.i.i, align 8, !tbaa !19
%_IO_write_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 6
%55 = load ptr, ptr %_IO_write_end.i.i, align 8, !tbaa !20
%cmp.not.i.i123 = icmp ult ptr %54, %55
br i1 %cmp.not.i.i123, label %cond.false.i.i128, label %cond.true.i.i124, !prof !15
cond.true.i.i124: ; preds = %while.body.i122
%conv.i125 = zext i8 %52 to i32
%call.i.i126 = tail call i32 @__overflow(ptr noundef nonnull %53, i32 noundef %conv.i125) #5
br label %putchar_unlocked.exit.i
cond.false.i.i128: ; preds = %while.body.i122
%incdec.ptr.i.i129 = getelementptr inbounds i8, ptr %54, i64 1
store ptr %incdec.ptr.i.i129, ptr %_IO_write_ptr.i.i, align 8, !tbaa !19
store i8 %52, ptr %54, align 1, !tbaa !16
br label %putchar_unlocked.exit.i
putchar_unlocked.exit.i: ; preds = %cond.false.i.i128, %cond.true.i.i124
%56 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !16
%tobool.not.i127 = icmp eq i8 %56, 0
br i1 %tobool.not.i127, label %outs.exit.loopexit, label %while.body.i122, !llvm.loop !21
outs.exit.loopexit: ; preds = %putchar_unlocked.exit.i
%.pre = load i32, ptr @N, align 4, !tbaa !23
br label %outs.exit
outs.exit: ; preds = %outs.exit.loopexit, %for.body11
%57 = phi i32 [ %.pre, %outs.exit.loopexit ], [ %49, %for.body11 ]
%indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
%58 = sext i32 %57 to i64
%cmp10 = icmp slt i64 %indvars.iv.next157, %58
br i1 %cmp10, label %for.body11, label %for.end17, !llvm.loop !28
for.end17: ; preds = %outs.exit, %out.exit121
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s2) #5
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s1) #5
ret i32 0
}
declare i32 @__uflow(ptr noundef) local_unnamed_addr #4
declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #4
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 norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 40}
!20 = !{!10, !6, i64 48}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{!11, !11, i64 0}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}
|
#include<stdio.h>
#include<string.h>
int N,M,P[105][105],i,j,r,t;
int main()
{
for(;scanf("%d",&N),N;)
{
memset(P,0,sizeof(P));
for(i=1;i<N+2;i++)
for(scanf("%d",&M),j=0;j<M;j++)
{
scanf("%d",&t);
P[i][t]=1;
}
for(i=1,r=-1;i<=N;i++)
{
for(j=1;j<=100;j++)
if(P[N+1][j]&&!P[i][j])
break;
if(j==101)
{
if(r!=-1)
{
r=-1;
break;
}
r=i;
}
}
printf("%d\n",r);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151282/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151282/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@N = dso_local global i32 0, align 4
@P = dso_local local_unnamed_addr global [105 x [105 x i32]] zeroinitializer, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@M = dso_local global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@t = dso_local global i32 0, align 4
@r = dso_local local_unnamed_addr global i32 0, align 4
@.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:
%call60 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%0 = load i32, ptr @N, align 4, !tbaa !5
%tobool.not61 = icmp eq i32 %0, 0
br i1 %tobool.not61, label %for.end43, label %for.body
for.body: ; preds = %entry, %for.end41
%1 = phi i32 [ %20, %for.end41 ], [ %0, %entry ]
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) @P, i8 0, i64 44100, i1 false)
store i32 1, ptr @i, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %1, -1
br i1 %cmp50, label %for.body2, label %for.end12.thread
for.end12.thread: ; preds = %for.body
store i32 -1, ptr @r, align 4, !tbaa !5
br label %for.end41
for.body2: ; preds = %for.body, %for.inc10
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @M)
store i32 0, ptr @j, align 4, !tbaa !5
%2 = load i32, ptr @M, align 4, !tbaa !5
%cmp548 = icmp sgt i32 %2, 0
br i1 %cmp548, label %for.body6, label %for.body2.for.inc10_crit_edge
for.body2.for.inc10_crit_edge: ; preds = %for.body2
%.pre = load i32, ptr @i, align 4, !tbaa !5
br label %for.inc10
for.body6: ; preds = %for.body2, %for.body6
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
%3 = load i32, ptr @i, align 4, !tbaa !5
%idxprom = sext i32 %3 to i64
%4 = load i32, ptr @t, align 4, !tbaa !5
%idxprom8 = sext i32 %4 to i64
%arrayidx9 = getelementptr inbounds [105 x [105 x i32]], ptr @P, i64 0, i64 %idxprom, i64 %idxprom8
store i32 1, ptr %arrayidx9, align 4, !tbaa !5
%5 = load i32, ptr @j, align 4, !tbaa !5
%inc = add nsw i32 %5, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
%6 = load i32, ptr @M, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc, %6
br i1 %cmp5, label %for.body6, label %for.inc10, !llvm.loop !9
for.inc10: ; preds = %for.body6, %for.body2.for.inc10_crit_edge
%7 = phi i32 [ %.pre, %for.body2.for.inc10_crit_edge ], [ %3, %for.body6 ]
%inc11 = add nsw i32 %7, 1
store i32 %inc11, ptr @i, align 4, !tbaa !5
%8 = load i32, ptr @N, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %7, %8
br i1 %cmp.not, label %for.end12, label %for.body2, !llvm.loop !11
for.end12: ; preds = %for.inc10
store i32 1, ptr @i, align 4, !tbaa !5
store i32 -1, ptr @r, align 4, !tbaa !5
%cmp14.not57 = icmp slt i32 %8, 1
br i1 %cmp14.not57, label %for.end41, label %for.cond16.preheader.lr.ph
for.cond16.preheader.lr.ph: ; preds = %for.end12
%add19 = add nuw nsw i32 %8, 1
%idxprom20 = zext i32 %add19 to i64
%wide.trip.count = zext i32 %add19 to i64
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.lr.ph, %for.inc39
%9 = phi i32 [ poison, %for.cond16.preheader.lr.ph ], [ %18, %for.inc39 ]
%10 = phi i32 [ -1, %for.cond16.preheader.lr.ph ], [ %17, %for.inc39 ]
%indvars.iv65 = phi i64 [ 1, %for.cond16.preheader.lr.ph ], [ %indvars.iv.next66, %for.inc39 ]
%inc40545658 = phi i32 [ -1, %for.cond16.preheader.lr.ph ], [ %inc405455, %for.inc39 ]
br label %for.body18
for.body18: ; preds = %for.inc30.1, %for.cond16.preheader
%indvars.iv = phi i64 [ 1, %for.cond16.preheader ], [ %indvars.iv.next.1, %for.inc30.1 ]
%arrayidx23 = getelementptr inbounds [105 x [105 x i32]], ptr @P, i64 0, i64 %idxprom20, i64 %indvars.iv
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%tobool24.not = icmp eq i32 %11, 0
br i1 %tobool24.not, label %for.inc30, label %land.lhs.true
land.lhs.true: ; preds = %for.body18
%arrayidx28 = getelementptr inbounds [105 x [105 x i32]], ptr @P, i64 0, i64 %indvars.iv65, i64 %indvars.iv
%12 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%tobool29.not = icmp eq i32 %12, 0
br i1 %tobool29.not, label %for.inc39.loopexit, label %for.inc30
for.inc30: ; preds = %for.body18, %land.lhs.true
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx23.1 = getelementptr inbounds [105 x [105 x i32]], ptr @P, i64 0, i64 %idxprom20, i64 %indvars.iv.next
%13 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%tobool24.not.1 = icmp eq i32 %13, 0
br i1 %tobool24.not.1, label %for.inc30.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc30
%arrayidx28.1 = getelementptr inbounds [105 x [105 x i32]], ptr @P, i64 0, i64 %indvars.iv65, i64 %indvars.iv.next
%14 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
%tobool29.not.1 = icmp eq i32 %14, 0
br i1 %tobool29.not.1, label %for.inc39.loopexit, label %for.inc30.1
for.inc30.1: ; preds = %land.lhs.true.1, %for.inc30
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 101
br i1 %exitcond.not.1, label %if.then34, label %for.body18, !llvm.loop !12
if.then34: ; preds = %for.inc30.1
store i32 101, ptr @j, align 4, !tbaa !5
%cmp35.not = icmp eq i32 %inc40545658, -1
br i1 %cmp35.not, label %if.end37, label %if.then36
if.then36: ; preds = %if.then34
store i32 %9, ptr @i, align 4, !tbaa !5
store i32 -1, ptr @r, align 4, !tbaa !5
br label %for.end41
if.end37: ; preds = %if.then34
%15 = trunc i64 %indvars.iv65 to i32
store i32 %15, ptr @r, align 4, !tbaa !5
br label %for.inc39
for.inc39.loopexit: ; preds = %land.lhs.true.1, %land.lhs.true
%indvars.iv.lcssa = phi i64 [ %indvars.iv, %land.lhs.true ], [ %indvars.iv.next, %land.lhs.true.1 ]
%16 = trunc i64 %indvars.iv.lcssa to i32
store i32 %16, ptr @j, align 4, !tbaa !5
br label %for.inc39
for.inc39: ; preds = %for.inc39.loopexit, %if.end37
%17 = phi i32 [ %10, %for.inc39.loopexit ], [ %15, %if.end37 ]
%inc405455 = phi i32 [ %inc40545658, %for.inc39.loopexit ], [ %15, %if.end37 ]
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%18 = trunc i64 %indvars.iv.next66 to i32
%exitcond68.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
br i1 %exitcond68.not, label %for.end41.loopexit, label %for.cond16.preheader, !llvm.loop !13
for.end41.loopexit: ; preds = %for.inc39
store i32 %18, ptr @i, align 4, !tbaa !5
br label %for.end41
for.end41: ; preds = %for.end41.loopexit, %for.end12.thread, %for.end12, %if.then36
%19 = phi i32 [ -1, %for.end12 ], [ -1, %if.then36 ], [ -1, %for.end12.thread ], [ %17, %for.end41.loopexit ]
%call42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%20 = load i32, ptr @N, align 4, !tbaa !5
%tobool.not = icmp eq i32 %20, 0
br i1 %tobool.not, label %for.end43, label %for.body, !llvm.loop !14
for.end43: ; preds = %for.end41, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 @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" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void){
long int n,d,x,y;
long int ans=0;
scanf("%ld %ld",&n,&d);
for(int i=0;i<n;i++){
scanf("%ld %ld",&x,&y);
if(((x*x)+(y*y))<=(d*d)){
ans++;
}
}
printf("%ld",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151325/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151325/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%d = alloca i64, align 8
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp11 = icmp sgt i64 %0, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ans.012 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i64, ptr %x, align 8, !tbaa !5
%mul = mul nsw i64 %1, %1
%2 = load i64, ptr %y, align 8, !tbaa !5
%mul3 = mul nsw i64 %2, %2
%add = add nuw nsw i64 %mul3, %mul
%3 = load i64, ptr %d, align 8, !tbaa !5
%mul4 = mul nsw i64 %3, %3
%cmp5.not = icmp ule i64 %add, %mul4
%inc = zext i1 %cmp5.not to i64
%spec.select = add nuw nsw i64 %ans.012, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp sgt i64 %4, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
long long int N,D;
scanf("%d",&N);
scanf("%d",&D);
long long int dplus= D*D;
int x,y;
long long int a,b;
int i;
long long int dist=0;
int count=0;
for(i=0;i<N;i++){
scanf("%d",&x);
scanf("%d",&y);
a= abs(x);
b= abs(y);
dist = (a*a) + (b*b);
if (dist<=dplus){
count++;
}
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151369/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151369/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i64, align 8
%D = alloca i64, align 8
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%0 = load i64, ptr %D, align 8, !tbaa !5
%mul = mul nsw i64 %0, %0
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%1 = load i64, ptr %N, align 8, !tbaa !5
%cmp17 = icmp sgt i64 %1, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%count.019 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%2 = load i32, ptr %x, align 4, !tbaa !9
%3 = call i32 @llvm.abs.i32(i32 %2, i1 true)
%conv5 = zext i32 %3 to i64
%4 = load i32, ptr %y, align 4, !tbaa !9
%5 = call i32 @llvm.abs.i32(i32 %4, i1 true)
%conv6 = zext i32 %5 to i64
%mul7 = mul nuw nsw i64 %conv5, %conv5
%mul8 = mul nuw nsw i64 %conv6, %conv6
%add = add nuw nsw i64 %mul8, %mul7
%cmp9.not = icmp ule i64 %add, %mul
%inc = zext i1 %cmp9.not to i32
%spec.select = add nuw nsw i32 %count.019, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp sgt i64 %6, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 8, 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, 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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
int main(){
int N,D;
scanf("%d %d",&N,&D);
int i;
int j=0;
int X,Y;
for(i=0;i<N;i++){
scanf("%d %d",&X,&Y);
if(pow(X,2)+pow(Y,2)<=pow(D,2)){
j++;
}
}
printf("%d\n",j);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151411/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151411/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%N = alloca i32, align 4
%D = alloca i32, align 4
%X = alloca i32, align 4
%Y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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 %N, ptr noundef nonnull %D)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #3
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%j.017 = phi i32 [ %j.1, %for.body ], [ 0, %entry ]
%i.016 = phi i32 [ %inc9, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%1 = load i32, ptr %X, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%square = fmul double %conv, %conv
%2 = load i32, ptr %Y, align 4, !tbaa !5
%conv3 = sitofp i32 %2 to double
%square13 = fmul double %conv3, %conv3
%add = fadd double %square, %square13
%3 = load i32, ptr %D, align 4, !tbaa !5
%conv5 = sitofp i32 %3 to double
%square14 = fmul double %conv5, %conv5
%cmp7 = fcmp ole double %add, %square14
%inc = zext i1 %cmp7 to i32
%j.1 = add nuw nsw i32 %j.017, %inc
%inc9 = add nuw nsw i32 %i.016, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc9, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%j.0.lcssa = phi i32 [ 0, %entry ], [ %j.1, %for.body ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int N, D, X, Y, i, cnt = 0;
if (scanf("%d %d", &N, &D) == 1)
;
double dist;
for (i = 0; i < N; i++)
{
if (scanf("%d %d", &X, &Y) == 1)
;
dist = sqrt(pow((double)X, 2.0) + pow((double)Y, 2.0));
if (dist <= (double)D)
{
cnt++;
}
}
printf("%d", cnt);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151462/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151462/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
%X = alloca i32, align 4
%Y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp120 = icmp sgt i32 %0, 0
br i1 %cmp120, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc15, %for.body ], [ 0, %entry ]
%cnt.021 = phi i32 [ %cnt.1, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%1 = load i32, ptr %X, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%square = fmul double %conv, %conv
%2 = load i32, ptr %Y, align 4, !tbaa !5
%conv7 = sitofp i32 %2 to double
%square19 = fmul double %conv7, %conv7
%add = fadd double %square, %square19
%sqrt = call double @llvm.sqrt.f64(double %add)
%3 = load i32, ptr %D, align 4, !tbaa !5
%conv10 = sitofp i32 %3 to double
%cmp11 = fcmp ole double %sqrt, %conv10
%inc = zext i1 %cmp11 to i32
%cnt.1 = add nuw nsw i32 %cnt.021, %inc
%inc15 = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc15, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %for.body ]
%call16 = 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 %Y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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 double @llvm.sqrt.f64(double) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(){
long int n, d;
scanf("%ld%ld", &n, &d);
long int x, y, ans = 0;
for(int i = 0; i < n; i++){
scanf("%ld%ld", &x, &y);
if(d*d >= x*x + y*y){
ans++;
}
}
printf("%ld", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151505/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151505/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%d = alloca i64, align 8
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp11 = icmp sgt i64 %0, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ans.012 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i64, ptr %d, align 8, !tbaa !5
%mul = mul nsw i64 %1, %1
%2 = load i64, ptr %x, align 8, !tbaa !5
%mul3 = mul nsw i64 %2, %2
%3 = load i64, ptr %y, align 8, !tbaa !5
%mul4 = mul nsw i64 %3, %3
%add = add nuw nsw i64 %mul4, %mul3
%cmp5.not = icmp uge i64 %mul, %add
%inc = zext i1 %cmp5.not to i64
%spec.select = add nuw nsw i64 %ans.012, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp sgt i64 %4, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main() {
long x,y,cnt=0;
scanf("%ld %ld",&x,&y);
while(x--){
long p,q;
scanf("%ld %ld",&p,&q);
double ans;
ans=sqrt((p*p)+(q*q));
// printf("%lf ",ans);
if(ans<=y) cnt++;
}
printf("%ld",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151556/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
%p = alloca i64, align 8
%q = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i64, ptr %x, align 8, !tbaa !5
%dec8 = add nsw i64 %0, -1
store i64 %dec8, ptr %x, align 8, !tbaa !5
%tobool.not9 = icmp eq i64 %0, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%cnt.010 = phi i64 [ %cnt.1, %while.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %q)
%1 = load i64, ptr %p, align 8, !tbaa !5
%mul = mul nsw i64 %1, %1
%2 = load i64, ptr %q, align 8, !tbaa !5
%mul2 = mul nsw i64 %2, %2
%add = add nuw nsw i64 %mul2, %mul
%conv = sitofp i64 %add to double
%call3 = call double @sqrt(double noundef %conv) #4
%3 = load i64, ptr %y, align 8, !tbaa !5
%conv4 = sitofp i64 %3 to double
%cmp = fcmp ole double %call3, %conv4
%inc = zext i1 %cmp to i64
%cnt.1 = add nuw nsw i64 %cnt.010, %inc
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %p) #4
%4 = load i64, ptr %x, align 8, !tbaa !5
%dec = add nsw i64 %4, -1
store i64 %dec, ptr %x, align 8, !tbaa !5
%tobool.not = icmp eq i64 %4, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%cnt.0.lcssa = phi i64 [ 0, %entry ], [ %cnt.1, %while.body ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#define SIZE 100005
#define PI acosl(-1) //3.14159265358979323846264338327950L
#define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転
#define array(N, t) (t*)calloc(N, sizeof(t)) //t型N要素の1次元配列を動的確保後0クリア(freeを忘れずに)
#define zero(a); {int iter; rep(iter, sizeof(a)/sizeof((a)[0])) (a)[iter]=0;} //1次元配列aのゼロ初期化?
#define Sort(a, t) qsort(a, sizeof(a)/sizeof((a)[0]), sizeof(t), comp) //compを使って1次元配列をソート
#define max(a, b) (a > b) ? (a) : (b)
#define min(a, b) (a < b) ? (a) : (b)
typedef long long ll; typedef long double ld;
typedef struct node { int data; struct node *next; } Node;
Node *list[SIZE];
int queue[SIZE]; int q_head = 0, q_tail = 0;
void print_log(); //とりあえず文字を出力してどこまで実行できているか確認(for debug)
void printa_int(int *a, int size); //int型の1次元配列aを出力(for debug)
void printl_int(int size); //リンクリストを出力(for debug)
int comp(const void *a, const void *b); //昇順並び替えに使う比較関数
Node* add_node(int i, int data); void free_list(Node* head);
int queue_empty(); int queue_full();
void enqueue(int data); int dequeue();
ll* factorize(ll N); //Nを素因数分解、得られる配列は素因数,指数,素因数,…となっている(添字はintで指定する必要あり?)
void check_factorization(ll *fact); //素因数分解を表示(for debug)
int main() {
int i, N, count = 0;
ll D, X, Y;
scanf("%d %lld", &N, &D);
rep(i, N) {
scanf("%lld %lld", &X, &Y);
if (X * X + Y * Y <= D * D) count++;
}
printf("%d\n", count);
return 0;
}
void print_log() {
printf("=== print log ===\n");
}
void printa_int(int *a, int size) {
int i;
printf("[");
for (i = 0; i < size; i++)
printf("%d, ", a[i]);
printf("]\n");
}
void printl_int(int size) {
int i;
Node *t;
rep(i, size) {
printf("[%d] ", i);
for (t = list[i]; t; t = t->next) printf("%d, ", t->data);
printf("\n");
}
}
int comp(const void *a, const void *b) {
return *(int*)a - *(int*)b;
}
Node* add_node(int i, int data) {
if (!list[i]) {
list[i] = (Node*)malloc(sizeof(Node*));
list[i]->data = data;
} else {
Node *t;
t = list[i];
list[i] = (Node*)malloc(sizeof(Node*));
list[i]->data = data;
list[i]->next = t;
}
return list[i];
}
void free_list(Node* head) {
Node *prev = NULL, *t = head;
while (t) {
prev = t;
t = t->next;
free(prev);
}
}
int queue_empty() {
return q_head == q_tail;
}
int queue_full() {
return (q_head - 1) % SIZE == q_tail % SIZE;
}
void enqueue(int data) {
if (queue_full()) {
printf("full!\n");
return;
}
queue[q_tail++] = data;
q_tail %= SIZE;
}
int dequeue() {
if (queue_empty()) {
printf("empty!\n");
return -444444;
}
int data = queue[q_head++];
q_head %= SIZE;
return data;
}
ll* factorize(ll N) {
ll *res = array(((sqrt(N) + 1) * 2), ll);
ll i, x = N;
int count = 0;
for (i = 2; i * i <= N; i++) {
ll e = 0;
while (x % i == 0) {
x /= i;
e++;
}
if (e > 0) {
res[count * 2] = i;
res[count * 2 + 1] = e;
count++;
}
}
if (x > 1) {
res[count * 2] = x;
res[count * 2 + 1] = 1;
}
return res;
}
void check_factorization(ll *fact) {
int i = 1;
printf("%lld^%lld", fact[0], fact[1]);
while (fact[i * 2] > 0) {
printf(" * %lld^%lld", fact[i * 2], fact[i * 2 + 1]);
i++;
}
printf("\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151606/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151606/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ptr }
@q_head = dso_local local_unnamed_addr global i32 0, align 4
@q_tail = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [8 x i8] c"%d %lld\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"%d, \00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@list = dso_local local_unnamed_addr global [100005 x ptr] zeroinitializer, align 16
@queue = dso_local local_unnamed_addr global [100005 x i32] zeroinitializer, align 16
@.str.11 = private unnamed_addr constant [10 x i8] c"%lld^%lld\00", align 1
@.str.12 = private unnamed_addr constant [13 x i8] c" * %lld^%lld\00", align 1
@str = private unnamed_addr constant [18 x i8] c"=== print log ===\00", align 1
@str.13 = private unnamed_addr constant [2 x i8] c"]\00", align 1
@str.14 = private unnamed_addr constant [6 x i8] c"full!\00", align 1
@str.15 = private unnamed_addr constant [7 x i8] c"empty!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i64, align 8
%X = alloca i64, align 8
%Y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%count.011 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%i.010 = phi i32 [ %inc5, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%1 = load i64, ptr %X, align 8, !tbaa !9
%mul = mul nsw i64 %1, %1
%2 = load i64, ptr %Y, align 8, !tbaa !9
%mul2 = mul nsw i64 %2, %2
%add = add nuw nsw i64 %mul2, %mul
%3 = load i64, ptr %D, align 8, !tbaa !9
%mul3 = mul nsw i64 %3, %3
%cmp4.not = icmp ule i64 %add, %mul3
%inc = zext i1 %cmp4.not to i32
%spec.select = add nuw nsw i32 %count.011, %inc
%inc5 = add nuw nsw i32 %i.010, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc5, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %D) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #13
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_log() local_unnamed_addr #0 {
entry:
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printa_int(ptr nocapture noundef readonly %a, i32 noundef %size) local_unnamed_addr #0 {
entry:
%putchar = tail call i32 @putchar(i32 91)
%cmp5 = icmp sgt i32 %size, 0
br i1 %cmp5, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %size to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.13)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printl_int(i32 noundef %size) local_unnamed_addr #0 {
entry:
%cmp15 = icmp sgt i32 %size, 0
br i1 %cmp15, label %for.body.preheader, label %for.end6
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %size to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.end
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.end ]
%0 = trunc i64 %indvars.iv to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %0)
%arrayidx = getelementptr inbounds [100005 x ptr], ptr @list, i64 0, i64 %indvars.iv
%t.012 = load ptr, ptr %arrayidx, align 8, !tbaa !14
%tobool.not13 = icmp eq ptr %t.012, null
br i1 %tobool.not13, label %for.end, label %for.body2
for.body2: ; preds = %for.body, %for.body2
%t.014 = phi ptr [ %t.0, %for.body2 ], [ %t.012, %for.body ]
%1 = load i32, ptr %t.014, align 8, !tbaa !16
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %1)
%next = getelementptr inbounds %struct.node, ptr %t.014, i64 0, i32 1
%t.0 = load ptr, ptr %next, align 8, !tbaa !14
%tobool.not = icmp eq ptr %t.0, null
br i1 %tobool.not, label %for.end, label %for.body2, !llvm.loop !18
for.end: ; preds = %for.body2, %for.body
%putchar = tail call i32 @putchar(i32 10)
%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.end6, label %for.body, !llvm.loop !19
for.end6: ; preds = %for.end, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable
define dso_local ptr @add_node(i32 noundef %i, i32 noundef %data) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [100005 x ptr], ptr @list, i64 0, i64 %idxprom
%0 = load ptr, ptr %arrayidx, align 8, !tbaa !14
%tobool.not = icmp eq ptr %0, null
%call = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #14
br i1 %tobool.not, label %if.then, label %if.else
if.then: ; preds = %entry
store i32 %data, ptr %call, align 8, !tbaa !16
br label %if.end
if.else: ; preds = %entry
%next = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %0, ptr %next, align 8, !tbaa !20
br label %if.end
if.end: ; preds = %if.else, %if.then
store ptr %call, ptr %arrayidx, align 8
ret ptr %call
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nounwind uwtable
define dso_local void @free_list(ptr noundef %head) local_unnamed_addr #6 {
entry:
%tobool.not3 = icmp eq ptr %head, null
br i1 %tobool.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%t.04 = phi ptr [ %0, %while.body ], [ %head, %entry ]
%next = getelementptr inbounds %struct.node, ptr %t.04, i64 0, i32 1
%0 = load ptr, ptr %next, align 8, !tbaa !20
tail call void @free(ptr noundef nonnull %t.04) #13
%tobool.not = icmp eq ptr %0, null
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @queue_empty() local_unnamed_addr #8 {
entry:
%0 = load i32, ptr @q_head, align 4, !tbaa !5
%1 = load i32, ptr @q_tail, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @queue_full() local_unnamed_addr #8 {
entry:
%0 = load i32, ptr @q_head, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%rem = srem i32 %sub, 100005
%1 = load i32, ptr @q_tail, align 4, !tbaa !5
%rem1 = srem i32 %1, 100005
%cmp = icmp eq i32 %rem, %rem1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @enqueue(i32 noundef %data) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q_head, align 4, !tbaa !5
%sub.i = add nsw i32 %0, -1
%rem.i = srem i32 %sub.i, 100005
%1 = load i32, ptr @q_tail, align 4, !tbaa !5
%rem1.i = srem i32 %1, 100005
%cmp.i.not = icmp eq i32 %rem.i, %rem1.i
br i1 %cmp.i.not, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.14)
br label %return
if.end: ; preds = %entry
%inc = add nsw i32 %1, 1
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr @queue, i64 0, i64 %idxprom
store i32 %data, ptr %arrayidx, align 4, !tbaa !5
%rem = srem i32 %inc, 100005
store i32 %rem, ptr @q_tail, align 4, !tbaa !5
br label %return
return: ; preds = %if.end, %if.then
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @dequeue() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q_head, align 4, !tbaa !5
%1 = load i32, ptr @q_tail, align 4, !tbaa !5
%cmp.i.not = icmp eq i32 %0, %1
br i1 %cmp.i.not, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.15)
br label %return
if.end: ; preds = %entry
%inc = add nsw i32 %0, 1
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100005 x i32], ptr @queue, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%rem = srem i32 %inc, 100005
store i32 %rem, ptr @q_head, align 4, !tbaa !5
br label %return
return: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ -444444, %if.then ], [ %2, %if.end ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind memory(write, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @factorize(i64 noundef %N) local_unnamed_addr #9 {
entry:
%conv = sitofp i64 %N to double
%call = tail call double @sqrt(double noundef %conv) #13
%add = fadd double %call, 1.000000e+00
%mul = fmul double %add, 2.000000e+00
%conv1 = fptoui double %mul to i64
%call2 = tail call noalias ptr @calloc(i64 noundef %conv1, i64 noundef 8) #15
%cmp.not52 = icmp slt i64 %N, 4
br i1 %cmp.not52, label %for.end, label %while.cond.preheader
while.cond.preheader: ; preds = %entry, %if.end
%count.055 = phi i32 [ %count.1, %if.end ], [ 0, %entry ]
%x.054 = phi i64 [ %x.1.lcssa61, %if.end ], [ %N, %entry ]
%i.053 = phi i64 [ %inc15, %if.end ], [ 2, %entry ]
%rem47 = srem i64 %x.054, %i.053
%cmp548 = icmp eq i64 %rem47, 0
br i1 %cmp548, label %while.body, label %if.end
while.body: ; preds = %while.cond.preheader, %while.body
%e.050 = phi i64 [ %inc, %while.body ], [ 0, %while.cond.preheader ]
%x.149 = phi i64 [ %div, %while.body ], [ %x.054, %while.cond.preheader ]
%div = sdiv i64 %x.149, %i.053
%inc = add nuw nsw i64 %e.050, 1
%rem = srem i64 %div, %i.053
%cmp5 = icmp eq i64 %rem, 0
br i1 %cmp5, label %while.body, label %if.then, !llvm.loop !22
if.then: ; preds = %while.body
%mul9 = shl nsw i32 %count.055, 1
%idxprom = sext i32 %mul9 to i64
%arrayidx = getelementptr inbounds i64, ptr %call2, i64 %idxprom
store i64 %i.053, ptr %arrayidx, align 8, !tbaa !9
%add11 = or i32 %mul9, 1
%idxprom12 = sext i32 %add11 to i64
%arrayidx13 = getelementptr inbounds i64, ptr %call2, i64 %idxprom12
store i64 %inc, ptr %arrayidx13, align 8, !tbaa !9
%inc14 = add nsw i32 %count.055, 1
br label %if.end
if.end: ; preds = %while.cond.preheader, %if.then
%x.1.lcssa61 = phi i64 [ %div, %if.then ], [ %x.054, %while.cond.preheader ]
%count.1 = phi i32 [ %inc14, %if.then ], [ %count.055, %while.cond.preheader ]
%inc15 = add nuw nsw i64 %i.053, 1
%mul3 = mul nsw i64 %inc15, %inc15
%cmp.not = icmp sgt i64 %mul3, %N
br i1 %cmp.not, label %for.end.loopexit, label %while.cond.preheader, !llvm.loop !23
for.end.loopexit: ; preds = %if.end
%0 = shl nsw i32 %count.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%x.0.lcssa = phi i64 [ %N, %entry ], [ %x.1.lcssa61, %for.end.loopexit ]
%count.0.lcssa = phi i32 [ 0, %entry ], [ %0, %for.end.loopexit ]
%cmp16 = icmp sgt i64 %x.0.lcssa, 1
br i1 %cmp16, label %if.then18, label %if.end26
if.then18: ; preds = %for.end
%idxprom20 = sext i32 %count.0.lcssa to i64
%arrayidx21 = getelementptr inbounds i64, ptr %call2, i64 %idxprom20
store i64 %x.0.lcssa, ptr %arrayidx21, align 8, !tbaa !9
%add23 = or i32 %count.0.lcssa, 1
%idxprom24 = sext i32 %add23 to i64
%arrayidx25 = getelementptr inbounds i64, ptr %call2, i64 %idxprom24
store i64 1, ptr %arrayidx25, align 8, !tbaa !9
br label %if.end26
if.end26: ; preds = %if.then18, %for.end
ret ptr %call2
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #11
; Function Attrs: nofree nounwind uwtable
define dso_local void @check_factorization(ptr nocapture noundef readonly %fact) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %fact, align 8, !tbaa !9
%arrayidx1 = getelementptr inbounds i64, ptr %fact, i64 1
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef %0, i64 noundef %1)
%arrayidx218 = getelementptr inbounds i64, ptr %fact, i64 2
%2 = load i64, ptr %arrayidx218, align 8, !tbaa !9
%cmp19 = icmp sgt i64 %2, 0
br i1 %cmp19, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 1, %entry ]
%3 = phi i64 [ %6, %while.body ], [ %2, %entry ]
%mul21 = phi i32 [ %mul, %while.body ], [ 2, %entry ]
%add = or i32 %mul21, 1
%idxprom7 = zext i32 %add to i64
%arrayidx8 = getelementptr inbounds i64, ptr %fact, i64 %idxprom7
%4 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %3, i64 noundef %4)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%5 = trunc i64 %indvars.iv.next to i32
%mul = shl nuw nsw i32 %5, 1
%idxprom = zext i32 %mul to i64
%arrayidx2 = getelementptr inbounds i64, ptr %fact, i64 %idxprom
%6 = load i64, ptr %arrayidx2, align 8, !tbaa !9
%cmp = icmp sgt i64 %6, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !24
while.end: ; preds = %while.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #12
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind memory(write, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind }
attributes #13 = { nounwind }
attributes #14 = { nounwind allocsize(0) }
attributes #15 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"node", !6, i64 0, !15, i64 8}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!17, !15, i64 8}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
|
#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
int a,b;
scanf("%d%d",&a,&b);
if(a%b==0)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15165/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15165/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%rem = srem i32 %1, %2
%cmp2 = icmp eq i32 %rem, 0
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, 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 %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int i;
int n;
int a;
int sum=0;
for(; ; ) {
scanf("%d", &n);
if(n==0) break;
sum=0;
for(a=5; n/a>0; a*=5) {
sum+=n/a;
}
printf("%d\n", sum);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151736/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151736/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp15 = icmp eq i32 %0, 0
br i1 %cmp15, label %for.end5, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %2, %for.end ], [ %0, %entry ]
%cmp210 = icmp sgt i32 %1, 4
br i1 %cmp210, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond1.preheader
%div916 = udiv i32 %1, 5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%div13 = phi i32 [ %div, %for.body ], [ %div916, %for.body.preheader ]
%sum.012 = phi i32 [ %add, %for.body ], [ 0, %for.body.preheader ]
%a.011 = phi i32 [ %mul, %for.body ], [ 5, %for.body.preheader ]
%add = add nuw nsw i32 %div13, %sum.012
%mul = mul nuw nsw i32 %a.011, 5
%div = sdiv i32 %1, %mul
%cmp2 = icmp sgt i32 %div, 0
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond1.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond1.preheader ], [ %add, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %for.end5, label %for.cond1.preheader
for.end5: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",0<a&&a<10&&0<b&&b<10?a*b:-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151787/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151787/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond7 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 10
%or.cond8 = select i1 %or.cond7, i1 %cmp5, i1 false
%mul = mul nsw i32 %2, %0
%cond = select i1 %or.cond8, i32 %mul, i32 -1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
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)"}
|
#include<stdio.h>
int main()
{
int A,B;
scanf("%d %d",&A,&B);
if(A<=9 && B<=9)
printf("%d\n",A*B);
else
printf("-1\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151837/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151837/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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:
%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
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %B, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a, b;
scanf("%d""%d", &a, &b);
if(a > 9 || b > 9){
printf("%d\n", -1);
return 0;
}
printf("%d\n", a * b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151880/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151880/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%mul = mul nsw i32 %1, %0
%mul.sink = select i1 %or.cond, i32 -1, i32 %mul
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if(a<=9&&b<=9){
printf("%d\n",a*b);
}
else
printf("-1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151923/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@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:
%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
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if (a<=9 && b<=9){
printf("%d\n",a*b);
}else{
printf("-1\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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:
%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
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
// Your code here!
int a ,b ,c;
scanf("%d %d",&a ,&b);
if(a>=10 || b>=10){
printf("-1");
}
else{
c = a*b;
printf("%d",c);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
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<=9 &&b<=9)
printf("%d\n",a*b);
else printf("-1\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152052/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152052/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@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:
%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
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
if(a<10&&b<10)
printf("%d",a*b);
else
printf("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152096/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152096/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\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
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
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 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(((1<=A)&&(A<=9))&&((1<=B)&&(B<=9))){
printf("%d\n",A*B);
}else{
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152139/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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:
%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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %B, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 10
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
br i1 %or.cond9, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nuw nsw i32 %2, %0
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef 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)"}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
if(a>=1&&a<=9&&b<=9&&b>=1)
printf("%d",a*b);
else
printf("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp slt i32 %2, 10
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp sgt i32 %2, 0
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
br i1 %or.cond9, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nuw nsw i32 %2, %0
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%call7 = 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 %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)"}
|
#include<stdio.h>
//qsort(pa,n,sizeof(int),(int(*)(const void* ,const void*))cmp);
int main(void){
int a,b;
scanf("%d%d",&a,&b);
if((a>=1&&a<=9)&&(b>=1&&b<=9))
printf("%d",a*b);
else
printf("%d",-1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 10
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
%mul = mul nuw nsw i32 %2, %0
%.sink = select i1 %or.cond9, i32 %mul, i32 -1
%call7 = 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) #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)"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
int ans =-1;
if(a<= 9 && a>=1 &&b<= 9 && b>=1)
ans = a*b;
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152269/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152269/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp slt i32 %2, 10
%or.cond7 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp sgt i32 %2, 0
%or.cond8 = select i1 %or.cond7, i1 %cmp5, i1 false
%mul = mul nuw nsw i32 %2, %0
%spec.select = select i1 %or.cond8, i32 %mul, i32 -1
%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 %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)"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if (a>=1 && b>=1 && a<=9 && b<=9){
printf("%d",a*b);
}else{
printf("%d",-1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152311/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 0
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 9
%or.cond8 = select i1 %3, i1 %cmp1, i1 false
%cmp5 = icmp slt i32 %1, 10
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
%mul = mul nuw nsw i32 %1, %0
%.sink = select i1 %or.cond9, i32 %mul, i32 -1
%call7 = 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) #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)"}
|
#include <stdio.h>
#include <stdlib.h>
long long mod = 1e9+7;
long long function1(long long x){
int i;
long long y=1;
for(i=1;i<=x;i++){
y *= i;
y %= mod;
}
return y;
}
int main(void){
long long N,M;
long long A,B;
scanf("%lld%lld",&N,&M);
long long ans = 0;
A = function1(N) % mod;
B = function1(M) % mod;
if(N==M){
ans = 2*A;
ans %=mod;
ans *= B;
ans %=mod;
}else if(abs(N-M)==1){
ans = A*B;
ans %=mod;
}else{
ans = 0;
}
printf("%lld",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152355/source.c"
target datalayout = "e-m:e-p270: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 global i64 1000000007, align 8
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @function1(i64 noundef %x) local_unnamed_addr #0 {
entry:
%cmp.not7 = icmp slt i64 %x, 1
br i1 %cmp.not7, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%0 = load i64, ptr @mod, align 8, !tbaa !5
%xtraiter = and i64 %x, 3
%1 = icmp ult i64 %x, 4
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %x, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%y.09 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %y.09, %indvars.iv
%rem = srem i64 %mul, %0
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, %0
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, %0
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, %0
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%rem.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%y.09.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%y.09.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %y.09.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %y.09.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, %0
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%y.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
ret i64 %y.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i64, align 8
%M = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not7.i = icmp slt i64 %0, 1
%.pre = load i64, ptr @mod, align 8, !tbaa !5
br i1 %cmp.not7.i, label %function1.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %0, 3
%1 = icmp ult i64 %0, 4
br i1 %1, label %function1.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %0, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %indvars.iv.next.i.3, %for.body.i ]
%y.09.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %rem.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.3, %for.body.i ]
%mul.i = mul nsw i64 %y.09.i, %indvars.iv.i
%rem.i = srem i64 %mul.i, %.pre
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%mul.i.1 = mul nsw i64 %rem.i, %indvars.iv.next.i
%rem.i.1 = srem i64 %mul.i.1, %.pre
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%mul.i.2 = mul nsw i64 %rem.i.1, %indvars.iv.next.i.1
%rem.i.2 = srem i64 %mul.i.2, %.pre
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%mul.i.3 = mul nsw i64 %rem.i.2, %indvars.iv.next.i.2
%rem.i.3 = srem i64 %mul.i.3, %.pre
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %function1.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9
function1.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %rem.i.3, %for.body.i ]
%indvars.iv.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %indvars.iv.next.i.3, %for.body.i ]
%y.09.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %rem.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %function1.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %function1.exit.loopexit.unr-lcssa, %for.body.i.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %for.body.i.epil ], [ %indvars.iv.i.unr, %function1.exit.loopexit.unr-lcssa ]
%y.09.i.epil = phi i64 [ %rem.i.epil, %for.body.i.epil ], [ %y.09.i.unr, %function1.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %function1.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul nsw i64 %y.09.i.epil, %indvars.iv.i.epil
%rem.i.epil = srem i64 %mul.i.epil, %.pre
%indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %function1.exit, label %for.body.i.epil, !llvm.loop !13
function1.exit: ; preds = %function1.exit.loopexit.unr-lcssa, %for.body.i.epil, %entry
%y.0.lcssa.i = phi i64 [ 1, %entry ], [ %rem.i.lcssa.ph, %function1.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i.epil ]
%rem = srem i64 %y.0.lcssa.i, %.pre
%2 = load i64, ptr %M, align 8, !tbaa !5
%cmp.not7.i22 = icmp slt i64 %2, 1
br i1 %cmp.not7.i22, label %function1.exit32, label %for.body.i24.preheader
for.body.i24.preheader: ; preds = %function1.exit
%xtraiter34 = and i64 %2, 3
%3 = icmp ult i64 %2, 4
br i1 %3, label %function1.exit32.loopexit.unr-lcssa, label %for.body.i24.preheader.new
for.body.i24.preheader.new: ; preds = %for.body.i24.preheader
%unroll_iter38 = and i64 %2, -4
br label %for.body.i24
for.body.i24: ; preds = %for.body.i24, %for.body.i24.preheader.new
%indvars.iv.i25 = phi i64 [ 1, %for.body.i24.preheader.new ], [ %indvars.iv.next.i29.3, %for.body.i24 ]
%y.09.i26 = phi i64 [ 1, %for.body.i24.preheader.new ], [ %rem.i28.3, %for.body.i24 ]
%niter39 = phi i64 [ 0, %for.body.i24.preheader.new ], [ %niter39.next.3, %for.body.i24 ]
%mul.i27 = mul nsw i64 %y.09.i26, %indvars.iv.i25
%rem.i28 = srem i64 %mul.i27, %.pre
%indvars.iv.next.i29 = add nuw nsw i64 %indvars.iv.i25, 1
%mul.i27.1 = mul nsw i64 %rem.i28, %indvars.iv.next.i29
%rem.i28.1 = srem i64 %mul.i27.1, %.pre
%indvars.iv.next.i29.1 = add nuw nsw i64 %indvars.iv.i25, 2
%mul.i27.2 = mul nsw i64 %rem.i28.1, %indvars.iv.next.i29.1
%rem.i28.2 = srem i64 %mul.i27.2, %.pre
%indvars.iv.next.i29.2 = add nuw nsw i64 %indvars.iv.i25, 3
%mul.i27.3 = mul nsw i64 %rem.i28.2, %indvars.iv.next.i29.2
%rem.i28.3 = srem i64 %mul.i27.3, %.pre
%indvars.iv.next.i29.3 = add nuw nsw i64 %indvars.iv.i25, 4
%niter39.next.3 = add i64 %niter39, 4
%niter39.ncmp.3 = icmp eq i64 %niter39.next.3, %unroll_iter38
br i1 %niter39.ncmp.3, label %function1.exit32.loopexit.unr-lcssa, label %for.body.i24, !llvm.loop !9
function1.exit32.loopexit.unr-lcssa: ; preds = %for.body.i24, %for.body.i24.preheader
%rem.i28.lcssa.ph = phi i64 [ undef, %for.body.i24.preheader ], [ %rem.i28.3, %for.body.i24 ]
%indvars.iv.i25.unr = phi i64 [ 1, %for.body.i24.preheader ], [ %indvars.iv.next.i29.3, %for.body.i24 ]
%y.09.i26.unr = phi i64 [ 1, %for.body.i24.preheader ], [ %rem.i28.3, %for.body.i24 ]
%lcmp.mod36.not = icmp eq i64 %xtraiter34, 0
br i1 %lcmp.mod36.not, label %function1.exit32, label %for.body.i24.epil
for.body.i24.epil: ; preds = %function1.exit32.loopexit.unr-lcssa, %for.body.i24.epil
%indvars.iv.i25.epil = phi i64 [ %indvars.iv.next.i29.epil, %for.body.i24.epil ], [ %indvars.iv.i25.unr, %function1.exit32.loopexit.unr-lcssa ]
%y.09.i26.epil = phi i64 [ %rem.i28.epil, %for.body.i24.epil ], [ %y.09.i26.unr, %function1.exit32.loopexit.unr-lcssa ]
%epil.iter35 = phi i64 [ %epil.iter35.next, %for.body.i24.epil ], [ 0, %function1.exit32.loopexit.unr-lcssa ]
%mul.i27.epil = mul nsw i64 %y.09.i26.epil, %indvars.iv.i25.epil
%rem.i28.epil = srem i64 %mul.i27.epil, %.pre
%indvars.iv.next.i29.epil = add nuw nsw i64 %indvars.iv.i25.epil, 1
%epil.iter35.next = add i64 %epil.iter35, 1
%epil.iter35.cmp.not = icmp eq i64 %epil.iter35.next, %xtraiter34
br i1 %epil.iter35.cmp.not, label %function1.exit32, label %for.body.i24.epil, !llvm.loop !14
function1.exit32: ; preds = %function1.exit32.loopexit.unr-lcssa, %for.body.i24.epil, %function1.exit
%y.0.lcssa.i31 = phi i64 [ 1, %function1.exit ], [ %rem.i28.lcssa.ph, %function1.exit32.loopexit.unr-lcssa ], [ %rem.i28.epil, %for.body.i24.epil ]
%rem3 = srem i64 %y.0.lcssa.i31, %.pre
%cmp = icmp eq i64 %0, %2
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %function1.exit32
%mul = shl nsw i64 %rem, 1
%rem4 = srem i64 %mul, %.pre
%mul5 = mul nsw i64 %rem4, %rem3
br label %if.end13.sink.split
if.else: ; preds = %function1.exit32
%sub = sub nsw i64 %0, %2
%conv = trunc i64 %sub to i32
%4 = call i32 @llvm.abs.i32(i32 %conv, i1 true)
%cmp7 = icmp eq i32 %4, 1
br i1 %cmp7, label %if.then9, label %if.end13
if.then9: ; preds = %if.else
%mul10 = mul nsw i64 %rem3, %rem
br label %if.end13.sink.split
if.end13.sink.split: ; preds = %if.then, %if.then9
%mul10.sink = phi i64 [ %mul10, %if.then9 ], [ %mul5, %if.then ]
%rem11 = srem i64 %mul10.sink, %.pre
br label %if.end13
if.end13: ; preds = %if.end13.sink.split, %if.else
%ans.0 = phi i64 [ 0, %if.else ], [ %rem11, %if.end13.sink.split ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include<stdio.h>
int MAX(int a,int b){return a<b?b:a;}
int MIN(int a,int b){return a<b?a:b;}
void ifMAX(int *a,int b){*a=MAX(*a,b);}
int main(){
int h,n,k,m,p,d,i,j,l,a[110],b[110],c[110],e[110],dp[110][110]={};
int s[11010]={};
int t[110][11010]={1};
scanf("%d %d %d %d %d %d",&h,&n,&k,&m,&p,&d);
for(i=0;i<n;i++)scanf("%d %d",&e[i],&c[i]);
for(i=0;i<m;i++)scanf("%d %d",&b[i],&a[i]);
for(i=0;i<10010;i++){
for(j=0;j<m;j++)ifMAX(&s[i+a[j]],s[i]+b[j]);
}
for(l=0;l<n;l++){
for(i=k-1;i>-1;i--){
for(j=h-1;j>-1;j--){
if(t[i][j])ifMAX(&t[i+1][j+e[l]],t[i][j]+c[l]);
}
}
}
for(i=0;i<=d;i++){
for(j=h;j;j--){
if(dp[i][j]==0&&i)continue;
ifMAX(&dp[i][j-1],dp[i][j]);
for(l=0;l<=j;l++){
if(t[k][l])ifMAX(&dp[i+1][MIN(h,j-l+p)],dp[i][j]+s[t[k][l]-1]);
}
}
}
printf("%d\n",dp[d][p]?dp[d][p]:-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MAX(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MIN(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @ifMAX(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%cond.i = tail call i32 @llvm.smax.i32(i32 %0, i32 %b)
store i32 %cond.i, ptr %a, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
%k = alloca i32, align 4
%m = alloca i32, align 4
%p = alloca i32, align 4
%d = alloca i32, align 4
%a = alloca [110 x i32], align 16
%b = alloca [110 x i32], align 16
%c = alloca [110 x i32], align 16
%e = alloca [110 x i32], align 16
%dp = alloca [110 x [110 x i32]], align 16
%s = alloca [11010 x i32], align 16
%t = alloca [110 x [11010 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #7
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %b) #7
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %c) #7
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %e) #7
call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %dp) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48400) %dp, i8 0, i64 48400, i1 false)
call void @llvm.lifetime.start.p0(i64 44040, ptr nonnull %s) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44040) %s, i8 0, i64 44040, i1 false)
call void @llvm.lifetime.start.p0(i64 4844400, ptr nonnull %t) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4844400) %t, i8 0, i64 4844400, i1 false)
store i32 1, ptr %t, align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %m, ptr noundef nonnull %p, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp199 = icmp sgt i32 %0, 0
br i1 %cmp199, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp5201 = icmp sgt i32 %1, 0
br i1 %cmp5201, label %for.body6, label %for.cond36.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [110 x i32], ptr %e, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [110 x i32], ptr %c, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond15.preheader: ; preds = %for.body6
%cmp19203 = icmp sgt i32 %18, 0
br i1 %cmp19203, label %for.cond18.preheader.us.preheader, label %for.cond36.preheader
for.cond18.preheader.us.preheader: ; preds = %for.cond15.preheader
%wide.trip.count = zext i32 %18 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %18, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond18.preheader.us
for.cond18.preheader.us: ; preds = %for.cond18.preheader.us.preheader, %for.cond18.for.inc33_crit_edge.us
%indvars.iv240 = phi i64 [ 0, %for.cond18.preheader.us.preheader ], [ %indvars.iv.next241, %for.cond18.for.inc33_crit_edge.us ]
%arrayidx26.us = getelementptr inbounds [11010 x i32], ptr %s, i64 0, i64 %indvars.iv240
%5 = trunc i64 %indvars.iv240 to i32
br i1 %4, label %for.cond18.for.inc33_crit_edge.us.unr-lcssa, label %for.body20.us
for.body20.us: ; preds = %for.cond18.preheader.us, %for.body20.us
%indvars.iv237 = phi i64 [ %indvars.iv.next238.1, %for.body20.us ], [ 0, %for.cond18.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body20.us ], [ 0, %for.cond18.preheader.us ]
%arrayidx22.us = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv237
%6 = load i32, ptr %arrayidx22.us, align 8, !tbaa !5
%add.us = add nsw i32 %6, %5
%idxprom23.us = sext i32 %add.us to i64
%arrayidx24.us = getelementptr inbounds [11010 x i32], ptr %s, i64 0, i64 %idxprom23.us
%7 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
%arrayidx28.us = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv237
%8 = load i32, ptr %arrayidx28.us, align 8, !tbaa !5
%add29.us = add nsw i32 %8, %7
%9 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5
%cond.i.i.us = call i32 @llvm.smax.i32(i32 %9, i32 %add29.us)
store i32 %cond.i.i.us, ptr %arrayidx24.us, align 4, !tbaa !5
%indvars.iv.next238 = or i64 %indvars.iv237, 1
%arrayidx22.us.1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv.next238
%10 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5
%add.us.1 = add nsw i32 %10, %5
%idxprom23.us.1 = sext i32 %add.us.1 to i64
%arrayidx24.us.1 = getelementptr inbounds [11010 x i32], ptr %s, i64 0, i64 %idxprom23.us.1
%11 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
%arrayidx28.us.1 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv.next238
%12 = load i32, ptr %arrayidx28.us.1, align 4, !tbaa !5
%add29.us.1 = add nsw i32 %12, %11
%13 = load i32, ptr %arrayidx24.us.1, align 4, !tbaa !5
%cond.i.i.us.1 = call i32 @llvm.smax.i32(i32 %13, i32 %add29.us.1)
store i32 %cond.i.i.us.1, ptr %arrayidx24.us.1, align 4, !tbaa !5
%indvars.iv.next238.1 = add nuw nsw i64 %indvars.iv237, 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.cond18.for.inc33_crit_edge.us.unr-lcssa, label %for.body20.us, !llvm.loop !11
for.cond18.for.inc33_crit_edge.us.unr-lcssa: ; preds = %for.body20.us, %for.cond18.preheader.us
%indvars.iv237.unr = phi i64 [ 0, %for.cond18.preheader.us ], [ %indvars.iv.next238.1, %for.body20.us ]
br i1 %lcmp.mod.not, label %for.cond18.for.inc33_crit_edge.us, label %for.body20.us.epil
for.body20.us.epil: ; preds = %for.cond18.for.inc33_crit_edge.us.unr-lcssa
%arrayidx22.us.epil = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv237.unr
%14 = load i32, ptr %arrayidx22.us.epil, align 4, !tbaa !5
%add.us.epil = add nsw i32 %14, %5
%idxprom23.us.epil = sext i32 %add.us.epil to i64
%arrayidx24.us.epil = getelementptr inbounds [11010 x i32], ptr %s, i64 0, i64 %idxprom23.us.epil
%15 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5
%arrayidx28.us.epil = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv237.unr
%16 = load i32, ptr %arrayidx28.us.epil, align 4, !tbaa !5
%add29.us.epil = add nsw i32 %16, %15
%17 = load i32, ptr %arrayidx24.us.epil, align 4, !tbaa !5
%cond.i.i.us.epil = call i32 @llvm.smax.i32(i32 %17, i32 %add29.us.epil)
store i32 %cond.i.i.us.epil, ptr %arrayidx24.us.epil, align 4, !tbaa !5
br label %for.cond18.for.inc33_crit_edge.us
for.cond18.for.inc33_crit_edge.us: ; preds = %for.cond18.for.inc33_crit_edge.us.unr-lcssa, %for.body20.us.epil
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%exitcond243.not = icmp eq i64 %indvars.iv.next241, 10010
br i1 %exitcond243.not, label %for.cond36.preheader, label %for.cond18.preheader.us, !llvm.loop !12
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.body6 ], [ 0, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv234
%arrayidx10 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv234
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx10)
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%18 = load i32, ptr %m, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp5 = icmp slt i64 %indvars.iv.next235, %19
br i1 %cmp5, label %for.body6, label %for.cond15.preheader, !llvm.loop !13
for.cond36.preheader: ; preds = %for.cond18.for.inc33_crit_edge.us, %for.cond4.preheader, %for.cond15.preheader
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp37213 = icmp sgt i32 %20, 0
br i1 %cmp37213, label %for.body38.lr.ph, label %for.cond73.preheader
for.body38.lr.ph: ; preds = %for.cond36.preheader
%21 = load i32, ptr %k, align 4, !tbaa !5
%cmp40210 = icmp sgt i32 %21, 0
%22 = load i32, ptr %h, align 4
%cmp44207 = icmp sgt i32 %22, 0
%or.cond283 = select i1 %cmp40210, i1 %cmp44207, i1 false
br i1 %or.cond283, label %for.body38.us.us.preheader, label %for.cond73.preheader
for.body38.us.us.preheader: ; preds = %for.body38.lr.ph
%23 = zext i32 %22 to i64
%24 = zext i32 %21 to i64
%wide.trip.count259 = zext i32 %20 to i64
br label %for.body38.us.us
for.body38.us.us: ; preds = %for.body38.us.us.preheader, %for.cond39.for.inc70_crit_edge.split.us.us.us
%indvars.iv255 = phi i64 [ 0, %for.body38.us.us.preheader ], [ %indvars.iv.next256, %for.cond39.for.inc70_crit_edge.split.us.us.us ]
%arrayidx54.us.us = getelementptr inbounds [110 x i32], ptr %e, i64 0, i64 %indvars.iv255
%arrayidx63.us.us = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %indvars.iv255
br label %for.body41.us.us.us
for.body41.us.us.us: ; preds = %for.cond43.for.cond39.loopexit_crit_edge.us.us.us, %for.body38.us.us
%indvars.iv249 = phi i64 [ %indvars.iv.next250, %for.cond43.for.cond39.loopexit_crit_edge.us.us.us ], [ %24, %for.body38.us.us ]
%indvars.iv247.in = phi i64 [ %indvars.iv247, %for.cond43.for.cond39.loopexit_crit_edge.us.us.us ], [ %24, %for.body38.us.us ]
%indvars.iv247 = add nsw i64 %indvars.iv247.in, -1
%indvars.iv.next250 = add nsw i64 %indvars.iv249, -1
br label %for.body45.us.us.us
for.body45.us.us.us: ; preds = %for.inc65.us.us.us, %for.body41.us.us.us
%indvars.iv244 = phi i64 [ %indvars.iv.next245, %for.inc65.us.us.us ], [ %23, %for.body41.us.us.us ]
%indvars.iv.next245 = add nsw i64 %indvars.iv244, -1
%idxprom48.us.us.us = and i64 %indvars.iv.next245, 4294967295
%arrayidx49.us.us.us = getelementptr inbounds [110 x [11010 x i32]], ptr %t, i64 0, i64 %indvars.iv247, i64 %idxprom48.us.us.us
%25 = load i32, ptr %arrayidx49.us.us.us, align 4, !tbaa !5
%tobool.not.us.us.us = icmp eq i32 %25, 0
br i1 %tobool.not.us.us.us, label %for.inc65.us.us.us, label %if.then.us.us.us
if.then.us.us.us: ; preds = %for.body45.us.us.us
%indvars = trunc i64 %indvars.iv.next245 to i32
%26 = load i32, ptr %arrayidx54.us.us, align 4, !tbaa !5
%add55.us.us.us = add nsw i32 %26, %indvars
%idxprom56.us.us.us = sext i32 %add55.us.us.us to i64
%arrayidx57.us.us.us = getelementptr inbounds [110 x [11010 x i32]], ptr %t, i64 0, i64 %indvars.iv249, i64 %idxprom56.us.us.us
%27 = load i32, ptr %arrayidx63.us.us, align 4, !tbaa !5
%add64.us.us.us = add nsw i32 %27, %25
%28 = load i32, ptr %arrayidx57.us.us.us, align 4, !tbaa !5
%cond.i.i195.us.us.us = call i32 @llvm.smax.i32(i32 %28, i32 %add64.us.us.us)
store i32 %cond.i.i195.us.us.us, ptr %arrayidx57.us.us.us, align 4, !tbaa !5
br label %for.inc65.us.us.us
for.inc65.us.us.us: ; preds = %if.then.us.us.us, %for.body45.us.us.us
%cmp44.us.us.us = icmp sgt i64 %indvars.iv244, 1
br i1 %cmp44.us.us.us, label %for.body45.us.us.us, label %for.cond43.for.cond39.loopexit_crit_edge.us.us.us, !llvm.loop !14
for.cond43.for.cond39.loopexit_crit_edge.us.us.us: ; preds = %for.inc65.us.us.us
%cmp40.us.us.us = icmp sgt i64 %indvars.iv247.in, 1
br i1 %cmp40.us.us.us, label %for.body41.us.us.us, label %for.cond39.for.inc70_crit_edge.split.us.us.us, !llvm.loop !15
for.cond39.for.inc70_crit_edge.split.us.us.us: ; preds = %for.cond43.for.cond39.loopexit_crit_edge.us.us.us
%indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
%exitcond260.not = icmp eq i64 %indvars.iv.next256, %wide.trip.count259
br i1 %exitcond260.not, label %for.cond73.preheader, label %for.body38.us.us, !llvm.loop !16
for.cond73.preheader: ; preds = %for.cond39.for.inc70_crit_edge.split.us.us.us, %for.body38.lr.ph, %for.cond36.preheader
%29 = load i32, ptr %d, align 4, !tbaa !5
%cmp74.not226 = icmp slt i32 %29, 0
%.pre = load i32, ptr %p, align 4
br i1 %cmp74.not226, label %for.end134, label %for.body75.lr.ph
for.body75.lr.ph: ; preds = %for.cond73.preheader
%30 = load i32, ptr %h, align 4, !tbaa !5
%tobool77.not223 = icmp eq i32 %30, 0
%31 = load i32, ptr %k, align 4
%idxprom99 = sext i32 %31 to i64
br i1 %tobool77.not223, label %for.end134, label %for.body75.preheader
for.body75.preheader: ; preds = %for.body75.lr.ph
%32 = add i32 %30, 1
%33 = sext i32 %30 to i64
%34 = add nuw i32 %29, 1
%wide.trip.count278 = zext i32 %34 to i64
br label %for.body75
for.body75: ; preds = %for.body75.preheader, %for.cond76.for.inc132_crit_edge
%indvars.iv274 = phi i64 [ 0, %for.body75.preheader ], [ %indvars.iv.next275, %for.cond76.for.inc132_crit_edge ]
%tobool84 = icmp ne i64 %indvars.iv274, 0
%indvars.iv.next275 = add nuw nsw i64 %indvars.iv274, 1
br label %for.body78
for.body78: ; preds = %for.body75, %for.inc129
%indvars.iv269 = phi i64 [ %33, %for.body75 ], [ %.pre280, %for.inc129 ]
%indvars.iv265 = phi i32 [ %32, %for.body75 ], [ %indvars.iv.next266, %for.inc129 ]
%arrayidx82 = getelementptr inbounds [110 x [110 x i32]], ptr %dp, i64 0, i64 %indvars.iv274, i64 %indvars.iv269
%35 = load i32, ptr %arrayidx82, align 4, !tbaa !5
%cmp83 = icmp eq i32 %35, 0
%or.cond = and i1 %tobool84, %cmp83
%.pre280 = add nsw i64 %indvars.iv269, -1
br i1 %or.cond, label %for.inc129, label %if.end86
if.end86: ; preds = %for.body78
%arrayidx91 = getelementptr inbounds [110 x [110 x i32]], ptr %dp, i64 0, i64 %indvars.iv274, i64 %.pre280
%36 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%cond.i.i196 = call i32 @llvm.smax.i32(i32 %36, i32 %35)
store i32 %cond.i.i196, ptr %arrayidx91, align 4, !tbaa !5
%cmp97.not221 = icmp slt i64 %indvars.iv269, 0
br i1 %cmp97.not221, label %for.inc129, label %for.body98.preheader
for.body98.preheader: ; preds = %if.end86
%wide.trip.count267 = zext i32 %indvars.iv265 to i64
%37 = trunc i64 %indvars.iv269 to i32
br label %for.body98
for.body98: ; preds = %for.body98.preheader, %for.inc126
%indvars.iv261 = phi i64 [ 0, %for.body98.preheader ], [ %indvars.iv.next262, %for.inc126 ]
%arrayidx102 = getelementptr inbounds [110 x [11010 x i32]], ptr %t, i64 0, i64 %idxprom99, i64 %indvars.iv261
%38 = load i32, ptr %arrayidx102, align 4, !tbaa !5
%tobool103.not = icmp eq i32 %38, 0
br i1 %tobool103.not, label %for.inc126, label %if.then104
if.then104: ; preds = %for.body98
%39 = trunc i64 %indvars.iv261 to i32
%sub108 = sub i32 %37, %39
%add109 = add nsw i32 %sub108, %.pre
%cond.i = call i32 @llvm.smin.i32(i32 %30, i32 %add109)
%idxprom111 = sext i32 %cond.i to i64
%arrayidx112 = getelementptr inbounds [110 x [110 x i32]], ptr %dp, i64 0, i64 %indvars.iv.next275, i64 %idxprom111
%40 = load i32, ptr %arrayidx82, align 4, !tbaa !5
%sub121 = add nsw i32 %38, -1
%idxprom122 = sext i32 %sub121 to i64
%arrayidx123 = getelementptr inbounds [11010 x i32], ptr %s, i64 0, i64 %idxprom122
%41 = load i32, ptr %arrayidx123, align 4, !tbaa !5
%add124 = add nsw i32 %41, %40
%42 = load i32, ptr %arrayidx112, align 4, !tbaa !5
%cond.i.i197 = call i32 @llvm.smax.i32(i32 %42, i32 %add124)
store i32 %cond.i.i197, ptr %arrayidx112, align 4, !tbaa !5
br label %for.inc126
for.inc126: ; preds = %for.body98, %if.then104
%indvars.iv.next262 = add nuw nsw i64 %indvars.iv261, 1
%exitcond268.not = icmp eq i64 %indvars.iv.next262, %wide.trip.count267
br i1 %exitcond268.not, label %for.inc129, label %for.body98, !llvm.loop !17
for.inc129: ; preds = %for.inc126, %for.body78, %if.end86
%43 = and i64 %.pre280, 4294967295
%tobool77.not = icmp eq i64 %43, 0
%indvars.iv.next266 = add i32 %indvars.iv265, -1
br i1 %tobool77.not, label %for.cond76.for.inc132_crit_edge, label %for.body78, !llvm.loop !18
for.cond76.for.inc132_crit_edge: ; preds = %for.inc129
%exitcond279.not = icmp eq i64 %indvars.iv.next275, %wide.trip.count278
br i1 %exitcond279.not, label %for.end134, label %for.body75, !llvm.loop !19
for.end134: ; preds = %for.cond76.for.inc132_crit_edge, %for.body75.lr.ph, %for.cond73.preheader
%idxprom135 = sext i32 %29 to i64
%idxprom137 = sext i32 %.pre to i64
%arrayidx138 = getelementptr inbounds [110 x [110 x i32]], ptr %dp, i64 0, i64 %idxprom135, i64 %idxprom137
%44 = load i32, ptr %arrayidx138, align 4, !tbaa !5
%tobool139.not = icmp eq i32 %44, 0
%spec.select = select i1 %tobool139.not, i32 -1, i32 %44
%call144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4844400, ptr nonnull %t) #7
call void @llvm.lifetime.end.p0(i64 44040, ptr nonnull %s) #7
call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %dp) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %e) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %c) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
int main()
{
int n;
int a;
int last_a = 1000000000;
int count = 0;
scanf("%d", &n);
while (n--) {
scanf("%d", &a);
if (a > last_a) count++;
last_a = a;
}
printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec4 = add nsw i32 %0, -1
store i32 %dec4, ptr %n, align 4, !tbaa !5
%tobool.not5 = icmp eq i32 %0, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%count.07 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%last_a.06 = phi i32 [ %1, %while.body ], [ 1000000000, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %1, %last_a.06
%inc = zext i1 %cmp to i32
%spec.select = add nuw nsw i32 %count.07, %inc
%2 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
%call2 = 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 %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n, x;
int i, j, k;
int sum;
int kaisuu;
while (1){
scanf("%d %d", &n, &x);
kaisuu = 0;
if (n == 0 && x == 0){
break;
}
for (i = 1; i <= n; i++){
for (j = i + 1; j <= n; j++){
for (k = j + 1; k <= n; k++){
sum = i + j + k;
if (sum == x && i != j && j != k){
kaisuu++;
}
}
}
}
printf("%d\n", kaisuu);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152506/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152506/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp eq i32 %0, 0
%1 = load i32, ptr %x, 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.end25
%2 = phi i32 [ %28, %for.end25 ], [ %1, %entry ]
%3 = phi i32 [ %27, %for.end25 ], [ %0, %entry ]
%cmp2.not49 = icmp slt i32 %3, 1
br i1 %cmp2.not49, label %for.end25, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%4 = add i32 %3, -2
%broadcast.splatinsert62 = insertelement <4 x i32> poison, i32 %2, i64 0
%broadcast.splat63 = shufflevector <4 x i32> %broadcast.splatinsert62, <4 x i32> poison, <4 x i32> zeroinitializer
br label %for.body
for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body
%kaisuu.1.lcssa = phi i32 [ %kaisuu.051, %for.body ], [ %kaisuu.2.lcssa, %for.cond3.loopexit ]
%exitcond57.not = icmp eq i32 %i.050, %3
%indvar.next = add i32 %indvar, 1
br i1 %exitcond57.not, label %for.end25, label %for.body, !llvm.loop !9
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%kaisuu.051 = phi i32 [ 0, %for.body.preheader ], [ %kaisuu.1.lcssa, %for.cond.loopexit ]
%i.050 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ]
%add = add nuw i32 %i.050, 1
%cmp4.not45.not = icmp slt i32 %i.050, %3
br i1 %cmp4.not45.not, label %for.body5, label %for.cond.loopexit
for.cond3.loopexit: ; preds = %for.body9, %middle.block, %for.body5
%kaisuu.2.lcssa = phi i32 [ %kaisuu.147, %for.body5 ], [ %25, %middle.block ], [ %kaisuu.3, %for.body9 ]
%exitcond.not = icmp eq i32 %j.046, %3
%indvar.next59 = add i32 %indvar58, 1
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body, %for.cond3.loopexit
%indvar58 = phi i32 [ %indvar.next59, %for.cond3.loopexit ], [ 0, %for.body ]
%kaisuu.147 = phi i32 [ %kaisuu.2.lcssa, %for.cond3.loopexit ], [ %kaisuu.051, %for.body ]
%j.046 = phi i32 [ %add6, %for.cond3.loopexit ], [ %add, %for.body ]
%5 = add i32 %indvar, %indvar58
%6 = sub i32 %4, %5
%add6 = add i32 %j.046, 1
%cmp8.not42.not = icmp slt i32 %j.046, %3
br i1 %cmp8.not42.not, label %for.body9.lr.ph, label %for.cond3.loopexit
for.body9.lr.ph: ; preds = %for.body5
%add10 = add nuw nsw i32 %j.046, %i.050
%cmp14.not = icmp eq i32 %i.050, %j.046
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body9.preheader, label %vector.ph
vector.ph: ; preds = %for.body9.lr.ph
%n.vec = and i32 %6, -8
%ind.end = add i32 %add6, %n.vec
%7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %kaisuu.147, i64 0
%.splatinsert = insertelement <4 x i32> poison, i32 %add6, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add10, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert64 = insertelement <4 x i1> poison, i1 %cmp14.not, i64 0
%broadcast.splat65 = shufflevector <4 x i1> %broadcast.splatinsert64, <4 x i1> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert66 = insertelement <4 x i32> poison, i32 %j.046, i64 0
%broadcast.splat67 = shufflevector <4 x i32> %broadcast.splatinsert66, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %7, %vector.ph ], [ %22, %vector.body ]
%vec.phi60 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%8 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind
%9 = add nuw nsw <4 x i32> %broadcast.splat, %step.add
%10 = icmp ne <4 x i32> %8, %broadcast.splat63
%11 = icmp ne <4 x i32> %9, %broadcast.splat63
%12 = icmp eq <4 x i32> %broadcast.splat67, %vec.ind
%13 = icmp eq <4 x i32> %broadcast.splat67, %step.add
%14 = or <4 x i1> %10, %12
%15 = or <4 x i1> %14, %broadcast.splat65
%16 = or <4 x i1> %11, %13
%17 = or <4 x i1> %16, %broadcast.splat65
%18 = xor <4 x i1> %15, <i1 true, i1 true, i1 true, i1 true>
%19 = xor <4 x i1> %17, <i1 true, i1 true, i1 true, i1 true>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = zext <4 x i1> %19 to <4 x i32>
%22 = add <4 x i32> %vec.phi, %20
%23 = add <4 x i32> %vec.phi60, %21
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%24 = icmp eq i32 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %23, %22
%25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %6, %n.vec
br i1 %cmp.n, label %for.cond3.loopexit, label %for.body9.preheader
for.body9.preheader: ; preds = %for.body9.lr.ph, %middle.block
%kaisuu.244.ph = phi i32 [ %kaisuu.147, %for.body9.lr.ph ], [ %25, %middle.block ]
%k.043.ph = phi i32 [ %add6, %for.body9.lr.ph ], [ %ind.end, %middle.block ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.body9
%kaisuu.244 = phi i32 [ %kaisuu.3, %for.body9 ], [ %kaisuu.244.ph, %for.body9.preheader ]
%k.043 = phi i32 [ %inc19, %for.body9 ], [ %k.043.ph, %for.body9.preheader ]
%add11 = add nuw nsw i32 %add10, %k.043
%cmp12 = icmp ne i32 %add11, %2
%cmp16.not = icmp eq i32 %j.046, %k.043
%26 = or i1 %cmp12, %cmp16.not
%or.cond41 = or i1 %26, %cmp14.not
%not.or.cond41 = xor i1 %or.cond41, true
%inc = zext i1 %not.or.cond41 to i32
%kaisuu.3 = add nsw i32 %kaisuu.244, %inc
%inc19 = add nuw nsw i32 %k.043, 1
%cmp8.not.not = icmp slt i32 %k.043, %3
br i1 %cmp8.not.not, label %for.body9, label %for.cond3.loopexit, !llvm.loop !15
for.end25: ; preds = %for.cond.loopexit, %for.cond.preheader
%kaisuu.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %kaisuu.1.lcssa, %for.cond.loopexit ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %kaisuu.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%27 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %27, 0
%28 = load i32, ptr %x, align 4
%cmp1 = icmp eq i32 %28, 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.end25, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
|
#include<stdio.h>
int main(void)
{
int kioku1[10000]={0},kioku2[10000]={0},kioku3[10000]={0};
int i,j,z;
int n,x;
int count;
int flg=0;
int mawaru=0;
while(scanf("%d %d",&n,&x))
{
count=0;
if (n==0&&x==0)
{
break;
}
for (i=1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
for (z=1;z<=n;z++)
{
flg=0;
if (i+j+z==x)
{
if (i==j||i==z||j==z)
{
}
else
{
for (mawaru=0;mawaru<count;mawaru++)
{
if (kioku1[mawaru]==i&&(kioku2[mawaru]==j||kioku2[mawaru]==z))
{
flg=1;
}
else if (kioku1[mawaru]==j&&(kioku2[mawaru]==i||kioku2[mawaru]==z))
{
flg=1;
}
else if (kioku1[mawaru]==z&&(kioku2[mawaru]==i||kioku2[mawaru]==j))
{
flg=1;
}
}
if (flg==0)
{
kioku1[count]=i;
kioku2[count]=j;
kioku3[count]=z;
count++;
}
}
}
}
}
}
printf("%d\n",count);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152557/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152557/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%kioku1 = alloca [10000 x i32], align 16
%kioku2 = alloca [10000 x i32], align 16
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %kioku1) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %kioku1, i8 0, i64 40000, i1 false)
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %kioku2) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %kioku2, i8 0, i64 40000, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call147 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%tobool.not148 = icmp eq i32 %call147, 0
br i1 %tobool.not148, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end79
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
%1 = load i32, ptr %x, align 4
%cmp1 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp2.not142 = icmp slt i32 %0, 1
br i1 %cmp2.not142, label %for.end79, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.cond3.for.inc77_crit_edge.split
%count.0144 = phi i32 [ %.us-phi, %for.cond3.for.inc77_crit_edge.split ], [ 0, %for.cond.preheader ]
%i.0143 = phi i32 [ %inc78, %for.cond3.for.inc77_crit_edge.split ], [ 1, %for.cond.preheader ]
br label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.cond3.preheader, %for.cond6.for.inc74_crit_edge
%count.1139 = phi i32 [ %count.0144, %for.cond3.preheader ], [ %.us-phi, %for.cond6.for.inc74_crit_edge ]
%j.0137 = phi i32 [ 1, %for.cond3.preheader ], [ %inc75, %for.cond6.for.inc74_crit_edge ]
%add = add nuw nsw i32 %j.0137, %i.0143
%cmp12 = icmp eq i32 %i.0143, %j.0137
%cmp12.fr = freeze i1 %cmp12
br i1 %cmp12.fr, label %for.cond6.for.inc74_crit_edge, label %for.body8
for.body8: ; preds = %for.cond6.preheader, %for.inc71
%count.2134 = phi i32 [ %count.3, %for.inc71 ], [ %count.1139, %for.cond6.preheader ]
%z.0132 = phi i32 [ %inc72, %for.inc71 ], [ 1, %for.cond6.preheader ]
%add9 = add nuw nsw i32 %add, %z.0132
%cmp10 = icmp ne i32 %add9, %1
%cmp13 = icmp eq i32 %i.0143, %z.0132
%or.cond123 = or i1 %cmp13, %cmp10
%cmp15 = icmp eq i32 %j.0137, %z.0132
%or.cond124 = or i1 %cmp15, %or.cond123
br i1 %or.cond124, label %for.inc71, label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.body8
%cmp18128 = icmp sgt i32 %count.2134, 0
br i1 %cmp18128, label %for.body19.preheader, label %if.then60
for.body19.preheader: ; preds = %for.cond17.preheader
%wide.trip.count = zext i32 %count.2134 to i64
br label %for.body19
for.body19: ; preds = %for.body19.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next, %for.inc ]
%flg.0129 = phi i32 [ 0, %for.body19.preheader ], [ %flg.1, %for.inc ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %kioku1, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp20 = icmp eq i32 %2, %i.0143
br i1 %cmp20, label %land.lhs.true21, label %if.else30
land.lhs.true21: ; preds = %for.body19
%arrayidx23 = getelementptr inbounds [10000 x i32], ptr %kioku2, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp eq i32 %3, %j.0137
%cmp28 = icmp eq i32 %3, %z.0132
%or.cond125 = or i1 %cmp24, %cmp28
br i1 %or.cond125, label %for.inc, label %if.else30
if.else30: ; preds = %land.lhs.true21, %for.body19
%cmp33 = icmp eq i32 %2, %j.0137
br i1 %cmp33, label %land.lhs.true34, label %if.else43
land.lhs.true34: ; preds = %if.else30
%arrayidx36 = getelementptr inbounds [10000 x i32], ptr %kioku2, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%cmp37 = icmp eq i32 %4, %i.0143
%cmp41 = icmp eq i32 %4, %z.0132
%or.cond126 = or i1 %cmp37, %cmp41
br i1 %or.cond126, label %for.inc, label %if.else43
if.else43: ; preds = %land.lhs.true34, %if.else30
%cmp46 = icmp eq i32 %2, %z.0132
br i1 %cmp46, label %land.lhs.true47, label %for.inc
land.lhs.true47: ; preds = %if.else43
%arrayidx49 = getelementptr inbounds [10000 x i32], ptr %kioku2, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%cmp50 = icmp eq i32 %5, %i.0143
%cmp54 = icmp eq i32 %5, %j.0137
%or.cond127 = or i1 %cmp50, %cmp54
%spec.select = select i1 %or.cond127, i32 1, i32 %flg.0129
br label %for.inc
for.inc: ; preds = %land.lhs.true47, %land.lhs.true34, %land.lhs.true21, %if.else43
%flg.1 = phi i32 [ %flg.0129, %if.else43 ], [ 1, %land.lhs.true21 ], [ 1, %land.lhs.true34 ], [ %spec.select, %land.lhs.true47 ]
%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.body19, !llvm.loop !9
for.end: ; preds = %for.inc
%cmp59 = icmp eq i32 %flg.1, 0
br i1 %cmp59, label %if.then60, label %for.inc71
if.then60: ; preds = %for.cond17.preheader, %for.end
%idxprom61 = sext i32 %count.2134 to i64
%arrayidx62 = getelementptr inbounds [10000 x i32], ptr %kioku1, i64 0, i64 %idxprom61
store i32 %i.0143, ptr %arrayidx62, align 4, !tbaa !5
%arrayidx64 = getelementptr inbounds [10000 x i32], ptr %kioku2, i64 0, i64 %idxprom61
store i32 %j.0137, ptr %arrayidx64, align 4, !tbaa !5
%inc67 = add nsw i32 %count.2134, 1
br label %for.inc71
for.inc71: ; preds = %for.body8, %for.end, %if.then60
%count.3 = phi i32 [ %inc67, %if.then60 ], [ %count.2134, %for.end ], [ %count.2134, %for.body8 ]
%inc72 = add nuw i32 %z.0132, 1
%exitcond151.not = icmp eq i32 %z.0132, %0
br i1 %exitcond151.not, label %for.cond6.for.inc74_crit_edge, label %for.body8, !llvm.loop !11
for.cond6.for.inc74_crit_edge: ; preds = %for.inc71, %for.cond6.preheader
%.us-phi = phi i32 [ %count.1139, %for.cond6.preheader ], [ %count.3, %for.inc71 ]
%inc75 = add nuw i32 %j.0137, 1
%exitcond152.not = icmp eq i32 %j.0137, %0
br i1 %exitcond152.not, label %for.cond3.for.inc77_crit_edge.split, label %for.cond6.preheader, !llvm.loop !12
for.cond3.for.inc77_crit_edge.split: ; preds = %for.cond6.for.inc74_crit_edge
%inc78 = add nuw i32 %i.0143, 1
%exitcond153.not = icmp eq i32 %i.0143, %0
br i1 %exitcond153.not, label %for.end79, label %for.cond3.preheader, !llvm.loop !13
for.end79: ; preds = %for.cond3.for.inc77_crit_edge.split, %for.cond.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %.us-phi, %for.cond3.for.inc77_crit_edge.split ]
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %for.end79, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %kioku2) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %kioku1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <string.h>
char arr[100000][2][51];
int main()
{
int N, i, j, ans = 1, prev, curr;
char temp[51], *prevstr;
scanf("%d", &N);
for (i = 0; i < N; i++)
{
scanf("%s%s", arr[i][0], arr[i][1]);
if (strcmp(arr[i][0], arr[i][1]) > 0)
{
strcpy(temp, arr[i][0]);
strcpy(arr[i][0], arr[i][1]);
strcpy(arr[i][1], temp);
}
}
i = 1;
scanf("%d", &prev);
prev--;
prevstr = arr[prev][0];
while (ans && i < N)
{
scanf("%d", &curr);
curr--;
i++;
if (strcmp(prevstr, arr[curr][0]) < 0)
prevstr = arr[curr][0];
else if (strcmp(prevstr, arr[curr][1]) < 0)
prevstr = arr[curr][1];
else
ans = 0;
}
while (i < N)
{
scanf("%d", &curr);
i++;
}
if (ans)
printf("YES");
else
printf("NO");
//system("PAUSE");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15260/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15260/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@arr = dso_local global [100000 x [2 x [51 x i8]]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%prev = alloca i32, align 4
%curr = alloca i32, align 4
%temp = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %prev) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %curr) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %temp) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp99 = icmp sgt i32 %0, 0
br i1 %cmp99, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x [2 x [51 x i8]]], ptr @arr, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [100000 x [2 x [51 x i8]]], ptr @arr, i64 0, i64 %indvars.iv, i64 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%call15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx4) #6
%cmp16 = icmp sgt i32 %call15, 0
br i1 %cmp16, label %if.then, label %for.inc
if.then: ; preds = %for.body
%call22 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %temp, ptr noundef nonnull dereferenceable(1) %arrayidx) #5
%call31 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx4) #5
%call37 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx4, ptr noundef nonnull dereferenceable(1) %temp) #5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %prev)
%3 = load i32, ptr %prev, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %prev, align 4, !tbaa !5
%4 = load i32, ptr %N, align 4
%cmp43101 = icmp sgt i32 %4, 1
br i1 %cmp43101, label %while.body.preheader, label %while.cond72.preheader
while.body.preheader: ; preds = %for.end
%idxprom39 = sext i32 %dec to i64
%arrayidx40 = getelementptr inbounds [100000 x [2 x [51 x i8]]], ptr @arr, i64 0, i64 %idxprom39
br label %while.body
while.cond72.preheader.loopexit: ; preds = %if.end71
%5 = select i1 %tobool, ptr @.str.2, ptr @.str.3
br label %while.cond72.preheader
while.cond72.preheader: ; preds = %while.cond72.preheader.loopexit, %for.end
%6 = phi i32 [ %4, %for.end ], [ %8, %while.cond72.preheader.loopexit ]
%i.1.lcssa = phi i32 [ 1, %for.end ], [ %inc46, %while.cond72.preheader.loopexit ]
%tobool.lcssa = phi ptr [ @.str.2, %for.end ], [ %5, %while.cond72.preheader.loopexit ]
%cmp73105 = icmp slt i32 %i.1.lcssa, %6
br i1 %cmp73105, label %while.body74, label %while.end77
while.body: ; preds = %while.body.preheader, %if.end71
%prevstr.0103 = phi ptr [ %prevstr.1, %if.end71 ], [ %arrayidx40, %while.body.preheader ]
%i.1102 = phi i32 [ %inc46, %if.end71 ], [ 1, %while.body.preheader ]
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %curr)
%7 = load i32, ptr %curr, align 4, !tbaa !5
%dec45 = add nsw i32 %7, -1
store i32 %dec45, ptr %curr, align 4, !tbaa !5
%inc46 = add nuw nsw i32 %i.1102, 1
%idxprom47 = sext i32 %dec45 to i64
%arrayidx48 = getelementptr inbounds [100000 x [2 x [51 x i8]]], ptr @arr, i64 0, i64 %idxprom47
%call51 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %prevstr.0103, ptr noundef nonnull dereferenceable(1) %arrayidx48) #6
%cmp52 = icmp slt i32 %call51, 0
br i1 %cmp52, label %if.end71, label %if.else
if.else: ; preds = %while.body
%arrayidx60 = getelementptr inbounds [100000 x [2 x [51 x i8]]], ptr @arr, i64 0, i64 %idxprom47, i64 1
%call62 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %prevstr.0103, ptr noundef nonnull dereferenceable(1) %arrayidx60) #6
%cmp63 = icmp slt i32 %call62, 0
%call62.lobit = lshr i32 %call62, 31
%arrayidx60.prevstr.0 = select i1 %cmp63, ptr %arrayidx60, ptr %prevstr.0103
br label %if.end71
if.end71: ; preds = %if.else, %while.body
%ans.1 = phi i32 [ 1, %while.body ], [ %call62.lobit, %if.else ]
%prevstr.1 = phi ptr [ %arrayidx48, %while.body ], [ %arrayidx60.prevstr.0, %if.else ]
%tobool = icmp ne i32 %ans.1, 0
%8 = load i32, ptr %N, align 4
%cmp43 = icmp slt i32 %inc46, %8
%9 = select i1 %tobool, i1 %cmp43, i1 false
br i1 %9, label %while.body, label %while.cond72.preheader.loopexit, !llvm.loop !11
while.body74: ; preds = %while.cond72.preheader, %while.body74
%i.2106 = phi i32 [ %inc76, %while.body74 ], [ %i.1.lcssa, %while.cond72.preheader ]
%call75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %curr)
%inc76 = add nuw nsw i32 %i.2106, 1
%10 = load i32, ptr %N, align 4, !tbaa !5
%cmp73 = icmp slt i32 %inc76, %10
br i1 %cmp73, label %while.body74, label %while.end77, !llvm.loop !12
while.end77: ; preds = %while.body74, %while.cond72.preheader
%call82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %tobool.lcssa)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %temp) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %curr) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %prev) #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 i32 @strcmp(ptr nocapture noundef, 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}
|
#include <stdio.h>
int main(){
int d[175000];
int x,y,a,b,c,i,q,cnt;
while(1){
i=cnt=0;
scanf("%d %d",&x,&y);
if(x==0&&y==0) break;
if(x>=3){
for(a=1;a<=x-2;a++){
for(b=a+1;b<=x-1;b++){
for(c=b+1;c<=x;c++){
d[i]=a+b+c;
i++;
}
}
}
q=x*(x-1)*(x-2)/6;
for(i=0;i<q;i++){
if(d[i]==y) cnt++;
}
printf("%d\n",cnt);
}else{
printf("0\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152643/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152643/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@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:
%d = alloca [175000 x i32], align 16
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 700000, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call68 = 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
%cmp69 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp170 = icmp eq i32 %1, 0
%or.cond71 = select i1 %cmp69, i1 %cmp170, i1 false
br i1 %or.cond71, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end39
%2 = phi i32 [ %30, %if.end39 ], [ %1, %entry ]
%3 = phi i32 [ %29, %if.end39 ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, 2
br i1 %cmp2, label %for.body.preheader, label %if.else
for.body.preheader: ; preds = %if.end
%sub = add nsw i32 %3, -2
%4 = add nsw i32 %3, -1
br label %for.body
for.cond.loopexit: ; preds = %for.cond5.loopexit, %for.body
%i.1.lcssa = phi i32 [ %i.061, %for.body ], [ %6, %for.cond5.loopexit ]
%exitcond73.not = icmp eq i32 %add, %4
%indvar.next = add i32 %indvar, 1
br i1 %exitcond73.not, label %for.end21, label %for.body, !llvm.loop !9
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%a.062 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ]
%i.061 = phi i32 [ 0, %for.body.preheader ], [ %i.1.lcssa, %for.cond.loopexit ]
%5 = add i32 %indvar, 3
%add = add nuw nsw i32 %a.062, 1
%cmp7.not.not56 = icmp slt i32 %add, %3
br i1 %cmp7.not.not56, label %for.body12.lr.ph, label %for.cond.loopexit
for.cond5.loopexit: ; preds = %for.body12, %middle.block83
%indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block83 ], [ %indvars.iv.next, %for.body12 ]
%6 = trunc i64 %indvars.iv.next.lcssa to i32
%exitcond.not = icmp eq i32 %add9, %3
%indvar.next82 = add i32 %indvar81, 1
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body12.lr.ph, !llvm.loop !11
for.body12.lr.ph: ; preds = %for.body, %for.cond5.loopexit
%indvar81 = phi i32 [ %indvar.next82, %for.cond5.loopexit ], [ 0, %for.body ]
%i.158 = phi i32 [ %6, %for.cond5.loopexit ], [ %i.061, %for.body ]
%b.057 = phi i32 [ %add9, %for.cond5.loopexit ], [ %add, %for.body ]
%7 = add i32 %5, %indvar81
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %7)
%8 = add i32 %indvar, %indvar81
%reass.sub = sub i32 %smax, %8
%9 = add i32 %reass.sub, -3
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
%add9 = add nuw nsw i32 %b.057, 1
%add13 = add nuw nsw i32 %b.057, %a.062
%12 = sext i32 %i.158 to i64
%min.iters.check85 = icmp ult i32 %9, 7
br i1 %min.iters.check85, label %for.body12.preheader, label %vector.ph86
vector.ph86: ; preds = %for.body12.lr.ph
%n.vec88 = and i64 %11, 8589934584
%ind.end = add nsw i64 %n.vec88, %12
%.cast = trunc i64 %n.vec88 to i32
%ind.end90 = add i32 %add9, %.cast
%.splatinsert = insertelement <4 x i32> poison, i32 %add9, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add nuw <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%broadcast.splatinsert96 = insertelement <4 x i32> poison, i32 %add13, i64 0
%broadcast.splat97 = shufflevector <4 x i32> %broadcast.splatinsert96, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body93
vector.body93: ; preds = %vector.body93, %vector.ph86
%index94 = phi i64 [ 0, %vector.ph86 ], [ %index.next98, %vector.body93 ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph86 ], [ %vec.ind.next, %vector.body93 ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = add i64 %index94, %12
%13 = add nuw nsw <4 x i32> %broadcast.splat97, %vec.ind
%14 = add nuw nsw <4 x i32> %broadcast.splat97, %step.add
%15 = getelementptr inbounds [175000 x i32], ptr %d, i64 0, i64 %offset.idx
store <4 x i32> %13, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
store <4 x i32> %14, ptr %16, align 4, !tbaa !5
%index.next98 = add nuw i64 %index94, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%17 = icmp eq i64 %index.next98, %n.vec88
br i1 %17, label %middle.block83, label %vector.body93, !llvm.loop !12
middle.block83: ; preds = %vector.body93
%cmp.n92 = icmp eq i64 %11, %n.vec88
br i1 %cmp.n92, label %for.cond5.loopexit, label %for.body12.preheader
for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block83
%indvars.iv.ph = phi i64 [ %12, %for.body12.lr.ph ], [ %ind.end, %middle.block83 ]
%c.054.ph = phi i32 [ %add9, %for.body12.lr.ph ], [ %ind.end90, %middle.block83 ]
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %for.body12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ %indvars.iv.ph, %for.body12.preheader ]
%c.054 = phi i32 [ %inc15, %for.body12 ], [ %c.054.ph, %for.body12.preheader ]
%add14 = add nuw nsw i32 %add13, %c.054
%arrayidx = getelementptr inbounds [175000 x i32], ptr %d, i64 0, i64 %indvars.iv
store i32 %add14, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%inc15 = add nuw nsw i32 %c.054, 1
%cmp11.not.not = icmp slt i32 %c.054, %3
br i1 %cmp11.not.not, label %for.body12, label %for.cond5.loopexit, !llvm.loop !15
for.end21: ; preds = %for.cond.loopexit
%mul = mul nsw i32 %4, %3
%mul24 = mul nsw i32 %mul, %sub
%cmp2664 = icmp sgt i32 %mul24, 5
br i1 %cmp2664, label %for.body27.preheader, label %for.end36
for.body27.preheader: ; preds = %for.end21
%div78 = udiv i32 %mul24, 6
%wide.trip.count = zext i32 %div78 to i64
%min.iters.check = icmp ult i32 %mul24, 48
br i1 %min.iters.check, label %for.body27.preheader99, label %vector.ph
vector.ph: ; preds = %for.body27.preheader
%n.vec = and i64 %wide.trip.count, 1073741816
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %2, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%18 = getelementptr inbounds [175000 x i32], ptr %d, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %18, align 16, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
%wide.load80 = load <4 x i32>, ptr %19, align 16, !tbaa !5
%20 = icmp eq <4 x i32> %wide.load, %broadcast.splat
%21 = icmp eq <4 x i32> %wide.load80, %broadcast.splat
%22 = zext <4 x i1> %20 to <4 x i32>
%23 = zext <4 x i1> %21 to <4 x i32>
%24 = add <4 x i32> %vec.phi, %22
%25 = add <4 x i32> %vec.phi79, %23
%index.next = add nuw i64 %index, 8
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %25, %24
%27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end36, label %for.body27.preheader99
for.body27.preheader99: ; preds = %for.body27.preheader, %middle.block
%indvars.iv74.ph = phi i64 [ 0, %for.body27.preheader ], [ %n.vec, %middle.block ]
%cnt.066.ph = phi i32 [ 0, %for.body27.preheader ], [ %27, %middle.block ]
br label %for.body27
for.body27: ; preds = %for.body27.preheader99, %for.body27
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body27 ], [ %indvars.iv74.ph, %for.body27.preheader99 ]
%cnt.066 = phi i32 [ %spec.select, %for.body27 ], [ %cnt.066.ph, %for.body27.preheader99 ]
%arrayidx29 = getelementptr inbounds [175000 x i32], ptr %d, i64 0, i64 %indvars.iv74
%28 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %28, %2
%inc32 = zext i1 %cmp30 to i32
%spec.select = add nuw nsw i32 %cnt.066, %inc32
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%exitcond77.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
br i1 %exitcond77.not, label %for.end36, label %for.body27, !llvm.loop !17
for.end36: ; preds = %for.body27, %middle.block, %for.end21
%cnt.0.lcssa = phi i32 [ 0, %for.end21 ], [ %27, %middle.block ], [ %spec.select, %for.body27 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
br label %if.end39
if.else: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end39
if.end39: ; preds = %if.else, %for.end36
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%29 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %29, 0
%30 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %30, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end39, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 700000, ptr nonnull %d) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10, !13, !14}
!17 = distinct !{!17, !10, !14, !13}
|
#include <stdio.h>
int main(void)
{
int n,x, k=0;
int i1, i2, i3;
while (1){
scanf("%d %d", &n, &x);
if (n == 0 && x == 0){
break;
}
else {
for (i1 = 1; i1 <= n-2; i1++){
for (i2 = i1 + 1; i2 <= n-1; i2++){
for (i3 = i2 + 1; i3 <= n; i3++){
if (i1 != i2 && i1 != i3 && i2 != i3){
if (i1+i2+i3 == x){
k++;
}
}
}
}
}
}
printf("%d\n", k);
k = 0;
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152687/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp60 = icmp eq i32 %0, 0
%1 = load i32, ptr %x, align 4
%cmp161 = icmp eq i32 %1, 0
%or.cond62 = select i1 %cmp60, i1 %cmp161, i1 false
br i1 %or.cond62, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end29
%2 = phi i32 [ %29, %if.end29 ], [ %1, %entry ]
%3 = phi i32 [ %28, %if.end29 ], [ %0, %entry ]
%cmp2.not55 = icmp slt i32 %3, 3
br i1 %cmp2.not55, label %if.end29, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%4 = add i32 %3, -2
%broadcast.splatinsert73 = insertelement <4 x i32> poison, i32 %2, i64 0
%broadcast.splat74 = shufflevector <4 x i32> %broadcast.splatinsert73, <4 x i32> poison, <4 x i32> zeroinitializer
br label %for.body
for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body
%k.2.lcssa = phi i32 [ %k.156, %for.body ], [ %k.3.lcssa, %for.cond3.loopexit ]
%exitcond64.not = icmp eq i32 %i1.057, %4
%indvar.next = add i32 %indvar, 1
br i1 %exitcond64.not, label %if.end29, label %for.body, !llvm.loop !9
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%i1.057 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ]
%k.156 = phi i32 [ 0, %for.body.preheader ], [ %k.2.lcssa, %for.cond.loopexit ]
%5 = add i32 %indvar, 3
%add = add nuw nsw i32 %i1.057, 1
%cmp5.not.not51 = icmp slt i32 %add, %3
br i1 %cmp5.not.not51, label %for.body10.lr.ph.preheader, label %for.cond.loopexit
for.body10.lr.ph.preheader: ; preds = %for.body
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i1.057, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %for.body10.lr.ph
for.cond3.loopexit: ; preds = %for.body10, %middle.block, %for.body10.lr.ph
%k.3.lcssa = phi i32 [ %k.252, %for.body10.lr.ph ], [ %27, %middle.block ], [ %k.4, %for.body10 ]
%exitcond.not = icmp eq i32 %add7, %3
%indvar.next66 = add i32 %indvar65, 1
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body10.lr.ph, !llvm.loop !11
for.body10.lr.ph: ; preds = %for.body10.lr.ph.preheader, %for.cond3.loopexit
%indvar65 = phi i32 [ %indvar.next66, %for.cond3.loopexit ], [ 0, %for.body10.lr.ph.preheader ]
%i2.053 = phi i32 [ %add7, %for.cond3.loopexit ], [ %add, %for.body10.lr.ph.preheader ]
%k.252 = phi i32 [ %k.3.lcssa, %for.cond3.loopexit ], [ %k.156, %for.body10.lr.ph.preheader ]
%6 = add i32 %5, %indvar65
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %6)
%7 = add i32 %indvar, %indvar65
%reass.sub = sub i32 %smax, %7
%8 = add i32 %reass.sub, -2
%add7 = add nuw nsw i32 %i2.053, 1
%cmp11.not = icmp eq i32 %i1.057, %i2.053
%add17 = add nuw nsw i32 %i2.053, %i1.057
%cmp11.not.fr = freeze i1 %cmp11.not
br i1 %cmp11.not.fr, label %for.cond3.loopexit, label %for.body10.preheader
for.body10.preheader: ; preds = %for.body10.lr.ph
%min.iters.check = icmp ult i32 %8, 8
br i1 %min.iters.check, label %for.body10.preheader75, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i32 %8, -8
%ind.end = add i32 %add7, %n.vec
%.splatinsert = insertelement <4 x i32> poison, i32 %add7, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add nuw <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %k.252, i64 0
%broadcast.splatinsert69 = insertelement <4 x i32> poison, i32 %i2.053, i64 0
%broadcast.splat70 = shufflevector <4 x i32> %broadcast.splatinsert69, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert71 = insertelement <4 x i32> poison, i32 %add17, i64 0
%broadcast.splat72 = shufflevector <4 x i32> %broadcast.splatinsert71, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %9, %vector.ph ], [ %24, %vector.body ]
%vec.phi68 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%10 = icmp ne <4 x i32> %broadcast.splat, %vec.ind
%11 = icmp ne <4 x i32> %broadcast.splat, %step.add
%12 = icmp ne <4 x i32> %broadcast.splat70, %vec.ind
%13 = icmp ne <4 x i32> %broadcast.splat70, %step.add
%14 = and <4 x i1> %12, %10
%15 = and <4 x i1> %13, %11
%16 = add nuw nsw <4 x i32> %broadcast.splat72, %vec.ind
%17 = add nuw nsw <4 x i32> %broadcast.splat72, %step.add
%18 = icmp eq <4 x i32> %16, %broadcast.splat74
%19 = icmp eq <4 x i32> %17, %broadcast.splat74
%20 = select <4 x i1> %14, <4 x i1> %18, <4 x i1> zeroinitializer
%21 = select <4 x i1> %15, <4 x i1> %19, <4 x i1> zeroinitializer
%22 = zext <4 x i1> %20 to <4 x i32>
%23 = zext <4 x i1> %21 to <4 x i32>
%24 = add <4 x i32> %vec.phi, %22
%25 = add <4 x i32> %vec.phi68, %23
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%26 = icmp eq i32 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %25, %24
%27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %8, %n.vec
br i1 %cmp.n, label %for.cond3.loopexit, label %for.body10.preheader75
for.body10.preheader75: ; preds = %for.body10.preheader, %middle.block
%i3.050.ph = phi i32 [ %add7, %for.body10.preheader ], [ %ind.end, %middle.block ]
%k.349.ph = phi i32 [ %k.252, %for.body10.preheader ], [ %27, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader75, %for.body10
%i3.050 = phi i32 [ %inc22, %for.body10 ], [ %i3.050.ph, %for.body10.preheader75 ]
%k.349 = phi i32 [ %k.4, %for.body10 ], [ %k.349.ph, %for.body10.preheader75 ]
%cmp13.not = icmp ne i32 %i1.057, %i3.050
%cmp15.not = icmp ne i32 %i2.053, %i3.050
%or.cond47.not = and i1 %cmp15.not, %cmp13.not
%add18 = add nuw nsw i32 %add17, %i3.050
%cmp19 = icmp eq i32 %add18, %2
%narrow = select i1 %or.cond47.not, i1 %cmp19, i1 false
%spec.select = zext i1 %narrow to i32
%k.4 = add nsw i32 %k.349, %spec.select
%inc22 = add nuw nsw i32 %i3.050, 1
%cmp9.not.not = icmp slt i32 %i3.050, %3
br i1 %cmp9.not.not, label %for.body10, label %for.cond3.loopexit, !llvm.loop !15
if.end29: ; preds = %for.cond.loopexit, %for.cond.preheader
%k.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %k.2.lcssa, %for.cond.loopexit ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%28 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %28, 0
%29 = load i32, ptr %x, align 4
%cmp1 = icmp eq i32 %29, 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.end29, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
|
#include <stdio.h>
#include <stdlib.h>
long int n,x,y;
int main(){
scanf("%ld",&n);
int i = n%10;
switch(i){
case 0:
case 2:
case 4:
case 6:
case 8:
case 9:
x = n - 4;
y = 4;
break;
case 1:
x = n - 6;
y = 6;
break;
case 3:
x = n - 8;
y = 8;
break;
case 5:
x = n - 10;
y = 10;
break;
case 7:
x = n - 9;
y = 9;
break;
}
if(n==13){ x = 9; y = 4; }
if(n==15){ x = 9; y = 6; }
printf("%ld %ld \n",x,y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15273/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15273/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@n = dso_local global i64 0, align 8
@x = dso_local local_unnamed_addr global i64 0, align 8
@y = dso_local local_unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [10 x i8] c"%ld %ld \0A\00", align 1
@switch.table.main = private unnamed_addr constant [10 x i64] [i64 -4, i64 -6, i64 -4, i64 -8, i64 -4, i64 -10, i64 -4, i64 -9, i64 -4, i64 -4], align 8
@switch.table.main.2 = private unnamed_addr constant [10 x i64] [i64 4, i64 6, i64 4, i64 8, i64 4, i64 10, i64 4, i64 9, i64 4, i64 4], align 8
; 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 @n)
%0 = load i64, ptr @n, align 8, !tbaa !5
%rem = srem i64 %0, 10
%conv = trunc i64 %rem to i32
%1 = icmp ult i32 %conv, 10
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%switch.gep = getelementptr inbounds [10 x i64], ptr @switch.table.main, i64 0, i64 %rem
%switch.load = load i64, ptr %switch.gep, align 8
%switch.gep18 = getelementptr inbounds [10 x i64], ptr @switch.table.main.2, i64 0, i64 %rem
%switch.load19 = load i64, ptr %switch.gep18, align 8
%sub8 = add nsw i64 %0, %switch.load
store i64 %sub8, ptr @x, align 8, !tbaa !5
store i64 %switch.load19, ptr @y, align 8, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %entry, %switch.lookup
switch i64 %0, label %sw.epilog.if.end13_crit_edge [
i64 13, label %if.end.thread
i64 15, label %if.then12
]
sw.epilog.if.end13_crit_edge: ; preds = %sw.epilog
%.pre = load i64, ptr @x, align 8, !tbaa !5
%.pre16 = load i64, ptr @y, align 8, !tbaa !5
br label %if.end13
if.end.thread: ; preds = %sw.epilog
store i64 9, ptr @x, align 8, !tbaa !5
store i64 4, ptr @y, align 8, !tbaa !5
br label %if.end13
if.then12: ; preds = %sw.epilog
store i64 9, ptr @x, align 8, !tbaa !5
store i64 6, ptr @y, align 8, !tbaa !5
br label %if.end13
if.end13: ; preds = %sw.epilog.if.end13_crit_edge, %if.end.thread, %if.then12
%2 = phi i64 [ %.pre16, %sw.epilog.if.end13_crit_edge ], [ 4, %if.end.thread ], [ 6, %if.then12 ]
%3 = phi i64 [ %.pre, %sw.epilog.if.end13_crit_edge ], [ 9, %if.end.thread ], [ 9, %if.then12 ]
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3, i64 noundef %2)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#if 0
cat <<EOF >mistaken-paste
#endif
// thanks for @rsk0315_h4x
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
using std::get;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// int32_t pullcomp (const void *left, const void *right) {
// ull l = *(ull*)left;
// ull r = *(ull*)right;
// if (l < r) {
// return -1;
// }
// if (l > r) {
// return +1;
// }
// return 0;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(ull);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
sll a[N_MAX + 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX + 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
ull d[N_MAX + 5];
sll e[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX + 5];
hwllc tup[N_MAX + 5];
sll table[3005][3005];
// here we go
ull gin[N_MAX];
hwll sorted[N_MAX];
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
// // 74
// // 2, 24
// // 4, 14
// // 2, 4, 4
// bool isp[200];
// for (i = 2; i <= n; i++) isp[i] = true;
// for (i = 2; i <= n; i++) {
// if (!isp[i]) continue;
// for (j = 2; i * j <= n; j++) {
// isp[i * j] = false;
// }
// }
// for (i = 2; i <= n; i++) {
// if (!isp[i]) continue;
// a[i] = 0;
// j = n;
// while (j /= i) {
// a[i] += j;
// }
// }
// // 74
// for (i = 2; i <= n; i++) {
// if (a[i] >= 74) result++;
// }
// // 2, 24
// for (i = 2; i <= n; i++) {
// if (a[i] < 24) continue;
// for (j = 2; j <= n; j++) {
// if (i == j) continue;
// if (a[j] >= 2) result++;
// }
// }
// // 4, 14
// for (i = 2; i <= n; i++) {
// if (a[i] < 14) continue;
// for (j = 2; j <= n; j++) {
// if (i == j) continue;
// if (a[j] >= 4) result++;
// }
// }
// // 2, 4, 4
// for (i = 2; i <= n; i++) {
// if (a[i] < 4) continue;
// for (j = i + 1; j <= n; j++) {
// if (a[j] < 4) continue;
// for (ki = 2; ki <= n; ki++) {
// if (ki == i || ki == j) continue;
// if (a[ki] < 2) continue;
// result++;
// }
// }
// }
ull a[] = {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,3,8,8,11,11,11,11,14,14,32,32,35,35,35,35,42,42,42,42,49,49,49,49,49,49,75,75,86,86,86,86,86,86,123,123,131,131,131,131,148,148,153,153,170,170,170,170,170,170,227,227,227,227,227,227,250,250,323,323,324,324,324,324,354,354,354,354,384,384,384,384,384,391,491,491,529,529,529,529,529,529,543};
result = a[n];
printf("%lld\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("Yay!");
return 0;
fail:
// puts("NO");
puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Impossible");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
n = 3;
// scanf("%llu%llu", &h, &w);
scanf("%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%s", s);
// scanf("%llu", &q);
// scanf("%lld%lld", &va, &vb, &vc, &vd);
// scanf("%llu%llu%llu", &ua, &ub, &uc, &ud, &ue);
// scanf("%s", t);
// scanf("%llu", &k);
// scanf("%lld", &m);
// for (i = 0; i < n; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &a[i]);
// scanf("%lld", &b[i]);
// // scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// a[i]--;
// // b[i]--;
// // c[i]--;
// // d[i]--;
// // xy[i].a--;
// // xy[i].b--;
// // tup[i].a--;
// // tup[i].b--;
// }
// for (i = 0; i < n - 1; i++) {
// scanf("%lld%lld", &a[i], &b[i]);
// a[i]--;
// b[i]--;
// }
// for (i = 1; i <= n; i++) {
// scanf("%llu", &d[i]);
// }
// for (i = 0; i < n; i++) {
// scanf("%lld%lld%lld", &c[i], &a[i], &b[i]);
// }
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < n; i++) {
// for (j = 0; j < n; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", s[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152773/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152773/source.c"
target datalayout = "e-m:e-p270: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.hwll = type { i64, i64 }
%struct.hwllc = type { i64, i64, i64 }
@__const.solve.a = private unnamed_addr constant [101 x i64] [i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 1, i64 1, i64 1, i64 1, i64 2, i64 2, i64 3, i64 3, i64 3, i64 3, i64 8, i64 8, i64 11, i64 11, i64 11, i64 11, i64 14, i64 14, i64 32, i64 32, i64 35, i64 35, i64 35, i64 35, i64 42, i64 42, i64 42, i64 42, i64 49, i64 49, i64 49, i64 49, i64 49, i64 49, i64 75, i64 75, i64 86, i64 86, i64 86, i64 86, i64 86, i64 86, i64 123, i64 123, i64 131, i64 131, i64 131, i64 131, i64 148, i64 148, i64 153, i64 153, i64 170, i64 170, i64 170, i64 170, i64 170, i64 170, i64 227, i64 227, i64 227, i64 227, i64 227, i64 227, i64 250, i64 250, i64 323, i64 323, i64 324, i64 324, i64 324, i64 324, i64 354, i64 354, i64 354, i64 354, i64 384, i64 384, i64 384, i64 384, i64 384, i64 391, i64 491, i64 491, i64 529, i64 529, i64 529, i64 529, i64 529, i64 529, i64 543], align 16
@n = dso_local global i64 0, align 8
@.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local global i64 0, align 8
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@va = dso_local local_unnamed_addr global i64 0, align 8
@vb = dso_local local_unnamed_addr global i64 0, align 8
@vc = dso_local local_unnamed_addr global i64 0, align 8
@vd = dso_local local_unnamed_addr global i64 0, align 8
@ve = dso_local local_unnamed_addr global i64 0, align 8
@vf = dso_local local_unnamed_addr global i64 0, align 8
@ua = dso_local local_unnamed_addr global i64 0, align 8
@ub = dso_local local_unnamed_addr global i64 0, align 8
@uc = dso_local local_unnamed_addr global i64 0, align 8
@ud = dso_local local_unnamed_addr global i64 0, align 8
@ue = dso_local local_unnamed_addr global i64 0, align 8
@uf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@a = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [1000005 x i64] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@u = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@xy = dso_local local_unnamed_addr global [1000005 x %struct.hwll] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1000005 x %struct.hwllc] zeroinitializer, align 16
@table = dso_local local_unnamed_addr global [3005 x [3005 x i64]] zeroinitializer, align 16
@gin = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@sorted = dso_local local_unnamed_addr global [1000000 x %struct.hwll] zeroinitializer, align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp ult i64 %1, %0
%cmp1 = icmp ugt i64 %1, %0
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !12
%1 = load i8, ptr %right, align 1, !tbaa !12
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %left, align 8, !tbaa !13
%1 = load double, ptr %right, align 8, !tbaa !13
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp ogt double %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !15
%1 = load ptr, ptr %right, align 8, !tbaa !15
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #9
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !20
%l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19
%l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17
%l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24
%l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !20
%r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19
%r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17
%r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24
%r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18
%cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp.i, label %cleanup10, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4.i, label %cleanup10, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit
phwllABcomp.exit: ; preds = %if.end6.i
%cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp13.i.not, label %cleanup10, label %if.end
if.end: ; preds = %phwllABcomp.exit
%cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp.i21, label %cleanup10, label %if.end.i22
if.end.i22: ; preds = %if.end
%cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24
if.end6.i24: ; preds = %if.end.i22
%cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26
if.end10.i26: ; preds = %if.end6.i24
%cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
%..i28 = zext i1 %cmp13.i27 to i32
br label %cleanup10
cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit
%retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #6 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !8
%arrayidx = getelementptr inbounds [101 x i64], ptr @__const.solve.a, i64 0, i64 %0
%1 = load i64, ptr %arrayidx, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %1)
ret i64 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
store i64 3, ptr @n, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !8
%arrayidx.i = getelementptr inbounds [101 x i64], ptr @__const.solve.a, i64 0, i64 %0
%1 = load i64, ptr %arrayidx.i, align 8, !tbaa !8
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %1)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!18 = !{i64 0, i64 8, !8}
!19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!20 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
|
#include <stdio.h>
int main(){
char s[15];
int i=0, win=0;
scanf("%s", s);
while(s[i] != '\0'){
if(s[i] == 'o')
win++;
i++;
}
if(win + (15-i) >= 8)
printf("YES\n");
else
printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152816/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152816/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %if.end, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%win.0 = phi i32 [ %win.1, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [15 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.end [
i8 0, label %while.end
i8 111, label %if.then
]
if.then: ; preds = %while.cond
%inc = add nsw i32 %win.0, 1
br label %if.end
if.end: ; preds = %while.cond, %if.then
%win.1 = phi i32 [ %inc, %if.then ], [ %win.0, %while.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%reass.sub19 = sub i32 %win.0, %1
%add = add i32 %reass.sub19, 15
%cmp8 = icmp sgt i32 %add, 7
%str.3.str = select i1 %cmp8, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define abs(a) ((a) > 0 ? (a) : (-(a)))
#define max(a,b) ((a) > (b) ? (a) : (b))
int main()
{
int n,k,i,j,p=0,m,sum=0,floor=0;
int f[2001]={};
scanf("%d %d",&n,&k);
for (i=1;i<=n;i++)
{
scanf("%d",&p);
f[p]++;
m = max(p,m);
}
p = m;
for (j=0;j<=(n+(k-n%k)%k)/k;j++)
{
//printf("j=%d\n",j);
floor = 1;
for (i=1;i<=k;i++)
{
while(f[p]==0 && p > 0){
p--;
}
//printf("p=%d,",p);
if (p == 0)break;
if (i==1)floor = p;
f[p]--;
}
sum+=2*floor-2;
//printf("sum=%d\n",sum);
}
printf("%d",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15286/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15286/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%p = alloca i32, align 4
%f = alloca [2001 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
store i32 0, ptr %p, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %f) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8004) %f, i8 0, i64 8004, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not41 = icmp slt i32 %0, 1
br i1 %cmp.not41, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%m.043 = phi i32 [ %cond, %for.body ], [ undef, %entry ]
%i.042 = phi i32 [ %inc3, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p)
%1 = load i32, ptr %p, align 4
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [2001 x i32], ptr %f, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%cond = call i32 @llvm.smax.i32(i32 %1, i32 %m.043)
%inc3 = add nuw nsw i32 %i.042, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.042, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%p.promoted60 = phi i32 [ undef, %entry ], [ %cond, %for.body ]
%.lcssa40 = phi i32 [ %0, %entry ], [ %3, %for.body ]
store i32 %p.promoted60, ptr %p, align 4, !tbaa !5
%4 = load i32, ptr %k, align 4, !tbaa !5
%rem = srem i32 %.lcssa40, %4
%sub = sub nsw i32 %4, %rem
%rem5 = srem i32 %sub, %4
%add = add nsw i32 %rem5, %.lcssa40
%div = sdiv i32 %add, %4
%cmp6.not66 = icmp slt i32 %div, 0
%cmp9.not54 = icmp slt i32 %4, 1
%or.cond = or i1 %cmp6.not66, %cmp9.not54
br i1 %or.cond, label %for.end29, label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.end, %for.end24
%sum.069 = phi i32 [ %add26, %for.end24 ], [ 0, %for.end ]
%j.068 = phi i32 [ %inc28, %for.end24 ], [ 0, %for.end ]
%p.promoted6467 = phi i32 [ %p.promoted61, %for.end24 ], [ %p.promoted60, %for.end ]
br label %while.condthread-pre-split
while.condthread-pre-split: ; preds = %for.cond8.preheader, %if.end
%p.promoted62 = phi i32 [ %p.promoted6467, %for.cond8.preheader ], [ %p.promoted61, %if.end ]
%floor.057 = phi i32 [ 1, %for.cond8.preheader ], [ %spec.select, %if.end ]
%i.156 = phi i32 [ 1, %for.cond8.preheader ], [ %inc23, %if.end ]
%dec.lcssa5355 = phi i32 [ %p.promoted6467, %for.cond8.preheader ], [ %dec.lcssa52, %if.end ]
%idxprom1145 = sext i32 %dec.lcssa5355 to i64
%arrayidx1246 = getelementptr inbounds [2001 x i32], ptr %f, i64 0, i64 %idxprom1145
%5 = load i32, ptr %arrayidx1246, align 4, !tbaa !5
%cmp1347 = icmp eq i32 %5, 0
%cmp1448 = icmp sgt i32 %dec.lcssa5355, 0
%6 = and i1 %cmp1448, %cmp1347
br i1 %6, label %while.body, label %while.end
while.body: ; preds = %while.condthread-pre-split, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ %idxprom1145, %while.condthread-pre-split ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx12 = getelementptr inbounds [2001 x i32], ptr %f, i64 0, i64 %indvars.iv.next
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp eq i32 %7, 0
%cmp14 = icmp sgt i64 %indvars.iv, 1
%8 = and i1 %cmp14, %cmp13
br i1 %8, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !11
while.cond.while.end_crit_edge: ; preds = %while.body
%9 = trunc i64 %indvars.iv.next to i32
store i32 %9, ptr %p, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %while.condthread-pre-split
%p.promoted61 = phi i32 [ %9, %while.cond.while.end_crit_edge ], [ %p.promoted62, %while.condthread-pre-split ]
%dec.lcssa52 = phi i32 [ %9, %while.cond.while.end_crit_edge ], [ %dec.lcssa5355, %while.condthread-pre-split ]
%idxprom11.lcssa = phi i64 [ %indvars.iv.next, %while.cond.while.end_crit_edge ], [ %idxprom1145, %while.condthread-pre-split ]
%.lcssa = phi i32 [ %7, %while.cond.while.end_crit_edge ], [ %5, %while.condthread-pre-split ]
%cmp15 = icmp eq i32 %dec.lcssa52, 0
br i1 %cmp15, label %for.end24, label %if.end
if.end: ; preds = %while.end
%arrayidx12.le = getelementptr inbounds [2001 x i32], ptr %f, i64 0, i64 %idxprom11.lcssa
%cmp16 = icmp eq i32 %i.156, 1
%spec.select = select i1 %cmp16, i32 %dec.lcssa52, i32 %floor.057
%dec21 = add nsw i32 %.lcssa, -1
store i32 %dec21, ptr %arrayidx12.le, align 4, !tbaa !5
%inc23 = add nuw i32 %i.156, 1
%exitcond.not = icmp eq i32 %i.156, %4
br i1 %exitcond.not, label %for.end24, label %while.condthread-pre-split, !llvm.loop !12
for.end24: ; preds = %if.end, %while.end
%floor.0.lcssa = phi i32 [ %floor.057, %while.end ], [ %spec.select, %if.end ]
%mul = shl nsw i32 %floor.0.lcssa, 1
%sub25 = add i32 %sum.069, -2
%add26 = add i32 %sub25, %mul
%inc28 = add nuw i32 %j.068, 1
%exitcond76.not = icmp eq i32 %j.068, %div
br i1 %exitcond76.not, label %for.end29, label %for.cond8.preheader, !llvm.loop !13
for.end29: ; preds = %for.end24, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %add26, %for.end24 ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int ret,win = 0,lose = 0,num = 0;
char c;
while(1){
ret = scanf("%c", &c);
if(ret == EOF || c == '\n') break;
else if(c == 'o') win++;
else if(c == 'x') lose++;
num++;
}
int flag = 0;
if(lose >= 8) flag = 1;
if(flag == 0) printf("YES\n");
else printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152902/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152902/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp30 = icmp eq i32 %call29, -1
%0 = load i8, ptr %c, align 1
%cmp131 = icmp eq i8 %0, 10
%or.cond32 = select i1 %cmp30, i1 true, i1 %cmp131
br i1 %or.cond32, label %if.end26, label %if.else
if.else: ; preds = %entry, %if.else
%1 = phi i8 [ %2, %if.else ], [ %0, %entry ]
%lose.033 = phi i32 [ %spec.select, %if.else ], [ 0, %entry ]
%cond = icmp eq i8 %1, 120
%inc12 = zext i1 %cond to i32
%spec.select = add nuw nsw i32 %lose.033, %inc12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp = icmp eq i32 %call, -1
%2 = load i8, ptr %c, align 1
%cmp1 = icmp eq i8 %2, 10
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %if.else
while.end: ; preds = %if.else
%3 = icmp ult i32 %spec.select, 8
%spec.select36 = select i1 %3, ptr @str.3, ptr @str
br label %if.end26
if.end26: ; preds = %while.end, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select36, %while.end ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 max(int x, int y){
if(x >= y) return x;
else return y;
}
int main(){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
int ans = max(a*10 + b + c, max(b*10 + a + c, c*10 + a + b));
printf("%d\n", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152946/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152946/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%y.x = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %y.x
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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 = 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
%mul = mul nsw i32 %0, 10
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %mul, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%mul2 = mul nsw i32 %1, 10
%add3 = add nsw i32 %mul2, %0
%add4 = add nsw i32 %add3, %2
%mul5 = mul nsw i32 %2, 10
%add6 = add i32 %1, %0
%add7 = add i32 %add6, %mul5
%y.x.i = call i32 @llvm.smax.i32(i32 %add4, i32 %add7)
%y.x.i11 = call i32 @llvm.smax.i32(i32 %add1, i32 %y.x.i)
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.x.i11)
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.smax.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
if(n&1)
{
printf("%d %d\n",n-9,9);
}else{
printf("%d %d\n",4,n-4);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15299/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15299/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%and = and i32 %0, 1
%tobool.not = icmp eq i32 %and, 0
%sub2 = add nsw i32 %0, -4
%sub = add nsw i32 %0, -9
%sub2.sink = select i1 %tobool.not, i32 %sub2, i32 9
%.sink = select i1 %tobool.not, i32 4, i32 %sub
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink, i32 noundef %sub2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
int max = a;
if(a < b) max = b;
if(max < c) max = c;
printf("%d\n", a+b+c+max*9);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153031/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153031/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %c, align 4, !tbaa !5
%max.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%add = add nsw i32 %1, %0
%add4 = add nsw i32 %add, %2
%mul = mul nsw i32 %max.1, 9
%add5 = add nsw i32 %add4, %mul
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int A,B,C;
scanf("%d %d %d",&A,&B,&C);
if(A>=B&&A>=C)
printf("%d\n",10*A+B+C);
else if(B>=A&&B>=C)
printf("%d\n",10*B+A+C);
else
printf("%d\n",10*C+A+B);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153075/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153075/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %C, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %0, %.pre.pre
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i32 %0, 10
%add = add nsw i32 %mul, %1
%add2 = add nsw i32 %add, %.pre.pre
br label %if.end17
if.else: ; preds = %entry
%cmp4.not = icmp slt i32 %1, %0
%cmp6.not = icmp slt i32 %1, %.pre.pre
%or.cond23 = select i1 %cmp4.not, i1 true, i1 %cmp6.not
br i1 %or.cond23, label %if.else12, label %if.then7
if.then7: ; preds = %if.else
%mul8 = mul nsw i32 %1, 10
%add9 = add nsw i32 %mul8, %0
%add10 = add nsw i32 %add9, %.pre.pre
br label %if.end17
if.else12: ; preds = %if.else
%mul13 = mul nsw i32 %.pre.pre, 10
%add14 = add i32 %1, %0
%add15 = add i32 %add14, %mul13
br label %if.end17
if.end17: ; preds = %if.then7, %if.else12, %if.then
%add10.sink = phi i32 [ %add10, %if.then7 ], [ %add15, %if.else12 ], [ %add2, %if.then ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10.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 main(void)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(b<=a && c<=a){
printf("%d\n",a*10+b+c);
}
else if(a<=b && c<=b){
printf("%d\n",b*10+a+c);
}
else{
printf("%d\n",c*10+a+b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153125/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153125/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %.pre.pre, %1
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i32 %1, 10
%add = add nsw i32 %mul, %0
%add2 = add nsw i32 %add, %.pre.pre
br label %if.end17
if.else: ; preds = %entry
%cmp4.not = icmp sgt i32 %1, %0
%cmp6.not = icmp sgt i32 %.pre.pre, %0
%or.cond23 = select i1 %cmp4.not, i1 true, i1 %cmp6.not
br i1 %or.cond23, label %if.else12, label %if.then7
if.then7: ; preds = %if.else
%mul8 = mul nsw i32 %0, 10
%add9 = add nsw i32 %mul8, %1
%add10 = add nsw i32 %add9, %.pre.pre
br label %if.end17
if.else12: ; preds = %if.else
%mul13 = mul nsw i32 %.pre.pre, 10
%add14 = add i32 %1, %0
%add15 = add i32 %add14, %mul13
br label %if.end17
if.end17: ; preds = %if.then7, %if.else12, %if.then
%add10.sink = phi i32 [ %add10, %if.then7 ], [ %add15, %if.else12 ], [ %add2, %if.then ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10.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 main(int argc, char const *argv[])
{
int num[3],max[3] = {0,0,0},maxj;
scanf("%d %d %d",&num[0],&num[1],&num[2]);
for(int i = 0;i < 3; ++i){
maxj = 0;
for (int j = 0;j < 3; ++j)
{
if(max[i] < num[j]){
max[i] = num[j];
maxj = j;
}
}
num[maxj] = 0;
}
printf("%d\n",max[0] * 10 + max[1] + max[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%num = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #4
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %num, align 4, !tbaa !5
%spec.store.select = call i32 @llvm.smax.i32(i32 %0, i32 0)
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %spec.store.select, %1
%spec.store.select.1 = call i32 @llvm.smax.i32(i32 %spec.store.select, i32 %1)
%spec.select.1 = zext i1 %cmp10.1 to i64
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp10.2 = icmp slt i32 %spec.store.select.1, %2
%spec.store.select.2 = call i32 @llvm.smax.i32(i32 %spec.store.select.1, i32 %2)
%spec.select.2 = select i1 %cmp10.2, i64 2, i64 %spec.select.1
%arrayidx16 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 %spec.select.2
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
%3 = load i32, ptr %num, align 4, !tbaa !5
%spec.store.select.139 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%4 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.1.1 = icmp slt i32 %spec.store.select.139, %4
%spec.store.select.1.1 = call i32 @llvm.smax.i32(i32 %spec.store.select.139, i32 %4)
%spec.select.1.1 = zext i1 %cmp10.1.1 to i64
%5 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp10.2.1 = icmp slt i32 %spec.store.select.1.1, %5
%spec.store.select.2.1 = call i32 @llvm.smax.i32(i32 %spec.store.select.1.1, i32 %5)
%spec.select.2.1 = select i1 %cmp10.2.1, i64 2, i64 %spec.select.1.1
%arrayidx16.1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 %spec.select.2.1
store i32 0, ptr %arrayidx16.1, align 4, !tbaa !5
%6 = load i32, ptr %num, align 4, !tbaa !5
%spec.store.select.240 = call i32 @llvm.smax.i32(i32 %6, i32 0)
%7 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.1.2 = icmp slt i32 %spec.store.select.240, %7
%spec.store.select.1.2 = call i32 @llvm.smax.i32(i32 %spec.store.select.240, i32 %7)
%spec.select.1.2 = zext i1 %cmp10.1.2 to i64
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp10.2.2 = icmp slt i32 %spec.store.select.1.2, %8
%spec.store.select.2.2 = call i32 @llvm.smax.i32(i32 %spec.store.select.1.2, i32 %8)
%spec.select.2.2 = select i1 %cmp10.2.2, i64 2, i64 %spec.select.1.2
%arrayidx16.2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 %spec.select.2.2
store i32 0, ptr %arrayidx16.2, align 4, !tbaa !5
%mul = mul nsw i32 %spec.store.select.2, 10
%add = add nuw nsw i32 %mul, %spec.store.select.2.1
%add23 = add nuw nsw i32 %add, %spec.store.select.2.2
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add23)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
int main (){
int a,b,c,anc;
scanf("%d %d %d",&a,&b,&c);
if(a >=b && a >=c) anc =10*a+b +c;
else if(b >=a && b>=c) anc = 10*b+a+c;
else anc =10*c +a+b;
printf("%d",anc);
}
//chcp 65001 cd contest | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153211/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153211/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %0, %.pre.pre
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i32 %0, 10
%add = add nsw i32 %mul, %1
%add2 = add nsw i32 %add, %.pre.pre
br label %if.end14
if.else: ; preds = %entry
%cmp3.not = icmp slt i32 %1, %0
%cmp5.not = icmp slt i32 %1, %.pre.pre
%or.cond21 = select i1 %cmp3.not, i1 true, i1 %cmp5.not
br i1 %or.cond21, label %if.else10, label %if.then6
if.then6: ; preds = %if.else
%mul7 = mul nsw i32 %1, 10
%add8 = add nsw i32 %mul7, %0
%add9 = add nsw i32 %add8, %.pre.pre
br label %if.end14
if.else10: ; preds = %if.else
%mul11 = mul nsw i32 %.pre.pre, 10
%add12 = add i32 %1, %0
%add13 = add i32 %add12, %mul11
br label %if.end14
if.end14: ; preds = %if.then6, %if.else10, %if.then
%anc.0 = phi i32 [ %add2, %if.then ], [ %add9, %if.then6 ], [ %add13, %if.else10 ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %anc.0)
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"}
|
// AOJ 0303: Mighty Man
// 2017.10.31 bal4u@uu
#include <stdio.h>
#include <string.h>
typedef struct { int c, w; } T;
T tbl[1002];
int s[1002];
char f[1002][1002];
char buf[22], *p;
int getint()
{
int n = 0;
while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
return n;
}
int main()
{
int n, i, j, k;
fgets(p=buf, 10, stdin), n = getint();
for (i = 1; i <= n; i++) {
fgets(p=buf, 20, stdin), tbl[i].c = getint(), p++, tbl[i].w = getint();
}
memset(f, 0, sizeof(f)); for (i = 1; i <= n; i++) f[i][i] = 1;
for (s[0] = 0, i = 1; i <= n; i++) s[i] = s[i-1] + tbl[i].w;
for (k = 1; k <= n; k++) {
for (i = 1; i <= n-k+1; i++) {
j = i+k-1;
if (!f[i][j]) continue;
if (j+1 <= n) {
if (s[j]-s[i-1] <= tbl[j+1].c) {
f[i][j+1] = 1;
}
}
if (i-1 >= 1) {
if (s[j]-s[i-1] <= tbl[i-1].c) {
f[i-1][j] = 1;
}
}
}
}
memset(s, -1, sizeof(s)); s[0] = 0;
for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) {
if (f[i][j] && (s[j] < 0 || s[i-1]+1 < s[j])) s[j] = s[i-1]+1;
}
printf("%d\n", s[n]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153255/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153255/source.c"
target datalayout = "e-m:e-p270: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.T = type { i32, i32 }
@p = dso_local local_unnamed_addr global ptr null, align 8
@buf = dso_local global [22 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@tbl = dso_local local_unnamed_addr global [1002 x %struct.T] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global [1002 x [1002 x i8]] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1002 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @getint() local_unnamed_addr #0 {
entry:
%p.promoted = load ptr, ptr @p, align 8, !tbaa !5
%0 = load i8, ptr %p.promoted, align 1, !tbaa !9
%cmp8 = icmp sgt i8 %0, 47
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.010 = phi i32 [ %add4, %while.body ], [ 0, %entry ]
%incdec.ptr79 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ]
%add = mul i32 %n.010, 10
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr79, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5
%1 = load i8, ptr %incdec.ptr79, align 1, !tbaa !9
%2 = and i8 %1, 15
%and = zext i8 %2 to i32
%add4 = add nsw i32 %add, %and
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp = icmp sgt i8 %3, 47
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10
while.end: ; preds = %while.body, %entry
%n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ]
ret i32 %n.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
store ptr @buf, ptr @p, align 8, !tbaa !5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %0)
%p.promoted.i = load ptr, ptr @p, align 8, !tbaa !5
%1 = load i8, ptr %p.promoted.i, align 1, !tbaa !9
%cmp8.i = icmp sgt i8 %1, 47
br i1 %cmp8.i, label %while.body.i, label %for.end.thread
while.body.i: ; preds = %entry, %while.body.i
%n.010.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %entry ]
%incdec.ptr79.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %p.promoted.i, %entry ]
%add.i = mul i32 %n.010.i, 10
%incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr79.i, i64 1
store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !5
%2 = load i8, ptr %incdec.ptr79.i, align 1, !tbaa !9
%3 = and i8 %2, 15
%and.i = zext i8 %3 to i32
%add4.i = add nsw i32 %add.i, %and.i
%4 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !9
%cmp.i = icmp sgt i8 %4, 47
br i1 %cmp.i, label %while.body.i, label %getint.exit, !llvm.loop !10
getint.exit: ; preds = %while.body.i
%cmp.not208 = icmp slt i32 %add4.i, 1
br i1 %cmp.not208, label %for.end.thread, label %for.body.preheader
for.body.preheader: ; preds = %getint.exit
%5 = add i32 %add4.i, 1
%wide.trip.count = zext i32 %5 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %getint.exit207
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %getint.exit207 ]
store ptr @buf, ptr @p, align 8, !tbaa !5
%6 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 20, ptr noundef %6)
%p.promoted.i184 = load ptr, ptr @p, align 8, !tbaa !5
%7 = load i8, ptr %p.promoted.i184, align 1, !tbaa !9
%cmp8.i185 = icmp sgt i8 %7, 47
br i1 %cmp8.i185, label %while.body.i187, label %getint.exit195
while.body.i187: ; preds = %for.body, %while.body.i187
%n.010.i188 = phi i32 [ %add4.i193, %while.body.i187 ], [ 0, %for.body ]
%incdec.ptr79.i189 = phi ptr [ %incdec.ptr.i191, %while.body.i187 ], [ %p.promoted.i184, %for.body ]
%add.i190 = mul i32 %n.010.i188, 10
%incdec.ptr.i191 = getelementptr inbounds i8, ptr %incdec.ptr79.i189, i64 1
store ptr %incdec.ptr.i191, ptr @p, align 8, !tbaa !5
%8 = load i8, ptr %incdec.ptr79.i189, align 1, !tbaa !9
%9 = and i8 %8, 15
%and.i192 = zext i8 %9 to i32
%add4.i193 = add nsw i32 %add.i190, %and.i192
%10 = load i8, ptr %incdec.ptr.i191, align 1, !tbaa !9
%cmp.i194 = icmp sgt i8 %10, 47
br i1 %cmp.i194, label %while.body.i187, label %getint.exit195, !llvm.loop !10
getint.exit195: ; preds = %while.body.i187, %for.body
%11 = phi ptr [ %p.promoted.i184, %for.body ], [ %incdec.ptr.i191, %while.body.i187 ]
%n.0.lcssa.i186 = phi i32 [ 0, %for.body ], [ %add4.i193, %while.body.i187 ]
%arrayidx = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv
store i32 %n.0.lcssa.i186, ptr %arrayidx, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %11, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5
%12 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp8.i197 = icmp sgt i8 %12, 47
br i1 %cmp8.i197, label %while.body.i199, label %getint.exit207
while.body.i199: ; preds = %getint.exit195, %while.body.i199
%n.010.i200 = phi i32 [ %add4.i205, %while.body.i199 ], [ 0, %getint.exit195 ]
%incdec.ptr79.i201 = phi ptr [ %incdec.ptr.i203, %while.body.i199 ], [ %incdec.ptr, %getint.exit195 ]
%add.i202 = mul i32 %n.010.i200, 10
%incdec.ptr.i203 = getelementptr inbounds i8, ptr %incdec.ptr79.i201, i64 1
store ptr %incdec.ptr.i203, ptr @p, align 8, !tbaa !5
%13 = load i8, ptr %incdec.ptr79.i201, align 1, !tbaa !9
%14 = and i8 %13, 15
%and.i204 = zext i8 %14 to i32
%add4.i205 = add nsw i32 %add.i202, %and.i204
%15 = load i8, ptr %incdec.ptr.i203, align 1, !tbaa !9
%cmp.i206 = icmp sgt i8 %15, 47
br i1 %cmp.i206, label %while.body.i199, label %getint.exit207, !llvm.loop !10
getint.exit207: ; preds = %while.body.i199, %getint.exit195
%n.0.lcssa.i198 = phi i32 [ 0, %getint.exit195 ], [ %add4.i205, %while.body.i199 ]
%w = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv, i32 1
store i32 %n.0.lcssa.i198, ptr %w, align 4, !tbaa !15
%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 !16
for.end.thread: ; preds = %getint.exit, %entry
%n.0.lcssa.i267.ph = phi i32 [ %add4.i, %getint.exit ], [ 0, %entry ]
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1004004) @f, i8 0, i64 1004004, i1 false)
br label %for.end93.thread
for.end: ; preds = %getint.exit207
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1004004) @f, i8 0, i64 1004004, i1 false)
br i1 %cmp.not208, label %for.end93.thread, label %for.body9.preheader
for.body9.preheader: ; preds = %for.end
%16 = add nsw i64 %wide.trip.count, -1
%17 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %16, 3
%18 = icmp ult i64 %17, 3
br i1 %18, label %for.end16.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %16, -4
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv223 = phi i64 [ 1, %for.body9.preheader.new ], [ %indvars.iv.next224.3, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx13 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv223, i64 %indvars.iv223
store i8 1, ptr %arrayidx13, align 1, !tbaa !9
%indvars.iv.next224 = add nuw nsw i64 %indvars.iv223, 1
%arrayidx13.1 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv.next224, i64 %indvars.iv.next224
store i8 1, ptr %arrayidx13.1, align 1, !tbaa !9
%indvars.iv.next224.1 = add nuw nsw i64 %indvars.iv223, 2
%arrayidx13.2 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv.next224.1, i64 %indvars.iv.next224.1
store i8 1, ptr %arrayidx13.2, align 1, !tbaa !9
%indvars.iv.next224.2 = add nuw nsw i64 %indvars.iv223, 3
%arrayidx13.3 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv.next224.2, i64 %indvars.iv.next224.2
store i8 1, ptr %arrayidx13.3, align 1, !tbaa !9
%indvars.iv.next224.3 = add nuw nsw i64 %indvars.iv223, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end16.unr-lcssa, label %for.body9, !llvm.loop !17
for.end16.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%indvars.iv223.unr = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next224.3, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end16, label %for.body9.epil
for.body9.epil: ; preds = %for.end16.unr-lcssa, %for.body9.epil
%indvars.iv223.epil = phi i64 [ %indvars.iv.next224.epil, %for.body9.epil ], [ %indvars.iv223.unr, %for.end16.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end16.unr-lcssa ]
%arrayidx13.epil = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv223.epil, i64 %indvars.iv223.epil
store i8 1, ptr %arrayidx13.epil, align 1, !tbaa !9
%indvars.iv.next224.epil = add nuw nsw i64 %indvars.iv223.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end16, label %for.body9.epil, !llvm.loop !18
for.end16: ; preds = %for.body9.epil, %for.end16.unr-lcssa
store i32 0, ptr @s, align 16, !tbaa !20
br i1 %cmp.not208, label %for.end93.thread, label %for.body19.preheader
for.body19.preheader: ; preds = %for.end16
%xtraiter287 = and i64 %16, 1
%19 = icmp eq i64 %17, 0
br i1 %19, label %for.cond30.preheader.unr-lcssa, label %for.body19.preheader.new
for.body19.preheader.new: ; preds = %for.body19.preheader
%unroll_iter290 = and i64 %16, -2
br label %for.body19
for.cond30.preheader.unr-lcssa: ; preds = %for.body19, %for.body19.preheader
%.unr = phi i32 [ 0, %for.body19.preheader ], [ %add.1, %for.body19 ]
%indvars.iv228.unr = phi i64 [ 1, %for.body19.preheader ], [ %indvars.iv.next229.1, %for.body19 ]
%lcmp.mod289.not = icmp eq i64 %xtraiter287, 0
br i1 %lcmp.mod289.not, label %for.cond30.preheader, label %for.body19.epil
for.body19.epil: ; preds = %for.cond30.preheader.unr-lcssa
%w24.epil = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv228.unr, i32 1
%20 = load i32, ptr %w24.epil, align 4, !tbaa !15
%add.epil = add nsw i32 %20, %.unr
%arrayidx26.epil = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %indvars.iv228.unr
store i32 %add.epil, ptr %arrayidx26.epil, align 4, !tbaa !20
br label %for.cond30.preheader
for.cond30.preheader: ; preds = %for.cond30.preheader.unr-lcssa, %for.body19.epil
br i1 %cmp.not208, label %for.end93.thread, label %for.cond33.preheader.lr.ph
for.cond33.preheader.lr.ph: ; preds = %for.cond30.preheader
%sub34 = add nuw i32 %add4.i, 1
%21 = zext i32 %add4.i to i64
%wide.trip.count249 = zext i32 %sub34 to i64
br label %for.cond33.preheader
for.body19: ; preds = %for.body19, %for.body19.preheader.new
%22 = phi i32 [ 0, %for.body19.preheader.new ], [ %add.1, %for.body19 ]
%indvars.iv228 = phi i64 [ 1, %for.body19.preheader.new ], [ %indvars.iv.next229.1, %for.body19 ]
%niter291 = phi i64 [ 0, %for.body19.preheader.new ], [ %niter291.next.1, %for.body19 ]
%w24 = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv228, i32 1
%23 = load i32, ptr %w24, align 4, !tbaa !15
%add = add nsw i32 %23, %22
%arrayidx26 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %indvars.iv228
store i32 %add, ptr %arrayidx26, align 4, !tbaa !20
%indvars.iv.next229 = add nuw nsw i64 %indvars.iv228, 1
%w24.1 = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %indvars.iv.next229, i32 1
%24 = load i32, ptr %w24.1, align 4, !tbaa !15
%add.1 = add nsw i32 %24, %add
%arrayidx26.1 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %indvars.iv.next229
store i32 %add.1, ptr %arrayidx26.1, align 4, !tbaa !20
%indvars.iv.next229.1 = add nuw nsw i64 %indvars.iv228, 2
%niter291.next.1 = add i64 %niter291, 2
%niter291.ncmp.1 = icmp eq i64 %niter291.next.1, %unroll_iter290
br i1 %niter291.ncmp.1, label %for.cond30.preheader.unr-lcssa, label %for.body19, !llvm.loop !21
for.cond33.preheader: ; preds = %for.cond33.preheader.lr.ph, %for.inc91
%indvars.iv246 = phi i64 [ 1, %for.cond33.preheader.lr.ph ], [ %indvars.iv.next247.pre-phi, %for.inc91 ]
%indvars.iv241 = phi i32 [ %sub34, %for.cond33.preheader.lr.ph ], [ %indvars.iv.next242, %for.inc91 ]
%indvars248 = trunc i64 %indvars.iv246 to i32
%add35 = sub i32 %sub34, %indvars248
%cmp36.not214 = icmp slt i32 %add35, 1
br i1 %cmp36.not214, label %for.cond33.preheader.for.inc91_crit_edge, label %for.body37.preheader
for.cond33.preheader.for.inc91_crit_edge: ; preds = %for.cond33.preheader
%.pre264 = add nuw nsw i64 %indvars.iv246, 1
br label %for.inc91
for.body37.preheader: ; preds = %for.cond33.preheader
%wide.trip.count243 = zext i32 %indvars.iv241 to i64
%25 = add nuw nsw i64 %indvars.iv246, 1
%arrayidx43.peel = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 1, i64 %indvars.iv246
%26 = load i8, ptr %arrayidx43.peel, align 1, !tbaa !9
%tobool.not.peel = icmp ne i8 %26, 0
%cmp45.not.peel.not = icmp slt i64 %indvars.iv246, %21
%or.cond = and i1 %tobool.not.peel, %cmp45.not.peel.not
br i1 %or.cond, label %if.then46.peel, label %for.inc88.peel
if.then46.peel: ; preds = %for.body37.preheader
%arrayidx48.peel = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %indvars.iv246
%27 = load i32, ptr %arrayidx48.peel, align 4, !tbaa !20
%idxprom54.peel = and i64 %25, 4294967295
%arrayidx55.peel = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %idxprom54.peel
%28 = load i32, ptr %arrayidx55.peel, align 8, !tbaa !12
%cmp57.not.peel = icmp sgt i32 %27, %28
br i1 %cmp57.not.peel, label %for.inc88.peel, label %if.then58.peel
if.then58.peel: ; preds = %if.then46.peel
%arrayidx63.peel = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 1, i64 %idxprom54.peel
store i8 1, ptr %arrayidx63.peel, align 1, !tbaa !9
br label %for.inc88.peel
for.inc88.peel: ; preds = %if.then46.peel, %if.then58.peel, %for.body37.preheader
%exitcond244.peel.not = icmp eq i32 %indvars.iv241, 2
br i1 %exitcond244.peel.not, label %for.inc91, label %for.body37
for.body37: ; preds = %for.inc88.peel, %for.inc88
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.inc88 ], [ 2, %for.inc88.peel ]
%29 = add nuw nsw i64 %indvars.iv234, %indvars.iv246
%30 = add nsw i64 %29, -1
%arrayidx43 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv234, i64 %30
%31 = load i8, ptr %arrayidx43, align 1, !tbaa !9
%tobool.not = icmp eq i8 %31, 0
br i1 %tobool.not, label %for.inc88, label %if.end
if.end: ; preds = %for.body37
%cmp45.not = icmp sgt i64 %29, %21
br i1 %cmp45.not, label %if.then68, label %if.then46
if.then46: ; preds = %if.end
%arrayidx48 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %30
%32 = load i32, ptr %arrayidx48, align 4, !tbaa !20
%33 = add nsw i64 %indvars.iv234, -1
%arrayidx51 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %33
%34 = load i32, ptr %arrayidx51, align 4, !tbaa !20
%sub52 = sub nsw i32 %32, %34
%idxprom54 = and i64 %29, 4294967295
%arrayidx55 = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %idxprom54
%35 = load i32, ptr %arrayidx55, align 8, !tbaa !12
%cmp57.not = icmp sgt i32 %sub52, %35
br i1 %cmp57.not, label %if.then68, label %if.then58
if.then58: ; preds = %if.then46
%arrayidx63 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv234, i64 %idxprom54
store i8 1, ptr %arrayidx63, align 1, !tbaa !9
br label %if.then68
if.then68: ; preds = %if.end, %if.then58, %if.then46
%36 = add nsw i64 %indvars.iv234, -1
%arrayidx70 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %30
%37 = load i32, ptr %arrayidx70, align 4, !tbaa !20
%arrayidx73 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %36
%38 = load i32, ptr %arrayidx73, align 4, !tbaa !20
%sub74 = sub nsw i32 %37, %38
%arrayidx77 = getelementptr inbounds [1002 x %struct.T], ptr @tbl, i64 0, i64 %36
%39 = load i32, ptr %arrayidx77, align 8, !tbaa !12
%cmp79.not = icmp sgt i32 %sub74, %39
br i1 %cmp79.not, label %for.inc88, label %if.then80
if.then80: ; preds = %if.then68
%arrayidx85 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %36, i64 %30
store i8 1, ptr %arrayidx85, align 1, !tbaa !9
br label %for.inc88
for.inc88: ; preds = %if.then80, %if.then68, %for.body37
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%exitcond244.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count243
br i1 %exitcond244.not, label %for.inc91, label %for.body37, !llvm.loop !22
for.inc91: ; preds = %for.inc88, %for.inc88.peel, %for.cond33.preheader.for.inc91_crit_edge
%indvars.iv.next247.pre-phi = phi i64 [ %.pre264, %for.cond33.preheader.for.inc91_crit_edge ], [ %25, %for.inc88.peel ], [ %25, %for.inc88 ]
%indvars.iv.next242 = add i32 %indvars.iv241, -1
%exitcond250.not = icmp eq i64 %indvars.iv.next247.pre-phi, %wide.trip.count249
br i1 %exitcond250.not, label %for.end93, label %for.cond33.preheader, !llvm.loop !24
for.end93.thread: ; preds = %for.end, %for.end.thread, %for.cond30.preheader, %for.end16
%n.0.lcssa.i267272275280.ph = phi i32 [ %add4.i, %for.cond30.preheader ], [ %add4.i, %for.end16 ], [ %add4.i, %for.end ], [ %n.0.lcssa.i267.ph, %for.end.thread ]
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4008) @s, i8 -1, i64 4008, i1 false)
store i32 0, ptr @s, align 16, !tbaa !20
br label %for.end130
for.end93: ; preds = %for.inc91
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4008) @s, i8 -1, i64 4008, i1 false)
store i32 0, ptr @s, align 16, !tbaa !20
br i1 %cmp.not208, label %for.end130, label %for.cond97.preheader.preheader
for.cond97.preheader.preheader: ; preds = %for.end93
%40 = add nuw i32 %add4.i, 1
%wide.trip.count261 = zext i32 %40 to i64
br label %for.cond97.preheader
for.cond97.preheader: ; preds = %for.cond97.preheader.preheader, %for.cond97.for.inc128_crit_edge
%indvars.iv256 = phi i64 [ 1, %for.cond97.preheader.preheader ], [ %indvars.iv.next257, %for.cond97.for.inc128_crit_edge ]
%41 = add nsw i64 %indvars.iv256, -1
%arrayidx111 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %41
br label %for.body99
for.body99: ; preds = %for.cond97.preheader, %for.inc125
%indvars.iv251 = phi i64 [ 1, %for.cond97.preheader ], [ %indvars.iv.next252, %for.inc125 ]
%arrayidx103 = getelementptr inbounds [1002 x [1002 x i8]], ptr @f, i64 0, i64 %indvars.iv256, i64 %indvars.iv251
%42 = load i8, ptr %arrayidx103, align 1, !tbaa !9
%tobool104.not = icmp eq i8 %42, 0
br i1 %tobool104.not, label %for.inc125, label %land.lhs.true
land.lhs.true: ; preds = %for.body99
%arrayidx106 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %indvars.iv251
%43 = load i32, ptr %arrayidx106, align 4, !tbaa !20
%cmp107 = icmp slt i32 %43, 0
%.pre = load i32, ptr %arrayidx111, align 4, !tbaa !20
%.pre263 = add nsw i32 %.pre, 1
%cmp115 = icmp slt i32 %.pre263, %43
%or.cond284 = select i1 %cmp107, i1 true, i1 %cmp115
br i1 %or.cond284, label %if.then117, label %for.inc125
if.then117: ; preds = %land.lhs.true
store i32 %.pre263, ptr %arrayidx106, align 4, !tbaa !20
br label %for.inc125
for.inc125: ; preds = %land.lhs.true, %for.body99, %if.then117
%indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1
%exitcond255.not = icmp eq i64 %indvars.iv.next252, %wide.trip.count261
br i1 %exitcond255.not, label %for.cond97.for.inc128_crit_edge, label %for.body99, !llvm.loop !25
for.cond97.for.inc128_crit_edge: ; preds = %for.inc125
%indvars.iv.next257 = add nuw nsw i64 %indvars.iv256, 1
%exitcond262.not = icmp eq i64 %indvars.iv.next257, %wide.trip.count261
br i1 %exitcond262.not, label %for.end130, label %for.cond97.preheader, !llvm.loop !26
for.end130: ; preds = %for.cond97.for.inc128_crit_edge, %for.end93.thread, %for.end93
%n.0.lcssa.i267272275280283 = phi i32 [ %n.0.lcssa.i267272275280.ph, %for.end93.thread ], [ %add4.i, %for.end93 ], [ %add4.i, %for.cond97.for.inc128_crit_edge ]
%idxprom131 = sext i32 %n.0.lcssa.i267272275280283 to i64
%arrayidx132 = getelementptr inbounds [1002 x i32], ptr @s, i64 0, i64 %idxprom131
%44 = load i32, ptr %arrayidx132, align 4, !tbaa !20
%call133 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %44)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !14, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 4}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !14, i64 4}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11, !23}
!23 = !{!"llvm.loop.peeled.count", i32 1}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11}
!26 = distinct !{!26, !11}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.