Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
// AOJ 2170: Marked Ancestor // 2018.1.2 bal4u@uu #include <stdio.h> #include <string.h> #define INF 0x01010101 typedef struct { int i, v; } T; T tbl[100003]; int sz; int p[100003]; int mk[100003]; //#define getchar_unlocked() getchar() int in() { int n, c; // while ((c = getchar_unlocked()) < '0'); c = getchar_unlocked(); n = 0; do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } int find(int v, int i) { if (mk[v] < i) return v; return p[v] = find(p[v], i); } int main() { int N, Q, i, cmd, v; long long ans; while (N = in()) { Q = in(); p[1] = 1; for (i = 2; i <= N; i++) p[i] = in(); memset(mk, INF, sizeof(mk)); mk[1] = 0; sz = 0; for (i = 1; i <= Q; i++) { cmd = getchar_unlocked(); getchar_unlocked(); v = in(); if (cmd == 'M') { if (mk[v] == INF) mk[v] = i; } else tbl[sz].i = i, tbl[sz++].v = v; } ans = 0; while (sz--) ans += find(tbl[sz].v, tbl[sz].i); printf("%lld\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152427/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152427/source.c" target datalayout = "e-m:e-p270: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 } %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] } @mk = dso_local local_unnamed_addr global [100003 x i32] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global [100003 x i32] zeroinitializer, align 16 @sz = dso_local local_unnamed_addr global i32 0, align 4 @tbl = dso_local local_unnamed_addr global [100003 x %struct.T] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @stdin = 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 %.pre17.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 ], [ %.pre17.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.exit16 %4 = phi ptr [ %8, %getchar_unlocked.exit16 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add2, %getchar_unlocked.exit16 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i12, %getchar_unlocked.exit16 ], [ %c.0.ph, %do.body.preheader ] %add = mul i32 %n.0, 10 %and = and i32 %c.0, 15 %add2 = add nsw i32 %and, %add %_IO_read_ptr.i7 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %_IO_read_end.i8 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8, align 8, !tbaa !14 %cmp.not.i9 = icmp ult ptr %5, %6 br i1 %cmp.not.i9, label %cond.false.i13, label %cond.true.i10, !prof !15 cond.true.i10: ; preds = %do.body %call.i11 = tail call i32 @__uflow(ptr noundef nonnull %4) #5 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16 cond.false.i13: ; preds = %do.body %incdec.ptr.i14 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15 = zext i8 %7 to i32 br label %getchar_unlocked.exit16 getchar_unlocked.exit16: ; preds = %cond.true.i10, %cond.false.i13 %8 = phi ptr [ %.pre, %cond.true.i10 ], [ %4, %cond.false.i13 ] %cond.i12 = phi i32 [ %call.i11, %cond.true.i10 ], [ %conv3.i15, %cond.false.i13 ] %cmp = icmp sgt i32 %cond.i12, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit16 ret i32 %add2 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @find(i32 noundef %v, i32 noundef %i) local_unnamed_addr #1 { entry: %idxprom = sext i32 %v to i64 %arrayidx = getelementptr inbounds [100003 x i32], ptr @mk, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !19 %cmp = icmp slt i32 %0, %i br i1 %cmp, label %common.ret9, label %if.end common.ret9: ; preds = %entry, %if.end %common.ret9.op = phi i32 [ %call, %if.end ], [ %v, %entry ] ret i32 %common.ret9.op if.end: ; preds = %entry %arrayidx2 = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx2, align 4, !tbaa !19 %call = tail call i32 @find(i32 noundef %1, i32 noundef %i) store i32 %call, ptr %arrayidx2, align 4, !tbaa !19 br label %common.ret9 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.end, %entry %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 = %while.cond %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #5 %.pre17.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %while.cond %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 %.ph179 = phi ptr [ %0, %cond.false.i.i ], [ %.pre17.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.exit16.i %4 = phi ptr [ %8, %getchar_unlocked.exit16.i ], [ %.ph179, %do.body.i.preheader ] %n.0.i = phi i32 [ %add2.i, %getchar_unlocked.exit16.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i12.i, %getchar_unlocked.exit16.i ], [ %c.0.i.ph, %do.body.i.preheader ] %add.i = mul i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add2.i = add nsw i32 %and.i, %add.i %_IO_read_ptr.i7.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %_IO_read_end.i8.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8.i, align 8, !tbaa !14 %cmp.not.i9.i = icmp ult ptr %5, %6 br i1 %cmp.not.i9.i, label %cond.false.i13.i, label %cond.true.i10.i, !prof !15 cond.true.i10.i: ; preds = %do.body.i %call.i11.i = tail call i32 @__uflow(ptr noundef nonnull %4) #5 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i cond.false.i13.i: ; preds = %do.body.i %incdec.ptr.i14.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14.i, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15.i = zext i8 %7 to i32 br label %getchar_unlocked.exit16.i getchar_unlocked.exit16.i: ; preds = %cond.false.i13.i, %cond.true.i10.i %8 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %4, %cond.false.i13.i ] %cond.i12.i = phi i32 [ %call.i11.i, %cond.true.i10.i ], [ %conv3.i15.i, %cond.false.i13.i ] %cmp.i = icmp sgt i32 %cond.i12.i, 47 br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17 in.exit: ; preds = %getchar_unlocked.exit16.i %tobool.not = icmp eq i32 %add2.i, 0 br i1 %tobool.not, label %while.end38, label %while.body while.body: ; preds = %in.exit %_IO_read_ptr.i.i48 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i.i48, align 8, !tbaa !9 %_IO_read_end.i.i49 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i.i49, align 8, !tbaa !14 %cmp.not.i.i50 = icmp ult ptr %9, %10 br i1 %cmp.not.i.i50, label %cond.false.i.i75, label %cond.true.i.i51, !prof !15 cond.true.i.i51: ; preds = %while.body %call.i.i52 = tail call i32 @__uflow(ptr noundef nonnull %8) #5 %.pre17.pre.i53 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i57.preheader cond.false.i.i75: ; preds = %while.body %incdec.ptr.i.i76 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i.i76, ptr %_IO_read_ptr.i.i48, align 8, !tbaa !9 %11 = load i8, ptr %9, align 1, !tbaa !16 %conv3.i.i77 = zext i8 %11 to i32 br label %do.body.i57.preheader do.body.i57.preheader: ; preds = %cond.false.i.i75, %cond.true.i.i51 %.ph178 = phi ptr [ %8, %cond.false.i.i75 ], [ %.pre17.pre.i53, %cond.true.i.i51 ] %c.0.i59.ph = phi i32 [ %conv3.i.i77, %cond.false.i.i75 ], [ %call.i.i52, %cond.true.i.i51 ] br label %do.body.i57 do.body.i57: ; preds = %do.body.i57.preheader, %getchar_unlocked.exit16.i69 %12 = phi ptr [ %16, %getchar_unlocked.exit16.i69 ], [ %.ph178, %do.body.i57.preheader ] %n.0.i58 = phi i32 [ %add2.i62, %getchar_unlocked.exit16.i69 ], [ 0, %do.body.i57.preheader ] %c.0.i59 = phi i32 [ %cond.i12.i70, %getchar_unlocked.exit16.i69 ], [ %c.0.i59.ph, %do.body.i57.preheader ] %add.i60 = mul i32 %n.0.i58, 10 %and.i61 = and i32 %c.0.i59, 15 %add2.i62 = add nsw i32 %and.i61, %add.i60 %_IO_read_ptr.i7.i63 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i7.i63, align 8, !tbaa !9 %_IO_read_end.i8.i64 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i8.i64, align 8, !tbaa !14 %cmp.not.i9.i65 = icmp ult ptr %13, %14 br i1 %cmp.not.i9.i65, label %cond.false.i13.i72, label %cond.true.i10.i66, !prof !15 cond.true.i10.i66: ; preds = %do.body.i57 %call.i11.i67 = tail call i32 @__uflow(ptr noundef nonnull %12) #5 %.pre.i68 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i69 cond.false.i13.i72: ; preds = %do.body.i57 %incdec.ptr.i14.i73 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i14.i73, ptr %_IO_read_ptr.i7.i63, align 8, !tbaa !9 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i15.i74 = zext i8 %15 to i32 br label %getchar_unlocked.exit16.i69 getchar_unlocked.exit16.i69: ; preds = %cond.false.i13.i72, %cond.true.i10.i66 %16 = phi ptr [ %.pre.i68, %cond.true.i10.i66 ], [ %12, %cond.false.i13.i72 ] %cond.i12.i70 = phi i32 [ %call.i11.i67, %cond.true.i10.i66 ], [ %conv3.i15.i74, %cond.false.i13.i72 ] %cmp.i71 = icmp sgt i32 %cond.i12.i70, 47 br i1 %cmp.i71, label %do.body.i57, label %in.exit78, !llvm.loop !17 in.exit78: ; preds = %getchar_unlocked.exit16.i69 store i32 1, ptr getelementptr inbounds ([100003 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !19 %cmp.not151 = icmp slt i32 %add2.i, 2 br i1 %cmp.not151, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %in.exit78 %17 = or i32 %add.i, 1 %18 = and i32 %c.0.i, 15 %19 = add i32 %17, %18 %wide.trip.count = zext i32 %19 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %in.exit109 %20 = phi ptr [ %16, %for.body.preheader ], [ %29, %in.exit109 ] %indvars.iv = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next, %in.exit109 ] %_IO_read_ptr.i.i79 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 1 %21 = load ptr, ptr %_IO_read_ptr.i.i79, align 8, !tbaa !9 %_IO_read_end.i.i80 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 2 %22 = load ptr, ptr %_IO_read_end.i.i80, align 8, !tbaa !14 %cmp.not.i.i81 = icmp ult ptr %21, %22 br i1 %cmp.not.i.i81, label %cond.false.i.i106, label %cond.true.i.i82, !prof !15 cond.true.i.i82: ; preds = %for.body %call.i.i83 = tail call i32 @__uflow(ptr noundef nonnull %20) #5 %.pre17.pre.i84 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i88.preheader cond.false.i.i106: ; preds = %for.body %incdec.ptr.i.i107 = getelementptr inbounds i8, ptr %21, i64 1 store ptr %incdec.ptr.i.i107, ptr %_IO_read_ptr.i.i79, align 8, !tbaa !9 %23 = load i8, ptr %21, align 1, !tbaa !16 %conv3.i.i108 = zext i8 %23 to i32 br label %do.body.i88.preheader do.body.i88.preheader: ; preds = %cond.false.i.i106, %cond.true.i.i82 %.ph177 = phi ptr [ %20, %cond.false.i.i106 ], [ %.pre17.pre.i84, %cond.true.i.i82 ] %c.0.i90.ph = phi i32 [ %conv3.i.i108, %cond.false.i.i106 ], [ %call.i.i83, %cond.true.i.i82 ] br label %do.body.i88 do.body.i88: ; preds = %do.body.i88.preheader, %getchar_unlocked.exit16.i100 %24 = phi ptr [ %29, %getchar_unlocked.exit16.i100 ], [ %.ph177, %do.body.i88.preheader ] %25 = phi ptr [ %30, %getchar_unlocked.exit16.i100 ], [ %.ph177, %do.body.i88.preheader ] %n.0.i89 = phi i32 [ %add2.i93, %getchar_unlocked.exit16.i100 ], [ 0, %do.body.i88.preheader ] %c.0.i90 = phi i32 [ %cond.i12.i101, %getchar_unlocked.exit16.i100 ], [ %c.0.i90.ph, %do.body.i88.preheader ] %add.i91 = mul i32 %n.0.i89, 10 %and.i92 = and i32 %c.0.i90, 15 %add2.i93 = add nsw i32 %and.i92, %add.i91 %_IO_read_ptr.i7.i94 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 1 %26 = load ptr, ptr %_IO_read_ptr.i7.i94, align 8, !tbaa !9 %_IO_read_end.i8.i95 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 2 %27 = load ptr, ptr %_IO_read_end.i8.i95, align 8, !tbaa !14 %cmp.not.i9.i96 = icmp ult ptr %26, %27 br i1 %cmp.not.i9.i96, label %cond.false.i13.i103, label %cond.true.i10.i97, !prof !15 cond.true.i10.i97: ; preds = %do.body.i88 %call.i11.i98 = tail call i32 @__uflow(ptr noundef nonnull %25) #5 %.pre.i99 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i100 cond.false.i13.i103: ; preds = %do.body.i88 %incdec.ptr.i14.i104 = getelementptr inbounds i8, ptr %26, i64 1 store ptr %incdec.ptr.i14.i104, ptr %_IO_read_ptr.i7.i94, align 8, !tbaa !9 %28 = load i8, ptr %26, align 1, !tbaa !16 %conv3.i15.i105 = zext i8 %28 to i32 br label %getchar_unlocked.exit16.i100 getchar_unlocked.exit16.i100: ; preds = %cond.false.i13.i103, %cond.true.i10.i97 %29 = phi ptr [ %.pre.i99, %cond.true.i10.i97 ], [ %24, %cond.false.i13.i103 ] %30 = phi ptr [ %.pre.i99, %cond.true.i10.i97 ], [ %25, %cond.false.i13.i103 ] %cond.i12.i101 = phi i32 [ %call.i11.i98, %cond.true.i10.i97 ], [ %conv3.i15.i105, %cond.false.i13.i103 ] %cmp.i102 = icmp sgt i32 %cond.i12.i101, 47 br i1 %cmp.i102, label %do.body.i88, label %in.exit109, !llvm.loop !17 in.exit109: ; preds = %getchar_unlocked.exit16.i100 %arrayidx = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %indvars.iv store i32 %add2.i93, ptr %arrayidx, align 4, !tbaa !19 %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 !20 for.end: ; preds = %in.exit109, %in.exit78 %31 = phi ptr [ %16, %in.exit78 ], [ %29, %in.exit109 ] tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400012) @mk, i8 1, i64 400012, i1 false) store i32 0, ptr getelementptr inbounds ([100003 x i32], ptr @mk, i64 0, i64 1), align 4, !tbaa !19 store i32 0, ptr @sz, align 4, !tbaa !19 %cmp4.not153 = icmp slt i32 %add2.i62, 1 br i1 %cmp4.not153, label %while.cond27.preheader.thread, label %for.body5.preheader while.cond27.preheader.thread: ; preds = %for.end store i32 -1, ptr @sz, align 4, !tbaa !19 br label %while.end for.body5.preheader: ; preds = %for.end %32 = or i32 %add.i60, 1 %33 = and i32 %c.0.i59, 15 %34 = add i32 %32, %33 br label %for.body5 while.cond27.preheader: ; preds = %for.inc24 %.pre164 = load i32, ptr @sz, align 4, !tbaa !19 %dec155 = add nsw i32 %.pre164, -1 store i32 %dec155, ptr @sz, align 4, !tbaa !19 %tobool28.not156 = icmp eq i32 %.pre164, 0 br i1 %tobool28.not156, label %while.end, label %while.body29 for.body5: ; preds = %for.body5.preheader, %for.inc24 %35 = phi ptr [ %53, %for.inc24 ], [ %31, %for.body5.preheader ] %36 = phi ptr [ %54, %for.inc24 ], [ %31, %for.body5.preheader ] %i.1154 = phi i32 [ %inc25, %for.inc24 ], [ 1, %for.body5.preheader ] %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %36, i64 0, i32 1 %37 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %36, i64 0, i32 2 %38 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %37, %38 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %for.body5 %call.i = tail call i32 @__uflow(ptr noundef nonnull %36) #5 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i110.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 1 %.pre161 = load ptr, ptr %_IO_read_ptr.i110.phi.trans.insert, align 8, !tbaa !9 %_IO_read_end.i111.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre, i64 0, i32 2 %.pre162 = load ptr, ptr %_IO_read_end.i111.phi.trans.insert, align 8, !tbaa !14 br label %getchar_unlocked.exit cond.false.i: ; preds = %for.body5 %incdec.ptr.i = getelementptr inbounds i8, ptr %37, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %39 = load i8, ptr %37, align 1, !tbaa !16 %conv3.i = zext i8 %39 to i32 br label %getchar_unlocked.exit getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %40 = phi ptr [ %.pre, %cond.true.i ], [ %35, %cond.false.i ] %41 = phi ptr [ %.pre162, %cond.true.i ], [ %38, %cond.false.i ] %42 = phi ptr [ %.pre161, %cond.true.i ], [ %incdec.ptr.i, %cond.false.i ] %43 = phi ptr [ %.pre, %cond.true.i ], [ %36, %cond.false.i ] %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] %cmp.not.i112 = icmp ult ptr %42, %41 br i1 %cmp.not.i112, label %cond.false.i116, label %cond.true.i113, !prof !15 cond.true.i113: ; preds = %getchar_unlocked.exit %call.i114 = tail call i32 @__uflow(ptr noundef nonnull %43) #5 %.pre163 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit119 cond.false.i116: ; preds = %getchar_unlocked.exit %_IO_read_ptr.i110 = getelementptr inbounds %struct._IO_FILE, ptr %43, i64 0, i32 1 %incdec.ptr.i117 = getelementptr inbounds i8, ptr %42, i64 1 store ptr %incdec.ptr.i117, ptr %_IO_read_ptr.i110, align 8, !tbaa !9 br label %getchar_unlocked.exit119 getchar_unlocked.exit119: ; preds = %cond.true.i113, %cond.false.i116 %44 = phi ptr [ %.pre163, %cond.true.i113 ], [ %40, %cond.false.i116 ] %_IO_read_ptr.i.i120 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 1 %45 = load ptr, ptr %_IO_read_ptr.i.i120, align 8, !tbaa !9 %_IO_read_end.i.i121 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 2 %46 = load ptr, ptr %_IO_read_end.i.i121, align 8, !tbaa !14 %cmp.not.i.i122 = icmp ult ptr %45, %46 br i1 %cmp.not.i.i122, label %cond.false.i.i147, label %cond.true.i.i123, !prof !15 cond.true.i.i123: ; preds = %getchar_unlocked.exit119 %call.i.i124 = tail call i32 @__uflow(ptr noundef nonnull %44) #5 %.pre17.pre.i125 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i129.preheader cond.false.i.i147: ; preds = %getchar_unlocked.exit119 %incdec.ptr.i.i148 = getelementptr inbounds i8, ptr %45, i64 1 store ptr %incdec.ptr.i.i148, ptr %_IO_read_ptr.i.i120, align 8, !tbaa !9 %47 = load i8, ptr %45, align 1, !tbaa !16 %conv3.i.i149 = zext i8 %47 to i32 br label %do.body.i129.preheader do.body.i129.preheader: ; preds = %cond.false.i.i147, %cond.true.i.i123 %.ph175 = phi ptr [ %44, %cond.false.i.i147 ], [ %.pre17.pre.i125, %cond.true.i.i123 ] %c.0.i131.ph = phi i32 [ %conv3.i.i149, %cond.false.i.i147 ], [ %call.i.i124, %cond.true.i.i123 ] br label %do.body.i129 do.body.i129: ; preds = %do.body.i129.preheader, %getchar_unlocked.exit16.i141 %48 = phi ptr [ %53, %getchar_unlocked.exit16.i141 ], [ %.ph175, %do.body.i129.preheader ] %49 = phi ptr [ %54, %getchar_unlocked.exit16.i141 ], [ %.ph175, %do.body.i129.preheader ] %n.0.i130 = phi i32 [ %add2.i134, %getchar_unlocked.exit16.i141 ], [ 0, %do.body.i129.preheader ] %c.0.i131 = phi i32 [ %cond.i12.i142, %getchar_unlocked.exit16.i141 ], [ %c.0.i131.ph, %do.body.i129.preheader ] %add.i132 = mul i32 %n.0.i130, 10 %and.i133 = and i32 %c.0.i131, 15 %add2.i134 = add nsw i32 %and.i133, %add.i132 %_IO_read_ptr.i7.i135 = getelementptr inbounds %struct._IO_FILE, ptr %49, i64 0, i32 1 %50 = load ptr, ptr %_IO_read_ptr.i7.i135, align 8, !tbaa !9 %_IO_read_end.i8.i136 = getelementptr inbounds %struct._IO_FILE, ptr %49, i64 0, i32 2 %51 = load ptr, ptr %_IO_read_end.i8.i136, align 8, !tbaa !14 %cmp.not.i9.i137 = icmp ult ptr %50, %51 br i1 %cmp.not.i9.i137, label %cond.false.i13.i144, label %cond.true.i10.i138, !prof !15 cond.true.i10.i138: ; preds = %do.body.i129 %call.i11.i139 = tail call i32 @__uflow(ptr noundef nonnull %49) #5 %.pre.i140 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i141 cond.false.i13.i144: ; preds = %do.body.i129 %incdec.ptr.i14.i145 = getelementptr inbounds i8, ptr %50, i64 1 store ptr %incdec.ptr.i14.i145, ptr %_IO_read_ptr.i7.i135, align 8, !tbaa !9 %52 = load i8, ptr %50, align 1, !tbaa !16 %conv3.i15.i146 = zext i8 %52 to i32 br label %getchar_unlocked.exit16.i141 getchar_unlocked.exit16.i141: ; preds = %cond.false.i13.i144, %cond.true.i10.i138 %53 = phi ptr [ %.pre.i140, %cond.true.i10.i138 ], [ %48, %cond.false.i13.i144 ] %54 = phi ptr [ %.pre.i140, %cond.true.i10.i138 ], [ %49, %cond.false.i13.i144 ] %cond.i12.i142 = phi i32 [ %call.i11.i139, %cond.true.i10.i138 ], [ %conv3.i15.i146, %cond.false.i13.i144 ] %cmp.i143 = icmp sgt i32 %cond.i12.i142, 47 br i1 %cmp.i143, label %do.body.i129, label %in.exit150, !llvm.loop !17 in.exit150: ; preds = %getchar_unlocked.exit16.i141 %cmp9 = icmp eq i32 %cond.i, 77 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %in.exit150 %idxprom10 = sext i32 %add2.i134 to i64 %arrayidx11 = getelementptr inbounds [100003 x i32], ptr @mk, i64 0, i64 %idxprom10 %55 = load i32, ptr %arrayidx11, align 4, !tbaa !19 %cmp12 = icmp eq i32 %55, 16843009 br i1 %cmp12, label %if.then13, label %for.inc24 if.then13: ; preds = %if.then store i32 %i.1154, ptr %arrayidx11, align 4, !tbaa !19 br label %for.inc24 if.else: ; preds = %in.exit150 %56 = load i32, ptr @sz, align 4, !tbaa !19 %idxprom16 = sext i32 %56 to i64 %arrayidx17 = getelementptr inbounds [100003 x %struct.T], ptr @tbl, i64 0, i64 %idxprom16 store i32 %i.1154, ptr %arrayidx17, align 8, !tbaa !21 %inc19 = add nsw i32 %56, 1 store i32 %inc19, ptr @sz, align 4, !tbaa !19 %v22 = getelementptr inbounds [100003 x %struct.T], ptr @tbl, i64 0, i64 %idxprom16, i32 1 store i32 %add2.i134, ptr %v22, align 4, !tbaa !23 br label %for.inc24 for.inc24: ; preds = %if.else, %if.then13, %if.then %inc25 = add nuw i32 %i.1154, 1 %exitcond160.not = icmp eq i32 %inc25, %34 br i1 %exitcond160.not, label %while.cond27.preheader, label %for.body5, !llvm.loop !24 while.body29: ; preds = %while.cond27.preheader, %while.body29 %dec158 = phi i32 [ %dec, %while.body29 ], [ %dec155, %while.cond27.preheader ] %ans.0157 = phi i64 [ %add, %while.body29 ], [ 0, %while.cond27.preheader ] %idxprom30 = sext i32 %dec158 to i64 %arrayidx31 = getelementptr inbounds [100003 x %struct.T], ptr @tbl, i64 0, i64 %idxprom30 %v32 = getelementptr inbounds [100003 x %struct.T], ptr @tbl, i64 0, i64 %idxprom30, i32 1 %57 = load i32, ptr %v32, align 4, !tbaa !23 %58 = load i32, ptr %arrayidx31, align 8, !tbaa !21 %call36 = tail call i32 @find(i32 noundef %57, i32 noundef %58) %conv = sext i32 %call36 to i64 %add = add nsw i64 %ans.0157, %conv %59 = load i32, ptr @sz, align 4, !tbaa !19 %dec = add nsw i32 %59, -1 store i32 %dec, ptr @sz, align 4, !tbaa !19 %tobool28.not = icmp eq i32 %59, 0 br i1 %tobool28.not, label %while.end, label %while.body29, !llvm.loop !25 while.end: ; preds = %while.body29, %while.cond27.preheader.thread, %while.cond27.preheader %ans.0.lcssa = phi i64 [ 0, %while.cond27.preheader ], [ 0, %while.cond27.preheader.thread ], [ %add, %while.body29 ] %call37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa) br label %while.cond, !llvm.loop !26 while.end38: ; preds = %in.exit ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 declare i32 @__uflow(ptr 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 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { "no-trapping-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 = !{!11, !11, i64 0} !20 = distinct !{!20, !18} !21 = !{!22, !11, i64 0} !22 = !{!"", !11, i64 0, !11, i64 4} !23 = !{!22, !11, i64 4} !24 = distinct !{!24, !18} !25 = distinct !{!25, !18} !26 = distinct !{!26, !18}
#include<stdio.h> int main(void){ int n,x; int a,b,c; int count; scanf("%d %d",&n,&x); while(n!=0||x!=0){ count=0; for(a=1;a<=n-2;a++){ for(b=a+1;b<=n-1;b++){ c=x-a-b; if(c>b&&c<=n) count++; } } printf("%d\n",count); scanf("%d %d",&n,&x); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152485/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152485/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %call = 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 %cmp32 = icmp ne i32 %0, 0 %1 = load i32, ptr %x, align 4 %cmp133 = icmp ne i32 %1, 0 %2 = select i1 %cmp32, i1 true, i1 %cmp133 br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end14 %3 = phi i32 [ %26, %for.end14 ], [ %1, %entry ] %4 = phi i32 [ %25, %for.end14 ], [ %0, %entry ] %cmp2.not28 = icmp slt i32 %4, 3 br i1 %cmp2.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %5 = add i32 %4, -2 %broadcast.splatinsert37 = insertelement <4 x i32> poison, i32 %3, i64 0 %broadcast.splat38 = shufflevector <4 x i32> %broadcast.splatinsert37, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert39 = insertelement <4 x i32> poison, i32 %4, i64 0 %broadcast.splat40 = shufflevector <4 x i32> %broadcast.splatinsert39, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.body6, %middle.block, %for.body %count.1.lcssa = phi i32 [ %count.030, %for.body ], [ %23, %middle.block ], [ %count.2, %for.body6 ] %exitcond34.not = icmp eq i32 %a.029, %5 %indvar.next = add i32 %indvar, 1 br i1 %exitcond34.not, label %for.end14, 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 ] %count.030 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %a.029 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %6 = sub i32 %5, %indvar %add = add nuw nsw i32 %a.029, 1 %cmp5.not.not25 = icmp slt i32 %add, %4 br i1 %cmp5.not.not25, label %for.body6.preheader, label %for.cond.loopexit for.body6.preheader: ; preds = %for.body %min.iters.check = icmp ult i32 %6, 8 br i1 %min.iters.check, label %for.body6.preheader41, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i32 %6, -8 %ind.end = add i32 %add, %n.vec %7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.030, i64 0 %.splatinsert = insertelement <4 x i32> poison, i32 %add, 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.splatinsert = insertelement <4 x i32> poison, i32 %a.029, 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> [ %7, %vector.ph ], [ %20, %vector.body ] %vec.phi35 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %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 <4 x i32> %broadcast.splat, %vec.ind %9 = add nuw <4 x i32> %broadcast.splat, %step.add %10 = sub <4 x i32> %broadcast.splat38, %8 %11 = sub <4 x i32> %broadcast.splat38, %9 %12 = icmp sgt <4 x i32> %10, %vec.ind %13 = icmp sgt <4 x i32> %11, %step.add %14 = icmp sle <4 x i32> %10, %broadcast.splat40 %15 = icmp sle <4 x i32> %11, %broadcast.splat40 %16 = and <4 x i1> %12, %14 %17 = and <4 x i1> %13, %15 %18 = zext <4 x i1> %16 to <4 x i32> %19 = zext <4 x i1> %17 to <4 x i32> %20 = add <4 x i32> %vec.phi, %18 %21 = add <4 x i32> %vec.phi35, %19 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %22 = icmp eq i32 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %21, %20 %23 = 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.cond.loopexit, label %for.body6.preheader41 for.body6.preheader41: ; preds = %for.body6.preheader, %middle.block %count.127.ph = phi i32 [ %count.030, %for.body6.preheader ], [ %23, %middle.block ] %b.026.ph = phi i32 [ %add, %for.body6.preheader ], [ %ind.end, %middle.block ] br label %for.body6 for.body6: ; preds = %for.body6.preheader41, %for.body6 %count.127 = phi i32 [ %count.2, %for.body6 ], [ %count.127.ph, %for.body6.preheader41 ] %b.026 = phi i32 [ %inc11, %for.body6 ], [ %b.026.ph, %for.body6.preheader41 ] %24 = add nuw i32 %a.029, %b.026 %sub8 = sub i32 %3, %24 %cmp9 = icmp sgt i32 %sub8, %b.026 %cmp10.not = icmp sle i32 %sub8, %4 %or.cond.not = and i1 %cmp9, %cmp10.not %inc = zext i1 %or.cond.not to i32 %count.2 = add nsw i32 %count.127, %inc %inc11 = add nuw nsw i32 %b.026, 1 %exitcond.not = icmp eq i32 %inc11, %4 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body6, !llvm.loop !14 for.end14: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %25 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp ne i32 %25, 0 %26 = load i32, ptr %x, align 4 %cmp1 = icmp ne i32 %26, 0 %27 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %27, label %for.cond.preheader, label %while.end, !llvm.loop !15 while.end: ; preds = %for.end14, %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, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12} !15 = distinct !{!15, !10}
#include<stdio.h> int main(){ int n, x, sum, i, j, k; sum = 0; scanf("%d %d",&n,&x); while(n != 0 || x != 0){ for(i = 1; i < n - 1; i++){ for(j = 2; j < n; j++){ for(k = 3; k <= n; k++){ if(i != j && j != k && i != k){ if(i < j && j < k){ if(i + j + k == x){ sum += 1; } } } } } } printf("%d\n",sum); scanf("%d %d",&n,&x); sum = 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152535/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152535/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %call = 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 %cmp78 = icmp ne i32 %0, 0 %1 = load i32, ptr %x, align 4 %cmp179 = icmp ne i32 %1, 0 %2 = select i1 %cmp78, i1 true, i1 %cmp179 br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end28 %3 = phi i32 [ %31, %for.end28 ], [ %1, %entry ] %4 = phi i32 [ %30, %for.end28 ], [ %0, %entry ] %cmp260 = icmp sgt i32 %4, 2 br i1 %cmp260, label %for.cond3.preheader.us.preheader, label %for.end28 for.cond3.preheader.us.preheader: ; preds = %for.cond.preheader %5 = add i32 %4, -2 %min.iters.check = icmp ult i32 %5, 8 %n.vec = and i32 %5, -8 %ind.end = or i32 %n.vec, 3 %broadcast.splatinsert93 = insertelement <4 x i32> poison, i32 %3, i64 0 %broadcast.splat94 = shufflevector <4 x i32> %broadcast.splatinsert93, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %5, %n.vec br label %for.cond3.preheader.us for.cond3.preheader.us: ; preds = %for.cond3.preheader.us.preheader, %for.cond3.for.inc26_crit_edge.split.us75 %i.062.us = phi i32 [ %inc27.us, %for.cond3.for.inc26_crit_edge.split.us75 ], [ 1, %for.cond3.preheader.us.preheader ] %sum.161.us = phi i32 [ %.us-phi.us, %for.cond3.for.inc26_crit_edge.split.us75 ], [ 0, %for.cond3.preheader.us.preheader ] %broadcast.splatinsert89 = insertelement <4 x i32> poison, i32 %i.062.us, i64 0 %broadcast.splat90 = shufflevector <4 x i32> %broadcast.splatinsert89, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond6.preheader.us69 for.body8.us65: ; preds = %for.body8.us65.preheader95, %for.body8.us65 %k.053.us66 = phi i32 [ %inc.us67, %for.body8.us65 ], [ %k.053.us66.ph, %for.body8.us65.preheader95 ] %sum.352.us = phi i32 [ %sum.4.us, %for.body8.us65 ], [ %sum.352.us.ph, %for.body8.us65.preheader95 ] %cmp12.not.us = icmp eq i32 %i.062.us, %k.053.us66 %cmp15.us = icmp uge i32 %j.056.us70, %k.053.us66 %6 = or i1 %cmp15.us, %cmp12.not.us %or.cond50.us.not = or i1 %6, %cmp9.not.us %add17.us = add nuw nsw i32 %add.us, %k.053.us66 %cmp18.us = icmp eq i32 %add17.us, %3 %not.or.cond50.us.not = xor i1 %or.cond50.us.not, true %narrow = select i1 %not.or.cond50.us.not, i1 %cmp18.us, i1 false %spec.select.us = zext i1 %narrow to i32 %sum.4.us = add nsw i32 %sum.352.us, %spec.select.us %inc.us67 = add nuw i32 %k.053.us66, 1 %exitcond.not = icmp eq i32 %k.053.us66, %4 br i1 %exitcond.not, label %for.cond6.for.inc23_crit_edge.us, label %for.body8.us65, !llvm.loop !9 for.cond6.preheader.us69: ; preds = %for.cond3.preheader.us, %for.cond6.for.inc23_crit_edge.us %j.056.us70 = phi i32 [ 2, %for.cond3.preheader.us ], [ %inc24.us73, %for.cond6.for.inc23_crit_edge.us ] %sum.255.us = phi i32 [ %sum.161.us, %for.cond3.preheader.us ], [ %.us-phi.us, %for.cond6.for.inc23_crit_edge.us ] %cmp9.not.us = icmp eq i32 %i.062.us, %j.056.us70 %cmp13.us = icmp ult i32 %i.062.us, %j.056.us70 %add.us = add nuw nsw i32 %j.056.us70, %i.062.us %cmp13.fr.us = freeze i1 %cmp13.us br i1 %cmp13.fr.us, label %for.body8.us65.preheader, label %for.cond6.for.inc23_crit_edge.us for.body8.us65.preheader: ; preds = %for.cond6.preheader.us69 br i1 %min.iters.check, label %for.body8.us65.preheader95, label %vector.ph vector.ph: ; preds = %for.body8.us65.preheader %7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %sum.255.us, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %j.056.us70, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert87 = insertelement <4 x i1> poison, i1 %cmp9.not.us, i64 0 %broadcast.splat88 = shufflevector <4 x i1> %broadcast.splatinsert87, <4 x i1> poison, <4 x i32> zeroinitializer %broadcast.splatinsert91 = insertelement <4 x i32> poison, i32 %add.us, i64 0 %broadcast.splat92 = shufflevector <4 x i32> %broadcast.splatinsert91, <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> [ <i32 3, i32 4, i32 5, i32 6>, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %7, %vector.ph ], [ %26, %vector.body ] %vec.phi86 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %8 = icmp eq <4 x i32> %broadcast.splat90, %vec.ind %9 = icmp eq <4 x i32> %broadcast.splat90, %step.add %10 = icmp uge <4 x i32> %broadcast.splat, %vec.ind %11 = icmp uge <4 x i32> %broadcast.splat, %step.add %12 = or <4 x i1> %10, %8 %13 = or <4 x i1> %12, %broadcast.splat88 %14 = or <4 x i1> %11, %9 %15 = or <4 x i1> %14, %broadcast.splat88 %16 = add nuw nsw <4 x i32> %broadcast.splat92, %vec.ind %17 = add nuw nsw <4 x i32> %broadcast.splat92, %step.add %18 = icmp eq <4 x i32> %16, %broadcast.splat94 %19 = icmp eq <4 x i32> %17, %broadcast.splat94 %20 = xor <4 x i1> %13, <i1 true, i1 true, i1 true, i1 true> %21 = xor <4 x i1> %15, <i1 true, i1 true, i1 true, i1 true> %22 = select <4 x i1> %20, <4 x i1> %18, <4 x i1> zeroinitializer %23 = select <4 x i1> %21, <4 x i1> %19, <4 x i1> zeroinitializer %24 = zext <4 x i1> %22 to <4 x i32> %25 = zext <4 x i1> %23 to <4 x i32> %26 = add <4 x i32> %vec.phi, %24 %27 = add <4 x i32> %vec.phi86, %25 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %28 = icmp eq i32 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %27, %26 %29 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond6.for.inc23_crit_edge.us, label %for.body8.us65.preheader95 for.body8.us65.preheader95: ; preds = %for.body8.us65.preheader, %middle.block %k.053.us66.ph = phi i32 [ 3, %for.body8.us65.preheader ], [ %ind.end, %middle.block ] %sum.352.us.ph = phi i32 [ %sum.255.us, %for.body8.us65.preheader ], [ %29, %middle.block ] br label %for.body8.us65 for.cond6.for.inc23_crit_edge.us: ; preds = %for.body8.us65, %middle.block, %for.cond6.preheader.us69 %.us-phi.us = phi i32 [ %sum.255.us, %for.cond6.preheader.us69 ], [ %29, %middle.block ], [ %sum.4.us, %for.body8.us65 ] %inc24.us73 = add nuw nsw i32 %j.056.us70, 1 %exitcond83.not = icmp eq i32 %inc24.us73, %4 br i1 %exitcond83.not, label %for.cond3.for.inc26_crit_edge.split.us75, label %for.cond6.preheader.us69, !llvm.loop !14 for.cond3.for.inc26_crit_edge.split.us75: ; preds = %for.cond6.for.inc23_crit_edge.us %inc27.us = add nuw nsw i32 %i.062.us, 1 %exitcond84.not = icmp eq i32 %i.062.us, %5 br i1 %exitcond84.not, label %for.end28, label %for.cond3.preheader.us, !llvm.loop !15 for.end28: ; preds = %for.cond3.for.inc26_crit_edge.split.us75, %for.cond.preheader %sum.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %.us-phi.us, %for.cond3.for.inc26_crit_edge.split.us75 ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.lcssa) %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %30 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp ne i32 %30, 0 %31 = load i32, ptr %x, align 4 %cmp1 = icmp ne i32 %31, 0 %32 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %32, label %for.cond.preheader, label %while.end, !llvm.loop !16 while.end: ; preds = %for.end28, %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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> int main(void){ int n,x; int i,j,k; int count=0; while(scanf("%d %d",&n,&x)){ if(n + x == 0){ break; } for(i = 1;i <= n;i++){ for(j = 1;j <= n;j++){ for(k = 1;k <= n;k++){ if(i == j || j == k || i == k) break; if(i + j + k == x) count++; } } } printf("%d\n",count/2); count = 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152579/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %call62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %tobool.not63 = icmp eq i32 %call62, 0 br i1 %tobool.not63, label %while.end, label %while.body while.body: ; preds = %entry, %for.end25 %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %x, align 4, !tbaa !5 %add = sub i32 0, %1 %cmp = icmp eq i32 %0, %add br i1 %cmp, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %while.body %cmp1.not56 = icmp slt i32 %0, 1 br i1 %cmp1.not56, label %for.end25, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %for.cond.preheader %2 = add nuw i32 %0, 1 %smax = call i32 @llvm.smax.i32(i32 %2, i32 2) %3 = add i32 %0, -1 %broadcast.splatinsert71 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat72 = shufflevector <4 x i32> %broadcast.splatinsert71, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.inc23_crit_edge %indvar = phi i32 [ 0, %for.cond2.preheader.preheader ], [ %indvar.next, %for.cond2.for.inc23_crit_edge ] %count.159 = phi i32 [ 0, %for.cond2.preheader.preheader ], [ %.us-phi55, %for.cond2.for.inc23_crit_edge ] %i.057 = phi i32 [ 1, %for.cond2.preheader.preheader ], [ %inc24, %for.cond2.for.inc23_crit_edge ] %4 = add i32 %indvar, -1 %cmp1146 = icmp eq i32 %i.057, 1 br i1 %cmp1146, label %for.cond2.for.inc23_crit_edge, label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc20 %indvar66 = phi i32 [ %indvar.next67, %for.inc20 ], [ 0, %for.cond2.preheader ] %count.253 = phi i32 [ %count.3.lcssa, %for.inc20 ], [ %count.159, %for.cond2.preheader ] %j.051 = phi i32 [ %inc21, %for.inc20 ], [ 1, %for.cond2.preheader ] %5 = add i32 %indvar66, -1 %umin = call i32 @llvm.umin.i32(i32 %4, i32 %5) %umin68 = call i32 @llvm.umin.i32(i32 %umin, i32 %3) %6 = add i32 %umin68, 1 %cmp8 = icmp eq i32 %i.057, %j.051 %cmp8.fr = freeze i1 %cmp8 %cmp944 = icmp eq i32 %j.051, 1 %or.cond4045 = or i1 %cmp944, %cmp8.fr br i1 %or.cond4045, label %for.inc20, label %if.end13.preheader if.end13.preheader: ; preds = %for.cond5.preheader %add14 = add nuw nsw i32 %j.051, %i.057 %min.iters.check = icmp ult i32 %6, 8 br i1 %min.iters.check, label %if.end13.preheader73, label %vector.ph vector.ph: ; preds = %if.end13.preheader %n.vec = and i32 %6, -8 %ind.end = or i32 %n.vec, 1 %7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.253, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add14, 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> [ %7, %vector.ph ], [ %14, %vector.body ] %vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %8 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %9 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %10 = icmp eq <4 x i32> %8, %broadcast.splat72 %11 = icmp eq <4 x i32> %9, %broadcast.splat72 %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi, %12 %15 = add <4 x i32> %vec.phi69, %13 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %16 = icmp eq i32 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = 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.inc20, label %if.end13.preheader73 if.end13.preheader73: ; preds = %if.end13.preheader, %middle.block %count.349.ph = phi i32 [ %count.253, %if.end13.preheader ], [ %17, %middle.block ] %k.048.ph = phi i32 [ 1, %if.end13.preheader ], [ %ind.end, %middle.block ] br label %if.end13 if.end13: ; preds = %if.end13.preheader73, %if.end13 %count.349 = phi i32 [ %spec.select, %if.end13 ], [ %count.349.ph, %if.end13.preheader73 ] %k.048 = phi i32 [ %inc19, %if.end13 ], [ %k.048.ph, %if.end13.preheader73 ] %add15 = add nuw nsw i32 %add14, %k.048 %cmp16 = icmp eq i32 %add15, %1 %inc = zext i1 %cmp16 to i32 %spec.select = add nsw i32 %count.349, %inc %inc19 = add nuw nsw i32 %k.048, 1 %cmp6.not = icmp sge i32 %k.048, %0 %cmp9 = icmp eq i32 %j.051, %inc19 %or.cond40 = or i1 %cmp9, %cmp6.not %cmp11 = icmp eq i32 %i.057, %inc19 %or.cond41 = or i1 %cmp11, %or.cond40 br i1 %or.cond41, label %for.inc20, label %if.end13, !llvm.loop !13 for.inc20: ; preds = %if.end13, %middle.block, %for.cond5.preheader %count.3.lcssa = phi i32 [ %count.253, %for.cond5.preheader ], [ %17, %middle.block ], [ %spec.select, %if.end13 ] %inc21 = add nuw i32 %j.051, 1 %exitcond.not = icmp eq i32 %j.051, %0 %indvar.next67 = add i32 %indvar66, 1 br i1 %exitcond.not, label %for.cond2.for.inc23_crit_edge, label %for.cond5.preheader, !llvm.loop !14 for.cond2.for.inc23_crit_edge: ; preds = %for.inc20, %for.cond2.preheader %.us-phi55 = phi i32 [ %count.159, %for.cond2.preheader ], [ %count.3.lcssa, %for.inc20 ] %inc24 = add nuw nsw i32 %i.057, 1 %exitcond65 = icmp eq i32 %inc24, %smax %indvar.next = add i32 %indvar, 1 br i1 %exitcond65, label %for.end25, label %for.cond2.preheader, !llvm.loop !15 for.end25: ; preds = %for.cond2.for.inc23_crit_edge, %for.cond.preheader %count.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %.us-phi55, %for.cond2.for.inc23_crit_edge ] %div = sdiv i32 %count.1.lcssa, 2 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %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 !16 while.end: ; preds = %for.end25, %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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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.umin.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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> int main() { int n, x; int i, j, k; int count = 0; while(1){ count = 0; scanf("%d %d", &n, &x ); if( n == 0 && x == 0 ) break; for( i=1; i<=n-2; i++ ){ for( j=i+1; j<=n-1; j++ ){ for( k=j+1; k<=n; k++ ){ if( i+j+k == x ){ count++; //printf("%d+%d+%d=%d\n", i, j, k, x ); } } } } printf("%d\n", count ); getchar(); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152621/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152621/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %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 %call45 = 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 %cmp46 = icmp eq i32 %0, 0 %1 = load i32, ptr %x, align 4 %cmp147 = icmp eq i32 %1, 0 %or.cond48 = select i1 %cmp46, i1 %cmp147, i1 false br i1 %or.cond48, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end22 %2 = phi i32 [ %22, %for.end22 ], [ %1, %entry ] %3 = phi i32 [ %21, %for.end22 ], [ %0, %entry ] %cmp2.not41 = icmp slt i32 %3, 3 br i1 %cmp2.not41, label %for.end22, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add i32 %3, -2 %broadcast.splatinsert54 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat55 = shufflevector <4 x i32> %broadcast.splatinsert54, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body %count.1.lcssa = phi i32 [ %count.043, %for.body ], [ %spec.select.lcssa, %for.cond3.loopexit ] %exitcond49.not = icmp eq i32 %i.042, %4 %indvar.next = add i32 %indvar, 1 br i1 %exitcond49.not, label %for.end22, 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 ] %count.043 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %i.042 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %5 = add i32 %indvar, 3 %add = add nuw nsw i32 %i.042, 1 %cmp5.not.not37 = icmp slt i32 %add, %3 br i1 %cmp5.not.not37, label %for.body10.lr.ph, label %for.cond.loopexit for.cond3.loopexit: ; preds = %for.body10, %middle.block %spec.select.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select, %for.body10 ] %exitcond.not = icmp eq i32 %add7, %3 %indvar.next51 = add i32 %indvar50, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body10.lr.ph, !llvm.loop !11 for.body10.lr.ph: ; preds = %for.body, %for.cond3.loopexit %indvar50 = phi i32 [ %indvar.next51, %for.cond3.loopexit ], [ 0, %for.body ] %count.139 = phi i32 [ %spec.select.lcssa, %for.cond3.loopexit ], [ %count.043, %for.body ] %j.038 = phi i32 [ %add7, %for.cond3.loopexit ], [ %add, %for.body ] %6 = add i32 %5, %indvar50 %smax = call i32 @llvm.smax.i32(i32 %3, i32 %6) %7 = add i32 %indvar, %indvar50 %reass.sub = sub i32 %smax, %7 %8 = add i32 %reass.sub, -2 %add7 = add nuw nsw i32 %j.038, 1 %add11 = add nuw nsw i32 %j.038, %i.042 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body10.preheader, label %vector.ph vector.ph: ; preds = %for.body10.lr.ph %n.vec = and i32 %8, -8 %ind.end = add i32 %add7, %n.vec %9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.139, i64 0 %.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> %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add11, 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> [ %9, %vector.ph ], [ %16, %vector.body ] %vec.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %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> %10 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %11 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %12 = icmp eq <4 x i32> %10, %broadcast.splat55 %13 = icmp eq <4 x i32> %11, %broadcast.splat55 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi52, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %8, %n.vec br i1 %cmp.n, label %for.cond3.loopexit, label %for.body10.preheader for.body10.preheader: ; preds = %for.body10.lr.ph, %middle.block %count.236.ph = phi i32 [ %count.139, %for.body10.lr.ph ], [ %19, %middle.block ] %k.035.ph = phi i32 [ %add7, %for.body10.lr.ph ], [ %ind.end, %middle.block ] br label %for.body10 for.body10: ; preds = %for.body10.preheader, %for.body10 %count.236 = phi i32 [ %spec.select, %for.body10 ], [ %count.236.ph, %for.body10.preheader ] %k.035 = phi i32 [ %inc16, %for.body10 ], [ %k.035.ph, %for.body10.preheader ] %add12 = add nuw nsw i32 %add11, %k.035 %cmp13 = icmp eq i32 %add12, %2 %inc = zext i1 %cmp13 to i32 %spec.select = add nsw i32 %count.236, %inc %inc16 = add nuw nsw i32 %k.035, 1 %cmp9.not.not = icmp slt i32 %k.035, %3 br i1 %cmp9.not.not, label %for.body10, label %for.cond3.loopexit, !llvm.loop !15 for.end22: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %20 = load ptr, ptr @stdin, align 8, !tbaa !16 %call.i = call i32 @getc(ptr noundef %20) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %21, 0 %22 = load i32, ptr %x, align 4 %cmp1 = icmp eq i32 %22, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end22, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; 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} !16 = !{!17, !17, i64 0} !17 = !{!"any pointer", !7, i64 0}
#include<stdio.h> int main(){ int n,x,i,j,k; int count; while(1){ count=0; scanf("%d%d",&n,&x); 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++){ if(i+j+k==x) count++; } } } printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152665/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152665/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %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 %call43 = 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 %cmp44 = icmp eq i32 %0, 0 %1 = load i32, ptr %x, align 4 %cmp145 = icmp eq i32 %1, 0 %or.cond46 = select i1 %cmp44, i1 %cmp145, i1 false br i1 %or.cond46, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end21 %2 = phi i32 [ %19, %for.end21 ], [ %1, %entry ] %3 = phi i32 [ %18, %for.end21 ], [ %0, %entry ] %cmp2.not39 = icmp slt i32 %3, 1 br i1 %cmp2.not39, label %for.end21, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add i32 %3, -2 %broadcast.splatinsert52 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat53 = shufflevector <4 x i32> %broadcast.splatinsert52, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.body for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body %count.1.lcssa = phi i32 [ %count.041, %for.body ], [ %count.2.lcssa, %for.cond3.loopexit ] %exitcond47.not = icmp eq i32 %i.040, %3 %indvar.next = add i32 %indvar, 1 br i1 %exitcond47.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 ] %count.041 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %i.040 = phi i32 [ 1, %for.body.preheader ], [ %add, %for.cond.loopexit ] %add = add nuw i32 %i.040, 1 %cmp4.not35.not = icmp slt i32 %i.040, %3 br i1 %cmp4.not35.not, label %for.body5, label %for.cond.loopexit for.cond3.loopexit: ; preds = %for.body9, %middle.block, %for.body5 %count.2.lcssa = phi i32 [ %count.137, %for.body5 ], [ %17, %middle.block ], [ %spec.select, %for.body9 ] %exitcond.not = icmp eq i32 %j.036, %3 %indvar.next49 = add i32 %indvar48, 1 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body5, !llvm.loop !11 for.body5: ; preds = %for.body, %for.cond3.loopexit %indvar48 = phi i32 [ %indvar.next49, %for.cond3.loopexit ], [ 0, %for.body ] %count.137 = phi i32 [ %count.2.lcssa, %for.cond3.loopexit ], [ %count.041, %for.body ] %j.036 = phi i32 [ %add6, %for.cond3.loopexit ], [ %add, %for.body ] %5 = add i32 %indvar, %indvar48 %6 = sub i32 %4, %5 %add6 = add i32 %j.036, 1 %cmp8.not32.not = icmp slt i32 %j.036, %3 br i1 %cmp8.not32.not, label %for.body9.lr.ph, label %for.cond3.loopexit for.body9.lr.ph: ; preds = %for.body5 %add10 = add nuw nsw i32 %j.036, %i.040 %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 %count.137, 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 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 ], [ %14, %vector.body ] %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %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 eq <4 x i32> %8, %broadcast.splat53 %11 = icmp eq <4 x i32> %9, %broadcast.splat53 %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi, %12 %15 = add <4 x i32> %vec.phi50, %13 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %16 = icmp eq i32 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = 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 %count.234.ph = phi i32 [ %count.137, %for.body9.lr.ph ], [ %17, %middle.block ] %k.033.ph = phi i32 [ %add6, %for.body9.lr.ph ], [ %ind.end, %middle.block ] br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.body9 %count.234 = phi i32 [ %spec.select, %for.body9 ], [ %count.234.ph, %for.body9.preheader ] %k.033 = phi i32 [ %inc15, %for.body9 ], [ %k.033.ph, %for.body9.preheader ] %add11 = add nuw nsw i32 %add10, %k.033 %cmp12 = icmp eq i32 %add11, %2 %inc = zext i1 %cmp12 to i32 %spec.select = add nsw i32 %count.234, %inc %inc15 = add nuw nsw i32 %k.033, 1 %cmp8.not.not = icmp slt i32 %k.033, %3 br i1 %cmp8.not.not, label %for.body9, label %for.cond3.loopexit, !llvm.loop !15 for.end21: ; preds = %for.cond.loopexit, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1.lcssa, %for.cond.loopexit ] %call22 = 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) %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %18, 0 %19 = load i32, ptr %x, align 4 %cmp1 = icmp eq i32 %19, 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.end21, %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() { int i, N, T, A[100001]; scanf("%d %d", &N, &T); for (i = 1; i <= N; i++) scanf("%d", &(A[i])); int min = 1 << 30, max = 0, ans = 0; for (i = 1; i <= N; i++) { if (A[i] < min) min = A[i]; if (A[i] - min > max) { max = A[i] - min; ans = 1; } else if (A[i] - min == max) ans++; } printf("%d\n", ans); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152708/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152708/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %T = alloca i32, align 4 %A = alloca [100001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not45 = icmp slt i32 %0, 1 br i1 %cmp.not45, label %for.end27, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not47 = icmp slt i32 %3, 1 br i1 %cmp3.not47, label %for.end27, label %for.body4.preheader for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %3 to i64 %xtraiter = and i64 %1, 1 %2 = icmp eq i32 %3, 1 br i1 %2, label %for.end27.loopexit.unr-lcssa, label %for.body4.preheader.new for.body4.preheader.new: ; preds = %for.body4.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4, %for.body4.preheader.new %indvars.iv55 = phi i64 [ 1, %for.body4.preheader.new ], [ %indvars.iv.next56.1, %for.body4 ] %ans.051 = phi i32 [ 0, %for.body4.preheader.new ], [ %ans.1.1, %for.body4 ] %max.050 = phi i32 [ 0, %for.body4.preheader.new ], [ %max.1.1, %for.body4 ] %min.049 = phi i32 [ 1073741824, %for.body4.preheader.new ], [ %spec.select.1, %for.body4 ] %niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.body4 ] %arrayidx6 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv55 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %spec.select = call i32 @llvm.smin.i32(i32 %5, i32 %min.049) %sub = sub nsw i32 %5, %spec.select %cmp12 = icmp sgt i32 %sub, %max.050 %cmp20 = icmp eq i32 %sub, %max.050 %inc22 = zext i1 %cmp20 to i32 %spec.select44 = add nsw i32 %ans.051, %inc22 %max.1 = call i32 @llvm.smax.i32(i32 %sub, i32 %max.050) %ans.1 = select i1 %cmp12, i32 1, i32 %spec.select44 %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %arrayidx6.1 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv.next56 %6 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %spec.select.1 = call i32 @llvm.smin.i32(i32 %6, i32 %spec.select) %sub.1 = sub nsw i32 %6, %spec.select.1 %cmp12.1 = icmp sgt i32 %sub.1, %max.1 %cmp20.1 = icmp eq i32 %sub.1, %max.1 %inc22.1 = zext i1 %cmp20.1 to i32 %spec.select44.1 = add nsw i32 %ans.1, %inc22.1 %max.1.1 = call i32 @llvm.smax.i32(i32 %sub.1, i32 %max.1) %ans.1.1 = select i1 %cmp12.1, i32 1, i32 %spec.select44.1 %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 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.end27.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11 for.end27.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.preheader %ans.1.lcssa.ph = phi i32 [ undef, %for.body4.preheader ], [ %ans.1.1, %for.body4 ] %indvars.iv55.unr = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next56.1, %for.body4 ] %ans.051.unr = phi i32 [ 0, %for.body4.preheader ], [ %ans.1.1, %for.body4 ] %max.050.unr = phi i32 [ 0, %for.body4.preheader ], [ %max.1.1, %for.body4 ] %min.049.unr = phi i32 [ 1073741824, %for.body4.preheader ], [ %spec.select.1, %for.body4 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end27, label %for.body4.epil for.body4.epil: ; preds = %for.end27.loopexit.unr-lcssa %arrayidx6.epil = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv55.unr %7 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %spec.select.epil = call i32 @llvm.smin.i32(i32 %7, i32 %min.049.unr) %sub.epil = sub nsw i32 %7, %spec.select.epil %cmp12.epil = icmp sgt i32 %sub.epil, %max.050.unr %cmp20.epil = icmp eq i32 %sub.epil, %max.050.unr %inc22.epil = zext i1 %cmp20.epil to i32 %spec.select44.epil = add nsw i32 %ans.051.unr, %inc22.epil %ans.1.epil = select i1 %cmp12.epil, i32 1, i32 %spec.select44.epil br label %for.end27 for.end27: ; preds = %for.body4.epil, %for.end27.loopexit.unr-lcssa, %entry, %for.cond2.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %ans.1.lcssa.ph, %for.end27.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body4.epil ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) %8 = load ptr, ptr @stdout, align 8, !tbaa !12 %call29 = call i32 @fflush(ptr noundef %8) call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> // uint64_t #define max(a,b) ((a) > (b) ? (a) : (b)) #define min(a,b) ((a) > (b) ? (b) : (a)) int get_int(void) { int num; scanf("%d", &num); return num; } int divs[] = {3, 5, 15, 25, 75}; int traverse(int *prime_map, int idx, int val) { if(val==1) return 1; if(idx >= 100) return 0; int i; int ans = 0; ans += traverse(prime_map, idx+1, val); for(i = 0; i < 5; i++) { if(val%divs[i]) continue; int d = divs[i]; if(prime_map[idx] >= d-1) { prime_map[idx] -= (d-1); ans += traverse(prime_map, idx+1, val/d); prime_map[idx] += (d-1); } } return ans; } #define TARGET_VAL 75 #define NUM_MAX 100 int main(void) { int num = get_int(); static int prime_map[NUM_MAX+1]; int i; for(i = 2; i <= num; i++) { int cur = i; int divisor = 2; while(cur>1) { if(cur%divisor) { divisor++; continue; } cur /= divisor; prime_map[divisor]++; } } #ifdef DEBUG for(i = 2; i <= num; i++) printf(" %d", prime_map[i]); putchar('\n'); #endif int64_t ans = traverse(prime_map, 0, TARGET_VAL); printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152751/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152751/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @divs = dso_local local_unnamed_addr global [5 x i32] [i32 3, i32 5, i32 15, i32 25, i32 75], align 16 @main.prime_map = internal global [101 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @get_int() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @traverse(ptr noundef %prime_map, i32 noundef %idx, i32 noundef %val) local_unnamed_addr #3 { entry: %cmp = icmp eq i32 %val, 1 br i1 %cmp, label %common.ret, label %if.end if.end: ; preds = %entry %cmp1 = icmp sgt i32 %idx, 99 br i1 %cmp1, label %common.ret, label %if.end3 if.end3: ; preds = %if.end %add = add nsw i32 %idx, 1 %call = tail call i32 @traverse(ptr noundef %prime_map, i32 noundef %add, i32 noundef %val) %idxprom10 = sext i32 %idx to i64 %arrayidx11 = getelementptr inbounds i32, ptr %prime_map, i64 %idxprom10 %0 = load i32, ptr @divs, align 16, !tbaa !5 %rem = srem i32 %val, %0 %div = sdiv i32 %val, %0 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %if.end7, label %for.inc if.end7: ; preds = %if.end3 %1 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %cmp12.not = icmp slt i32 %1, %sub br i1 %cmp12.not, label %for.inc, label %if.then13 if.then13: ; preds = %if.end7 %sub17 = sub nsw i32 %1, %sub store i32 %sub17, ptr %arrayidx11, align 4, !tbaa !5 %call19 = tail call i32 @traverse(ptr noundef nonnull %prime_map, i32 noundef %add, i32 noundef %div) %add20 = add nsw i32 %call19, %call %2 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add24 = add nsw i32 %2, %sub store i32 %add24, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end7, %if.then13, %if.end3 %ans.2 = phi i32 [ %call, %if.end3 ], [ %add20, %if.then13 ], [ %call, %if.end7 ] %3 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @divs, i64 0, i64 1), align 4, !tbaa !5 %rem.1 = srem i32 %val, %3 %div.1 = sdiv i32 %val, %3 %tobool.not.1 = icmp eq i32 %rem.1, 0 br i1 %tobool.not.1, label %if.end7.1, label %for.inc.1 if.end7.1: ; preds = %for.inc %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub.1 = add nsw i32 %3, -1 %cmp12.not.1 = icmp slt i32 %4, %sub.1 br i1 %cmp12.not.1, label %for.inc.1, label %if.then13.1 if.then13.1: ; preds = %if.end7.1 %sub17.1 = sub nsw i32 %4, %sub.1 store i32 %sub17.1, ptr %arrayidx11, align 4, !tbaa !5 %call19.1 = tail call i32 @traverse(ptr noundef nonnull %prime_map, i32 noundef %add, i32 noundef %div.1) %add20.1 = add nsw i32 %call19.1, %ans.2 %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add24.1 = add nsw i32 %5, %sub.1 store i32 %add24.1, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then13.1, %if.end7.1, %for.inc %ans.2.1 = phi i32 [ %ans.2, %for.inc ], [ %add20.1, %if.then13.1 ], [ %ans.2, %if.end7.1 ] %6 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @divs, i64 0, i64 2), align 8, !tbaa !5 %rem.2 = srem i32 %val, %6 %div.2 = sdiv i32 %val, %6 %tobool.not.2 = icmp eq i32 %rem.2, 0 br i1 %tobool.not.2, label %if.end7.2, label %for.inc.2 if.end7.2: ; preds = %for.inc.1 %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub.2 = add nsw i32 %6, -1 %cmp12.not.2 = icmp slt i32 %7, %sub.2 br i1 %cmp12.not.2, label %for.inc.2, label %if.then13.2 if.then13.2: ; preds = %if.end7.2 %sub17.2 = sub nsw i32 %7, %sub.2 store i32 %sub17.2, ptr %arrayidx11, align 4, !tbaa !5 %call19.2 = tail call i32 @traverse(ptr noundef nonnull %prime_map, i32 noundef %add, i32 noundef %div.2) %add20.2 = add nsw i32 %call19.2, %ans.2.1 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add24.2 = add nsw i32 %8, %sub.2 store i32 %add24.2, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then13.2, %if.end7.2, %for.inc.1 %ans.2.2 = phi i32 [ %ans.2.1, %for.inc.1 ], [ %add20.2, %if.then13.2 ], [ %ans.2.1, %if.end7.2 ] %9 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @divs, i64 0, i64 3), align 4, !tbaa !5 %rem.3 = srem i32 %val, %9 %div.3 = sdiv i32 %val, %9 %tobool.not.3 = icmp eq i32 %rem.3, 0 br i1 %tobool.not.3, label %if.end7.3, label %for.inc.3 if.end7.3: ; preds = %for.inc.2 %10 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub.3 = add nsw i32 %9, -1 %cmp12.not.3 = icmp slt i32 %10, %sub.3 br i1 %cmp12.not.3, label %for.inc.3, label %if.then13.3 if.then13.3: ; preds = %if.end7.3 %sub17.3 = sub nsw i32 %10, %sub.3 store i32 %sub17.3, ptr %arrayidx11, align 4, !tbaa !5 %call19.3 = tail call i32 @traverse(ptr noundef nonnull %prime_map, i32 noundef %add, i32 noundef %div.3) %add20.3 = add nsw i32 %call19.3, %ans.2.2 %11 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add24.3 = add nsw i32 %11, %sub.3 store i32 %add24.3, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then13.3, %if.end7.3, %for.inc.2 %ans.2.3 = phi i32 [ %ans.2.2, %for.inc.2 ], [ %add20.3, %if.then13.3 ], [ %ans.2.2, %if.end7.3 ] %12 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @divs, i64 0, i64 4), align 16, !tbaa !5 %rem.4 = srem i32 %val, %12 %div.4 = sdiv i32 %val, %12 %tobool.not.4 = icmp eq i32 %rem.4, 0 br i1 %tobool.not.4, label %if.end7.4, label %common.ret if.end7.4: ; preds = %for.inc.3 %13 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub.4 = add nsw i32 %12, -1 %cmp12.not.4 = icmp slt i32 %13, %sub.4 br i1 %cmp12.not.4, label %common.ret, label %if.then13.4 common.ret: ; preds = %entry, %if.end, %if.end7.4, %for.inc.3, %if.then13.4 %common.ret.op = phi i32 [ %add20.4, %if.then13.4 ], [ 1, %entry ], [ 0, %if.end ], [ %ans.2.3, %for.inc.3 ], [ %ans.2.3, %if.end7.4 ] ret i32 %common.ret.op if.then13.4: ; preds = %if.end7.4 %sub17.4 = sub nsw i32 %13, %sub.4 store i32 %sub17.4, ptr %arrayidx11, align 4, !tbaa !5 %call19.4 = tail call i32 @traverse(ptr noundef nonnull %prime_map, i32 noundef %add, i32 noundef %div.4) %add20.4 = add nsw i32 %call19.4, %ans.2.3 %14 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add24.4 = add nsw i32 %14, %sub.4 store i32 %add24.4, ptr %arrayidx11, align 4, !tbaa !5 br label %common.ret } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #4 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num.i) %0 = load i32, ptr %num.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #4 %cmp.not18 = icmp slt i32 %0, 2 br i1 %cmp.not18, label %for.end, label %while.cond.preheader while.cond.preheader: ; preds = %entry, %while.end %i.019 = phi i32 [ %inc3, %while.end ], [ 2, %entry ] br label %while.body.us.preheader while.body.us.preheader: ; preds = %if.end, %while.cond.preheader %divisor.0.ph16 = phi i32 [ 2, %while.cond.preheader ], [ %divisor.014.us, %if.end ] %cur.0.ph15 = phi i32 [ %i.019, %while.cond.preheader ], [ %div, %if.end ] br label %while.body.us while.body.us: ; preds = %while.body.us.preheader, %while.body.us %divisor.014.us = phi i32 [ %inc.us, %while.body.us ], [ %divisor.0.ph16, %while.body.us.preheader ] %rem.us = srem i32 %cur.0.ph15, %divisor.014.us %div = sdiv i32 %cur.0.ph15, %divisor.014.us %tobool.not.us = icmp eq i32 %rem.us, 0 %inc.us = add nsw i32 %divisor.014.us, 1 br i1 %tobool.not.us, label %if.end, label %while.body.us if.end: ; preds = %while.body.us %idxprom = sext i32 %divisor.014.us to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @main.prime_map, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc2 = add nsw i32 %1, 1 store i32 %inc2, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %div, 1 br i1 %cmp1, label %while.body.us.preheader, label %while.end, !llvm.loop !9 while.end: ; preds = %if.end %inc3 = add nuw i32 %i.019, 1 %exitcond.not = icmp eq i32 %i.019, %0 br i1 %exitcond.not, label %for.end, label %while.cond.preheader, !llvm.loop !11 for.end: ; preds = %while.end, %entry %call4 = call i32 @traverse(ptr noundef nonnull @main.prime_map, i32 noundef 0, i32 noundef 75) %conv = sext i32 %call4 to i64 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv) ret i32 0 } ; 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 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> int *count; void plus(int n){ int i; for(i = 2; n > 1; i++){ while(n % i == 0){ count[i]++; n /= i; } } } int main(){ int N, i, j, k, ans = 0; scanf("%d", &N); count = (int *)malloc(sizeof(int) * (N + 1)); for(i = 0; i <= N; i++){ count[i] = 0; } for(i = 1; i <= N; i++){ plus(i); } for(i = 2; i <= N; i++){ if(count[i] >= 74){ // printf("1:i = %d\n", i); ans++; } } for(i = 2; i <= N; i++){ for(j = 2; j <= N; j++){ if(i == j){ continue; } if(count[i] >= 2 && count[j] >= 24){ // printf("2:(i, j) = (%d, %d)\n", i, j); ans++; } if(count[i] >= 4 && count[j] >= 14){ // printf("3:(i, j) = (%d, %d)\n", i, j); ans++; } } } for(i = 2; i <= N; i++){ for(j = 2; j <= N; j++){ for(k = 2; k <= N; k++){ if(i == j || j == k || k == i || j < k){ continue; } if(count[i] >= 2 && count[j] >= 4 && count[k] >= 4){ // printf("4:(i, j, k) = (%d, %d, %d)\n", i, j, k); ans++; } } } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152795/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152795/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @count = dso_local local_unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @plus(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp12 = icmp sgt i32 %n, 1 br i1 %cmp12, label %while.cond.preheader.lr.ph, label %for.end while.cond.preheader.lr.ph: ; preds = %entry %0 = load ptr, ptr @count, align 8 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %for.inc %indvars.iv = phi i64 [ 2, %while.cond.preheader.lr.ph ], [ %indvars.iv.next, %for.inc ] %n.addr.013 = phi i32 [ %n, %while.cond.preheader.lr.ph ], [ %n.addr.1.lcssa, %for.inc ] %1 = trunc i64 %indvars.iv to i32 %rem8 = srem i32 %n.addr.013, %1 %cmp19 = icmp eq i32 %rem8, 0 br i1 %cmp19, label %while.body.lr.ph, label %for.inc while.body.lr.ph: ; preds = %while.cond.preheader %arrayidx = getelementptr inbounds i32, ptr %0, i64 %indvars.iv %arrayidx.promoted = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %inc11 = phi i32 [ %arrayidx.promoted, %while.body.lr.ph ], [ %inc, %while.body ] %n.addr.110 = phi i32 [ %n.addr.013, %while.body.lr.ph ], [ %div, %while.body ] %inc = add nsw i32 %inc11, 1 %div = sdiv i32 %n.addr.110, %1 %rem = srem i32 %div, %1 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %while.body, label %while.cond.for.inc_crit_edge, !llvm.loop !9 while.cond.for.inc_crit_edge: ; preds = %while.body store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %while.cond.for.inc_crit_edge, %while.cond.preheader %n.addr.1.lcssa = phi i32 [ %div, %while.cond.for.inc_crit_edge ], [ %n.addr.013, %while.cond.preheader ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp = icmp sgt i32 %n.addr.1.lcssa, 1 br i1 %cmp, label %while.cond.preheader, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %add = add i32 %0, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #8 store ptr %call1, ptr @count, align 8, !tbaa !12 %cmp.not158 = icmp slt i32 %0, 0 br i1 %cmp.not158, label %for.end112, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry %1 = zext i32 %add to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr align 4 %call1, i8 0, i64 %2, i1 false), !tbaa !5 %cmp4.not160 = icmp eq i32 %0, 0 br i1 %cmp4.not160, label %for.end112, label %for.body6 for.cond10.preheader: ; preds = %plus.exit %cmp11.not162 = icmp slt i32 %18, 2 br i1 %cmp11.not162, label %for.end112, label %for.body13.preheader for.body13.preheader: ; preds = %for.cond10.preheader %3 = add nuw i32 %18, 1 %wide.trip.count = zext i32 %3 to i64 %4 = add nsw i64 %wide.trip.count, -2 %min.iters.check = icmp ult i64 %4, 8 br i1 %min.iters.check, label %for.body13.preheader237, label %vector.ph vector.ph: ; preds = %for.body13.preheader %n.vec = and i64 %4, -8 %ind.end = or i64 %n.vec, 2 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 ], [ %11, %vector.body ] %vec.phi235 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %offset.idx = or i64 %index, 2 %5 = getelementptr inbounds i32, ptr %call1, i64 %offset.idx %wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load236 = load <4 x i32>, ptr %6, align 4, !tbaa !5 %7 = icmp sgt <4 x i32> %wide.load, <i32 73, i32 73, i32 73, i32 73> %8 = icmp sgt <4 x i32> %wide.load236, <i32 73, i32 73, i32 73, i32 73> %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi235, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.cond22.preheader, label %for.body13.preheader237 for.body13.preheader237: ; preds = %for.body13.preheader, %middle.block %indvars.iv.ph = phi i64 [ 2, %for.body13.preheader ], [ %ind.end, %middle.block ] %ans.0164.ph = phi i32 [ 0, %for.body13.preheader ], [ %14, %middle.block ] br label %for.body13 for.body6: ; preds = %for.cond3.preheader, %plus.exit %15 = phi i32 [ %18, %plus.exit ], [ %0, %for.cond3.preheader ] %i.1161 = phi i32 [ %inc8, %plus.exit ], [ 1, %for.cond3.preheader ] %cmp12.i = icmp ugt i32 %i.1161, 1 br i1 %cmp12.i, label %while.cond.preheader.lr.ph.i, label %plus.exit while.cond.preheader.lr.ph.i: ; preds = %for.body6 %16 = load ptr, ptr @count, align 8 br label %while.cond.preheader.i while.cond.preheader.i: ; preds = %for.inc.i, %while.cond.preheader.lr.ph.i %indvars.iv.i = phi i64 [ 2, %while.cond.preheader.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ] %n.addr.013.i = phi i32 [ %i.1161, %while.cond.preheader.lr.ph.i ], [ %n.addr.1.lcssa.i, %for.inc.i ] %17 = trunc i64 %indvars.iv.i to i32 %rem8.i = srem i32 %n.addr.013.i, %17 %cmp19.i = icmp eq i32 %rem8.i, 0 br i1 %cmp19.i, label %while.body.lr.ph.i, label %for.inc.i while.body.lr.ph.i: ; preds = %while.cond.preheader.i %arrayidx.i = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.i %arrayidx.promoted.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.body.i while.body.i: ; preds = %while.body.i, %while.body.lr.ph.i %inc11.i = phi i32 [ %arrayidx.promoted.i, %while.body.lr.ph.i ], [ %inc.i, %while.body.i ] %n.addr.110.i = phi i32 [ %n.addr.013.i, %while.body.lr.ph.i ], [ %div.i, %while.body.i ] %inc.i = add nsw i32 %inc11.i, 1 %div.i = sdiv i32 %n.addr.110.i, %17 %rem.i = srem i32 %div.i, %17 %cmp1.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.i, label %while.body.i, label %while.cond.for.inc_crit_edge.i, !llvm.loop !9 while.cond.for.inc_crit_edge.i: ; preds = %while.body.i store i32 %inc.i, ptr %arrayidx.i, align 4, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %while.cond.for.inc_crit_edge.i, %while.cond.preheader.i %n.addr.1.lcssa.i = phi i32 [ %div.i, %while.cond.for.inc_crit_edge.i ], [ %n.addr.013.i, %while.cond.preheader.i ] %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %cmp.i = icmp sgt i32 %n.addr.1.lcssa.i, 1 br i1 %cmp.i, label %while.cond.preheader.i, label %plus.exit.loopexit, !llvm.loop !11 plus.exit.loopexit: ; preds = %for.inc.i %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %plus.exit plus.exit: ; preds = %plus.exit.loopexit, %for.body6 %18 = phi i32 [ %.pre, %plus.exit.loopexit ], [ %15, %for.body6 ] %inc8 = add nuw nsw i32 %i.1161, 1 %cmp4.not.not = icmp slt i32 %i.1161, %18 br i1 %cmp4.not.not, label %for.body6, label %for.cond10.preheader, !llvm.loop !17 for.cond22.preheader: ; preds = %for.body13, %middle.block %spec.select.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select, %for.body13 ] br i1 %cmp11.not162, label %for.end112, label %for.cond26.preheader.preheader for.cond26.preheader.preheader: ; preds = %for.cond22.preheader %19 = add nuw i32 %18, 1 %wide.trip.count202 = zext i32 %19 to i64 br label %for.cond26.preheader for.body13: ; preds = %for.body13.preheader237, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ %indvars.iv.ph, %for.body13.preheader237 ] %ans.0164 = phi i32 [ %spec.select, %for.body13 ], [ %ans.0164.ph, %for.body13.preheader237 ] %arrayidx15 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %20 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %20, 73 %inc18 = zext i1 %cmp16 to i32 %spec.select = add nuw nsw i32 %ans.0164, %inc18 %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.cond22.preheader, label %for.body13, !llvm.loop !18 for.cond26.preheader: ; preds = %for.cond26.preheader.preheader, %for.cond26.for.inc60_crit_edge %indvars.iv199 = phi i64 [ 2, %for.cond26.preheader.preheader ], [ %indvars.iv.next200, %for.cond26.for.inc60_crit_edge ] %ans.2172 = phi i32 [ %spec.select.lcssa, %for.cond26.preheader.preheader ], [ %ans.5, %for.cond26.for.inc60_crit_edge ] %arrayidx35 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv199 br label %for.body29 for.cond63.preheader: ; preds = %for.cond26.for.inc60_crit_edge br i1 %cmp11.not162, label %for.end112, label %for.cond67.preheader.preheader for.cond67.preheader.preheader: ; preds = %for.cond63.preheader %21 = add nuw i32 %18, 1 %wide.trip.count217 = zext i32 %21 to i64 br label %for.cond67.preheader for.body29: ; preds = %for.cond26.preheader, %for.inc57 %indvars.iv194 = phi i64 [ 2, %for.cond26.preheader ], [ %indvars.iv.next195, %for.inc57 ] %ans.3168 = phi i32 [ %ans.2172, %for.cond26.preheader ], [ %ans.5, %for.inc57 ] %cmp30 = icmp eq i64 %indvars.iv199, %indvars.iv194 br i1 %cmp30, label %for.inc57, label %if.end33 if.end33: ; preds = %for.body29 %22 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %22, 1 br i1 %cmp36, label %if.end44, label %for.inc57 if.end44: ; preds = %if.end33 %arrayidx39 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv194 %23 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %23, 23 %inc43 = zext i1 %cmp40 to i32 %spec.select151 = add nsw i32 %ans.3168, %inc43 %cmp47 = icmp ugt i32 %22, 3 br i1 %cmp47, label %land.lhs.true49, label %for.inc57 land.lhs.true49: ; preds = %if.end44 %cmp52 = icmp sgt i32 %23, 13 %inc55 = zext i1 %cmp52 to i32 %spec.select152 = add nsw i32 %spec.select151, %inc55 br label %for.inc57 for.inc57: ; preds = %if.end33, %land.lhs.true49, %if.end44, %for.body29 %ans.5 = phi i32 [ %ans.3168, %for.body29 ], [ %spec.select151, %if.end44 ], [ %spec.select152, %land.lhs.true49 ], [ %ans.3168, %if.end33 ] %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1 %exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count202 br i1 %exitcond198.not, label %for.cond26.for.inc60_crit_edge, label %for.body29, !llvm.loop !19 for.cond26.for.inc60_crit_edge: ; preds = %for.inc57 %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1 %exitcond203.not = icmp eq i64 %indvars.iv.next200, %wide.trip.count202 br i1 %exitcond203.not, label %for.cond63.preheader, label %for.cond26.preheader, !llvm.loop !20 for.cond67.preheader: ; preds = %for.cond67.preheader.preheader, %for.cond67.for.inc110_crit_edge.split %indvars.iv214 = phi i64 [ 2, %for.cond67.preheader.preheader ], [ %indvars.iv.next215, %for.cond67.for.inc110_crit_edge.split ] %ans.6187 = phi i32 [ %ans.5, %for.cond67.preheader.preheader ], [ %.us-phi178, %for.cond67.for.inc110_crit_edge.split ] %arrayidx88 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv214 br label %for.cond71.preheader for.cond71.preheader: ; preds = %for.cond67.preheader, %for.cond71.for.inc107_crit_edge %indvars.iv209 = phi i64 [ 2, %for.cond67.preheader ], [ %indvars.iv.next210, %for.cond71.for.inc107_crit_edge ] %ans.7182 = phi i32 [ %ans.6187, %for.cond67.preheader ], [ %.us-phi178, %for.cond71.for.inc107_crit_edge ] %cmp75 = icmp eq i64 %indvars.iv214, %indvars.iv209 %arrayidx93 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv209 %cmp75.fr = freeze i1 %cmp75 br i1 %cmp75.fr, label %for.cond71.for.inc107_crit_edge, label %for.body74 for.body74: ; preds = %for.cond71.preheader, %for.inc104 %indvars.iv204 = phi i64 [ %indvars.iv.next205, %for.inc104 ], [ 2, %for.cond71.preheader ] %ans.8176 = phi i32 [ %ans.9, %for.inc104 ], [ %ans.7182, %for.cond71.preheader ] %cmp80 = icmp eq i64 %indvars.iv204, %indvars.iv214 %24 = icmp ule i64 %indvars.iv209, %indvars.iv204 %or.cond154 = or i1 %cmp80, %24 br i1 %or.cond154, label %for.inc104, label %if.end86 if.end86: ; preds = %for.body74 %25 = load i32, ptr %arrayidx88, align 4, !tbaa !5 %cmp89 = icmp sgt i32 %25, 1 br i1 %cmp89, label %land.lhs.true91, label %for.inc104 land.lhs.true91: ; preds = %if.end86 %26 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %cmp94 = icmp sgt i32 %26, 3 br i1 %cmp94, label %land.lhs.true96, label %for.inc104 land.lhs.true96: ; preds = %land.lhs.true91 %arrayidx98 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv204 %27 = load i32, ptr %arrayidx98, align 4, !tbaa !5 %cmp99 = icmp sgt i32 %27, 3 %inc102 = zext i1 %cmp99 to i32 %spec.select155 = add nsw i32 %ans.8176, %inc102 br label %for.inc104 for.inc104: ; preds = %land.lhs.true96, %if.end86, %land.lhs.true91, %for.body74 %ans.9 = phi i32 [ %ans.8176, %for.body74 ], [ %ans.8176, %land.lhs.true91 ], [ %ans.8176, %if.end86 ], [ %spec.select155, %land.lhs.true96 ] %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond208.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count217 br i1 %exitcond208.not, label %for.cond71.for.inc107_crit_edge, label %for.body74, !llvm.loop !21 for.cond71.for.inc107_crit_edge: ; preds = %for.inc104, %for.cond71.preheader %.us-phi178 = phi i32 [ %ans.7182, %for.cond71.preheader ], [ %ans.9, %for.inc104 ] %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1 %exitcond213.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count217 br i1 %exitcond213.not, label %for.cond67.for.inc110_crit_edge.split, label %for.cond71.preheader, !llvm.loop !22 for.cond67.for.inc110_crit_edge.split: ; preds = %for.cond71.for.inc107_crit_edge %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1 %exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217 br i1 %exitcond218.not, label %for.end112, label %for.cond67.preheader, !llvm.loop !23 for.end112: ; preds = %for.cond67.for.inc110_crit_edge.split, %for.cond10.preheader, %entry, %for.cond3.preheader, %for.cond22.preheader, %for.cond63.preheader %ans.6.lcssa = phi i32 [ %ans.5, %for.cond63.preheader ], [ %spec.select.lcssa, %for.cond22.preheader ], [ 0, %for.cond3.preheader ], [ 0, %entry ], [ 0, %for.cond10.preheader ], [ %.us-phi178, %for.cond67.for.inc110_crit_edge.split ] %call113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.6.lcssa) 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree norecurse 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !10, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !16, !15} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10}
#include<stdio.h> #include<string.h> int main(){ char S[16]; scanf("%s",S); int i,j,k,w=0,l=0; for(i=0;i<strlen(S);i++){ if(S[i] == 'o') w++; } if(w+15-strlen(S) >= 8){ puts("YES"); } else puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152838/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [16 x i8], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6 %cmp20.not = icmp eq i64 %call2, 0 br i1 %cmp20.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %call2, 8 br i1 %min.iters.check, label %for.body.preheader28, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %call2, -8 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 ], [ %6, %vector.body ] %vec.phi26 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %0 = getelementptr inbounds [16 x i8], ptr %S, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load27 = load <4 x i8>, ptr %1, align 4, !tbaa !5 %2 = icmp eq <4 x i8> %wide.load, <i8 111, i8 111, i8 111, i8 111> %3 = icmp eq <4 x i8> %wide.load27, <i8 111, i8 111, i8 111, i8 111> %4 = zext <4 x i1> %2 to <4 x i32> %5 = zext <4 x i1> %3 to <4 x i32> %6 = add <4 x i32> %vec.phi, %4 %7 = add <4 x i32> %vec.phi26, %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 !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %call2, %n.vec br i1 %cmp.n, label %for.end.loopexit, label %for.body.preheader28 for.body.preheader28: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %w.021.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader28, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader28 ] %w.021 = phi i32 [ %spec.select, %for.body ], [ %w.021.ph, %for.body.preheader28 ] %arrayidx = getelementptr inbounds [16 x i8], ptr %S, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp5 = icmp eq i8 %10, 111 %inc = zext i1 %cmp5 to i32 %spec.select = add nuw nsw i32 %w.021, %inc %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.end.loopexit, label %for.body, !llvm.loop !12 for.end.loopexit: ; preds = %for.body, %middle.block %spec.select.lcssa = phi i32 [ %9, %middle.block ], [ %spec.select, %for.body ] %11 = add nuw nsw i32 %spec.select.lcssa, 15 %12 = zext i32 %11 to i64 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %w.0.lcssa = phi i64 [ 15, %entry ], [ %12, %for.end.loopexit ] %sub = sub i64 %w.0.lcssa, %call2 %cmp11 = icmp ugt i64 %sub, 7 %.str.1..str.2 = select i1 %cmp11, ptr @.str.1, ptr @.str.2 %call15 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include <stdio.h> #include <string.h> int main(void){ char k[15]; int i; scanf("%s",k); for(i=0; k[i]!='\0'; ++i); int j=0; for(i=0;k[i];i++) { if(k[i]=='o') { j++; } } if(8<=15-i+j){ printf("YES"); }else{ printf("NO"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152881/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152881/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca [15 x i8], align 1 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) br label %for.cond2 for.cond2: ; preds = %entry, %for.inc12 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc12 ] %j.0 = phi i32 [ 0, %entry ], [ %j.1, %for.inc12 ] %arrayidx4 = getelementptr inbounds [15 x i8], ptr %k, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx4, align 1, !tbaa !5 switch i8 %0, label %for.inc12 [ i8 0, label %for.end14 i8 111, label %if.then ] if.then: ; preds = %for.cond2 %inc11 = add nsw i32 %j.0, 1 br label %for.inc12 for.inc12: ; preds = %for.cond2, %if.then %j.1 = phi i32 [ %inc11, %if.then ], [ %j.0, %for.cond2 ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond2, !llvm.loop !8 for.end14: ; preds = %for.cond2 %1 = trunc i64 %indvars.iv to i32 %reass.sub27 = sub i32 %j.0, %1 %add = add i32 %reass.sub27, 15 %cmp15 = icmp sgt i32 %add, 7 %.str.1..str.2 = select i1 %cmp15, ptr @.str.1, ptr @.str.2 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int max(int a,int b){ if(a>=b){ return a; }else{ return b; } } int amax(int a,int b,int c){ int s=max(a,b); int q=max(s,c); return q; } int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); printf("%d\n",amax(10*a+b+c,10*b+a+c,10*c+a+b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152924/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152924/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, i32 noundef %b) local_unnamed_addr #0 { entry: %b.a = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @amax(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 { entry: %b.a.i = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %b.a.i2 = tail call i32 @llvm.smax.i32(i32 %b.a.i, i32 %c) ret i32 %b.a.i2 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca 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 %b.a.i.i = call i32 @llvm.smax.i32(i32 %add1, i32 %add4) %b.a.i2.i = call i32 @llvm.smax.i32(i32 %b.a.i.i, i32 %add7) %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b.a.i2.i) 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <limits.h> #include <math.h> int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */ int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */ int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */ int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */ #define min(a,b) (a < b ? a: b) #define max(a,b) (a > b ? a: b) #define rep(i, l, r) for (int i = l; i < r; i++) #define MAX 100001 #define MOD 1000000007 typedef long long int lli; int main(void) { int a, b, c; scanf("%d %d %d",&a, &b, &c); int max = max(max(a, b), c); int ans = a + b + c; ans = ans - max + max * 10; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !9 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !10 %1 = load ptr, ptr %b, align 8, !tbaa !10 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #8 %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 %1 = load i32, ptr %b, align 4 %cond = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %cond. = call i32 @llvm.smax.i32(i32 %cond, i32 %2) %add = add nsw i32 %1, %0 %add11 = add nsw i32 %add, %2 %sub = sub i32 %add11, %cond. %mul = mul nsw i32 %cond., 10 %add12 = add nsw i32 %sub, %mul %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add12) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress 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 #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 nosync nounwind willreturn memory(argmem: readwrite) } 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 willreturn memory(read) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !7, i64 0}
#include<stdio.h> #include<string.h> char f[1100000][60],s[1100000][60]; int p[110000]; int main() { int n,n1,flag; char c[60],x[60],y[60]; flag=0; scanf("%d",&n); for(n1=0;n1<n;n1++) scanf("%s %s",f[n1],s[n1]); for(n1=0;n1<n;n1++) scanf("%d",&p[n1]); if(strcmp(f[p[0]-1],s[p[0]-1])!=1) strcpy(c,f[p[0]-1]); else strcpy(c,s[p[0]-1]); for(n1=1;n1<n;n1++) { /*if(!strcmp(f[p[n1]],c)) strcpy(c,f[p[n1]]); else { if(!strcmp(s[p[n1]],c)) strcpy(c,s[p[n1]]); else { flag=1; break; } }*/ if(strcmp(f[p[n1]-1],s[p[n1]-1])==1) { strcpy(x,f[p[n1]-1]); strcpy(y,s[p[n1]-1]); } else { strcpy(y,f[p[n1]-1]); strcpy(x,s[p[n1]-1]); } if(strcmp(y,c)==1||strcmp(y,c)==0) strcpy(c,y); else { if(strcmp(x,c)==1||strcmp(x,c)==0) strcpy(c,x); else { flag=1; break; } } } if(flag==0) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15301/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15301/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @f = dso_local global [1100000 x [60 x i8]] zeroinitializer, align 16 @s = dso_local global [1100000 x [60 x i8]] zeroinitializer, align 16 @p = dso_local global [110000 x i32] zeroinitializer, align 16 @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 %c = alloca [60 x i8], align 16 %x = alloca [60 x i8], align 16 %y = alloca [60 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %c) #6 call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %y) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp141 = icmp sgt i32 %0, 0 br i1 %cmp141, label %for.body, label %for.end13 for.cond5.preheader: ; preds = %for.body %cmp6143 = icmp sgt i32 %1, 0 br i1 %cmp6143, label %for.body7, label %for.end13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1100000 x [60 x i8]], ptr @f, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1100000 x [60 x i8]], ptr @s, i64 0, i64 %indvars.iv %call4 = 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 %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.cond5.preheader, !llvm.loop !9 for.body7: ; preds = %for.cond5.preheader, %for.body7 %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body7 ], [ 0, %for.cond5.preheader ] %arrayidx9 = getelementptr inbounds [110000 x i32], ptr @p, i64 0, i64 %indvars.iv149 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp6 = icmp slt i64 %indvars.iv.next150, %4 br i1 %cmp6, label %for.body7, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.body7, %entry, %for.cond5.preheader %.lcssa = phi i32 [ %1, %for.cond5.preheader ], [ %0, %entry ], [ %3, %for.body7 ] %5 = load i32, ptr @p, align 16, !tbaa !5 %sub = add nsw i32 %5, -1 %idxprom14 = sext i32 %sub to i64 %arrayidx15 = getelementptr inbounds [1100000 x [60 x i8]], ptr @f, i64 0, i64 %idxprom14 %arrayidx19 = getelementptr inbounds [1100000 x [60 x i8]], ptr @s, i64 0, i64 %idxprom14 %call21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx15, ptr noundef nonnull dereferenceable(1) %arrayidx19) #7 %cmp22.not = icmp eq i32 %call21, 1 %arrayidx19.arrayidx15 = select i1 %cmp22.not, ptr %arrayidx19, ptr %arrayidx15 %call34 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) %arrayidx19.arrayidx15) #6 %cmp36.not145 = icmp sgt i32 %.lcssa, 1 br i1 %cmp36.not145, label %for.body37.preheader, label %if.end124 for.body37.preheader: ; preds = %for.end13 %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body37 for.body37: ; preds = %for.body37.preheader, %for.inc116 %indvars.iv152 = phi i64 [ 1, %for.body37.preheader ], [ %indvars.iv.next153, %for.inc116 ] %arrayidx39 = getelementptr inbounds [110000 x i32], ptr @p, i64 0, i64 %indvars.iv152 %6 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %sub40 = add nsw i32 %6, -1 %idxprom41 = sext i32 %sub40 to i64 %arrayidx42 = getelementptr inbounds [1100000 x [60 x i8]], ptr @f, i64 0, i64 %idxprom41 %arrayidx48 = getelementptr inbounds [1100000 x [60 x i8]], ptr @s, i64 0, i64 %idxprom41 %call50 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx42, ptr noundef nonnull dereferenceable(1) %arrayidx48) #7 %cmp51 = icmp eq i32 %call50, 1 %x.y = select i1 %cmp51, ptr %x, ptr %y %y.x = select i1 %cmp51, ptr %y, ptr %x %call77 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %x.y, ptr noundef nonnull dereferenceable(1) %arrayidx42) #6 %call85 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %y.x, ptr noundef nonnull dereferenceable(1) %arrayidx48) #6 %call89 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %y, ptr noundef nonnull dereferenceable(1) %c) #7 %switch = icmp ult i32 %call89, 2 br i1 %switch, label %for.inc116, label %if.else99 if.else99: ; preds = %for.body37 %call102 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %x, ptr noundef nonnull dereferenceable(1) %c) #7 %switch140 = icmp ult i32 %call102, 2 br i1 %switch140, label %for.inc116, label %if.end124 for.inc116: ; preds = %if.else99, %for.body37 %y.sink158 = phi ptr [ %y, %for.body37 ], [ %x, %if.else99 ] %call98 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %c, ptr noundef nonnull dereferenceable(1) %y.sink158) #6 %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count br i1 %exitcond.not, label %if.end124, label %for.body37, !llvm.loop !12 if.end124: ; preds = %if.else99, %for.inc116, %for.end13 %str.sink = phi ptr [ @str.4, %for.end13 ], [ @str.4, %for.inc116 ], [ @str, %if.else99 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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}
/* * main.c * * Created on: 2019/03/09 * Author: family */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b); } int main() { int a[3] = {0}; scanf("%d %d %d", &a[0], &a[1], &a[2]); qsort(a, 3, sizeof(int), sort_inc); printf("%d\n", (a[2]*10) + (a[1]) + a[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153053/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153053/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sort_inc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %a, i8 0, i64 12, i1 false) %arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) call void @qsort(ptr noundef nonnull %a, i64 noundef 3, i64 noundef 4, ptr noundef nonnull @sort_inc) #6 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %mul = mul nsw i32 %0, 10 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add = add nsw i32 %mul, %1 %2 = load i32, ptr %a, align 4, !tbaa !5 %add6 = add nsw i32 %add, %2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add6) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree "no-trapping-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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> 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(a+b*10+c, a+b+c*10)); printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153097/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153097/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: 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 %add5 = add nsw i32 %1, %0 %mul6 = mul nsw i32 %2, 10 %add7 = add nsw i32 %add5, %mul6 %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(void){ char a[10]; int j,i,max; fgets(a,10,stdin); for(i=0;i<=4;i=i+2){ if(i==4)break; for(j=i+2;j<=4;j=j+2){ if(a[i]<a[j]){ max=a[j]; a[j]=a[i]; a[i]=max; } } } int k=a[0]-'0'; int kk=a[2]-'0'; int kkk=a[4]-'0'; max=10*k+kk+kkk; printf("%d",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153147/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.body4.lr.ph: %a = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %a) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %a, i32 noundef 10, ptr noundef %0) %1 = load i8, ptr %a, align 1, !tbaa !9 %arrayidx6 = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %cmp8 = icmp slt i8 %1, %2 br i1 %cmp8, label %if.then10, label %for.inc for.body4.lr.ph.1: ; preds = %if.then10.160, %for.inc %arrayidx.1 = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 2 %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %arrayidx6.1 = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 4 %4 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9 %cmp8.1 = icmp slt i8 %3, %4 br i1 %cmp8.1, label %if.then10.1, label %for.cond.loopexit.1 if.then10.1: ; preds = %for.body4.lr.ph.1 store i8 %3, ptr %arrayidx6.1, align 1, !tbaa !9 store i8 %4, ptr %arrayidx.1, align 1, !tbaa !9 br label %for.cond.loopexit.1 for.cond.loopexit.1: ; preds = %for.body4.lr.ph.1, %if.then10.1 %5 = phi i8 [ %3, %if.then10.1 ], [ %4, %for.body4.lr.ph.1 ] %6 = phi i8 [ %4, %if.then10.1 ], [ %3, %for.body4.lr.ph.1 ] %7 = load i8, ptr %a, align 1, !tbaa !9 %conv27 = sext i8 %7 to i32 %conv29 = sext i8 %6 to i32 %conv32 = sext i8 %5 to i32 %8 = mul nsw i32 %conv27, 10 %sub30 = add nsw i32 %conv29, -576 %sub33 = add nsw i32 %sub30, %8 %add35 = add nsw i32 %sub33, %conv32 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add35) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %a) #3 ret i32 0 if.then10: ; preds = %for.body4.lr.ph store i8 %1, ptr %arrayidx6, align 1, !tbaa !9 store i8 %2, ptr %a, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body4.lr.ph, %if.then10 %9 = phi i8 [ %1, %for.body4.lr.ph ], [ %2, %if.then10 ] %arrayidx6.157 = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 4 %10 = load i8, ptr %arrayidx6.157, align 1, !tbaa !9 %cmp8.158 = icmp slt i8 %9, %10 br i1 %cmp8.158, label %if.then10.160, label %for.body4.lr.ph.1 if.then10.160: ; preds = %for.inc store i8 %9, ptr %arrayidx6.157, align 1, !tbaa !9 store i8 %10, ptr %a, align 1, !tbaa !9 br label %for.body4.lr.ph.1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include<stdio.h> int main() { int a,b,c,max=0,i,kari; scanf("%d %d %d",&a,&b,&c); for(i=0;i<3;i++) { if(i==0)kari=(a*10+b)+c; else if(i==1)kari=(b*10)+a+c; else kari=c*10+a+b; if(max<kari)max=kari; } printf("%d",max); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 { if.end12.2: %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 %b, align 4 %1 = load i32, ptr %a, align 4 %2 = load i32, ptr %c, align 4 %mul5 = mul nsw i32 %0, 10 %add6 = add nsw i32 %mul5, %1 %add7 = add nsw i32 %add6, %2 %mul = mul nsw i32 %1, 10 %add = add nsw i32 %mul, %0 %add2 = add nsw i32 %add, %2 %spec.select = call i32 @llvm.smax.i32(i32 %add2, i32 %add7) %mul9 = mul nsw i32 %2, 10 %add10 = add nsw i32 %mul9, %1 %add11 = add nsw i32 %add10, %0 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %add11) %spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 0) %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.2) 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)"}
/* cat <<EOF >mistaken-paste */ #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 200000000000007LL #define MOD 1000000007 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 200000 #define M_MAX 200000 #ifdef __cplusplus #include <queue> #include <stack> // #include <tuple> #include <set> #include <map> // using namespace std; // HELL using std::queue; using std::priority_queue; using std::stack; // using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; #endif typedef struct { int32_t a; int32_t b; } hw; typedef struct { sll a; sll b; } hwll; typedef struct { hwll a; hwll b; } linell; typedef struct { ull s; ull t; int32_t c; } struct_a; typedef struct { int32_t from; int32_t to; sll cost; } struct_b; const hw vector8[8] = { {-1, -1}, {-1, 0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1, 0}, {+1, +1} }; ull n, m; ull h, w; ull k; ull q; ull vua, vub, vuc, vud, vue, vuf; sll vsa, vsb, vsc, vsd, vse, vsf; long double vra, vrb, vrc; double vda, vdb, vdc; size_t slen; size_t tlen; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } void printUquotient (ull left, ull right) { const int32_t digits = 20; printf("%llu.", left / right); left %= right; for (int32_t i = 0; i < digits; i++) { left *= 10; printf("%1d", left / right); left %= right; } puts(""); return; } void printSquotient (sll left, sll right) { if (left * right < 0) putchar('-'); printUquotient(sdiff(left, 0), sdiff(right, 0)); return; } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #ifdef __cplusplus bool setfind (set<ull> s, ull x) { return (s.find(x) != s.end()); } #endif // double distance (sll x1, sll y1, sll x2, sll y2) { // double xdist2, ydist2, origindist, dist; // xdist2 = (x1 - x2) * (x1 - x2); // ydist2 = (y1 - y2) * (y1 - y2); // return sqrt(xdist2 + ydist2); // } int32_t pullcomp (const void *left, const void *right) { ull l = *(ull*)left; ull r = *(ull*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t psllcomp (const void *left, const void *right) { sll l = *(sll*)left; sll r = *(sll*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t pcharcomp (const void *left, const void *right) { char l = *(char*)left; char r = *(char*)right; if (l < r) { return -1; } if (l > r) { return +1; } return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } int32_t phwllABcomp (const void *left, const void *right) { hwll l = *(hwll*)left; hwll r = *(hwll*)right; if (l.a < r.a) { return -1; } if (l.a > r.a) { return +1; } if (l.b < r.b) { return -1; } if (l.b > r.b) { return +1; } return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } ull mergeteq (ull a[], ull n) { ull l = n / 2, r = n - l; if (n == 1) return 0; ull ret = mergeteq(a, l) + mergeteq(a + l, r); ull tmp[n]; sll i = 0, j = 0; while (i < l || j < r) { if (i == l) { tmp[i + j] = a[i + j]; j++; continue; } if (j == r) { tmp[i + j] = a[i]; i++; continue; } if (a[i] > a[l + j]) { tmp[i + j] = a[l + j]; ret += l - i; j++; } else { tmp[i + j] = a[i]; i++; } } for (i = 0; i < n; i++) { a[i] = tmp[i]; } return ret; } ull parent[N_MAX]; ull rank[N_MAX]; ull uf_init (ull n) { sll i; for (i = 0; i < n; i++) { parent[i] = i; rank[i] = 0; } return n; } ull uf_find (ull x) { if (parent[x] == x) return x; return parent[x] = uf_find(parent[x]); } ull uf_unite (ull a, ull b) { a = uf_find(a); b = uf_find(b); if (a == b) return 0; if (rank[a] > rank[b]) { parent[b] = a; } else { parent[a] = b; if (rank[a] == rank[b]) { rank[b]++; } } return 1; } sll a[N_MAX]; sll b[N_MAX]; char s[N_MAX + 1]; sll dp[N_MAX]; ull as[N_MAX], bs[N_MAX]; ull converter[N_MAX]; ull revconv[N_MAX]; sll nibu (ull x, ull a[], ull n) { sll ok = 0, ng = n; if (a[0] > x) return -1; while (ok + 1 < ng) { sll med = (ok + ng) >> 1; if (a[med] <= x) { ok = med; } else { ng = med; } } return ok; } sll shuffle (ull a[], ull b[]) { sll i, j; ull toshuf = n; for (i = 0; i < n; i++) { ull ap = a[i], bp = b[i]; if (a[i] == b[i]) { toshuf--; ap = bp = ~0ULL; } as[i] = ap; bs[i] = bp; // as[i].b = bs[i].b = i; } qsort(as, n, sizeof(ull), pullcomp); qsort(bs, n, sizeof(ull), pullcomp); for (i = 0; i < n; i++) { if (as[i] != bs[i]) return -1; } sll count = -1; for (i = 0; i < toshuf; i++) { if (!i || as[i - 1] != as[i]) { count++; revconv[count] = as[i]; } converter[i] = count; } uf_init(count + 1); for (i = 0; i < n; i++) { if (a[i] == b[i]) continue; uf_unite(converter[nibu(a[i], as, toshuf)], converter[nibu(b[i], bs, toshuf)]); } ull loops = 0; for (i = 0; i <= count; i++) { if (uf_find(i) == i) loops++; } return toshuf + loops; } sll kimerashuf (ull a[], ull b[]) { sll i, j; ull axor = 0, bxor = 0; for (i = 0; i < n; i++) { axor ^= a[i]; bxor ^= b[i]; } sll af1 = -1, af2 = -1, bf1 = -1, bf2 = -1; for (i = 0; i < n; i++) { if (a[i] == bxor) { if (af1 < 0) { af1 = i; } else { af2 = i; } } if (b[i] == axor) { if (bf1 < 0) { bf1 = i; } else { bf2 = i; } } } if (af1 < 0 || bf1 < 0) return -1; bool issame = false; sll af, bf; if (af1 != bf1) { af = af1; bf = bf1; } else if (af2 >= 0) { af = af2; bf = bf1; } else if (bf2 >= 0) { af = af1; bf = bf2; } else { af = af1; bf = bf1; issame = true; } // printf("%lld, %lld\n", af, bf); // if (issame) abort(); // issame = true; a[af] = axor; sll r = shuffle(a, b); if (r >= 0) { // printf("%llu...\n", r); return r + (issame ? +1 : -1); } else { return -1; } } 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; // if (n == 2) abort(); if (n == 2) { if (b[0] == a[0] && b[1] == a[1]) { result = 0; } else if (b[0] == a[0] ^ a[1] && b[1] == a[1]) { result = 1; } else if (b[0] == a[0] && b[1] == a[0] ^ a[1]) { result = 1; } else if (b[0] == a[0] ^ a[1] && b[1] == a[0]) { result = 2; } else if (b[0] == a[1] && b[1] == a[0] ^ a[1]) { result = 2; } else if (b[0] == a[1] && b[1] == a[0]) { result = 3; } else { goto fail; } printf("%llu\n", result); return 2; } result = shuffle(a, b); maybe = kimerashuf(a, b); // printf("%lld or %lld\n", result, maybe); if (result < 0 && maybe < 0) goto fail; result = umin((ull)result, (ull)maybe); // -1 become VERY BIG printf("%llu\n", result); // printf("%.12lf\n", dresult); // puts(s); return 0; success: // puts("YES"); // puts("Yes"); // printf("%llu\n", result); // puts("0"); puts("Takahashi"); return 0; fail: // puts("NO"); // puts("No"); // puts("0"); puts("-1"); // puts("-1 -1 -1"); // puts("Aoki"); return 1; } int32_t main (void) { int32_t i, j; int32_t x, y; // scanf("%lf%lf", &vda, &vdb, &vdc); // scanf("%lld%lld%lld%lld", &vsa, &vsb, &vsc, &vsd); // scanf("%llu%llu%llu", &vua, &vub, &vuc, &vud); // scanf("%llu%llu", &h, &w); // scanf("%*llu%*llu"); scanf("%llu", &n, &m); // scanf("%llu", &k, &n); // scanf("%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf); // scanf("%lld%lld", &vsa, &vsb, &vsc); // scanf("%s", s); // scanf("%s", t); // scanf("%llu", &m); // scanf("%llu", &q); for (i = 0; i < n; i++) { scanf("%lld", &a[i]); // scanf("%lld", &b[i]); // scanf("%llu", &c[i]); // a[i]--; // b[i]--; } // for (i = 0; i < m; i++) { // scanf("%lld", &a[n + i]); // scanf("%lld", &b[n + i]); // } for (i = 0; i < n; i++) { scanf("%llu", &b[i]); } // for (i = 0; i < h; i++) { // for (j = 0; j < w; j++) { // scanf("%llu", &a[i][j]); // } // } // for (i = 0; i < h; i++) { // scanf("%s", &s[i]); // } // scanf("%llu", &k); // scanf("%llu", &q); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153233/source.c" target datalayout = "e-m:e-p270: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.hw = type { i32, i32 } @vector8 = dso_local local_unnamed_addr constant [8 x %struct.hw] [%struct.hw { i32 -1, i32 -1 }, %struct.hw { i32 -1, i32 0 }, %struct.hw { i32 -1, i32 1 }, %struct.hw { i32 0, i32 -1 }, %struct.hw { i32 0, i32 1 }, %struct.hw { i32 1, i32 -1 }, %struct.hw { i32 1, i32 0 }, %struct.hw { i32 1, i32 1 }], align 16 @.str = private unnamed_addr constant [6 x i8] c"%llu.\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1 @parent = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @rank = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @n = dso_local global i64 0, align 8 @as = dso_local global [200000 x i64] zeroinitializer, align 16 @bs = dso_local global [200000 x i64] zeroinitializer, align 16 @revconv = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @converter = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @b = dso_local global [200000 x i64] zeroinitializer, align 16 @a = dso_local global [200000 x i64] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 @.str.5 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 @.str.6 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @m = dso_local global i64 0, align 8 @.str.7 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @q = dso_local local_unnamed_addr global i64 0, align 8 @vua = dso_local local_unnamed_addr global i64 0, align 8 @vub = dso_local local_unnamed_addr global i64 0, align 8 @vuc = dso_local local_unnamed_addr global i64 0, align 8 @vud = dso_local local_unnamed_addr global i64 0, align 8 @vue = dso_local local_unnamed_addr global i64 0, align 8 @vuf = dso_local local_unnamed_addr global i64 0, align 8 @vsa = dso_local local_unnamed_addr global i64 0, align 8 @vsb = dso_local local_unnamed_addr global i64 0, align 8 @vsc = dso_local local_unnamed_addr global i64 0, align 8 @vsd = dso_local local_unnamed_addr global i64 0, align 8 @vse = dso_local local_unnamed_addr global i64 0, align 8 @vsf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @slen = dso_local local_unnamed_addr global i64 0, align 8 @tlen = dso_local local_unnamed_addr global i64 0, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @s = dso_local local_unnamed_addr global [200001 x i8] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 { entry: %sub = add i64 %modulo, -2 %tobool.not12.i = icmp eq i64 %sub, 0 br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i while.body.i: ; preds = %entry, %if.end.i %result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ] %a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ] %x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ] %and.i = and i64 %x.addr.013.i, 1 %tobool1.not.i = icmp eq i64 %and.i, 0 br i1 %tobool1.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul i64 %a.addr.014.i, %result.015.i %rem.i = urem i64 %mul.i, %modulo br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ] %div11.i = lshr i64 %x.addr.013.i, 1 %mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i %rem3.i = urem i64 %mul2.i, %modulo %tobool.not.i = icmp ult i64 %x.addr.013.i, 2 br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5 bitpow.exit: ; preds = %if.end.i, %entry %result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ] %mul = mul i64 %result.0.lcssa.i, %a %rem = urem i64 %mul, %modulo ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %div = udiv i64 %left, %right %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div) %left.addr.0 = urem i64 %left, %right %mul = mul i64 %left.addr.0, 10 %div1 = udiv i64 %mul, %right %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1) %left.addr.0.1 = urem i64 %mul, %right %mul.1 = mul i64 %left.addr.0.1, 10 %div1.1 = udiv i64 %mul.1, %right %call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1) %left.addr.0.2 = urem i64 %mul.1, %right %mul.2 = mul i64 %left.addr.0.2, 10 %div1.2 = udiv i64 %mul.2, %right %call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2) %left.addr.0.3 = urem i64 %mul.2, %right %mul.3 = mul i64 %left.addr.0.3, 10 %div1.3 = udiv i64 %mul.3, %right %call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3) %left.addr.0.4 = urem i64 %mul.3, %right %mul.4 = mul i64 %left.addr.0.4, 10 %div1.4 = udiv i64 %mul.4, %right %call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4) %left.addr.0.5 = urem i64 %mul.4, %right %mul.5 = mul i64 %left.addr.0.5, 10 %div1.5 = udiv i64 %mul.5, %right %call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5) %left.addr.0.6 = urem i64 %mul.5, %right %mul.6 = mul i64 %left.addr.0.6, 10 %div1.6 = udiv i64 %mul.6, %right %call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6) %left.addr.0.7 = urem i64 %mul.6, %right %mul.7 = mul i64 %left.addr.0.7, 10 %div1.7 = udiv i64 %mul.7, %right %call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7) %left.addr.0.8 = urem i64 %mul.7, %right %mul.8 = mul i64 %left.addr.0.8, 10 %div1.8 = udiv i64 %mul.8, %right %call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8) %left.addr.0.9 = urem i64 %mul.8, %right %mul.9 = mul i64 %left.addr.0.9, 10 %div1.9 = udiv i64 %mul.9, %right %call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9) %left.addr.0.10 = urem i64 %mul.9, %right %mul.10 = mul i64 %left.addr.0.10, 10 %div1.10 = udiv i64 %mul.10, %right %call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10) %left.addr.0.11 = urem i64 %mul.10, %right %mul.11 = mul i64 %left.addr.0.11, 10 %div1.11 = udiv i64 %mul.11, %right %call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11) %left.addr.0.12 = urem i64 %mul.11, %right %mul.12 = mul i64 %left.addr.0.12, 10 %div1.12 = udiv i64 %mul.12, %right %call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12) %left.addr.0.13 = urem i64 %mul.12, %right %mul.13 = mul i64 %left.addr.0.13, 10 %div1.13 = udiv i64 %mul.13, %right %call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13) %left.addr.0.14 = urem i64 %mul.13, %right %mul.14 = mul i64 %left.addr.0.14, 10 %div1.14 = udiv i64 %mul.14, %right %call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14) %left.addr.0.15 = urem i64 %mul.14, %right %mul.15 = mul i64 %left.addr.0.15, 10 %div1.15 = udiv i64 %mul.15, %right %call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15) %left.addr.0.16 = urem i64 %mul.15, %right %mul.16 = mul i64 %left.addr.0.16, 10 %div1.16 = udiv i64 %mul.16, %right %call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16) %left.addr.0.17 = urem i64 %mul.16, %right %mul.17 = mul i64 %left.addr.0.17, 10 %div1.17 = udiv i64 %mul.17, %right %call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17) %left.addr.0.18 = urem i64 %mul.17, %right %mul.18 = mul i64 %left.addr.0.18, 10 %div1.18 = udiv i64 %mul.18, %right %call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18) %left.addr.0.19 = urem i64 %mul.18, %right %mul.19 = mul i64 %left.addr.0.19, 10 %div1.19 = udiv i64 %mul.19, %right %call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19) %0 = load ptr, ptr @stdout, align 8, !tbaa !7 %call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %mul = mul nsw i64 %right, %left %cmp = icmp slt i64 %mul, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load ptr, ptr @stdout, align 8, !tbaa !7 %call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0) br label %if.end if.end: ; preds = %if.then, %entry %retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true) %retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true) tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5) ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !12 %1 = load i64, ptr %right, align 8, !tbaa !12 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !12 %1 = load i64, ptr %right, align 8, !tbaa !12 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i8, ptr %left, align 1, !tbaa !14 %1 = load i8, ptr %right, align 1, !tbaa !14 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !7 %1 = load ptr, ptr %right, align 8, !tbaa !7 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #18 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(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: nofree nosync nounwind uwtable define dso_local i64 @mergeteq(ptr noundef %a, i64 noundef %n) local_unnamed_addr #8 { entry: %div88 = lshr i64 %n, 1 %sub = sub i64 %n, %div88 %cmp = icmp eq i64 %n, 1 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %call = tail call i64 @mergeteq(ptr noundef %a, i64 noundef %div88) %add.ptr = getelementptr inbounds i64, ptr %a, i64 %div88 %call1 = tail call i64 @mergeteq(ptr noundef %add.ptr, i64 noundef %sub) %add = add i64 %call1, %call %0 = tail call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %n, align 16 %cmp394129 = icmp ne i64 %div88, %n %cmp2106130 = icmp ne i64 %n, 0 %1 = or i1 %cmp2106130, %cmp394129 br i1 %1, label %while.body.lr.ph.lr.ph.preheader, label %for.end while.body.lr.ph.lr.ph.preheader: ; preds = %if.end %cmp10189 = icmp eq i64 %sub, 0 br i1 %cmp10189, label %while.body.lr.ph.lr.ph.split.us, label %while.body.lr.ph.lr.ph.split while.body.lr.ph.lr.ph: ; preds = %if.end33 %cmp10 = icmp eq i64 %j.1, %sub br i1 %cmp10, label %while.body.lr.ph.lr.ph.split.us, label %while.body.lr.ph.lr.ph.split, !llvm.loop !17 while.body.lr.ph.lr.ph.split.us: ; preds = %while.body.lr.ph.lr.ph, %while.body.lr.ph.lr.ph.preheader %cmp2106135.lcssa = phi i1 [ %cmp2106130, %while.body.lr.ph.lr.ph.preheader ], [ %cmp2106, %while.body.lr.ph.lr.ph ] %cmp394134.lcssa = phi i1 [ %cmp394129, %while.body.lr.ph.lr.ph.preheader ], [ %cmp394, %while.body.lr.ph.lr.ph ] %i.0.ph132.lcssa = phi i64 [ 0, %while.body.lr.ph.lr.ph.preheader ], [ %i.1, %while.body.lr.ph.lr.ph ] %ret.0.ph131.lcssa = phi i64 [ %add, %while.body.lr.ph.lr.ph.preheader ], [ %ret.1, %while.body.lr.ph.lr.ph ] %invariant.gep.le = getelementptr i64, ptr %vla, i64 %sub %cmp4.us197 = icmp eq i64 %i.0.ph132.lcssa, %div88 br i1 %cmp4.us197, label %while.body.lr.ph.split.us, label %while.body.lr.ph.split.us111 while.body.lr.ph.us: ; preds = %while.body.lr.ph.split.us111 %cmp4.us = icmp eq i64 %inc15.us, %div88 br i1 %cmp4.us, label %while.body.lr.ph.split.us, label %while.body.lr.ph.split.us111, !llvm.loop !17 while.body.lr.ph.split.us111: ; preds = %while.body.lr.ph.lr.ph.split.us, %while.body.lr.ph.us %i.0.ph90107.us198 = phi i64 [ %inc15.us, %while.body.lr.ph.us ], [ %i.0.ph132.lcssa, %while.body.lr.ph.lr.ph.split.us ] %arrayidx12.us = getelementptr inbounds i64, ptr %a, i64 %i.0.ph90107.us198 %2 = load i64, ptr %arrayidx12.us, align 8, !tbaa !12 %gep.us = getelementptr i64, ptr %invariant.gep.le, i64 %i.0.ph90107.us198 store i64 %2, ptr %gep.us, align 8, !tbaa !12 %inc15.us = add nsw i64 %i.0.ph90107.us198, 1 %cmp2.us = icmp ult i64 %inc15.us, %div88 %3 = or i1 %cmp2.us, %cmp394134.lcssa br i1 %3, label %while.body.lr.ph.us, label %for.cond.preheader, !llvm.loop !17 while.body.lr.ph.lr.ph.split: ; preds = %while.body.lr.ph.lr.ph.preheader, %while.body.lr.ph.lr.ph %ret.0.ph131193 = phi i64 [ %ret.1, %while.body.lr.ph.lr.ph ], [ %add, %while.body.lr.ph.lr.ph.preheader ] %i.0.ph132192 = phi i64 [ %i.1, %while.body.lr.ph.lr.ph ], [ 0, %while.body.lr.ph.lr.ph.preheader ] %j.0.ph133191 = phi i64 [ %j.1, %while.body.lr.ph.lr.ph ], [ 0, %while.body.lr.ph.lr.ph.preheader ] %cmp2106135190 = phi i1 [ %cmp2106, %while.body.lr.ph.lr.ph ], [ %cmp2106130, %while.body.lr.ph.lr.ph.preheader ] %cmp4 = icmp eq i64 %i.0.ph132192, %div88 br i1 %cmp4, label %while.body.lr.ph.split.us, label %while.body.lr.ph.split while.body.lr.ph.split.us: ; preds = %while.body.lr.ph.lr.ph.split, %while.body.lr.ph.us, %while.body.lr.ph.lr.ph.split.us %ret.0.ph131180 = phi i64 [ %ret.0.ph131.lcssa, %while.body.lr.ph.lr.ph.split.us ], [ %ret.0.ph131.lcssa, %while.body.lr.ph.us ], [ %ret.0.ph131193, %while.body.lr.ph.lr.ph.split ] %j.0.ph133151 = phi i64 [ %sub, %while.body.lr.ph.lr.ph.split.us ], [ %sub, %while.body.lr.ph.us ], [ %j.0.ph133191, %while.body.lr.ph.lr.ph.split ] %.us-phi114 = phi i1 [ %cmp2106135.lcssa, %while.body.lr.ph.lr.ph.split.us ], [ %cmp2.us, %while.body.lr.ph.us ], [ %cmp2106135190, %while.body.lr.ph.lr.ph.split ] br label %while.body.us while.body.us: ; preds = %while.body.us, %while.body.lr.ph.split.us %j.095.us = phi i64 [ %j.0.ph133151, %while.body.lr.ph.split.us ], [ %inc.us, %while.body.us ] %add6.us = add nsw i64 %j.095.us, %div88 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %add6.us %4 = load i64, ptr %arrayidx.us, align 8, !tbaa !12 %arrayidx8.us = getelementptr inbounds i64, ptr %vla, i64 %add6.us store i64 %4, ptr %arrayidx8.us, align 8, !tbaa !12 %inc.us = add nsw i64 %j.095.us, 1 %cmp3.us = icmp ult i64 %inc.us, %sub %5 = select i1 %.us-phi114, i1 true, i1 %cmp3.us br i1 %5, label %while.body.us, label %for.cond.preheader, !llvm.loop !17 while.body.lr.ph.split: ; preds = %while.body.lr.ph.lr.ph.split %arrayidx17 = getelementptr inbounds i64, ptr %a, i64 %i.0.ph132192 %6 = load i64, ptr %arrayidx17, align 8, !tbaa !12 %arrayidx19 = getelementptr i64, ptr %add.ptr, i64 %j.0.ph133191 %7 = load i64, ptr %arrayidx19, align 8, !tbaa !12 %cmp20 = icmp ugt i64 %6, %7 %8 = getelementptr i64, ptr %vla, i64 %i.0.ph132192 %arrayidx25 = getelementptr i64, ptr %8, i64 %j.0.ph133191 br i1 %cmp20, label %if.then21, label %if.else for.cond.preheader: ; preds = %if.end33, %while.body.lr.ph.split.us111, %while.body.us %ret.0.ph.lcssa = phi i64 [ %ret.0.ph131180, %while.body.us ], [ %ret.0.ph131.lcssa, %while.body.lr.ph.split.us111 ], [ %ret.1, %if.end33 ] %cmp34137.not = icmp eq i64 %n, 0 br i1 %cmp34137.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %9 = shl nuw i64 %n, 3 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %a, ptr nonnull align 16 %vla, i64 %9, i1 false), !tbaa !12 br label %for.end if.then21: ; preds = %while.body.lr.ph.split store i64 %7, ptr %arrayidx25, align 8, !tbaa !12 %sub26 = add i64 %ret.0.ph131193, %div88 %add27 = sub i64 %sub26, %i.0.ph132192 %inc28 = add i64 %j.0.ph133191, 1 br label %if.end33 if.else: ; preds = %while.body.lr.ph.split store i64 %6, ptr %arrayidx25, align 8, !tbaa !12 %inc32 = add nsw i64 %i.0.ph132192, 1 br label %if.end33 if.end33: ; preds = %if.else, %if.then21 %ret.1 = phi i64 [ %add27, %if.then21 ], [ %ret.0.ph131193, %if.else ] %i.1 = phi i64 [ %i.0.ph132192, %if.then21 ], [ %inc32, %if.else ] %j.1 = phi i64 [ %inc28, %if.then21 ], [ %j.0.ph133191, %if.else ] %cmp394 = icmp ult i64 %j.1, %sub %cmp2106 = icmp ult i64 %i.1, %div88 %10 = or i1 %cmp2106, %cmp394 br i1 %10, label %while.body.lr.ph.lr.ph, label %for.cond.preheader, !llvm.loop !17 for.end: ; preds = %if.end, %for.body.preheader, %for.cond.preheader %ret.0.ph.lcssa158 = phi i64 [ %ret.0.ph.lcssa, %for.body.preheader ], [ %ret.0.ph.lcssa, %for.cond.preheader ], [ %add, %if.end ] tail call void @llvm.stackrestore.p0(ptr %0) br label %cleanup cleanup: ; preds = %entry, %for.end %retval.0 = phi i64 [ %ret.0.ph.lcssa158, %for.end ], [ 0, %entry ] ret i64 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #9 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #9 ; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @uf_init(i64 noundef returned %n) local_unnamed_addr #10 { entry: %cmp7.not = icmp eq i64 %n, 0 br i1 %cmp7.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = shl nuw i64 %n, 3 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !12 %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %1 = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %index store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !12 %2 = getelementptr inbounds i64, ptr %1, i64 2 store <2 x i64> %step.add, ptr %2, align 16, !tbaa !12 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.end, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.08.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader10, %for.body %i.08 = phi i64 [ %inc, %for.body ], [ %i.08.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %i.08 store i64 %i.08, ptr %arrayidx, align 8, !tbaa !12 %inc = add nuw nsw i64 %i.08, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.body, %middle.block, %entry ret i64 %n } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #11 { entry: %arrayidx = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %x %0 = load i64, ptr %arrayidx, align 8, !tbaa !12 %cmp = icmp eq i64 %0, %x br i1 %cmp, label %common.ret7, label %if.end common.ret7: ; preds = %entry, %if.end %common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ] ret i64 %common.ret7.op if.end: ; preds = %entry %call = tail call i64 @uf_find(i64 noundef %0) store i64 %call, ptr %arrayidx, align 8, !tbaa !12 br label %common.ret7 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @uf_unite(i64 noundef %a, i64 noundef %b) local_unnamed_addr #12 { entry: %call = tail call i64 @uf_find(i64 noundef %a) %call1 = tail call i64 @uf_find(i64 noundef %b) %cmp = icmp eq i64 %call, %call1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %arrayidx = getelementptr inbounds [200000 x i64], ptr @rank, i64 0, i64 %call %0 = load i64, ptr %arrayidx, align 8, !tbaa !12 %arrayidx2 = getelementptr inbounds [200000 x i64], ptr @rank, i64 0, i64 %call1 %1 = load i64, ptr %arrayidx2, align 8, !tbaa !12 %cmp3 = icmp ugt i64 %0, %1 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %if.end %arrayidx5 = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %call1 store i64 %call, ptr %arrayidx5, align 8, !tbaa !12 br label %return if.else: ; preds = %if.end %arrayidx6 = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %call store i64 %call1, ptr %arrayidx6, align 8, !tbaa !12 %cmp9 = icmp eq i64 %0, %1 br i1 %cmp9, label %if.then10, label %return if.then10: ; preds = %if.else %inc = add i64 %0, 1 store i64 %inc, ptr %arrayidx2, align 8, !tbaa !12 br label %return return: ; preds = %if.then4, %if.then10, %if.else, %entry %retval.0 = phi i64 [ 0, %entry ], [ 1, %if.else ], [ 1, %if.then10 ], [ 1, %if.then4 ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @nibu(i64 noundef %x, ptr nocapture noundef readonly %a, i64 noundef %n) local_unnamed_addr #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !12 %cmp = icmp ugt i64 %0, %x br i1 %cmp, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %entry %cmp115 = icmp sgt i64 %n, 1 br i1 %cmp115, label %while.body, label %cleanup while.body: ; preds = %while.cond.preheader, %while.body %ng.017 = phi i64 [ %shr.ng.0, %while.body ], [ %n, %while.cond.preheader ] %ok.016 = phi i64 [ %ok.0.shr, %while.body ], [ 0, %while.cond.preheader ] %add2 = add nsw i64 %ng.017, %ok.016 %shr = ashr i64 %add2, 1 %arrayidx3 = getelementptr inbounds i64, ptr %a, i64 %shr %1 = load i64, ptr %arrayidx3, align 8, !tbaa !12 %cmp4.not = icmp ugt i64 %1, %x %ok.0.shr = select i1 %cmp4.not, i64 %ok.016, i64 %shr %shr.ng.0 = select i1 %cmp4.not, i64 %shr, i64 %ng.017 %add = add nsw i64 %ok.0.shr, 1 %cmp1 = icmp slt i64 %add, %shr.ng.0 br i1 %cmp1, label %while.body, label %cleanup, !llvm.loop !22 cleanup: ; preds = %while.body, %while.cond.preheader, %entry %retval.0 = phi i64 [ -1, %entry ], [ 0, %while.cond.preheader ], [ %ok.0.shr, %while.body ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @shuffle(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %b164 = ptrtoint ptr %b to i64 %a163 = ptrtoint ptr %a to i64 %0 = load i64, ptr @n, align 8, !tbaa !12 %cmp131.not = icmp eq i64 %0, 0 br i1 %cmp131.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %0, 12 br i1 %min.iters.check, label %for.body.preheader187, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %1 = sub i64 ptrtoint (ptr @as to i64), %a163 %diff.check = icmp ult i64 %1, 32 %conflict.rdx = or i1 %diff.check, icmp ult (i64 sub (i64 ptrtoint (ptr @bs to i64), i64 ptrtoint (ptr @as to i64)), i64 32) %2 = sub i64 ptrtoint (ptr @as to i64), %b164 %diff.check165 = icmp ult i64 %2, 32 %conflict.rdx166 = or i1 %conflict.rdx, %diff.check165 %3 = sub i64 ptrtoint (ptr @bs to i64), %a163 %diff.check167 = icmp ult i64 %3, 32 %conflict.rdx168 = or i1 %conflict.rdx166, %diff.check167 %4 = sub i64 ptrtoint (ptr @bs to i64), %b164 %diff.check169 = icmp ult i64 %4, 32 %conflict.rdx170 = or i1 %conflict.rdx168, %diff.check169 br i1 %conflict.rdx170, label %for.body.preheader187, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %0, -4 %5 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %0, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %5, %vector.ph ], [ %14, %vector.body ] %vec.phi171 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %6 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %6, align 8, !tbaa !12 %7 = getelementptr inbounds i64, ptr %6, i64 2 %wide.load172 = load <2 x i64>, ptr %7, align 8, !tbaa !12 %8 = getelementptr inbounds i64, ptr %b, i64 %index %wide.load173 = load <2 x i64>, ptr %8, align 8, !tbaa !12 %9 = getelementptr inbounds i64, ptr %8, i64 2 %wide.load174 = load <2 x i64>, ptr %9, align 8, !tbaa !12 %10 = icmp eq <2 x i64> %wide.load, %wide.load173 %11 = icmp eq <2 x i64> %wide.load172, %wide.load174 %12 = sext <2 x i1> %10 to <2 x i64> %13 = sext <2 x i1> %11 to <2 x i64> %14 = add <2 x i64> %vec.phi, %12 %15 = add <2 x i64> %vec.phi171, %13 %16 = select <2 x i1> %10, <2 x i64> <i64 -1, i64 -1>, <2 x i64> %wide.load %17 = select <2 x i1> %11, <2 x i64> <i64 -1, i64 -1>, <2 x i64> %wide.load172 %18 = select <2 x i1> %10, <2 x i64> <i64 -1, i64 -1>, <2 x i64> %wide.load173 %19 = select <2 x i1> %11, <2 x i64> <i64 -1, i64 -1>, <2 x i64> %wide.load174 %20 = getelementptr inbounds [200000 x i64], ptr @as, i64 0, i64 %index store <2 x i64> %16, ptr %20, align 16, !tbaa !12 %21 = getelementptr inbounds i64, ptr %20, i64 2 store <2 x i64> %17, ptr %21, align 16, !tbaa !12 %22 = getelementptr inbounds [200000 x i64], ptr @bs, i64 0, i64 %index store <2 x i64> %18, ptr %22, align 16, !tbaa !12 %23 = getelementptr inbounds i64, ptr %22, i64 2 store <2 x i64> %19, ptr %23, align 16, !tbaa !12 %index.next = add nuw i64 %index, 4 %24 = icmp eq i64 %index.next, %n.vec br i1 %24, label %middle.block, label %vector.body, !llvm.loop !23 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %15, %14 %25 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader187 for.body.preheader187: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %toshuf.0133.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %25, %middle.block ] %i.0132.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader187, %for.body %toshuf.0133 = phi i64 [ %toshuf.1, %for.body ], [ %toshuf.0133.ph, %for.body.preheader187 ] %i.0132 = phi i64 [ %inc, %for.body ], [ %i.0132.ph, %for.body.preheader187 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.0132 %26 = load i64, ptr %arrayidx, align 8, !tbaa !12 %arrayidx1 = getelementptr inbounds i64, ptr %b, i64 %i.0132 %27 = load i64, ptr %arrayidx1, align 8, !tbaa !12 %cmp4 = icmp eq i64 %26, %27 %dec = sext i1 %cmp4 to i64 %toshuf.1 = add i64 %toshuf.0133, %dec %ap.0 = select i1 %cmp4, i64 -1, i64 %26 %bp.0 = select i1 %cmp4, i64 -1, i64 %27 %arrayidx5 = getelementptr inbounds [200000 x i64], ptr @as, i64 0, i64 %i.0132 store i64 %ap.0, ptr %arrayidx5, align 8, !tbaa !12 %arrayidx6 = getelementptr inbounds [200000 x i64], ptr @bs, i64 0, i64 %i.0132 store i64 %bp.0, ptr %arrayidx6, align 8, !tbaa !12 %inc = add nuw nsw i64 %i.0132, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !24 for.end: ; preds = %for.body, %middle.block, %entry %toshuf.0.lcssa = phi i64 [ 0, %entry ], [ %25, %middle.block ], [ %toshuf.1, %for.body ] tail call void @qsort(ptr noundef nonnull @as, i64 noundef %0, i64 noundef 8, ptr noundef nonnull @pullcomp) #19 %28 = load i64, ptr @n, align 8, !tbaa !12 tail call void @qsort(ptr noundef nonnull @bs, i64 noundef %28, i64 noundef 8, ptr noundef nonnull @pullcomp) #19 %29 = load i64, ptr @n, align 8, !tbaa !12 %cmp8134.not = icmp eq i64 %29, 0 br i1 %cmp8134.not, label %for.cond18.preheader, label %for.body9 for.cond7: ; preds = %for.body9 %inc16 = add nuw i64 %i.1135, 1 %exitcond148.not = icmp eq i64 %inc16, %29 br i1 %exitcond148.not, label %for.cond18.preheader, label %for.body9, !llvm.loop !25 for.cond18.preheader: ; preds = %for.cond7, %for.end %cmp19136.not = icmp eq i64 %toshuf.0.lcssa, 0 br i1 %cmp19136.not, label %uf_init.exit, label %if.end28.peel if.end28.peel: ; preds = %for.cond18.preheader %.pre = load i64, ptr @as, align 16, !tbaa !12 store i64 %.pre, ptr @revconv, align 16, !tbaa !12 store i64 0, ptr @converter, align 16, !tbaa !12 %exitcond149.peel.not = icmp eq i64 %toshuf.0.lcssa, 1 br i1 %exitcond149.peel.not, label %for.body.preheader.i, label %lor.lhs.false for.body9: ; preds = %for.end, %for.cond7 %i.1135 = phi i64 [ %inc16, %for.cond7 ], [ 0, %for.end ] %arrayidx10 = getelementptr inbounds [200000 x i64], ptr @as, i64 0, i64 %i.1135 %30 = load i64, ptr %arrayidx10, align 8, !tbaa !12 %arrayidx11 = getelementptr inbounds [200000 x i64], ptr @bs, i64 0, i64 %i.1135 %31 = load i64, ptr %arrayidx11, align 8, !tbaa !12 %cmp12.not = icmp eq i64 %30, %31 br i1 %cmp12.not, label %for.cond7, label %cleanup lor.lhs.false: ; preds = %if.end28.peel, %if.end28 %count.0138 = phi i64 [ %count.1, %if.end28 ], [ 0, %if.end28.peel ] %i.2137 = phi i64 [ %inc31, %if.end28 ], [ 1, %if.end28.peel ] %sub = add nsw i64 %i.2137, -1 %arrayidx21 = getelementptr inbounds [200000 x i64], ptr @as, i64 0, i64 %sub %32 = load i64, ptr %arrayidx21, align 8, !tbaa !12 %arrayidx22 = getelementptr inbounds [200000 x i64], ptr @as, i64 0, i64 %i.2137 %33 = load i64, ptr %arrayidx22, align 8, !tbaa !12 %cmp23.not = icmp eq i64 %32, %33 br i1 %cmp23.not, label %if.end28, label %if.then24 if.then24: ; preds = %lor.lhs.false %inc25 = add nsw i64 %count.0138, 1 %arrayidx27 = getelementptr inbounds [200000 x i64], ptr @revconv, i64 0, i64 %inc25 store i64 %33, ptr %arrayidx27, align 8, !tbaa !12 br label %if.end28 if.end28: ; preds = %if.then24, %lor.lhs.false %count.1 = phi i64 [ %inc25, %if.then24 ], [ %count.0138, %lor.lhs.false ] %arrayidx29 = getelementptr inbounds [200000 x i64], ptr @converter, i64 0, i64 %i.2137 store i64 %count.1, ptr %arrayidx29, align 8, !tbaa !12 %inc31 = add nuw nsw i64 %i.2137, 1 %exitcond149.not = icmp eq i64 %inc31, %toshuf.0.lcssa br i1 %exitcond149.not, label %for.end32, label %lor.lhs.false, !llvm.loop !26 for.end32: ; preds = %if.end28 %add = add nsw i64 %count.1, 1 %cmp7.not.i = icmp eq i64 %add, 0 br i1 %cmp7.not.i, label %uf_init.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %if.end28.peel, %for.end32 %add162 = phi i64 [ %add, %for.end32 ], [ 1, %if.end28.peel ] %count.0.lcssa161 = phi i64 [ %count.1, %for.end32 ], [ 0, %if.end28.peel ] %34 = shl nuw i64 %add162, 3 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @rank, i8 0, i64 %34, i1 false), !tbaa !12 %35 = add i64 %count.0.lcssa161, 1 %min.iters.check177 = icmp ult i64 %35, 4 br i1 %min.iters.check177, label %for.body.i.preheader, label %vector.ph178 vector.ph178: ; preds = %for.body.preheader.i %n.vec180 = and i64 %35, -4 br label %vector.body183 vector.body183: ; preds = %vector.body183, %vector.ph178 %index184 = phi i64 [ 0, %vector.ph178 ], [ %index.next186, %vector.body183 ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph178 ], [ %vec.ind.next, %vector.body183 ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %36 = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %index184 store <2 x i64> %vec.ind, ptr %36, align 16, !tbaa !12 %37 = getelementptr inbounds i64, ptr %36, i64 2 store <2 x i64> %step.add, ptr %37, align 16, !tbaa !12 %index.next186 = add nuw i64 %index184, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %38 = icmp eq i64 %index.next186, %n.vec180 br i1 %38, label %middle.block175, label %vector.body183, !llvm.loop !28 middle.block175: ; preds = %vector.body183 %cmp.n182 = icmp eq i64 %35, %n.vec180 br i1 %cmp.n182, label %uf_init.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block175 %i.08.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec180, %middle.block175 ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %i.08.i = phi i64 [ %inc.i, %for.body.i ], [ %i.08.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %i.08.i store i64 %i.08.i, ptr %arrayidx.i, align 8, !tbaa !12 %inc.i = add nuw nsw i64 %i.08.i, 1 %exitcond.not.i = icmp eq i64 %i.08.i, %count.0.lcssa161 br i1 %exitcond.not.i, label %uf_init.exit, label %for.body.i, !llvm.loop !29 uf_init.exit: ; preds = %for.body.i, %middle.block175, %for.cond18.preheader, %for.end32 %count.0.lcssa156 = phi i64 [ -1, %for.end32 ], [ -1, %for.cond18.preheader ], [ %count.0.lcssa161, %middle.block175 ], [ %count.0.lcssa161, %for.body.i ] br i1 %cmp8134.not, label %for.cond51.preheader, label %for.body35.lr.ph for.body35.lr.ph: ; preds = %uf_init.exit %cmp115.i = icmp slt i64 %toshuf.0.lcssa, 2 br label %for.body35 for.cond51.preheader: ; preds = %for.inc48, %uf_init.exit %cmp52.not142 = icmp slt i64 %count.0.lcssa156, 0 br i1 %cmp52.not142, label %for.end61, label %for.body53 for.body35: ; preds = %for.body35.lr.ph, %for.inc48 %i.3141 = phi i64 [ 0, %for.body35.lr.ph ], [ %inc49, %for.inc48 ] %arrayidx36 = getelementptr inbounds i64, ptr %a, i64 %i.3141 %39 = load i64, ptr %arrayidx36, align 8, !tbaa !12 %arrayidx37 = getelementptr inbounds i64, ptr %b, i64 %i.3141 %40 = load i64, ptr %arrayidx37, align 8, !tbaa !12 %cmp38 = icmp eq i64 %39, %40 br i1 %cmp38, label %for.inc48, label %if.end40 if.end40: ; preds = %for.body35 %41 = load i64, ptr @as, align 16, !tbaa !12 %cmp.i = icmp ugt i64 %41, %39 %brmerge = select i1 %cmp.i, i1 true, i1 %cmp115.i %.mux = sext i1 %cmp.i to i64 br i1 %brmerge, label %nibu.exit, label %while.body.i while.body.i: ; preds = %if.end40, %while.body.i %ng.017.i = phi i64 [ %shr.ng.0.i, %while.body.i ], [ %toshuf.0.lcssa, %if.end40 ] %ok.016.i = phi i64 [ %ok.0.shr.i, %while.body.i ], [ 0, %if.end40 ] %add2.i = add nsw i64 %ok.016.i, %ng.017.i %shr.i = ashr i64 %add2.i, 1 %arrayidx3.i = getelementptr inbounds i64, ptr @as, i64 %shr.i %42 = load i64, ptr %arrayidx3.i, align 8, !tbaa !12 %cmp4.not.i = icmp ugt i64 %42, %39 %ok.0.shr.i = select i1 %cmp4.not.i, i64 %ok.016.i, i64 %shr.i %shr.ng.0.i = select i1 %cmp4.not.i, i64 %shr.i, i64 %ng.017.i %add.i = add nsw i64 %ok.0.shr.i, 1 %cmp1.i = icmp slt i64 %add.i, %shr.ng.0.i br i1 %cmp1.i, label %while.body.i, label %nibu.exit, !llvm.loop !22 nibu.exit: ; preds = %while.body.i, %if.end40 %retval.0.i = phi i64 [ %.mux, %if.end40 ], [ %ok.0.shr.i, %while.body.i ] %arrayidx43 = getelementptr inbounds [200000 x i64], ptr @converter, i64 0, i64 %retval.0.i %43 = load i64, ptr %arrayidx43, align 8, !tbaa !12 %44 = load i64, ptr @bs, align 16, !tbaa !12 %cmp.i111 = icmp ugt i64 %44, %40 %brmerge146 = select i1 %cmp.i111, i1 true, i1 %cmp115.i %.mux147 = sext i1 %cmp.i111 to i64 br i1 %brmerge146, label %nibu.exit126, label %while.body.i115 while.body.i115: ; preds = %nibu.exit, %while.body.i115 %ng.017.i116 = phi i64 [ %shr.ng.0.i123, %while.body.i115 ], [ %toshuf.0.lcssa, %nibu.exit ] %ok.016.i117 = phi i64 [ %ok.0.shr.i122, %while.body.i115 ], [ 0, %nibu.exit ] %add2.i118 = add nsw i64 %ok.016.i117, %ng.017.i116 %shr.i119 = ashr i64 %add2.i118, 1 %arrayidx3.i120 = getelementptr inbounds i64, ptr @bs, i64 %shr.i119 %45 = load i64, ptr %arrayidx3.i120, align 8, !tbaa !12 %cmp4.not.i121 = icmp ugt i64 %45, %40 %ok.0.shr.i122 = select i1 %cmp4.not.i121, i64 %ok.016.i117, i64 %shr.i119 %shr.ng.0.i123 = select i1 %cmp4.not.i121, i64 %shr.i119, i64 %ng.017.i116 %add.i124 = add nsw i64 %ok.0.shr.i122, 1 %cmp1.i125 = icmp slt i64 %add.i124, %shr.ng.0.i123 br i1 %cmp1.i125, label %while.body.i115, label %nibu.exit126, !llvm.loop !22 nibu.exit126: ; preds = %while.body.i115, %nibu.exit %retval.0.i114 = phi i64 [ %.mux147, %nibu.exit ], [ %ok.0.shr.i122, %while.body.i115 ] %arrayidx46 = getelementptr inbounds [200000 x i64], ptr @converter, i64 0, i64 %retval.0.i114 %46 = load i64, ptr %arrayidx46, align 8, !tbaa !12 %call.i = tail call i64 @uf_find(i64 noundef %43) %call1.i = tail call i64 @uf_find(i64 noundef %46) %cmp.i127 = icmp eq i64 %call.i, %call1.i br i1 %cmp.i127, label %for.inc48, label %if.end.i if.end.i: ; preds = %nibu.exit126 %arrayidx.i128 = getelementptr inbounds [200000 x i64], ptr @rank, i64 0, i64 %call.i %47 = load i64, ptr %arrayidx.i128, align 8, !tbaa !12 %arrayidx2.i = getelementptr inbounds [200000 x i64], ptr @rank, i64 0, i64 %call1.i %48 = load i64, ptr %arrayidx2.i, align 8, !tbaa !12 %cmp3.i = icmp ugt i64 %47, %48 br i1 %cmp3.i, label %if.then4.i, label %if.else.i if.then4.i: ; preds = %if.end.i %arrayidx5.i = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %call1.i store i64 %call.i, ptr %arrayidx5.i, align 8, !tbaa !12 br label %for.inc48 if.else.i: ; preds = %if.end.i %arrayidx6.i = getelementptr inbounds [200000 x i64], ptr @parent, i64 0, i64 %call.i store i64 %call1.i, ptr %arrayidx6.i, align 8, !tbaa !12 %cmp9.i = icmp eq i64 %47, %48 br i1 %cmp9.i, label %if.then10.i, label %for.inc48 if.then10.i: ; preds = %if.else.i %inc.i130 = add i64 %47, 1 store i64 %inc.i130, ptr %arrayidx2.i, align 8, !tbaa !12 br label %for.inc48 for.inc48: ; preds = %if.then10.i, %if.else.i, %if.then4.i, %nibu.exit126, %for.body35 %inc49 = add nuw nsw i64 %i.3141, 1 %49 = load i64, ptr @n, align 8, !tbaa !12 %cmp34 = icmp ult i64 %inc49, %49 br i1 %cmp34, label %for.body35, label %for.cond51.preheader, !llvm.loop !30 for.body53: ; preds = %for.cond51.preheader, %for.body53 %loops.0144 = phi i64 [ %spec.select, %for.body53 ], [ 0, %for.cond51.preheader ] %i.4143 = phi i64 [ %inc60, %for.body53 ], [ 0, %for.cond51.preheader ] %call54 = tail call i64 @uf_find(i64 noundef %i.4143) %cmp55 = icmp eq i64 %call54, %i.4143 %inc57 = zext i1 %cmp55 to i64 %spec.select = add i64 %loops.0144, %inc57 %inc60 = add nuw i64 %i.4143, 1 %exitcond151.not = icmp eq i64 %i.4143, %count.0.lcssa156 br i1 %exitcond151.not, label %for.end61, label %for.body53, !llvm.loop !31 for.end61: ; preds = %for.body53, %for.cond51.preheader %loops.0.lcssa = phi i64 [ 0, %for.cond51.preheader ], [ %spec.select, %for.body53 ] %add62 = add i64 %loops.0.lcssa, %toshuf.0.lcssa br label %cleanup cleanup: ; preds = %for.body9, %for.end61 %retval.0 = phi i64 [ %add62, %for.end61 ], [ -1, %for.body9 ] ret i64 %retval.0 } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #14 ; Function Attrs: nofree nounwind uwtable define dso_local i64 @kimerashuf(ptr nocapture noundef %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i64, ptr @n, align 8, !tbaa !12 %cmp85.not = icmp eq i64 %0, 0 br i1 %cmp85.not, label %cleanup45, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %0, 4 br i1 %min.iters.check, label %for.body.preheader122, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi114 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %vec.phi115 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi116 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !12 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load117 = load <2 x i64>, ptr %2, align 8, !tbaa !12 %3 = xor <2 x i64> %wide.load, %vec.phi115 %4 = xor <2 x i64> %wide.load117, %vec.phi116 %5 = getelementptr inbounds i64, ptr %b, i64 %index %wide.load118 = load <2 x i64>, ptr %5, align 8, !tbaa !12 %6 = getelementptr inbounds i64, ptr %5, i64 2 %wide.load119 = load <2 x i64>, ptr %6, align 8, !tbaa !12 %7 = xor <2 x i64> %wide.load118, %vec.phi %8 = xor <2 x i64> %wide.load119, %vec.phi114 %index.next = add nuw i64 %index, 4 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !32 middle.block: ; preds = %vector.body %bin.rdx120 = xor <2 x i64> %4, %3 %10 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx120) %bin.rdx = xor <2 x i64> %8, %7 %11 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond3.preheader, label %for.body.preheader122 for.body.preheader122: ; preds = %for.body.preheader, %middle.block %bxor.088.ph = phi i64 [ 0, %for.body.preheader ], [ %11, %middle.block ] %axor.087.ph = phi i64 [ 0, %for.body.preheader ], [ %10, %middle.block ] %i.086.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond3.preheader: ; preds = %for.body, %middle.block %xor.lcssa = phi i64 [ %10, %middle.block ], [ %xor, %for.body ] %xor2.lcssa = phi i64 [ %11, %middle.block ], [ %xor2, %for.body ] br i1 %cmp85.not, label %cleanup45, label %for.body5 for.body: ; preds = %for.body.preheader122, %for.body %bxor.088 = phi i64 [ %xor2, %for.body ], [ %bxor.088.ph, %for.body.preheader122 ] %axor.087 = phi i64 [ %xor, %for.body ], [ %axor.087.ph, %for.body.preheader122 ] %i.086 = phi i64 [ %inc, %for.body ], [ %i.086.ph, %for.body.preheader122 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.086 %12 = load i64, ptr %arrayidx, align 8, !tbaa !12 %xor = xor i64 %12, %axor.087 %arrayidx1 = getelementptr inbounds i64, ptr %b, i64 %i.086 %13 = load i64, ptr %arrayidx1, align 8, !tbaa !12 %xor2 = xor i64 %13, %bxor.088 %inc = add nuw nsw i64 %i.086, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !33 for.body5: ; preds = %for.cond3.preheader, %for.body5 %bf2.096 = phi i64 [ %bf2.1, %for.body5 ], [ -1, %for.cond3.preheader ] %bf1.095 = phi i64 [ %bf1.1, %for.body5 ], [ -1, %for.cond3.preheader ] %af2.094 = phi i64 [ %af2.1, %for.body5 ], [ -1, %for.cond3.preheader ] %af1.093 = phi i64 [ %af1.1, %for.body5 ], [ -1, %for.cond3.preheader ] %i.192 = phi i64 [ %inc20, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx6 = getelementptr inbounds i64, ptr %a, i64 %i.192 %14 = load i64, ptr %arrayidx6, align 8, !tbaa !12 %cmp7 = icmp eq i64 %14, %xor2.lcssa %cmp8 = icmp slt i64 %af1.093, 0 %af2.0.i.1 = select i1 %cmp8, i64 %af2.094, i64 %i.192 %15 = select i1 %cmp7, i1 %cmp8, i1 false %af1.1 = select i1 %15, i64 %i.192, i64 %af1.093 %af2.1 = select i1 %cmp7, i64 %af2.0.i.1, i64 %af2.094 %arrayidx11 = getelementptr inbounds i64, ptr %b, i64 %i.192 %16 = load i64, ptr %arrayidx11, align 8, !tbaa !12 %cmp12 = icmp eq i64 %16, %xor.lcssa %cmp14 = icmp slt i64 %bf1.095, 0 %bf2.0.i.1 = select i1 %cmp14, i64 %bf2.096, i64 %i.192 %17 = select i1 %cmp12, i1 %cmp14, i1 false %bf1.1 = select i1 %17, i64 %i.192, i64 %bf1.095 %bf2.1 = select i1 %cmp12, i64 %bf2.0.i.1, i64 %bf2.096 %inc20 = add nuw nsw i64 %i.192, 1 %exitcond101.not = icmp eq i64 %inc20, %0 br i1 %exitcond101.not, label %for.end21, label %for.body5, !llvm.loop !34 for.end21: ; preds = %for.body5 %cmp22 = icmp slt i64 %af1.1, 0 %cmp23 = icmp slt i64 %bf1.1, 0 %or.cond = select i1 %cmp22, i1 true, i1 %cmp23 br i1 %or.cond, label %cleanup45, label %if.end25 if.end25: ; preds = %for.end21 %18 = icmp sgt i64 %bf2.1, -1 %cmp26.not = icmp eq i64 %af1.1, %bf1.1 %cmp29 = icmp sgt i64 %af2.1, -1 %19 = select i1 %cmp29, i1 true, i1 %18 %spec.select = select i1 %19, i64 -1, i64 1 %issame.0 = select i1 %cmp26.not, i64 %spec.select, i64 -1 %20 = select i1 %cmp26.not, i1 %cmp29, i1 false %af.0 = select i1 %20, i64 %af2.1, i64 %af1.1 %arrayidx38 = getelementptr inbounds i64, ptr %a, i64 %af.0 store i64 %xor.lcssa, ptr %arrayidx38, align 8, !tbaa !12 %call = tail call i64 @shuffle(ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp39 = icmp sgt i64 %call, -1 %add = add nsw i64 %call, %issame.0 %retval.0 = select i1 %cmp39, i64 %add, i64 -1 br label %cleanup45 cleanup45: ; preds = %entry, %for.cond3.preheader, %for.end21, %if.end25 %retval.1 = phi i64 [ %retval.0, %if.end25 ], [ -1, %for.end21 ], [ -1, %for.cond3.preheader ], [ -1, %entry ] ret i64 %retval.1 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #3 { entry: %0 = load i64, ptr @n, align 8, !tbaa !12 %cmp = icmp eq i64 %0, 2 br i1 %cmp, label %if.then, label %if.end53 if.then: ; preds = %entry %1 = load i64, ptr @b, align 16, !tbaa !12 %2 = load i64, ptr @a, align 16, !tbaa !12 %cmp1 = icmp eq i64 %1, %2 br i1 %cmp1, label %land.lhs.true, label %if.else.thread land.lhs.true: ; preds = %if.then %3 = load i64, ptr getelementptr inbounds ([200000 x i64], ptr @b, i64 0, i64 1), align 8 %4 = load i64, ptr getelementptr inbounds ([200000 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !12 %cmp2 = icmp eq i64 %3, %4 br i1 %cmp2, label %if.end52, label %land.lhs.true13 if.else.thread: ; preds = %if.then %5 = load i64, ptr getelementptr inbounds ([200000 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !12 %tobool.not84 = icmp ne i64 %5, 0 %6 = load i64, ptr getelementptr inbounds ([200000 x i64], ptr @b, i64 0, i64 1), align 8 %cmp785 = icmp eq i64 %6, %5 %or.cond8186 = select i1 %tobool.not84, i1 %cmp785, i1 false br i1 %or.cond8186, label %if.end52, label %if.else20 land.lhs.true13: ; preds = %land.lhs.true %tobool.not = icmp ne i64 %4, 1 %cmp14 = icmp eq i64 %3, %1 %conv16 = zext i1 %cmp14 to i64 %tobool18.not = icmp eq i64 %4, %conv16 br i1 %tobool18.not, label %if.else20, label %if.end52 if.else20: ; preds = %if.else.thread, %land.lhs.true13 %7 = phi i64 [ %4, %land.lhs.true13 ], [ %5, %if.else.thread ] %tobool.not8789 = phi i1 [ %tobool.not, %land.lhs.true13 ], [ %tobool.not84, %if.else.thread ] %8 = phi i64 [ %3, %land.lhs.true13 ], [ %6, %if.else.thread ] %cmp27 = icmp eq i64 %8, %2 %or.cond82 = select i1 %tobool.not8789, i1 %cmp27, i1 false br i1 %or.cond82, label %if.end52, label %if.else30 if.else30: ; preds = %if.else20 %cmp31 = icmp eq i64 %1, %7 br i1 %cmp31, label %land.lhs.true33, label %fail land.lhs.true33: ; preds = %if.else30 %conv36 = zext i1 %cmp27 to i64 %tobool38.not = icmp ne i64 %1, %conv36 %brmerge = or i1 %cmp27, %tobool38.not %.mux = select i1 %tobool38.not, i64 2, i64 3 br i1 %brmerge, label %if.end52, label %fail if.end52: ; preds = %land.lhs.true33, %if.else.thread, %if.else20, %land.lhs.true13, %land.lhs.true %result.0 = phi i64 [ 0, %land.lhs.true ], [ 1, %land.lhs.true13 ], [ 2, %if.else20 ], [ %.mux, %land.lhs.true33 ], [ 1, %if.else.thread ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %result.0) br label %cleanup if.end53: ; preds = %entry %call54 = tail call i64 @shuffle(ptr noundef nonnull @a, ptr noundef nonnull @b) %9 = load i64, ptr @n, align 8, !tbaa !12 %cmp85.not.i = icmp eq i64 %9, 0 br i1 %cmp85.not.i, label %kimerashuf.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %if.end53 %min.iters.check = icmp ult i64 %9, 4 br i1 %min.iters.check, label %for.body.i.preheader98, label %vector.ph vector.ph: ; preds = %for.body.i.preheader %n.vec = and i64 %9, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.phi90 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %vec.phi91 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %vec.phi92 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %10 = getelementptr inbounds i64, ptr @a, i64 %index %wide.load = load <2 x i64>, ptr %10, align 16, !tbaa !12 %11 = getelementptr inbounds i64, ptr %10, i64 2 %wide.load93 = load <2 x i64>, ptr %11, align 16, !tbaa !12 %12 = xor <2 x i64> %wide.load, %vec.phi91 %13 = xor <2 x i64> %wide.load93, %vec.phi92 %14 = getelementptr inbounds i64, ptr @b, i64 %index %wide.load94 = load <2 x i64>, ptr %14, align 16, !tbaa !12 %15 = getelementptr inbounds i64, ptr %14, i64 2 %wide.load95 = load <2 x i64>, ptr %15, align 16, !tbaa !12 %16 = xor <2 x i64> %wide.load94, %vec.phi %17 = xor <2 x i64> %wide.load95, %vec.phi90 %index.next = add nuw i64 %index, 4 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !35 middle.block: ; preds = %vector.body %bin.rdx96 = xor <2 x i64> %13, %12 %19 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx96) %bin.rdx = xor <2 x i64> %17, %16 %20 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %for.body5.i.preheader, label %for.body.i.preheader98 for.body.i.preheader98: ; preds = %for.body.i.preheader, %middle.block %bxor.088.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %20, %middle.block ] %axor.087.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %19, %middle.block ] %i.086.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ] br label %for.body.i for.body5.i.preheader: ; preds = %for.body.i, %middle.block %xor.i.lcssa = phi i64 [ %19, %middle.block ], [ %xor.i, %for.body.i ] %xor2.i.lcssa = phi i64 [ %20, %middle.block ], [ %xor2.i, %for.body.i ] br label %for.body5.i for.body.i: ; preds = %for.body.i.preheader98, %for.body.i %bxor.088.i = phi i64 [ %xor2.i, %for.body.i ], [ %bxor.088.i.ph, %for.body.i.preheader98 ] %axor.087.i = phi i64 [ %xor.i, %for.body.i ], [ %axor.087.i.ph, %for.body.i.preheader98 ] %i.086.i = phi i64 [ %inc.i, %for.body.i ], [ %i.086.i.ph, %for.body.i.preheader98 ] %arrayidx.i = getelementptr inbounds i64, ptr @a, i64 %i.086.i %21 = load i64, ptr %arrayidx.i, align 8, !tbaa !12 %xor.i = xor i64 %21, %axor.087.i %arrayidx1.i = getelementptr inbounds i64, ptr @b, i64 %i.086.i %22 = load i64, ptr %arrayidx1.i, align 8, !tbaa !12 %xor2.i = xor i64 %22, %bxor.088.i %inc.i = add nuw nsw i64 %i.086.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %9 br i1 %exitcond.not.i, label %for.body5.i.preheader, label %for.body.i, !llvm.loop !36 for.body5.i: ; preds = %for.body5.i.preheader, %for.body5.i %bf2.096.i = phi i64 [ %bf2.1.i, %for.body5.i ], [ -1, %for.body5.i.preheader ] %bf1.095.i = phi i64 [ %bf1.1.i, %for.body5.i ], [ -1, %for.body5.i.preheader ] %af2.094.i = phi i64 [ %af2.1.i, %for.body5.i ], [ -1, %for.body5.i.preheader ] %af1.093.i = phi i64 [ %af1.1.i, %for.body5.i ], [ -1, %for.body5.i.preheader ] %i.192.i = phi i64 [ %inc20.i, %for.body5.i ], [ 0, %for.body5.i.preheader ] %arrayidx6.i = getelementptr inbounds i64, ptr @a, i64 %i.192.i %23 = load i64, ptr %arrayidx6.i, align 8, !tbaa !12 %cmp7.i = icmp eq i64 %23, %xor2.i.lcssa %cmp8.i = icmp slt i64 %af1.093.i, 0 %af2.0.i.1.i = select i1 %cmp8.i, i64 %af2.094.i, i64 %i.192.i %24 = select i1 %cmp7.i, i1 %cmp8.i, i1 false %af1.1.i = select i1 %24, i64 %i.192.i, i64 %af1.093.i %af2.1.i = select i1 %cmp7.i, i64 %af2.0.i.1.i, i64 %af2.094.i %arrayidx11.i = getelementptr inbounds i64, ptr @b, i64 %i.192.i %25 = load i64, ptr %arrayidx11.i, align 8, !tbaa !12 %cmp12.i = icmp eq i64 %25, %xor.i.lcssa %cmp14.i = icmp slt i64 %bf1.095.i, 0 %bf2.0.i.1.i = select i1 %cmp14.i, i64 %bf2.096.i, i64 %i.192.i %26 = select i1 %cmp12.i, i1 %cmp14.i, i1 false %bf1.1.i = select i1 %26, i64 %i.192.i, i64 %bf1.095.i %bf2.1.i = select i1 %cmp12.i, i64 %bf2.0.i.1.i, i64 %bf2.096.i %inc20.i = add nuw nsw i64 %i.192.i, 1 %exitcond101.not.i = icmp eq i64 %inc20.i, %9 br i1 %exitcond101.not.i, label %for.end21.i, label %for.body5.i, !llvm.loop !34 for.end21.i: ; preds = %for.body5.i %cmp22.i = icmp slt i64 %af1.1.i, 0 %cmp23.i = icmp slt i64 %bf1.1.i, 0 %or.cond.i = select i1 %cmp22.i, i1 true, i1 %cmp23.i br i1 %or.cond.i, label %kimerashuf.exit, label %if.end25.i if.end25.i: ; preds = %for.end21.i %27 = icmp sgt i64 %bf2.1.i, -1 %cmp26.not.i = icmp eq i64 %af1.1.i, %bf1.1.i %cmp29.i = icmp sgt i64 %af2.1.i, -1 %28 = select i1 %cmp29.i, i1 true, i1 %27 %spec.select.i = select i1 %28, i64 -1, i64 1 %issame.0.i = select i1 %cmp26.not.i, i64 %spec.select.i, i64 -1 %29 = select i1 %cmp26.not.i, i1 %cmp29.i, i1 false %af.0.i = select i1 %29, i64 %af2.1.i, i64 %af1.1.i %arrayidx38.i = getelementptr inbounds i64, ptr @a, i64 %af.0.i store i64 %xor.i.lcssa, ptr %arrayidx38.i, align 8, !tbaa !12 %call.i = tail call i64 @shuffle(ptr noundef nonnull @a, ptr noundef nonnull @b) %cmp39.i = icmp sgt i64 %call.i, -1 %add.i = add nsw i64 %call.i, %issame.0.i %retval.0.i = select i1 %cmp39.i, i64 %add.i, i64 -1 br label %kimerashuf.exit kimerashuf.exit: ; preds = %if.end53, %for.end21.i, %if.end25.i %retval.1.i = phi i64 [ %retval.0.i, %if.end25.i ], [ -1, %for.end21.i ], [ -1, %if.end53 ] %cmp56 = icmp slt i64 %call54, 0 %cmp59 = icmp slt i64 %retval.1.i, 0 %or.cond = select i1 %cmp56, i1 %cmp59, i1 false br i1 %or.cond, label %fail, label %if.end62 if.end62: ; preds = %kimerashuf.exit %cond.i = tail call i64 @llvm.umin.i64(i64 %call54, i64 %retval.1.i) %call64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %cond.i) br label %cleanup fail: ; preds = %land.lhs.true33, %if.else30, %kimerashuf.exit %call66 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5) br label %cleanup cleanup: ; preds = %fail, %if.end62, %if.end52 %retval.0 = phi i64 [ 2, %if.end52 ], [ 1, %fail ], [ 0, %if.end62 ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @n, ptr noundef nonnull @m) %0 = load i64, ptr @n, align 8, !tbaa !12 %cmp20.not = icmp eq i64 %0, 0 br i1 %cmp20.not, label %for.end13, label %for.body for.cond3.preheader: ; preds = %for.body %1 = icmp eq i64 %2, 0 br i1 %1, label %for.end13, label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %2 = load i64, ptr @n, align 8, !tbaa !12 %cmp = icmp ugt i64 %2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !37 for.body7: ; preds = %for.cond3.preheader, %for.body7 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ 0, %for.cond3.preheader ] %arrayidx9 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv27 %call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %arrayidx9) %indvars.iv.next28 = add nuw i64 %indvars.iv27, 1 %3 = load i64, ptr @n, align 8, !tbaa !12 %cmp5 = icmp ugt i64 %3, %indvars.iv.next28 br i1 %cmp5, label %for.body7, label %for.end13, !llvm.loop !38 for.end13: ; preds = %for.body7, %entry, %for.cond3.preheader %call14 = tail call i64 @solve(), !range !39 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #15 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #16 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #17 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.xor.v2i64(<2 x i64>) #15 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nosync nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #10 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { 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 #13 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #17 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #18 = { nounwind willreturn memory(read) } attributes #19 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"any pointer", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = !{!13, !13, i64 0} !13 = !{!"long", !9, i64 0} !14 = !{!9, !9, i64 0} !15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12} !16 = !{i64 0, i64 8, !12} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6, !19, !20} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = distinct !{!21, !6, !20, !19} !22 = distinct !{!22, !6} !23 = distinct !{!23, !6, !19, !20} !24 = distinct !{!24, !6, !19} !25 = distinct !{!25, !6} !26 = distinct !{!26, !6, !27} !27 = !{!"llvm.loop.peeled.count", i32 1} !28 = distinct !{!28, !6, !19, !20} !29 = distinct !{!29, !6, !20, !19} !30 = distinct !{!30, !6} !31 = distinct !{!31, !6} !32 = distinct !{!32, !6, !19, !20} !33 = distinct !{!33, !6, !20, !19} !34 = distinct !{!34, !6} !35 = distinct !{!35, !6, !19, !20} !36 = distinct !{!36, !6, !20, !19} !37 = distinct !{!37, !6} !38 = distinct !{!38, !6} !39 = !{i64 0, i64 3}
#include <stdio.h> int main(){ int N,i,j; double sum,ave,x,y; double a[1000]; sum = ave = 0.0; x = 200.0; scanf("%d", &N); for(i = 0; i < N; ++i){ scanf("%lf", &a[i]); sum += a[i]; } ave = sum / N; for(i = 0; i < N; ++i){ if(ave - a[i] > 0){ y = ave - a[i]; } else { y = a[i] - ave; } if(y < x){ x = y; j = i; } } printf("%d\n", j); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153291/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153291/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %a = alloca [1000 x double], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp39 = icmp sgt i32 %0, 0 br i1 %cmp39, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.041 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ] %arrayidx = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load double, ptr %arrayidx, align 8, !tbaa !9 %add = fadd double %sum.041, %1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ] %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %conv = sitofp i32 %.lcssa to double %div = fdiv double %sum.0.lcssa, %conv %cmp543 = icmp sgt i32 %.lcssa, 0 call void @llvm.assume(i1 %cmp543) %wide.trip.count = zext i32 %.lcssa to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %.lcssa, 1 br i1 %4, label %for.end24.unr-lcssa, label %for.end.new for.end.new: ; preds = %for.end %unroll_iter = and i64 %wide.trip.count, 2147483646 br label %for.body7 for.body7: ; preds = %for.body7, %for.end.new %indvars.iv50 = phi i64 [ 0, %for.end.new ], [ %indvars.iv.next51.1, %for.body7 ] %x.046 = phi double [ 2.000000e+02, %for.end.new ], [ %x.1.1, %for.body7 ] %j.045 = phi i32 [ undef, %for.end.new ], [ %j.1.1, %for.body7 ] %niter = phi i64 [ 0, %for.end.new ], [ %niter.next.1, %for.body7 ] %arrayidx9 = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv50 %5 = load double, ptr %arrayidx9, align 16, !tbaa !9 %sub = fsub double %div, %5 %cmp10 = fcmp ogt double %sub, 0.000000e+00 %sub17 = fsub double %5, %div %y.0 = select i1 %cmp10, double %sub, double %sub17 %cmp18 = fcmp olt double %y.0, %x.046 %6 = trunc i64 %indvars.iv50 to i32 %j.1 = select i1 %cmp18, i32 %6, i32 %j.045 %x.1 = select i1 %cmp18, double %y.0, double %x.046 %indvars.iv.next51 = or i64 %indvars.iv50, 1 %arrayidx9.1 = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv.next51 %7 = load double, ptr %arrayidx9.1, align 8, !tbaa !9 %sub.1 = fsub double %div, %7 %cmp10.1 = fcmp ogt double %sub.1, 0.000000e+00 %sub17.1 = fsub double %7, %div %y.0.1 = select i1 %cmp10.1, double %sub.1, double %sub17.1 %cmp18.1 = fcmp olt double %y.0.1, %x.1 %8 = trunc i64 %indvars.iv.next51 to i32 %j.1.1 = select i1 %cmp18.1, i32 %8, i32 %j.1 %x.1.1 = select i1 %cmp18.1, double %y.0.1, double %x.1 %indvars.iv.next51.1 = add nuw nsw i64 %indvars.iv50, 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.end24.unr-lcssa, label %for.body7, !llvm.loop !13 for.end24.unr-lcssa: ; preds = %for.body7, %for.end %indvars.iv50.unr = phi i64 [ 0, %for.end ], [ %indvars.iv.next51.1, %for.body7 ] %x.046.unr = phi double [ 2.000000e+02, %for.end ], [ %x.1.1, %for.body7 ] %j.045.unr = phi i32 [ undef, %for.end ], [ %j.1.1, %for.body7 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end24, label %for.body7.epil for.body7.epil: ; preds = %for.end24.unr-lcssa %arrayidx9.epil = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv50.unr %9 = load double, ptr %arrayidx9.epil, align 8, !tbaa !9 %sub.epil = fsub double %div, %9 %cmp10.epil = fcmp ogt double %sub.epil, 0.000000e+00 %sub17.epil = fsub double %9, %div %y.0.epil = select i1 %cmp10.epil, double %sub.epil, double %sub17.epil %cmp18.epil = fcmp olt double %y.0.epil, %x.046.unr %10 = trunc i64 %indvars.iv50.unr to i32 %j.1.epil = select i1 %cmp18.epil, i32 %10, i32 %j.045.unr br label %for.end24 for.end24: ; preds = %for.end24.unr-lcssa, %for.body7.epil %j.1.lcssa = phi i32 [ %j.045.unr, %for.end24.unr-lcssa ], [ %j.1.epil, %for.body7.epil ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %j.1.lcssa) call void @llvm.lifetime.end.p0(i64 8000, 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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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 = !{!10, !10, i64 0} !10 = !{!"double", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> int main(){ int n, i, j, move; int data[1000]; scanf("%d",&n); for(i = 0;i < n;i++){ scanf("%d",&data[i]); } while(n != 0){ for(j = 1;j < n;j++){ if(data[j-1] < data[j]){ move = data[j-1]; data[j-1] = data[j]; data[j] = move; } } if(n == 1){ printf("%d\n",data[n-1]); } else{ printf("%d ",data[n-1]); } n = n - 1; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %data = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %data) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] %cmp2.not51 = icmp eq i32 %.lcssa, 0 br i1 %cmp2.not51, label %while.end, label %for.cond3.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %data, 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 %while.cond.preheader, !llvm.loop !9 for.cond3.preheader: ; preds = %while.cond.preheader, %if.end34 %3 = phi i32 [ %sub35, %if.end34 ], [ %.lcssa, %while.cond.preheader ] %cmp449 = icmp sgt i32 %3, 1 br i1 %cmp449, label %for.body5.preheader, label %for.end23 for.body5.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %3 to i64 %.pre = load i32, ptr %data, align 16, !tbaa !5 %4 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %4, 1 %5 = icmp eq i32 %3, 2 br i1 %5, label %for.end23.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %4, -2 br label %for.body5 for.body5: ; preds = %for.inc21.1, %for.body5.preheader.new %6 = phi i32 [ %.pre, %for.body5.preheader.new ], [ %11, %for.inc21.1 ] %indvars.iv54 = phi i64 [ 1, %for.body5.preheader.new ], [ %indvars.iv.next55.1, %for.inc21.1 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc21.1 ] %arrayidx9 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp slt i32 %6, %7 br i1 %cmp10, label %if.then, label %for.inc21 if.then: ; preds = %for.body5 %8 = add nsw i64 %indvars.iv54, -1 %arrayidx7 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %8 store i32 %7, ptr %arrayidx7, align 4, !tbaa !5 store i32 %6, ptr %arrayidx9, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body5, %if.then %9 = phi i32 [ %7, %for.body5 ], [ %6, %if.then ] %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %arrayidx9.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next55 %10 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %cmp10.1 = icmp slt i32 %9, %10 br i1 %cmp10.1, label %if.then.1, label %for.inc21.1 if.then.1: ; preds = %for.inc21 %arrayidx7.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54 store i32 %10, ptr %arrayidx7.1, align 4, !tbaa !5 store i32 %9, ptr %arrayidx9.1, align 4, !tbaa !5 br label %for.inc21.1 for.inc21.1: ; preds = %if.then.1, %for.inc21 %11 = phi i32 [ %10, %for.inc21 ], [ %9, %if.then.1 ] %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 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.end23.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11 for.end23.loopexit.unr-lcssa: ; preds = %for.inc21.1, %for.body5.preheader %.unr = phi i32 [ %.pre, %for.body5.preheader ], [ %11, %for.inc21.1 ] %indvars.iv54.unr = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next55.1, %for.inc21.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end23, label %for.body5.epil for.body5.epil: ; preds = %for.end23.loopexit.unr-lcssa %arrayidx9.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54.unr %12 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5 %cmp10.epil = icmp slt i32 %.unr, %12 br i1 %cmp10.epil, label %if.then.epil, label %for.end23 if.then.epil: ; preds = %for.body5.epil %13 = add nsw i64 %indvars.iv54.unr, -1 %arrayidx7.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %13 store i32 %12, ptr %arrayidx7.epil, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx9.epil, align 4, !tbaa !5 br label %for.end23 for.end23: ; preds = %for.end23.loopexit.unr-lcssa, %if.then.epil, %for.body5.epil, %for.cond3.preheader %cmp24 = icmp eq i32 %3, 1 br i1 %cmp24, label %if.then25, label %if.else if.then25: ; preds = %for.end23 %14 = load i32, ptr %data, align 16, !tbaa !5 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) br label %if.end34 if.else: ; preds = %for.end23 %sub30 = add nsw i32 %3, -1 %idxprom31 = sext i32 %sub30 to i64 %arrayidx32 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %idxprom31 %15 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) br label %if.end34 if.end34: ; preds = %if.else, %if.then25 %16 = load i32, ptr %n, align 4, !tbaa !5 %sub35 = add nsw i32 %16, -1 store i32 %sub35, ptr %n, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %sub35, 0 br i1 %cmp2.not, label %while.end, label %for.cond3.preheader, !llvm.loop !12 while.end: ; preds = %if.end34, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %data) #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}
#include<stdio.h> #include<string.h> int main(void){ int i,j,tmp; int n,x[1000]; memset(x,0,sizeof(x)); scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<n-1;i++){ for(j=n-1;j>i;j--){ if(x[j-1]>x[j]){ tmp = x[j]; x[j] = x[j-1]; x[j-1] = tmp; } } } for(i=0;i<n;i++){ if(i==n-1){ printf("%d\n",x[i]); }else{ printf("%d ",x[i]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153385/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \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 [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %x, i8 0, i64 4000, 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 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.body, label %for.end45 for.cond2.preheader: ; preds = %for.body %cmp368 = icmp sgt i32 %3, 1 br i1 %cmp368, label %for.cond6.preheader.preheader, label %for.cond30.preheader for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %3, -1 %1 = zext i32 %3 to i64 %2 = add nsw i64 %1, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx13.phi.trans.insert = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %2 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %x, 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 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc27 %indvars.iv77 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next78, %for.inc27 ] %.pre = load i32, ptr %arrayidx13.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.cond30.preheader: ; preds = %for.inc27, %for.cond2.preheader %cmp3170 = icmp sgt i32 %3, 0 br i1 %cmp3170, label %for.body32, label %for.end45 for.body8: ; preds = %for.cond6.preheader, %for.inc25 %5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc25 ] %indvars.iv74 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next75, %for.inc25 ] %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1 %arrayidx11 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next75 %6 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %6, %5 br i1 %cmp14, label %if.then, label %for.inc25 if.then: ; preds = %for.body8 %arrayidx13 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv74 store i32 %6, ptr %arrayidx13, align 4, !tbaa !5 store i32 %5, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body8, %if.then %7 = phi i32 [ %6, %for.body8 ], [ %5, %if.then ] %cmp7 = icmp sgt i64 %indvars.iv.next75, %indvars.iv77 br i1 %cmp7, label %for.body8, label %for.inc27, !llvm.loop !11 for.inc27: ; preds = %for.inc25 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader, !llvm.loop !12 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body32 ], [ 0, %for.cond30.preheader ] %8 = phi i32 [ %11, %for.body32 ], [ %3, %for.cond30.preheader ] %sub33 = add nsw i32 %8, -1 %9 = zext i32 %sub33 to i64 %cmp34 = icmp eq i64 %indvars.iv80, %9 %arrayidx37 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv80 %10 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %.str.1..str.2 = select i1 %cmp34, ptr @.str.1, ptr @.str.2 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %10) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp31 = icmp slt i64 %indvars.iv.next81, %12 br i1 %cmp31, label %for.body32, label %for.end45, !llvm.loop !13 for.end45: ; preds = %for.body32, %entry, %for.cond30.preheader call void @llvm.lifetime.end.p0(i64 4000, 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: 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}
#include<stdio.h> int main(){ int i,j,a[1000],n,tmp; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<n-1;i++){ for(j=n-1;j>i;j--){ if(a[j] < a[j-1]){ tmp=a[j]; a[j]=a[j-1]; a[j-1]=tmp; } } } for(i=0;i<n;i++){ if(i!=n-1){ printf("%d ",a[i]); } else{ printf("%d\n",a[i]); } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153428/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [1000 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #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) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.body, label %for.end45 for.cond2.preheader: ; preds = %for.body %cmp368 = icmp sgt i32 %3, 1 br i1 %cmp368, label %for.cond6.preheader.preheader, label %for.cond30.preheader for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %3, -1 %1 = zext i32 %3 to i64 %2 = add nsw i64 %1, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx10.phi.trans.insert = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %2 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 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 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc27 %indvars.iv77 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next78, %for.inc27 ] %.pre = load i32, ptr %arrayidx10.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.cond30.preheader: ; preds = %for.inc27, %for.cond2.preheader %cmp3170 = icmp sgt i32 %3, 0 br i1 %cmp3170, label %for.body32, label %for.end45 for.body8: ; preds = %for.cond6.preheader, %for.inc25 %5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc25 ] %indvars.iv74 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next75, %for.inc25 ] %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1 %arrayidx13 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next75 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %5, %6 br i1 %cmp14, label %if.then, label %for.inc25 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv74 store i32 %6, ptr %arrayidx10, align 4, !tbaa !5 store i32 %5, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body8, %if.then %7 = phi i32 [ %6, %for.body8 ], [ %5, %if.then ] %cmp7 = icmp sgt i64 %indvars.iv.next75, %indvars.iv77 br i1 %cmp7, label %for.body8, label %for.inc27, !llvm.loop !11 for.inc27: ; preds = %for.inc25 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader, !llvm.loop !12 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body32 ], [ 0, %for.cond30.preheader ] %8 = phi i32 [ %11, %for.body32 ], [ %3, %for.cond30.preheader ] %sub33 = add nsw i32 %8, -1 %9 = zext i32 %sub33 to i64 %cmp34.not = icmp eq i64 %indvars.iv80, %9 %arrayidx40 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv80 %10 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %.str.2..str.1 = select i1 %cmp34.not, ptr @.str.2, ptr @.str.1 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1, i32 noundef %10) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp31 = icmp slt i64 %indvars.iv.next81, %12 br i1 %cmp31, label %for.body32, label %for.end45, !llvm.loop !13 for.end45: ; preds = %for.body32, %entry, %for.cond30.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void) { int n; int a[1001]; int i, j, tmp; scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d", &a[i]); } for (i = 0; i < n; i++){ for (j = i + 1; j < n; j++){ if(a[i] > a[j]){ tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } } for (i = 0; i < n-1; i++){ printf("%d ", a[i]); } printf("%d\n", a[n-1]); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153471/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153471/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4004, 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 %cmp56 = icmp sgt i32 %0, 0 br i1 %cmp56, label %for.body, label %for.cond27.preheader.for.end35_crit_edge for.cond2.preheader: ; preds = %for.body %cmp360 = icmp sgt i32 %2, 0 br i1 %cmp360, label %for.body4.preheader, label %for.cond27.preheader.for.end35_crit_edge for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count77 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.inc21, %for.body4 %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1 %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77 br i1 %exitcond78.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11 for.cond27.preheader: ; preds = %for.cond2.loopexit %cmp2863 = icmp sgt i32 %2, 1 br i1 %cmp2863, label %for.body29, label %for.cond27.preheader.for.end35_crit_edge for.cond27.preheader.for.end35_crit_edge: ; preds = %entry, %for.cond2.preheader, %for.cond27.preheader %4 = phi i32 [ %2, %for.cond27.preheader ], [ %2, %for.cond2.preheader ], [ %0, %entry ] %sub62 = add nsw i32 %4, -1 %.pre = sext i32 %sub62 to i64 br label %for.end35 for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit %indvars.iv74 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next75, %for.cond2.loopexit ] %indvars.iv69 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next70, %for.cond2.loopexit ] %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %cmp658 = icmp ult i64 %indvars.iv.next75, %1 br i1 %cmp658, label %for.body7.lr.ph, label %for.cond2.loopexit for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv74 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv71 = phi i64 [ %indvars.iv69, %for.body7.lr.ph ], [ %indvars.iv.next72, %for.inc21 ] %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv71 %6 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %5, %6 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %6, ptr %arrayidx9, align 4, !tbaa !5 store i32 %5, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count77 br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !12 for.body29: ; preds = %for.cond27.preheader, %for.body29 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body29 ], [ 0, %for.cond27.preheader ] %arrayidx31 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv79 %7 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp28 = icmp slt i64 %indvars.iv.next80, %9 br i1 %cmp28, label %for.body29, label %for.end35, !llvm.loop !13 for.end35: ; preds = %for.body29, %for.cond27.preheader.for.end35_crit_edge %idxprom37.pre-phi = phi i64 [ %.pre, %for.cond27.preheader.for.end35_crit_edge ], [ %9, %for.body29 ] %arrayidx38 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %idxprom37.pre-phi %10 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
/* * ID: ITP2_10_A * Problem: Bit Operation I */ #include <stdio.h> void print_bits(unsigned int a) { int i; for (i = 0; i < 32; i++) { printf("%d", (a & 0x80000000) == 0 ? 0 : 1); a <<= 1; } printf("\n"); } int main(void) { unsigned int a; scanf("%d", &a); print_bits(a); print_bits(~a); print_bits(a << 1); print_bits(a >> 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153521/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153521/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @print_bits(i32 noundef %a) local_unnamed_addr #0 { entry: %a.addr.0.lobit = lshr i32 %a, 31 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit) %0 = lshr i32 %a, 30 %a.addr.0.lobit.1 = and i32 %0, 1 %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.1) %1 = lshr i32 %a, 29 %a.addr.0.lobit.2 = and i32 %1, 1 %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.2) %2 = lshr i32 %a, 28 %a.addr.0.lobit.3 = and i32 %2, 1 %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.3) %3 = lshr i32 %a, 27 %a.addr.0.lobit.4 = and i32 %3, 1 %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.4) %4 = lshr i32 %a, 26 %a.addr.0.lobit.5 = and i32 %4, 1 %call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.5) %5 = lshr i32 %a, 25 %a.addr.0.lobit.6 = and i32 %5, 1 %call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.6) %6 = lshr i32 %a, 24 %a.addr.0.lobit.7 = and i32 %6, 1 %call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.7) %7 = lshr i32 %a, 23 %a.addr.0.lobit.8 = and i32 %7, 1 %call.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.8) %8 = lshr i32 %a, 22 %a.addr.0.lobit.9 = and i32 %8, 1 %call.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.9) %9 = lshr i32 %a, 21 %a.addr.0.lobit.10 = and i32 %9, 1 %call.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.10) %10 = lshr i32 %a, 20 %a.addr.0.lobit.11 = and i32 %10, 1 %call.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.11) %11 = lshr i32 %a, 19 %a.addr.0.lobit.12 = and i32 %11, 1 %call.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.12) %12 = lshr i32 %a, 18 %a.addr.0.lobit.13 = and i32 %12, 1 %call.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.13) %13 = lshr i32 %a, 17 %a.addr.0.lobit.14 = and i32 %13, 1 %call.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.14) %14 = lshr i32 %a, 16 %a.addr.0.lobit.15 = and i32 %14, 1 %call.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.15) %15 = lshr i32 %a, 15 %a.addr.0.lobit.16 = and i32 %15, 1 %call.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.16) %16 = lshr i32 %a, 14 %a.addr.0.lobit.17 = and i32 %16, 1 %call.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.17) %17 = lshr i32 %a, 13 %a.addr.0.lobit.18 = and i32 %17, 1 %call.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.18) %18 = lshr i32 %a, 12 %a.addr.0.lobit.19 = and i32 %18, 1 %call.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.19) %19 = lshr i32 %a, 11 %a.addr.0.lobit.20 = and i32 %19, 1 %call.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.20) %20 = lshr i32 %a, 10 %a.addr.0.lobit.21 = and i32 %20, 1 %call.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.21) %21 = lshr i32 %a, 9 %a.addr.0.lobit.22 = and i32 %21, 1 %call.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.22) %22 = lshr i32 %a, 8 %a.addr.0.lobit.23 = and i32 %22, 1 %call.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.23) %23 = lshr i32 %a, 7 %a.addr.0.lobit.24 = and i32 %23, 1 %call.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.24) %24 = lshr i32 %a, 6 %a.addr.0.lobit.25 = and i32 %24, 1 %call.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.25) %25 = lshr i32 %a, 5 %a.addr.0.lobit.26 = and i32 %25, 1 %call.26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.26) %26 = lshr i32 %a, 4 %a.addr.0.lobit.27 = and i32 %26, 1 %call.27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.27) %27 = lshr i32 %a, 3 %a.addr.0.lobit.28 = and i32 %27, 1 %call.28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.28) %28 = lshr i32 %a, 2 %a.addr.0.lobit.29 = and i32 %28, 1 %call.29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.29) %29 = lshr i32 %a, 1 %a.addr.0.lobit.30 = and i32 %29, 1 %call.30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.addr.0.lobit.30) %shl.30 = and i32 %a, 1 %call.31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %shl.30) %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 call void @print_bits(i32 noundef %0) %1 = load i32, ptr %a, align 4, !tbaa !5 %not = xor i32 %1, -1 call void @print_bits(i32 noundef %not) %2 = load i32, ptr %a, align 4, !tbaa !5 %shl = shl i32 %2, 1 call void @print_bits(i32 noundef %shl) %3 = load i32, ptr %a, align 4, !tbaa !5 %shr = lshr i32 %3, 1 call void @print_bits(i32 noundef %shr) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d",&a); b=a-30; c=b/2; printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153565/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153565/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %0, -30 %div = sdiv i32 %sub, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) 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"}
/* * TestWorks1.c * * * input is b and e-1 * after q operations are done print everything * Print: use getchar and put * Reverse: 123456 for loop with one counter increasing and one decreasing. * Created on: 2019/09/10 * Author: pepe */ #include<stdio.h> int Value[1000]; int z; struct qeb{ unsigned int q:10; unsigned int b:10; unsigned int e:10; }; struct qeb qeb; struct cnt { unsigned int a:10; unsigned int i:10; unsigned int dec:10; }; struct cnt cnt; int input(); int Rev(void); int main(void){ qeb.q = input(); for (int i = 0; i < qeb.q; i++){ Value[i] = input(); } cnt.a = input(); for (int i = 0; i < cnt.a; i++){ Rev(); } for (int i = 0; i < qeb.q; i++){//print int j = Value[i]; char buff[20]; if (j == 0) putchar('0'); else{ if (j < 0){ putchar('-'); j = -j; } qeb.b = 0; while (j) buff[qeb.b++] = j % 10 +'0', j /= 10; while (qeb.b--) putchar(buff[qeb.b]); } if (i == qeb.q - 1) putchar('\n'); else putchar(' '); } return 0; } int input(){ int z = 0, j = getchar(); if (j == '-'){ j = getchar(); do z = z*10 + (j & 0xf), j = getchar(); while (j >= '0'); z = -z; } else { do z = z*10 + (j & 0xf), j = getchar(); while (j >= '0'); } return z; } int Rev(void){ qeb.b = input(); //printf("%d", qeb.b); qeb.e = input(); //printf("%d", qeb.e); cnt.i = qeb.b; cnt.dec = qeb.e-1; for (int k = 0; k < (qeb.e - qeb.b) / 2; k++){ z = Value[cnt.i]; //printf("%d\n", z); Value[cnt.i] = Value[cnt.dec]; Value[cnt.dec] = z; cnt.dec--; cnt.i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153622/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153622/source.c" target datalayout = "e-m:e-p270: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.qeb = type { i32 } %struct.cnt = type { i32 } @qeb = dso_local local_unnamed_addr global %struct.qeb zeroinitializer, align 4 @Value = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global %struct.cnt zeroinitializer, align 4 @z = dso_local local_unnamed_addr global i32 0, align 4 @stdout = external local_unnamed_addr global ptr, align 8 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %buff = alloca [20 x i8], align 16 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.i = tail call i32 @getc(ptr noundef %0) %cmp.i = icmp eq i32 %call.i.i, 45 br i1 %cmp.i, label %if.then.i, label %do.body4.i if.then.i: ; preds = %entry %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19.i = tail call i32 @getc(ptr noundef %1) br label %do.body.i do.body.i: ; preds = %do.body.i, %if.then.i %z.0.i = phi i32 [ 0, %if.then.i ], [ %add.i, %do.body.i ] %j.0.i = phi i32 [ %call.i19.i, %if.then.i ], [ %call.i20.i, %do.body.i ] %mul.i = mul nsw i32 %z.0.i, 10 %and.i = and i32 %j.0.i, 15 %add.i = add nsw i32 %and.i, %mul.i %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20.i = tail call i32 @getc(ptr noundef %2) %cmp3.i = icmp sgt i32 %call.i20.i, 47 br i1 %cmp3.i, label %do.body.i, label %do.end.i, !llvm.loop !9 do.end.i: ; preds = %do.body.i %sub.i = sub nsw i32 0, %add.i br label %input.exit do.body4.i: ; preds = %entry, %do.body4.i %z.1.i = phi i32 [ %add7.i, %do.body4.i ], [ 0, %entry ] %j.1.i = phi i32 [ %call.i21.i, %do.body4.i ], [ %call.i.i, %entry ] %mul5.i = mul nsw i32 %z.1.i, 10 %and6.i = and i32 %j.1.i, 15 %add7.i = add nsw i32 %and6.i, %mul5.i %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21.i = tail call i32 @getc(ptr noundef %3) %cmp10.i = icmp sgt i32 %call.i21.i, 47 br i1 %cmp10.i, label %do.body4.i, label %input.exit, !llvm.loop !11 input.exit: ; preds = %do.body4.i, %do.end.i %z.2.i = phi i32 [ %sub.i, %do.end.i ], [ %add7.i, %do.body4.i ] %bf.load = load i32, ptr @qeb, align 4 %bf.value = and i32 %z.2.i, 1023 %bf.clear = and i32 %bf.load, -1024 %bf.set = or i32 %bf.clear, %bf.value store i32 %bf.set, ptr @qeb, align 4 %cmp144.not = icmp eq i32 %bf.value, 0 br i1 %cmp144.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %input.exit137, %input.exit %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.i90 = tail call i32 @getc(ptr noundef %4) %cmp.i91 = icmp eq i32 %call.i.i90, 45 br i1 %cmp.i91, label %if.then.i101, label %do.body4.i92 if.then.i101: ; preds = %for.cond.cleanup %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19.i102 = tail call i32 @getc(ptr noundef %5) br label %do.body.i103 do.body.i103: ; preds = %do.body.i103, %if.then.i101 %z.0.i104 = phi i32 [ 0, %if.then.i101 ], [ %add.i108, %do.body.i103 ] %j.0.i105 = phi i32 [ %call.i19.i102, %if.then.i101 ], [ %call.i20.i109, %do.body.i103 ] %mul.i106 = mul nsw i32 %z.0.i104, 10 %and.i107 = and i32 %j.0.i105, 15 %add.i108 = add nsw i32 %and.i107, %mul.i106 %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20.i109 = tail call i32 @getc(ptr noundef %6) %cmp3.i110 = icmp sgt i32 %call.i20.i109, 47 br i1 %cmp3.i110, label %do.body.i103, label %do.end.i111, !llvm.loop !9 do.end.i111: ; preds = %do.body.i103 %sub.i112 = sub nsw i32 0, %add.i108 br label %input.exit113 do.body4.i92: ; preds = %for.cond.cleanup, %do.body4.i92 %z.1.i93 = phi i32 [ %add7.i97, %do.body4.i92 ], [ 0, %for.cond.cleanup ] %j.1.i94 = phi i32 [ %call.i21.i98, %do.body4.i92 ], [ %call.i.i90, %for.cond.cleanup ] %mul5.i95 = mul nsw i32 %z.1.i93, 10 %and6.i96 = and i32 %j.1.i94, 15 %add7.i97 = add nsw i32 %and6.i96, %mul5.i95 %7 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21.i98 = tail call i32 @getc(ptr noundef %7) %cmp10.i99 = icmp sgt i32 %call.i21.i98, 47 br i1 %cmp10.i99, label %do.body4.i92, label %input.exit113, !llvm.loop !11 input.exit113: ; preds = %do.body4.i92, %do.end.i111 %z.2.i100 = phi i32 [ %sub.i112, %do.end.i111 ], [ %add7.i97, %do.body4.i92 ] %bf.load5 = load i32, ptr @cnt, align 4 %bf.value6 = and i32 %z.2.i100, 1023 %bf.clear7 = and i32 %bf.load5, -1024 %bf.set8 = or i32 %bf.clear7, %bf.value6 store i32 %bf.set8, ptr @cnt, align 4 %cmp13148.not = icmp eq i32 %bf.value6, 0 br i1 %cmp13148.not, label %for.cond21.preheader, label %for.body15 for.body: ; preds = %input.exit, %input.exit137 %indvars.iv = phi i64 [ %indvars.iv.next, %input.exit137 ], [ 0, %input.exit ] %8 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.i114 = tail call i32 @getc(ptr noundef %8) %cmp.i115 = icmp eq i32 %call.i.i114, 45 br i1 %cmp.i115, label %if.then.i125, label %do.body4.i116 if.then.i125: ; preds = %for.body %9 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19.i126 = tail call i32 @getc(ptr noundef %9) br label %do.body.i127 do.body.i127: ; preds = %do.body.i127, %if.then.i125 %z.0.i128 = phi i32 [ 0, %if.then.i125 ], [ %add.i132, %do.body.i127 ] %j.0.i129 = phi i32 [ %call.i19.i126, %if.then.i125 ], [ %call.i20.i133, %do.body.i127 ] %mul.i130 = mul nsw i32 %z.0.i128, 10 %and.i131 = and i32 %j.0.i129, 15 %add.i132 = add nsw i32 %and.i131, %mul.i130 %10 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20.i133 = tail call i32 @getc(ptr noundef %10) %cmp3.i134 = icmp sgt i32 %call.i20.i133, 47 br i1 %cmp3.i134, label %do.body.i127, label %do.end.i135, !llvm.loop !9 do.end.i135: ; preds = %do.body.i127 %sub.i136 = sub nsw i32 0, %add.i132 br label %input.exit137 do.body4.i116: ; preds = %for.body, %do.body4.i116 %z.1.i117 = phi i32 [ %add7.i121, %do.body4.i116 ], [ 0, %for.body ] %j.1.i118 = phi i32 [ %call.i21.i122, %do.body4.i116 ], [ %call.i.i114, %for.body ] %mul5.i119 = mul nsw i32 %z.1.i117, 10 %and6.i120 = and i32 %j.1.i118, 15 %add7.i121 = add nsw i32 %and6.i120, %mul5.i119 %11 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21.i122 = tail call i32 @getc(ptr noundef %11) %cmp10.i123 = icmp sgt i32 %call.i21.i122, 47 br i1 %cmp10.i123, label %do.body4.i116, label %input.exit137, !llvm.loop !11 input.exit137: ; preds = %do.body4.i116, %do.end.i135 %z.2.i124 = phi i32 [ %sub.i136, %do.end.i135 ], [ %add7.i121, %do.body4.i116 ] %arrayidx = getelementptr inbounds [1000 x i32], ptr @Value, i64 0, i64 %indvars.iv store i32 %z.2.i124, ptr %arrayidx, align 4, !tbaa !12 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %bf.load1 = load i32, ptr @qeb, align 4 %bf.clear2 = and i32 %bf.load1, 1023 %12 = zext i32 %bf.clear2 to i64 %cmp = icmp ult i64 %indvars.iv.next, %12 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !14 for.cond21.preheader: ; preds = %for.body15, %input.exit113 %bf.load22160 = load i32, ptr @qeb, align 4 %bf.clear23161 = and i32 %bf.load22160, 1023 %cmp24162.not = icmp eq i32 %bf.clear23161, 0 br i1 %cmp24162.not, label %for.cond.cleanup25, label %for.body26 for.body15: ; preds = %input.exit113, %for.body15 %i9.0149 = phi i32 [ %inc18, %for.body15 ], [ 0, %input.exit113 ] %call16 = tail call i32 @Rev() %inc18 = add nuw nsw i32 %i9.0149, 1 %bf.load11 = load i32, ptr @cnt, align 4 %bf.clear12 = and i32 %bf.load11, 1023 %cmp13 = icmp ult i32 %inc18, %bf.clear12 br i1 %cmp13, label %for.body15, label %for.cond21.preheader, !llvm.loop !15 for.cond.cleanup25: ; preds = %if.end65, %for.cond21.preheader ret i32 0 for.body26: ; preds = %for.cond21.preheader, %if.end65 %bf.load34169 = phi i32 [ %bf.load22, %if.end65 ], [ %bf.load22160, %for.cond21.preheader ] %indvars.iv165 = phi i64 [ %indvars.iv.next166, %if.end65 ], [ 0, %for.cond21.preheader ] %arrayidx28 = getelementptr inbounds [1000 x i32], ptr @Value, i64 0, i64 %indvars.iv165 %13 = load i32, ptr %arrayidx28, align 4, !tbaa !12 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %buff) #3 %cmp29 = icmp eq i32 %13, 0 br i1 %cmp29, label %if.then, label %if.else if.then: ; preds = %for.body26 %14 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i = tail call i32 @putc(i32 noundef 48, ptr noundef %14) %bf.load66.pre = load i32, ptr @qeb, align 4 br label %if.end65 if.else: ; preds = %for.body26 %cmp31 = icmp slt i32 %13, 0 br i1 %cmp31, label %if.then32, label %if.end if.then32: ; preds = %if.else %15 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i138 = tail call i32 @putc(i32 noundef 45, ptr noundef %15) %sub = sub nsw i32 0, %13 %bf.load34.pre = load i32, ptr @qeb, align 4 br label %if.end if.end: ; preds = %if.then32, %if.else %bf.load34 = phi i32 [ %bf.load34.pre, %if.then32 ], [ %bf.load34169, %if.else ] %j.0 = phi i32 [ %sub, %if.then32 ], [ %13, %if.else ] %bf.clear35 = and i32 %bf.load34, -1047553 br label %while.body while.cond46.preheader: ; preds = %while.body store i32 %bf.set43150151, ptr @qeb, align 4 %tobool55.not158 = icmp eq i32 %bf.shl, 0 br i1 %tobool55.not158, label %if.end65, label %while.body56.preheader while.body56.preheader: ; preds = %while.cond46.preheader %bf.shl52155 = and i32 %bf.set43150151, 1047552 br label %while.body56 while.body: ; preds = %if.end, %while.body %j.1152 = phi i32 [ %j.0, %if.end ], [ %div, %while.body ] %bf.set43150151 = phi i32 [ %bf.clear35, %if.end ], [ %bf.set43, %while.body ] %rem = srem i32 %j.1152, 10 %16 = trunc i32 %rem to i8 %conv = add nsw i8 %16, 48 %bf.lshr = lshr i32 %bf.set43150151, 10 %bf.clear38 = and i32 %bf.lshr, 1023 %bf.value41 = add i32 %bf.set43150151, 1024 %bf.shl = and i32 %bf.value41, 1047552 %bf.clear42 = and i32 %bf.set43150151, -1047553 %bf.set43 = or i32 %bf.shl, %bf.clear42 %idxprom44 = zext i32 %bf.clear38 to i64 %arrayidx45 = getelementptr inbounds [20 x i8], ptr %buff, i64 0, i64 %idxprom44 store i8 %conv, ptr %arrayidx45, align 1, !tbaa !16 %div = sdiv i32 %j.1152, 10 %j.1152.off = add i32 %j.1152, 9 %tobool.not = icmp ult i32 %j.1152.off, 19 br i1 %tobool.not, label %while.cond46.preheader, label %while.body, !llvm.loop !17 while.body56: ; preds = %while.body56.preheader, %while.body56 %bf.shl52159 = phi i32 [ %bf.shl52, %while.body56 ], [ %bf.shl52155, %while.body56.preheader ] %bf.lshr58 = lshr exact i32 %bf.shl52159, 10 %idxprom60 = zext i32 %bf.lshr58 to i64 %arrayidx61 = getelementptr inbounds [20 x i8], ptr %buff, i64 0, i64 %idxprom60 %17 = load i8, ptr %arrayidx61, align 1, !tbaa !16 %conv62 = sext i8 %17 to i32 %18 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i139 = tail call i32 @putc(i32 noundef %conv62, ptr noundef %18) %bf.load47 = load i32, ptr @qeb, align 4 %bf.value51 = add i32 %bf.load47, 1047552 %bf.shl52 = and i32 %bf.value51, 1047552 %bf.clear53 = and i32 %bf.load47, -1047553 %bf.set54 = or i32 %bf.shl52, %bf.clear53 store i32 %bf.set54, ptr @qeb, align 4 %19 = and i32 %bf.load47, 1047552 %tobool55.not = icmp eq i32 %19, 0 br i1 %tobool55.not, label %if.end65, label %while.body56, !llvm.loop !18 if.end65: ; preds = %while.body56, %while.cond46.preheader, %if.then %bf.load66 = phi i32 [ %bf.set43150151, %while.cond46.preheader ], [ %bf.load66.pre, %if.then ], [ %bf.set54, %while.body56 ] %bf.clear67 = and i32 %bf.load66, 1023 %sub68 = add nsw i32 %bf.clear67, -1 %20 = zext i32 %sub68 to i64 %cmp69 = icmp eq i64 %indvars.iv165, %20 %21 = load ptr, ptr @stdout, align 8, !tbaa !5 %. = select i1 %cmp69, i32 10, i32 32 %call.i141 = tail call i32 @putc(i32 noundef %., ptr noundef %21) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %buff) #3 %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %bf.load22 = load i32, ptr @qeb, align 4 %bf.clear23 = and i32 %bf.load22, 1023 %22 = zext i32 %bf.clear23 to i64 %cmp24 = icmp ult i64 %indvars.iv.next166, %22 br i1 %cmp24, label %for.body26, label %for.cond.cleanup25, !llvm.loop !19 } ; 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 @Rev() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.i = tail call i32 @getc(ptr noundef %0) %cmp.i = icmp eq i32 %call.i.i, 45 br i1 %cmp.i, label %if.then.i, label %do.body4.i if.then.i: ; preds = %entry %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19.i = tail call i32 @getc(ptr noundef %1) br label %do.body.i do.body.i: ; preds = %do.body.i, %if.then.i %z.0.i = phi i32 [ 0, %if.then.i ], [ %add.i, %do.body.i ] %j.0.i = phi i32 [ %call.i19.i, %if.then.i ], [ %call.i20.i, %do.body.i ] %mul.i = mul nsw i32 %z.0.i, 10 %and.i = and i32 %j.0.i, 15 %add.i = add nsw i32 %and.i, %mul.i %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20.i = tail call i32 @getc(ptr noundef %2) %cmp3.i = icmp sgt i32 %call.i20.i, 47 br i1 %cmp3.i, label %do.body.i, label %do.end.i, !llvm.loop !9 do.end.i: ; preds = %do.body.i %sub.i = sub nsw i32 0, %add.i br label %input.exit do.body4.i: ; preds = %entry, %do.body4.i %z.1.i = phi i32 [ %add7.i, %do.body4.i ], [ 0, %entry ] %j.1.i = phi i32 [ %call.i21.i, %do.body4.i ], [ %call.i.i, %entry ] %mul5.i = mul nsw i32 %z.1.i, 10 %and6.i = and i32 %j.1.i, 15 %add7.i = add nsw i32 %and6.i, %mul5.i %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21.i = tail call i32 @getc(ptr noundef %3) %cmp10.i = icmp sgt i32 %call.i21.i, 47 br i1 %cmp10.i, label %do.body4.i, label %input.exit, !llvm.loop !11 input.exit: ; preds = %do.body4.i, %do.end.i %z.2.i = phi i32 [ %sub.i, %do.end.i ], [ %add7.i, %do.body4.i ] %bf.load = load i32, ptr @qeb, align 4 %bf.value = shl i32 %z.2.i, 10 %bf.shl = and i32 %bf.value, 1047552 %bf.clear = and i32 %bf.load, -1047553 %bf.set = or i32 %bf.clear, %bf.shl store i32 %bf.set, ptr @qeb, align 4 %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.i65 = tail call i32 @getc(ptr noundef %4) %cmp.i66 = icmp eq i32 %call.i.i65, 45 br i1 %cmp.i66, label %if.then.i76, label %do.body4.i67 if.then.i76: ; preds = %input.exit %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19.i77 = tail call i32 @getc(ptr noundef %5) br label %do.body.i78 do.body.i78: ; preds = %do.body.i78, %if.then.i76 %z.0.i79 = phi i32 [ 0, %if.then.i76 ], [ %add.i83, %do.body.i78 ] %j.0.i80 = phi i32 [ %call.i19.i77, %if.then.i76 ], [ %call.i20.i84, %do.body.i78 ] %mul.i81 = mul nsw i32 %z.0.i79, 10 %and.i82 = and i32 %j.0.i80, 15 %add.i83 = add nsw i32 %and.i82, %mul.i81 %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20.i84 = tail call i32 @getc(ptr noundef %6) %cmp3.i85 = icmp sgt i32 %call.i20.i84, 47 br i1 %cmp3.i85, label %do.body.i78, label %do.end.i86, !llvm.loop !9 do.end.i86: ; preds = %do.body.i78 %sub.i87 = sub nsw i32 0, %add.i83 br label %input.exit88 do.body4.i67: ; preds = %input.exit, %do.body4.i67 %z.1.i68 = phi i32 [ %add7.i72, %do.body4.i67 ], [ 0, %input.exit ] %j.1.i69 = phi i32 [ %call.i21.i73, %do.body4.i67 ], [ %call.i.i65, %input.exit ] %mul5.i70 = mul nsw i32 %z.1.i68, 10 %and6.i71 = and i32 %j.1.i69, 15 %add7.i72 = add nsw i32 %and6.i71, %mul5.i70 %7 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21.i73 = tail call i32 @getc(ptr noundef %7) %cmp10.i74 = icmp sgt i32 %call.i21.i73, 47 br i1 %cmp10.i74, label %do.body4.i67, label %input.exit88, !llvm.loop !11 input.exit88: ; preds = %do.body4.i67, %do.end.i86 %z.2.i75 = phi i32 [ %sub.i87, %do.end.i86 ], [ %add7.i72, %do.body4.i67 ] %bf.load2 = load i32, ptr @qeb, align 4 %bf.value3 = shl i32 %z.2.i75, 20 %bf.shl4 = and i32 %bf.value3, 1072693248 %bf.clear5 = and i32 %bf.load2, -1072693249 %bf.set6 = or i32 %bf.clear5, %bf.shl4 store i32 %bf.set6, ptr @qeb, align 4 %bf.clear8 = and i32 %bf.load2, 1047552 %bf.load9 = load i32, ptr @cnt, align 4 %bf.clear12 = and i32 %bf.load9, -1073740801 %bf.value18 = add i32 %bf.value3, 1072693248 %bf.shl19 = and i32 %bf.value18, 1072693248 %bf.set13 = or i32 %bf.shl19, %bf.clear8 %bf.set21 = or i32 %bf.set13, %bf.clear12 store i32 %bf.set21, ptr @cnt, align 4 %bf.clear24 = and i32 %z.2.i75, 1023 %bf.lshr26 = lshr i32 %bf.load2, 10 %bf.clear27 = and i32 %bf.lshr26, 1023 %sub28 = sub nsw i32 %bf.clear24, %bf.clear27 %div.lhs.trunc = trunc i32 %sub28 to i16 %div89 = sdiv i16 %div.lhs.trunc, 2 %div.sext = sext i16 %div89 to i32 %cmp91 = icmp sgt i16 %div.lhs.trunc, 1 br i1 %cmp91, label %for.body, label %for.cond.cleanup for.cond.for.cond.cleanup_crit_edge: ; preds = %for.body store i32 %8, ptr @z, align 4, !tbaa !12 store i32 %bf.set62, ptr @cnt, align 4 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.for.cond.cleanup_crit_edge, %input.exit88 ret i32 0 for.body: ; preds = %input.exit88, %for.body %k.093 = phi i32 [ %inc63, %for.body ], [ 0, %input.exit88 ] %bf.set629092 = phi i32 [ %bf.set62, %for.body ], [ %bf.set21, %input.exit88 ] %bf.lshr30 = lshr i32 %bf.set629092, 10 %bf.clear31 = and i32 %bf.lshr30, 1023 %idxprom = zext i32 %bf.clear31 to i64 %arrayidx = getelementptr inbounds [1000 x i32], ptr @Value, i64 0, i64 %idxprom %8 = load i32, ptr %arrayidx, align 4, !tbaa !12 %bf.lshr33 = lshr i32 %bf.set629092, 20 %bf.clear34 = and i32 %bf.lshr33, 1023 %idxprom35 = zext i32 %bf.clear34 to i64 %arrayidx36 = getelementptr inbounds [1000 x i32], ptr @Value, i64 0, i64 %idxprom35 %9 = load i32, ptr %arrayidx36, align 4, !tbaa !12 store i32 %9, ptr %arrayidx, align 4, !tbaa !12 store i32 %8, ptr %arrayidx36, align 4, !tbaa !12 %bf.value51 = add i32 %bf.set629092, 1072693248 %bf.shl52 = and i32 %bf.value51, 1072693248 %bf.clear53 = and i32 %bf.set629092, -1073740801 %bf.set54 = or i32 %bf.shl52, %bf.clear53 %bf.value59 = add i32 %bf.set629092, 1024 %bf.shl60 = and i32 %bf.value59, 1047552 %bf.set62 = or i32 %bf.set54, %bf.shl60 %inc63 = add nuw nsw i32 %k.093, 1 %exitcond.not = icmp eq i32 %inc63, %div.sext br i1 %exitcond.not, label %for.cond.for.cond.cleanup_crit_edge, label %for.body, !llvm.loop !20 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @input() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %cmp = icmp eq i32 %call.i, 45 br i1 %cmp, label %if.then, label %do.body4 if.then: ; preds = %entry %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i19 = tail call i32 @getc(ptr noundef %1) br label %do.body do.body: ; preds = %do.body, %if.then %z.0 = phi i32 [ 0, %if.then ], [ %add, %do.body ] %j.0 = phi i32 [ %call.i19, %if.then ], [ %call.i20, %do.body ] %mul = mul nsw i32 %z.0, 10 %and = and i32 %j.0, 15 %add = add nsw i32 %and, %mul %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i20 = tail call i32 @getc(ptr noundef %2) %cmp3 = icmp sgt i32 %call.i20, 47 br i1 %cmp3, label %do.body, label %do.end, !llvm.loop !9 do.end: ; preds = %do.body %sub = sub nsw i32 0, %add br label %if.end do.body4: ; preds = %entry, %do.body4 %z.1 = phi i32 [ %add7, %do.body4 ], [ 0, %entry ] %j.1 = phi i32 [ %call.i21, %do.body4 ], [ %call.i, %entry ] %mul5 = mul nsw i32 %z.1, 10 %and6 = and i32 %j.1, 15 %add7 = add nsw i32 %and6, %mul5 %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21 = tail call i32 @getc(ptr noundef %3) %cmp10 = icmp sgt i32 %call.i21, 47 br i1 %cmp10, label %do.body4, label %if.end, !llvm.loop !11 if.end: ; preds = %do.body4, %do.end %z.2 = phi i32 [ %sub, %do.end ], [ %add7, %do.body4 ] ret i32 %z.2 } ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, !10} !12 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> int main(){ int n; scanf("%d",&n); int a[n]; for (int i = 0; i < n; i++) { scanf("%d",&a[i]); } if (n%2==0) { for (int i = n-1; i > 0; i-=2) { printf("%d ",a[i]); } for (int i = 0; i < n; i+=2) { printf("%d ",a[i]); } }else{ for (int i = n-1; i >= 0; i-=2) { printf("%d ",a[i]); } for (int i = 1; i < n; i+=2) { printf("%d ",a[i]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153666/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153666/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp58 = icmp sgt i32 %3, 0 br i1 %cmp58, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %5, %for.body ] %4 = and i32 %.lcssa, 1 %cmp2 = icmp eq i32 %4, 0 br i1 %cmp2, label %if.then, label %if.else for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 if.then: ; preds = %for.cond.cleanup %cmp564 = icmp sgt i32 %.lcssa, 1 br i1 %cmp564, label %for.body7.preheader, label %for.cond15.preheader for.body7.preheader: ; preds = %if.then %sub = add nsw i32 %.lcssa, -1 br label %for.body7 for.cond15.preheader.loopexit: ; preds = %for.body7 %.pre77 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %if.then %7 = phi i32 [ %.pre77, %for.cond15.preheader.loopexit ], [ %.lcssa, %if.then ] %cmp1666 = icmp sgt i32 %7, 0 br i1 %cmp1666, label %for.body18, label %if.end for.body7: ; preds = %for.body7.preheader, %for.body7 %i3.065 = phi i32 [ %sub12, %for.body7 ], [ %sub, %for.body7.preheader ] %idxprom8 = zext i32 %i3.065 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8 %8 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8) %sub12 = add nsw i32 %i3.065, -2 %cmp5 = icmp ugt i32 %i3.065, 2 br i1 %cmp5, label %for.body7, label %for.cond15.preheader.loopexit, !llvm.loop !11 for.body18: ; preds = %for.cond15.preheader, %for.body18 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body18 ], [ 0, %for.cond15.preheader ] %arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv74 %9 = load i32, ptr %arrayidx20, align 8, !tbaa !5 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next75 = add nuw i64 %indvars.iv74, 2 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next75 to i32 %cmp16 = icmp sgt i32 %10, %11 br i1 %cmp16, label %for.body18, label %if.end, !llvm.loop !12 if.else: ; preds = %for.cond.cleanup %cmp2760 = icmp sgt i32 %.lcssa, 0 br i1 %cmp2760, label %for.body29.preheader, label %if.end for.body29.preheader: ; preds = %if.else %sub25 = add nsw i32 %.lcssa, -1 br label %for.body29 for.cond37.preheader: ; preds = %for.body29 %.pre = load i32, ptr %n, align 4, !tbaa !5 %12 = icmp sgt i32 %.pre, 1 br i1 %12, label %for.body40, label %if.end for.body29: ; preds = %for.body29.preheader, %for.body29 %i24.061 = phi i32 [ %sub34, %for.body29 ], [ %sub25, %for.body29.preheader ] %idxprom30 = zext i32 %i24.061 to i64 %arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30 %13 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13) %sub34 = add nsw i32 %i24.061, -2 %cmp27 = icmp ugt i32 %i24.061, 1 br i1 %cmp27, label %for.body29, label %for.cond37.preheader, !llvm.loop !13 for.body40: ; preds = %for.cond37.preheader, %for.body40 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body40 ], [ 1, %for.cond37.preheader ] %arrayidx42 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv71 %14 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next72 = add nuw i64 %indvars.iv71, 2 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = trunc i64 %indvars.iv.next72 to i32 %cmp38 = icmp sgt i32 %15, %16 br i1 %cmp38, label %for.body40, label %if.end, !llvm.loop !14 if.end: ; preds = %for.body40, %for.body18, %if.else, %for.cond37.preheader, %for.cond15.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> long long a[200000],b[200000],temp; int main() { int n,i,j; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); if(n%2==0) { for(i=0,j=n/2;i<n;i+=2,j++) { b[j]=a[i]; } for(i=n-1,j=0;i>0;i-=2,j++) { b[j]=a[i]; } for(i=0;i<n;i++) printf("%lld ",b[i]); } else { for(i=0,j=(n-1)/2;i<n-1;i+=2,j++) { b[j]=a[i]; } for(i=n-2,j=0;i>0;i-=2,j++) { b[j]=a[i]; } b[n-1]=a[n-1]; for(i=n-1;i>=0;i--) printf("%lld ",b[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153709/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153709/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [200000 x i64] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1 @temp = dso_local local_unnamed_addr global i64 0, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp103 = icmp sgt i32 %0, 0 br i1 %cmp103, 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 [200000 x i64], 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 !9 for.end: ; preds = %for.body, %entry %3 = phi i32 [ %0, %entry ], [ %1, %for.body ] %4 = and i32 %3, 1 %cmp2 = icmp eq i32 %4, 0 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.end %cmp4113 = icmp sgt i32 %3, 0 br i1 %cmp4113, label %for.body5.preheader, label %if.end for.body5.preheader: ; preds = %if.then %div155159 = lshr i32 %3, 1 %5 = zext i32 %div155159 to i64 %6 = zext i32 %3 to i64 %min.iters.check168 = icmp ult i32 %3, 9 br i1 %min.iters.check168, label %for.body5.preheader185, label %vector.ph169 vector.ph169: ; preds = %for.body5.preheader %7 = add nsw i64 %6, -1 %8 = lshr i64 %7, 1 %9 = add nuw i64 %8, 1 %n.mod.vf170 = and i64 %9, 3 %10 = icmp eq i64 %n.mod.vf170, 0 %11 = select i1 %10, i64 4, i64 %n.mod.vf170 %n.vec171 = sub i64 %9, %11 %ind.end172 = shl i64 %n.vec171, 1 %ind.end174 = add i64 %n.vec171, %5 br label %vector.body176 vector.body176: ; preds = %vector.body176, %vector.ph169 %index177 = phi i64 [ 0, %vector.ph169 ], [ %index.next184, %vector.body176 ] %offset.idx178 = add i64 %index177, %5 %offset.idx179 = shl i64 %index177, 1 %12 = or i64 %offset.idx179, 4 %13 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %offset.idx179 %14 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %12 %wide.vec180 = load <4 x i64>, ptr %13, align 16, !tbaa !11 %wide.vec181 = load <4 x i64>, ptr %14, align 16, !tbaa !11 %strided.vec182 = shufflevector <4 x i64> %wide.vec180, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec183 = shufflevector <4 x i64> %wide.vec181, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %15 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %offset.idx178 store <2 x i64> %strided.vec182, ptr %15, align 8, !tbaa !11 %16 = getelementptr inbounds i64, ptr %15, i64 2 store <2 x i64> %strided.vec183, ptr %16, align 8, !tbaa !11 %index.next184 = add nuw i64 %index177, 4 %17 = icmp eq i64 %index.next184, %n.vec171 br i1 %17, label %for.body5.preheader185, label %vector.body176, !llvm.loop !13 for.body5.preheader185: ; preds = %vector.body176, %for.body5.preheader %indvars.iv139.ph = phi i64 [ 0, %for.body5.preheader ], [ %ind.end172, %vector.body176 ] %indvars.iv137.ph = phi i64 [ %5, %for.body5.preheader ], [ %ind.end174, %vector.body176 ] br label %for.body5 for.body5: ; preds = %for.body5.preheader185, %for.body5 %indvars.iv139 = phi i64 [ %indvars.iv.next140, %for.body5 ], [ %indvars.iv139.ph, %for.body5.preheader185 ] %indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.body5 ], [ %indvars.iv137.ph, %for.body5.preheader185 ] %arrayidx7 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %indvars.iv139 %18 = load i64, ptr %arrayidx7, align 16, !tbaa !11 %arrayidx9 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv137 store i64 %18, ptr %arrayidx9, align 8, !tbaa !11 %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 2 %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %cmp4 = icmp ult i64 %indvars.iv.next140, %6 br i1 %cmp4, label %for.body5, label %for.end12, !llvm.loop !16 for.end12: ; preds = %for.body5 %cmp14116 = icmp sgt i32 %3, 1 br i1 %cmp14116, label %for.body15.preheader, label %for.cond24.preheader for.body15.preheader: ; preds = %for.end12 %sub = add nsw i32 %3, -1 br label %for.body15 for.cond24.preheader: ; preds = %for.body15, %for.end12 br i1 %cmp4113, label %for.body26, label %if.end for.body15: ; preds = %for.body15.preheader, %for.body15 %indvars.iv145 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next146, %for.body15 ] %i.2117 = phi i32 [ %sub, %for.body15.preheader ], [ %sub21, %for.body15 ] %idxprom16 = zext i32 %i.2117 to i64 %arrayidx17 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %idxprom16 %19 = load i64, ptr %arrayidx17, align 8, !tbaa !11 %arrayidx19 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv145 store i64 %19, ptr %arrayidx19, align 8, !tbaa !11 %sub21 = add nsw i32 %i.2117, -2 %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %cmp14 = icmp ugt i32 %i.2117, 2 br i1 %cmp14, label %for.body15, label %for.cond24.preheader, !llvm.loop !17 for.body26: ; preds = %for.cond24.preheader, %for.body26 %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body26 ], [ 0, %for.cond24.preheader ] %arrayidx28 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv149 %20 = load i64, ptr %arrayidx28, align 8, !tbaa !11 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %20) %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp25 = icmp slt i64 %indvars.iv.next150, %22 br i1 %cmp25, label %for.body26, label %if.end, !llvm.loop !18 if.else: ; preds = %for.end %sub33 = add nsw i32 %3, -1 %cmp37105 = icmp sgt i32 %3, 1 br i1 %cmp37105, label %for.body38.preheader, label %for.end58 for.body38.preheader: ; preds = %if.else %div34156158 = lshr i32 %sub33, 1 %23 = zext i32 %div34156158 to i64 %24 = zext i32 %sub33 to i64 %min.iters.check = icmp ult i32 %3, 10 br i1 %min.iters.check, label %for.body38.preheader187, label %vector.ph for.body38.preheader187: ; preds = %vector.body, %for.body38.preheader %indvars.iv126.ph = phi i64 [ 0, %for.body38.preheader ], [ %ind.end, %vector.body ] %indvars.iv124.ph = phi i64 [ %23, %for.body38.preheader ], [ %ind.end161, %vector.body ] br label %for.body38 vector.ph: ; preds = %for.body38.preheader %25 = add nsw i64 %24, -1 %26 = lshr i64 %25, 1 %27 = add nuw nsw i64 %26, 1 %n.mod.vf = and i64 %27, 3 %28 = icmp eq i64 %n.mod.vf, 0 %29 = select i1 %28, i64 4, i64 %n.mod.vf %n.vec = sub nsw i64 %27, %29 %ind.end = shl i64 %n.vec, 1 %ind.end161 = add i64 %n.vec, %23 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %23 %offset.idx163 = shl i64 %index, 1 %30 = or i64 %offset.idx163, 4 %31 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %offset.idx163 %32 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %30 %wide.vec = load <4 x i64>, ptr %31, align 16, !tbaa !11 %wide.vec164 = load <4 x i64>, ptr %32, align 16, !tbaa !11 %strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec165 = shufflevector <4 x i64> %wide.vec164, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %33 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %offset.idx store <2 x i64> %strided.vec, ptr %33, align 8, !tbaa !11 %34 = getelementptr inbounds i64, ptr %33, i64 2 store <2 x i64> %strided.vec165, ptr %34, align 8, !tbaa !11 %index.next = add nuw i64 %index, 4 %35 = icmp eq i64 %index.next, %n.vec br i1 %35, label %for.body38.preheader187, label %vector.body, !llvm.loop !19 for.cond48.preheader: ; preds = %for.body38 %cmp49108 = icmp sgt i32 %3, 2 br i1 %cmp49108, label %for.body50, label %for.end58 for.body38: ; preds = %for.body38.preheader187, %for.body38 %indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body38 ], [ %indvars.iv126.ph, %for.body38.preheader187 ] %indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.body38 ], [ %indvars.iv124.ph, %for.body38.preheader187 ] %arrayidx40 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %indvars.iv126 %36 = load i64, ptr %arrayidx40, align 16, !tbaa !11 %arrayidx42 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv124 store i64 %36, ptr %arrayidx42, align 8, !tbaa !11 %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 2 %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1 %cmp37 = icmp ult i64 %indvars.iv.next127, %24 br i1 %cmp37, label %for.body38, label %for.cond48.preheader, !llvm.loop !20 for.body50: ; preds = %for.cond48.preheader, %for.body50 %indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.body50 ], [ 0, %for.cond48.preheader ] %i.5.in109 = phi i32 [ %i.5, %for.body50 ], [ %3, %for.cond48.preheader ] %i.5 = add nsw i32 %i.5.in109, -2 %idxprom51 = zext i32 %i.5 to i64 %arrayidx52 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %idxprom51 %37 = load i64, ptr %arrayidx52, align 8, !tbaa !11 %arrayidx54 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %indvars.iv131 store i64 %37, ptr %arrayidx54, align 8, !tbaa !11 %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %cmp49 = icmp ugt i32 %i.5.in109, 4 br i1 %cmp49, label %for.body50, label %for.end58, !llvm.loop !21 for.end58: ; preds = %for.body50, %if.else, %for.cond48.preheader %idxprom60 = sext i32 %sub33 to i64 %arrayidx61 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %idxprom60 %38 = load i64, ptr %arrayidx61, align 8, !tbaa !11 %arrayidx64 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %idxprom60 store i64 %38, ptr %arrayidx64, align 8, !tbaa !11 %cmp67111 = icmp sgt i32 %3, 0 br i1 %cmp67111, label %for.body68.preheader, label %if.end for.body68.preheader: ; preds = %for.end58 %39 = zext i32 %3 to i64 br label %for.body68 for.body68: ; preds = %for.body68.preheader, %for.body68 %indvars.iv134 = phi i64 [ %39, %for.body68.preheader ], [ %indvars.iv.next135, %for.body68 ] %indvars.iv.next135 = add nsw i64 %indvars.iv134, -1 %idxprom69 = and i64 %indvars.iv.next135, 4294967295 %arrayidx70 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %idxprom69 %40 = load i64, ptr %arrayidx70, align 8, !tbaa !11 %call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %40) %cmp67 = icmp ugt i64 %indvars.iv134, 1 br i1 %cmp67, label %for.body68, label %if.end, !llvm.loop !22 if.end: ; preds = %for.body68, %for.body26, %if.then, %for.end58, %for.cond24.preheader 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 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !14, !15} !20 = distinct !{!20, !10, !15, !14} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#include<stdio.h> int main() { int n,i,q,p; scanf("%d",&n); int a[n],b[n]; p=0,q=n-1; for(i=0;i<n;i++) { scanf(" %d",&a[i]); } for(i=q;i>=0;i--) { if(n%2) { if(i%2==0) b[p++]=a[i]; else b[q--]=a[i];} else { if(i%2) b[p++]=a[i]; else b[q--]=a[i]; } } for(i=0;i<n;i++) { printf("%d ",b[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153752/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153752/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \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 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %sub = add i32 %3, -1 %cmp63 = icmp sgt i32 %3, 0 br i1 %cmp63, label %for.body, label %for.end46 for.cond3.preheader: ; preds = %for.body br i1 %cmp63, label %for.body5.lr.ph, label %for.cond38.preheader for.body5.lr.ph: ; preds = %for.cond3.preheader %5 = and i32 %17, 1 %tobool.not = icmp eq i32 %5, 0 %6 = zext i32 %sub to i64 br i1 %tobool.not, label %for.body5.us.preheader, label %for.body5.preheader for.body5.preheader: ; preds = %for.body5.lr.ph %7 = zext i32 %3 to i64 %xtraiter = and i64 %7, 1 %8 = icmp eq i32 %sub, 0 br i1 %8, label %for.cond38.preheader.loopexit88.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %7, 4294967294 %9 = and i32 %3, 1 %.not.not = icmp eq i32 %9, 0 %dec = sext i1 %.not.not to i32 %cmp7.1 = icmp eq i64 %xtraiter, 0 %invariant.gep = getelementptr i32, ptr %vla, i64 -1 %inc11.1 = zext i1 %cmp7.1 to i32 %not.cmp7.1 = xor i1 %cmp7.1, true %dec.1 = sext i1 %not.cmp7.1 to i32 br label %for.body5 for.body5.us.preheader: ; preds = %for.body5.lr.ph %10 = zext i32 %3 to i64 %xtraiter89 = and i64 %10, 1 %11 = icmp eq i32 %sub, 0 br i1 %11, label %for.cond38.preheader.loopexit.unr-lcssa, label %for.body5.us.preheader.new for.body5.us.preheader.new: ; preds = %for.body5.us.preheader %unroll_iter91 = and i64 %10, 4294967294 %12 = and i32 %3, 1 %.not = icmp eq i32 %12, 0 %tobool20.not.us = xor i1 %.not, true %13 = xor i32 %12, 1 %dec30.us = sext i1 %tobool20.not.us to i32 %tobool20.not.us.1 = icmp eq i64 %xtraiter89, 0 %invariant.gep93 = getelementptr i32, ptr %vla, i64 -1 %14 = trunc i64 %xtraiter89 to i32 %dec30.us.1 = sext i1 %tobool20.not.us.1 to i32 br label %for.body5.us for.body5.us: ; preds = %for.body5.us, %for.body5.us.preheader.new %indvars.iv77 = phi i64 [ %6, %for.body5.us.preheader.new ], [ %indvars.iv.next78.1, %for.body5.us ] %q.067.us = phi i32 [ %sub, %for.body5.us.preheader.new ], [ %q.1.us.1, %for.body5.us ] %p.066.us = phi i32 [ 0, %for.body5.us.preheader.new ], [ %p.1.us.1, %for.body5.us ] %niter92 = phi i64 [ 0, %for.body5.us.preheader.new ], [ %niter92.next.1, %for.body5.us ] %arrayidx29.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77 %15 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %q.067.us.sink = select i1 %.not, i32 %p.066.us, i32 %q.067.us %p.1.us = add i32 %p.066.us, %13 %q.1.us = add nsw i32 %q.067.us, %dec30.us %idxprom31.us = sext i32 %q.067.us.sink to i64 %arrayidx32.us = getelementptr inbounds i32, ptr %vla1, i64 %idxprom31.us store i32 %15, ptr %arrayidx32.us, align 4, !tbaa !5 %gep94 = getelementptr i32, ptr %invariant.gep93, i64 %indvars.iv77 %16 = load i32, ptr %gep94, align 4, !tbaa !5 %q.067.us.sink.1 = select i1 %tobool20.not.us.1, i32 %q.1.us, i32 %p.1.us %p.1.us.1 = add i32 %p.1.us, %14 %q.1.us.1 = add nsw i32 %q.1.us, %dec30.us.1 %idxprom31.us.1 = sext i32 %q.067.us.sink.1 to i64 %arrayidx32.us.1 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom31.us.1 store i32 %16, ptr %arrayidx32.us.1, align 4, !tbaa !5 %indvars.iv.next78.1 = add nsw i64 %indvars.iv77, -2 %niter92.next.1 = add i64 %niter92, 2 %niter92.ncmp.1.not = icmp eq i64 %niter92.next.1, %unroll_iter91 br i1 %niter92.ncmp.1.not, label %for.cond38.preheader.loopexit.unr-lcssa, label %for.body5.us, !llvm.loop !9 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.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !11 for.cond38.preheader.loopexit.unr-lcssa: ; preds = %for.body5.us, %for.body5.us.preheader %indvars.iv77.unr = phi i64 [ %6, %for.body5.us.preheader ], [ %indvars.iv.next78.1, %for.body5.us ] %q.067.us.unr = phi i32 [ %sub, %for.body5.us.preheader ], [ %q.1.us.1, %for.body5.us ] %p.066.us.unr = phi i32 [ 0, %for.body5.us.preheader ], [ %p.1.us.1, %for.body5.us ] %lcmp.mod90.not = icmp eq i64 %xtraiter89, 0 br i1 %lcmp.mod90.not, label %for.cond38.preheader, label %for.body5.us.epil for.body5.us.epil: ; preds = %for.cond38.preheader.loopexit.unr-lcssa %rem19.us84.epil = and i64 %indvars.iv77.unr, 1 %tobool20.not.us.epil = icmp eq i64 %rem19.us84.epil, 0 %arrayidx29.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77.unr %19 = load i32, ptr %arrayidx29.us.epil, align 4, !tbaa !5 %q.067.us.sink.epil = select i1 %tobool20.not.us.epil, i32 %q.067.us.unr, i32 %p.066.us.unr %idxprom31.us.epil = sext i32 %q.067.us.sink.epil to i64 %arrayidx32.us.epil = getelementptr inbounds i32, ptr %vla1, i64 %idxprom31.us.epil store i32 %19, ptr %arrayidx32.us.epil, align 4, !tbaa !5 br label %for.cond38.preheader for.cond38.preheader.loopexit88.unr-lcssa: ; preds = %for.body5, %for.body5.preheader %indvars.iv74.unr = phi i64 [ %6, %for.body5.preheader ], [ %indvars.iv.next75.1, %for.body5 ] %q.067.unr = phi i32 [ %sub, %for.body5.preheader ], [ %q.1.1, %for.body5 ] %p.066.unr = phi i32 [ 0, %for.body5.preheader ], [ %p.1.1, %for.body5 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond38.preheader, label %for.body5.epil for.body5.epil: ; preds = %for.cond38.preheader.loopexit88.unr-lcssa %rem683.epil = and i64 %indvars.iv74.unr, 1 %cmp7.epil = icmp eq i64 %rem683.epil, 0 %arrayidx10.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv74.unr %20 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %q.067.sink.epil = select i1 %cmp7.epil, i32 %p.066.unr, i32 %q.067.unr %idxprom16.epil = sext i32 %q.067.sink.epil to i64 %arrayidx17.epil = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16.epil store i32 %20, ptr %arrayidx17.epil, align 4, !tbaa !5 br label %for.cond38.preheader for.cond38.preheader: ; preds = %for.body5.epil, %for.cond38.preheader.loopexit88.unr-lcssa, %for.body5.us.epil, %for.cond38.preheader.loopexit.unr-lcssa, %for.cond3.preheader %cmp3969 = icmp sgt i32 %17, 0 br i1 %cmp3969, label %for.body40, label %for.end46 for.body5: ; preds = %for.body5, %for.body5.preheader.new %indvars.iv74 = phi i64 [ %6, %for.body5.preheader.new ], [ %indvars.iv.next75.1, %for.body5 ] %q.067 = phi i32 [ %sub, %for.body5.preheader.new ], [ %q.1.1, %for.body5 ] %p.066 = phi i32 [ 0, %for.body5.preheader.new ], [ %p.1.1, %for.body5 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ] %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv74 %21 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %q.067.sink = select i1 %.not.not, i32 %q.067, i32 %p.066 %p.1 = add nuw nsw i32 %p.066, %9 %q.1 = add nsw i32 %q.067, %dec %idxprom16 = sext i32 %q.067.sink to i64 %arrayidx17 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16 store i32 %21, ptr %arrayidx17, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv74 %22 = load i32, ptr %gep, align 4, !tbaa !5 %q.067.sink.1 = select i1 %cmp7.1, i32 %p.1, i32 %q.1 %p.1.1 = add nuw nsw i32 %p.1, %inc11.1 %q.1.1 = add nsw i32 %q.1, %dec.1 %idxprom16.1 = sext i32 %q.067.sink.1 to i64 %arrayidx17.1 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom16.1 store i32 %22, ptr %arrayidx17.1, align 4, !tbaa !5 %indvars.iv.next75.1 = add nsw i64 %indvars.iv74, -2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.cond38.preheader.loopexit88.unr-lcssa, label %for.body5, !llvm.loop !9 for.body40: ; preds = %for.cond38.preheader, %for.body40 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body40 ], [ 0, %for.cond38.preheader ] %arrayidx42 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv80 %23 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp39 = icmp slt i64 %indvars.iv.next81, %25 br i1 %cmp39, label %for.body40, label %for.end46, !llvm.loop !12 for.end46: ; preds = %for.body40, %entry, %for.cond38.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} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <math.h> int main(void) { int n; scanf("%d\n",&n); int a[n]; int b[n]; int i; for (i=0;i<n;i++){ scanf("%d ",&a[i]); b[i]=-1; } int j=0; for (i=n-1;i>=0;i-=2){ b[j]=a[i]; j++; } if ((n%2)==0)i=0; else i=1; for (;i<=n-1;i+=2){ b[j]=a[i]; j++; } for (i=0;i<n;i++){ if (i!=0)printf(" "); printf("%d",b[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153796/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153796/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %cmp59 = icmp sgt i32 %3, 0 br i1 %cmp59, label %for.body, label %for.end40 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.1, ptr noundef nonnull %arrayidx) %arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv store i32 -1, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp661 = icmp sgt i32 %5, 0 br i1 %cmp661, label %for.body7.preheader, label %for.end40 for.body7.preheader: ; preds = %for.end %sub = add nsw i32 %5, -1 br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv72 = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next73, %for.body7 ] %i.162 = phi i32 [ %sub, %for.body7.preheader ], [ %sub14, %for.body7 ] %idxprom8 = zext i32 %i.162 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv72 store i32 %7, ptr %arrayidx11, align 4, !tbaa !5 %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %sub14 = add nsw i32 %i.162, -2 %cmp6 = icmp ugt i32 %i.162, 1 br i1 %cmp6, label %for.body7, label %for.end15, !llvm.loop !11 for.end15: ; preds = %for.body7 %cmp19.not.not65 = icmp sgt i32 %5, 1 br i1 %cmp19.not.not65, label %for.body20.preheader, label %for.cond28.preheader for.body20.preheader: ; preds = %for.end15 %8 = and i64 %indvars.iv.next73, 4294967295 %9 = and i32 %5, 1 %10 = zext i32 %9 to i64 %11 = zext i32 %5 to i64 %12 = or i64 %10, 2 %umax = call i64 @llvm.umax.i64(i64 %12, i64 %11) %13 = xor i64 %10, -1 %14 = add nsw i64 %umax, %13 %min.iters.check = icmp ult i64 %14, 16 br i1 %min.iters.check, label %for.body20.preheader98, label %vector.ph for.body20.preheader98: ; preds = %vector.body, %for.body20.preheader %indvars.iv77.ph = phi i64 [ %10, %for.body20.preheader ], [ %ind.end, %vector.body ] %indvars.iv75.ph = phi i64 [ %8, %for.body20.preheader ], [ %ind.end93, %vector.body ] br label %for.body20 vector.ph: ; preds = %for.body20.preheader %15 = lshr i64 %14, 1 %16 = add nuw nsw i64 %15, 1 %n.mod.vf = and i64 %16, 7 %17 = icmp eq i64 %n.mod.vf, 0 %18 = select i1 %17, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %16, %18 %19 = shl i64 %n.vec, 1 %ind.end = or i64 %19, %10 %ind.end93 = add i64 %8, %n.vec %20 = getelementptr i32, ptr %vla1, i64 %8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %21 = shl i64 %index, 1 %offset.idx95 = or i64 %21, %10 %22 = or i64 %offset.idx95, 8 %23 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx95 %24 = getelementptr inbounds i32, ptr %vla, i64 %22 %wide.vec = load <8 x i32>, ptr %23, align 4, !tbaa !5 %wide.vec96 = load <8 x i32>, ptr %24, align 4, !tbaa !5 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec97 = shufflevector <8 x i32> %wide.vec96, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %25 = getelementptr i32, ptr %20, i64 %index store <4 x i32> %strided.vec, ptr %25, align 4, !tbaa !5 %26 = getelementptr inbounds i32, ptr %25, i64 4 store <4 x i32> %strided.vec97, ptr %26, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %27 = icmp eq i64 %index.next, %n.vec br i1 %27, label %for.body20.preheader98, label %vector.body, !llvm.loop !12 for.cond28.preheader: ; preds = %for.body20, %for.end15 br i1 %cmp661, label %if.end34.peel, label %for.end40 if.end34.peel: ; preds = %for.cond28.preheader %28 = load i32, ptr %vla1, align 16, !tbaa !5 %call37.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %28) %29 = load i32, ptr %n, align 4, !tbaa !5 %cmp29.peel = icmp sgt i32 %29, 1 br i1 %cmp29.peel, label %if.end34, label %for.end40 for.body20: ; preds = %for.body20.preheader98, %for.body20 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body20 ], [ %indvars.iv77.ph, %for.body20.preheader98 ] %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body20 ], [ %indvars.iv75.ph, %for.body20.preheader98 ] %arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77 %30 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %arrayidx24 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv75 store i32 %30, ptr %arrayidx24, align 4, !tbaa !5 %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 2 %cmp19.not.not = icmp ult i64 %indvars.iv.next78, %11 br i1 %cmp19.not.not, label %for.body20, label %for.cond28.preheader, !llvm.loop !15 if.end34: ; preds = %if.end34.peel, %if.end34 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %if.end34 ], [ 1, %if.end34.peel ] %putchar58 = call i32 @putchar(i32 32) %arrayidx36 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv82 %31 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %31) %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %32 = load i32, ptr %n, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp29 = icmp slt i64 %indvars.iv.next83, %33 br i1 %cmp29, label %if.end34, label %for.end40, !llvm.loop !16 for.end40: ; preds = %if.end34, %for.end, %entry, %if.end34.peel, %for.cond28.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 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 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } 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} !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, !17} !17 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main(void){ int n,i,j,d1,d2,temp,max; int ind[10001]; int dist[10001]; while(scanf("%d",&n)){ if(n==0) break; for(i=0;i<n;i++){ scanf("%d %d %d",&ind[i],&d1,&d2); dist[i] = d1+d2; } temp = 0; for(i=0;i<n;i++){ if(temp<dist[i]){ temp=dist[i]; max = i; } } printf("%d %d\n",ind[max],dist[max]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153839/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153839/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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 %d1 = alloca i32, align 4 %d2 = alloca i32, align 4 %ind = alloca [10001 x i32], align 16 %dist = alloca [10001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %ind) #4 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %dist) #4 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool41 = icmp eq i32 %call40, 0 %0 = load i32, ptr %n, align 4 %cmp42 = icmp eq i32 %0, 0 %or.cond43 = select i1 %tobool41, i1 true, i1 %cmp42 br i1 %or.cond43, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end17 %1 = phi i32 [ %19, %for.end17 ], [ %0, %entry ] %max.044 = phi i32 [ %max.1.lcssa, %for.end17 ], [ undef, %entry ] %cmp133 = icmp sgt i32 %1, 0 br i1 %cmp133, label %for.body, label %for.end17 for.cond5.preheader: ; preds = %for.body %cmp635 = icmp sgt i32 %5, 0 br i1 %cmp635, label %for.body7.preheader, label %for.end17 for.body7.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %5 to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %5, 4 br i1 %2, label %for.end17.loopexit.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body7 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [10001 x i32], ptr %ind, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %d1, ptr noundef nonnull %d2) %3 = load i32, ptr %d1, align 4, !tbaa !5 %4 = load i32, ptr %d2, align 4, !tbaa !5 %add = add nsw i32 %4, %3 %arrayidx4 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp1, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.body7: ; preds = %for.body7, %for.body7.preheader.new %indvars.iv47 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next48.3, %for.body7 ] %max.138 = phi i32 [ %max.044, %for.body7.preheader.new ], [ %spec.select32.3, %for.body7 ] %temp.037 = phi i32 [ 0, %for.body7.preheader.new ], [ %spec.select.3, %for.body7 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ] %arrayidx9 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv47 %7 = load i32, ptr %arrayidx9, align 16, !tbaa !5 %cmp10 = icmp slt i32 %temp.037, %7 %spec.select = call i32 @llvm.smax.i32(i32 %temp.037, i32 %7) %8 = trunc i64 %indvars.iv47 to i32 %spec.select32 = select i1 %cmp10, i32 %8, i32 %max.138 %indvars.iv.next48 = or i64 %indvars.iv47, 1 %arrayidx9.1 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv.next48 %9 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %cmp10.1 = icmp slt i32 %spec.select, %9 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %9) %10 = trunc i64 %indvars.iv.next48 to i32 %spec.select32.1 = select i1 %cmp10.1, i32 %10, i32 %spec.select32 %indvars.iv.next48.1 = or i64 %indvars.iv47, 2 %arrayidx9.2 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv.next48.1 %11 = load i32, ptr %arrayidx9.2, align 8, !tbaa !5 %cmp10.2 = icmp slt i32 %spec.select.1, %11 %spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %11) %12 = trunc i64 %indvars.iv.next48.1 to i32 %spec.select32.2 = select i1 %cmp10.2, i32 %12, i32 %spec.select32.1 %indvars.iv.next48.2 = or i64 %indvars.iv47, 3 %arrayidx9.3 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv.next48.2 %13 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5 %cmp10.3 = icmp slt i32 %spec.select.2, %13 %spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %13) %14 = trunc i64 %indvars.iv.next48.2 to i32 %spec.select32.3 = select i1 %cmp10.3, i32 %14, i32 %spec.select32.2 %indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end17.loopexit.unr-lcssa, label %for.body7, !llvm.loop !11 for.end17.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader %spec.select32.lcssa.ph = phi i32 [ undef, %for.body7.preheader ], [ %spec.select32.3, %for.body7 ] %indvars.iv47.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next48.3, %for.body7 ] %max.138.unr = phi i32 [ %max.044, %for.body7.preheader ], [ %spec.select32.3, %for.body7 ] %temp.037.unr = phi i32 [ 0, %for.body7.preheader ], [ %spec.select.3, %for.body7 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end17, label %for.body7.epil for.body7.epil: ; preds = %for.end17.loopexit.unr-lcssa, %for.body7.epil %indvars.iv47.epil = phi i64 [ %indvars.iv.next48.epil, %for.body7.epil ], [ %indvars.iv47.unr, %for.end17.loopexit.unr-lcssa ] %max.138.epil = phi i32 [ %spec.select32.epil, %for.body7.epil ], [ %max.138.unr, %for.end17.loopexit.unr-lcssa ] %temp.037.epil = phi i32 [ %spec.select.epil, %for.body7.epil ], [ %temp.037.unr, %for.end17.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.end17.loopexit.unr-lcssa ] %arrayidx9.epil = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %indvars.iv47.epil %15 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5 %cmp10.epil = icmp slt i32 %temp.037.epil, %15 %spec.select.epil = call i32 @llvm.smax.i32(i32 %temp.037.epil, i32 %15) %16 = trunc i64 %indvars.iv47.epil to i32 %spec.select32.epil = select i1 %cmp10.epil, i32 %16, i32 %max.138.epil %indvars.iv.next48.epil = add nuw nsw i64 %indvars.iv47.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end17, label %for.body7.epil, !llvm.loop !12 for.end17: ; preds = %for.end17.loopexit.unr-lcssa, %for.body7.epil, %for.cond.preheader, %for.cond5.preheader %max.1.lcssa = phi i32 [ %max.044, %for.cond5.preheader ], [ %max.044, %for.cond.preheader ], [ %spec.select32.lcssa.ph, %for.end17.loopexit.unr-lcssa ], [ %spec.select32.epil, %for.body7.epil ] %idxprom18 = sext i32 %max.1.lcssa to i64 %arrayidx19 = getelementptr inbounds [10001 x i32], ptr %ind, i64 0, i64 %idxprom18 %17 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx21 = getelementptr inbounds [10001 x i32], ptr %dist, i64 0, i64 %idxprom18 %18 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17, i32 noundef %18) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool = icmp eq i32 %call, 0 %19 = load i32, ptr %n, align 4 %cmp = icmp eq i32 %19, 0 %or.cond = select i1 %tobool, i1 true, i1 %cmp br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !14 while.end: ; preds = %for.end17, %entry call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %dist) #4 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %ind) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10}
#include<stdio.h> int main(){ int n,m,f[310],d[310][310],r[310],i,j,mi,min=310; scanf("%d %d",&n,&m); for(i=0;i<n;i++){ for(j=r[i]=0;j<m;j++)scanf("%d",&d[i][j]); } for(i=0;i<m;i++){ int c[310]={}; for(j=0;j<n;j++){ while(f[d[j][r[j]]])r[j]++; c[d[j][r[j]]]++; } for(j=mi=1;j<305;j++){ if(c[mi]<c[j])mi=j; } if(min>c[mi])min=c[mi]; f[mi]=1; } printf("%d\n",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153897/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %f = alloca [310 x i32], align 16 %d = alloca [310 x [310 x i32]], align 16 %r = alloca [310 x i32], align 16 %c = alloca [310 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 1240, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 384400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 1240, ptr nonnull %r) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp90 = icmp sgt i32 %0, 0 %.pre126 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp90, label %for.body.lr.ph, label %for.cond12.preheader for.body.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre126, 0 br i1 %1, label %for.body, label %for.end63 for.cond12.preheader: ; preds = %for.inc9, %entry %2 = phi i32 [ %.pre126, %entry ], [ %26, %for.inc9 ] %.lcssa = phi i32 [ %0, %entry ], [ %25, %for.inc9 ] %cmp1397 = icmp sgt i32 %2, 0 br i1 %cmp1397, label %for.body14.lr.ph, label %for.end63 for.body14.lr.ph: ; preds = %for.cond12.preheader %cmp1693 = icmp sgt i32 %.lcssa, 0 br i1 %cmp1693, label %for.body14.us.preheader, label %for.body14 for.body14.us.preheader: ; preds = %for.body14.lr.ph %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.end51.us %min.099.us = phi i32 [ %spec.select87.us, %for.end51.us ], [ 310, %for.body14.us.preheader ] %i.198.us = phi i32 [ %inc62.us, %for.end51.us ], [ 0, %for.body14.us.preheader ] call void @llvm.lifetime.start.p0(i64 1240, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1240) %c, i8 0, i64 1240, i1 false) br label %while.cond.preheader.us for.end51.us: ; preds = %for.body43.us %idxprom52.us = sext i32 %spec.select.us.3 to i64 %arrayidx53.us = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom52.us %3 = load i32, ptr %arrayidx53.us, align 4, !tbaa !5 %spec.select87.us = call i32 @llvm.smin.i32(i32 %min.099.us, i32 %3) %arrayidx60.us = getelementptr inbounds [310 x i32], ptr %f, i64 0, i64 %idxprom52.us store i32 1, ptr %arrayidx60.us, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 1240, ptr nonnull %c) #5 %inc62.us = add nuw nsw i32 %i.198.us, 1 %exitcond125.not = icmp eq i32 %inc62.us, %2 br i1 %exitcond125.not, label %for.end63, label %for.body14.us, !llvm.loop !9 for.body43.us: ; preds = %while.end.us, %for.body43.us %indvars.iv121 = phi i64 [ %indvars.iv.next122.3, %for.body43.us ], [ 1, %while.end.us ] %mi.096.us = phi i32 [ %spec.select.us.3, %for.body43.us ], [ 1, %while.end.us ] %idxprom44.us = sext i32 %mi.096.us to i64 %arrayidx45.us = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.us %4 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5 %arrayidx47.us = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv121 %5 = load i32, ptr %arrayidx47.us, align 4, !tbaa !5 %cmp48.us = icmp slt i32 %4, %5 %6 = trunc i64 %indvars.iv121 to i32 %spec.select.us = select i1 %cmp48.us, i32 %6, i32 %mi.096.us %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1 %idxprom44.us.1 = sext i32 %spec.select.us to i64 %arrayidx45.us.1 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.us.1 %7 = load i32, ptr %arrayidx45.us.1, align 4, !tbaa !5 %arrayidx47.us.1 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next122 %8 = load i32, ptr %arrayidx47.us.1, align 4, !tbaa !5 %cmp48.us.1 = icmp slt i32 %7, %8 %9 = trunc i64 %indvars.iv.next122 to i32 %spec.select.us.1 = select i1 %cmp48.us.1, i32 %9, i32 %spec.select.us %indvars.iv.next122.1 = add nuw nsw i64 %indvars.iv121, 2 %idxprom44.us.2 = sext i32 %spec.select.us.1 to i64 %arrayidx45.us.2 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.us.2 %10 = load i32, ptr %arrayidx45.us.2, align 4, !tbaa !5 %arrayidx47.us.2 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next122.1 %11 = load i32, ptr %arrayidx47.us.2, align 4, !tbaa !5 %cmp48.us.2 = icmp slt i32 %10, %11 %12 = trunc i64 %indvars.iv.next122.1 to i32 %spec.select.us.2 = select i1 %cmp48.us.2, i32 %12, i32 %spec.select.us.1 %indvars.iv.next122.2 = add nuw nsw i64 %indvars.iv121, 3 %idxprom44.us.3 = sext i32 %spec.select.us.2 to i64 %arrayidx45.us.3 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.us.3 %13 = load i32, ptr %arrayidx45.us.3, align 4, !tbaa !5 %arrayidx47.us.3 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next122.2 %14 = load i32, ptr %arrayidx47.us.3, align 4, !tbaa !5 %cmp48.us.3 = icmp slt i32 %13, %14 %15 = trunc i64 %indvars.iv.next122.2 to i32 %spec.select.us.3 = select i1 %cmp48.us.3, i32 %15, i32 %spec.select.us.2 %indvars.iv.next122.3 = add nuw nsw i64 %indvars.iv121, 4 %exitcond124.not.3 = icmp eq i64 %indvars.iv.next122.3, 305 br i1 %exitcond124.not.3, label %for.end51.us, label %for.body43.us, !llvm.loop !11 while.cond.us: ; preds = %while.cond.preheader.us, %while.cond.us %indvars.iv114 = phi i64 [ %20, %while.cond.preheader.us ], [ %indvars.iv.next115, %while.cond.us ] %arrayidx23.us = getelementptr inbounds [310 x [310 x i32]], ptr %d, i64 0, i64 %indvars.iv117, i64 %indvars.iv114 %16 = load i32, ptr %arrayidx23.us, align 4, !tbaa !5 %idxprom24.us = sext i32 %16 to i64 %arrayidx25.us = getelementptr inbounds [310 x i32], ptr %f, i64 0, i64 %idxprom24.us %17 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %tobool.not.us = icmp eq i32 %17, 0 %indvars.iv.next115 = add i64 %indvars.iv114, 1 br i1 %tobool.not.us, label %while.end.us, label %while.cond.us, !llvm.loop !12 while.end.us: ; preds = %while.cond.us %18 = trunc i64 %indvars.iv114 to i32 store i32 %18, ptr %arrayidx21.us, align 4, !tbaa !5 %arrayidx36.us = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom24.us %19 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %inc37.us = add nsw i32 %19, 1 store i32 %inc37.us, ptr %arrayidx36.us, align 4, !tbaa !5 %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %exitcond120.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count br i1 %exitcond120.not, label %for.body43.us, label %while.cond.preheader.us, !llvm.loop !13 while.cond.preheader.us: ; preds = %for.body14.us, %while.end.us %indvars.iv117 = phi i64 [ 0, %for.body14.us ], [ %indvars.iv.next118, %while.end.us ] %arrayidx21.us = getelementptr inbounds [310 x i32], ptr %r, i64 0, i64 %indvars.iv117 %arrayidx21.promoted.us = load i32, ptr %arrayidx21.us, align 4, !tbaa !5 %20 = sext i32 %arrayidx21.promoted.us to i64 br label %while.cond.us for.body: ; preds = %for.body.lr.ph, %for.inc9 %21 = phi i32 [ %25, %for.inc9 ], [ %0, %for.body.lr.ph ] %22 = phi i32 [ %26, %for.inc9 ], [ %.pre126, %for.body.lr.ph ] %indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.inc9 ], [ 0, %for.body.lr.ph ] %arrayidx = getelementptr inbounds [310 x i32], ptr %r, i64 0, i64 %indvars.iv107 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %cmp288 = icmp sgt i32 %22, 0 br i1 %cmp288, label %for.body3, label %for.inc9 for.body3: ; preds = %for.body, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.body ] %arrayidx7 = getelementptr inbounds [310 x [310 x i32]], ptr %d, i64 0, i64 %indvars.iv107, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = load i32, ptr %m, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp2, label %for.body3, label %for.inc9.loopexit, !llvm.loop !14 for.inc9.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc9 for.inc9: ; preds = %for.inc9.loopexit, %for.body %25 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %21, %for.body ] %26 = phi i32 [ %23, %for.inc9.loopexit ], [ %22, %for.body ] %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %27 = sext i32 %25 to i64 %cmp = icmp slt i64 %indvars.iv.next108, %27 br i1 %cmp, label %for.body, label %for.cond12.preheader, !llvm.loop !15 for.body14: ; preds = %for.body14.lr.ph, %for.end51 %min.099 = phi i32 [ %spec.select87, %for.end51 ], [ 310, %for.body14.lr.ph ] %i.198 = phi i32 [ %inc62, %for.end51 ], [ 0, %for.body14.lr.ph ] call void @llvm.lifetime.start.p0(i64 1240, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1240) %c, i8 0, i64 1240, i1 false) br label %for.body43 for.body43: ; preds = %for.body43, %for.body14 %indvars.iv110 = phi i64 [ 1, %for.body14 ], [ %indvars.iv.next111.3, %for.body43 ] %mi.096 = phi i32 [ 1, %for.body14 ], [ %spec.select.3, %for.body43 ] %idxprom44 = sext i32 %mi.096 to i64 %arrayidx45 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44 %28 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %arrayidx47 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv110 %29 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %cmp48 = icmp slt i32 %28, %29 %30 = trunc i64 %indvars.iv110 to i32 %spec.select = select i1 %cmp48, i32 %30, i32 %mi.096 %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %idxprom44.1 = sext i32 %spec.select to i64 %arrayidx45.1 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.1 %31 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5 %arrayidx47.1 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next111 %32 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5 %cmp48.1 = icmp slt i32 %31, %32 %33 = trunc i64 %indvars.iv.next111 to i32 %spec.select.1 = select i1 %cmp48.1, i32 %33, i32 %spec.select %indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2 %idxprom44.2 = sext i32 %spec.select.1 to i64 %arrayidx45.2 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.2 %34 = load i32, ptr %arrayidx45.2, align 4, !tbaa !5 %arrayidx47.2 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next111.1 %35 = load i32, ptr %arrayidx47.2, align 4, !tbaa !5 %cmp48.2 = icmp slt i32 %34, %35 %36 = trunc i64 %indvars.iv.next111.1 to i32 %spec.select.2 = select i1 %cmp48.2, i32 %36, i32 %spec.select.1 %indvars.iv.next111.2 = add nuw nsw i64 %indvars.iv110, 3 %idxprom44.3 = sext i32 %spec.select.2 to i64 %arrayidx45.3 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom44.3 %37 = load i32, ptr %arrayidx45.3, align 4, !tbaa !5 %arrayidx47.3 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %indvars.iv.next111.2 %38 = load i32, ptr %arrayidx47.3, align 4, !tbaa !5 %cmp48.3 = icmp slt i32 %37, %38 %39 = trunc i64 %indvars.iv.next111.2 to i32 %spec.select.3 = select i1 %cmp48.3, i32 %39, i32 %spec.select.2 %indvars.iv.next111.3 = add nuw nsw i64 %indvars.iv110, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next111.3, 305 br i1 %exitcond.not.3, label %for.end51, label %for.body43, !llvm.loop !11 for.end51: ; preds = %for.body43 %idxprom52 = sext i32 %spec.select.3 to i64 %arrayidx53 = getelementptr inbounds [310 x i32], ptr %c, i64 0, i64 %idxprom52 %40 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %spec.select87 = call i32 @llvm.smin.i32(i32 %min.099, i32 %40) %arrayidx60 = getelementptr inbounds [310 x i32], ptr %f, i64 0, i64 %idxprom52 store i32 1, ptr %arrayidx60, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 1240, ptr nonnull %c) #5 %inc62 = add nuw nsw i32 %i.198, 1 %exitcond113.not = icmp eq i32 %inc62, %2 br i1 %exitcond113.not, label %for.end63, label %for.body14, !llvm.loop !9 for.end63: ; preds = %for.end51, %for.end51.us, %for.body.lr.ph, %for.cond12.preheader %min.0.lcssa = phi i32 [ 310, %for.cond12.preheader ], [ 310, %for.body.lr.ph ], [ %spec.select87.us, %for.end51.us ], [ %spec.select87, %for.end51 ] %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 1240, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 384400, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 1240, ptr nonnull %f) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !16} !16 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> #include<stdlib.h> #include<math.h> int isprime(int n) { int i; for (i=2;i<=sqrt(n);i++) { if (n%i==0 && i!=n) return 0; } return 1; } int main(void) { int i,j,n; scanf("%d",&n); for(i=4;i<n;i++) for(j=n-1;j>=4;j--) { if((i+j)==n) { if(isprime(i)!=1 && isprime(j)!=1) {printf("%d %d",i,j); exit(0); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15394/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15394/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind memory(write) uwtable define dso_local i32 @isprime(i32 noundef %n) local_unnamed_addr #0 { entry: %conv1 = sitofp i32 %n to double %call12 = tail call double @sqrt(double noundef %conv1) #6 %cmp13 = fcmp ult double %call12, 2.000000e+00 br i1 %cmp13, label %cleanup, label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.014, 1 %conv = sitofp i32 %inc to double %call = tail call double @sqrt(double noundef %conv1) #6 %cmp = fcmp ult double %call, %conv br i1 %cmp, label %cleanup, label %for.body, !llvm.loop !5 for.body: ; preds = %entry, %for.cond %i.014 = phi i32 [ %inc, %for.cond ], [ 2, %entry ] %rem = srem i32 %n, %i.014 %cmp3 = icmp ne i32 %rem, 0 %cmp5.not = icmp eq i32 %i.014, %n %or.cond = or i1 %cmp5.not, %cmp3 br i1 %or.cond, label %for.cond, label %cleanup cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double 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: 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 !7 %cmp48 = icmp sgt i32 %0, 4 br i1 %cmp48, label %for.cond1.preheader, label %for.end13 for.cond1.preheader: ; preds = %entry, %for.inc12 %1 = phi i32 [ %3, %for.inc12 ], [ %0, %entry ] %i.049 = phi i32 [ %inc, %for.inc12 ], [ 4, %entry ] %cmp246 = icmp sgt i32 %1, 4 br i1 %cmp246, label %for.body3.lr.ph, label %for.inc12 for.body3.lr.ph: ; preds = %for.cond1.preheader %conv1.i = sitofp i32 %i.049 to double br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %j.047.in = phi i32 [ %1, %for.body3.lr.ph ], [ %j.047, %for.inc ] %j.047 = add nsw i32 %j.047.in, -1 %add = add nsw i32 %j.047, %i.049 %2 = load i32, ptr %n, align 4, !tbaa !7 %cmp4 = icmp eq i32 %add, %2 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body3 %call12.i = call double @sqrt(double noundef %conv1.i) #6 %cmp13.i = fcmp ult double %call12.i, 2.000000e+00 br i1 %cmp13.i, label %for.inc, label %for.body.i for.cond.i: ; preds = %for.body.i %inc.i = add nuw nsw i32 %i.014.i, 1 %conv.i = sitofp i32 %inc.i to double %call.i = call double @sqrt(double noundef %conv1.i) #6 %cmp.i = fcmp ult double %call.i, %conv.i br i1 %cmp.i, label %for.inc, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %if.then, %for.cond.i %i.014.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %if.then ] %rem.i = urem i32 %i.049, %i.014.i %cmp3.i = icmp ne i32 %rem.i, 0 %cmp5.not.i = icmp eq i32 %i.014.i, %i.049 %or.cond.i = or i1 %cmp5.not.i, %cmp3.i br i1 %or.cond.i, label %for.cond.i, label %land.lhs.true land.lhs.true: ; preds = %for.body.i %conv1.i22 = sitofp i32 %j.047 to double %call12.i23 = call double @sqrt(double noundef %conv1.i22) #6 %cmp13.i24 = fcmp ult double %call12.i23, 2.000000e+00 br i1 %cmp13.i24, label %for.inc, label %for.body.i25 for.cond.i32: ; preds = %for.body.i25 %inc.i33 = add nuw nsw i32 %i.014.i26, 1 %conv.i34 = sitofp i32 %inc.i33 to double %call.i35 = call double @sqrt(double noundef %conv1.i22) #6 %cmp.i36 = fcmp ult double %call.i35, %conv.i34 br i1 %cmp.i36, label %for.inc, label %for.body.i25, !llvm.loop !5 for.body.i25: ; preds = %land.lhs.true, %for.cond.i32 %i.014.i26 = phi i32 [ %inc.i33, %for.cond.i32 ], [ 2, %land.lhs.true ] %rem.i27 = srem i32 %j.047, %i.014.i26 %cmp3.i28 = icmp ne i32 %rem.i27, 0 %cmp5.not.i29 = icmp eq i32 %i.014.i26, %j.047 %or.cond.i30 = or i1 %cmp5.not.i29, %cmp3.i28 br i1 %or.cond.i30, label %for.cond.i32, label %if.then9 if.then9: ; preds = %for.body.i25 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.049, i32 noundef %j.047) call void @exit(i32 noundef 0) #7 unreachable for.inc: ; preds = %for.cond.i, %for.cond.i32, %land.lhs.true, %if.then, %for.body3 %cmp2 = icmp sgt i32 %j.047.in, 5 br i1 %cmp2, label %for.body3, label %for.inc12.loopexit, !llvm.loop !11 for.inc12.loopexit: ; preds = %for.inc %.pre = load i32, ptr %n, align 4, !tbaa !7 br label %for.inc12 for.inc12: ; preds = %for.inc12.loopexit, %for.cond1.preheader %3 = phi i32 [ %.pre, %for.inc12.loopexit ], [ %1, %for.cond1.preheader ] %inc = add nuw nsw i32 %i.049, 1 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.cond1.preheader, label %for.end13, !llvm.loop !12 for.end13: ; preds = %for.inc12, %entry 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: 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 attributes #0 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind } attributes #7 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6}
#include <stdio.h> int main(){ int n; scanf("%d",&n); int N[3],M[3]; N[2]=n/100; N[1]=(n%100)/10; N[0]=n%10; for(int i=0;i<=2;i++){ if(N[i]==9) M[i]=1; else M[i]=9; } int m; m=100*M[2]+10*M[1]+M[0]; printf("%d\n",m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154025/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154025/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 100 %div1.lhs.trunc = trunc i32 %rem to i8 %rem3 = srem i32 %0, 10 %cmp6 = icmp eq i32 %rem3, 9 %spec.select = select i1 %cmp6, i32 1, i32 9 %div1.lhs.trunc.off = add i8 %div1.lhs.trunc, -90 %cmp6.1 = icmp ult i8 %div1.lhs.trunc.off, 10 %M.sroa.5.0 = select i1 %cmp6.1, i32 10, i32 90 %.off = add i32 %0, -900 %cmp6.2 = icmp ult i32 %.off, 100 %M.sroa.8.0 = select i1 %cmp6.2, i32 100, i32 900 %add = add nuw nsw i32 %M.sroa.5.0, %M.sroa.8.0 %add15 = add nuw nsw i32 %add, %spec.select %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add15) 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"}
#include<stdio.h> int main(void){ int i,j; scanf("%d",&i); if (i%10==9){ i-=8; }else if (i%10==1){ i+=8; } j=i/100; if (j==9){ i-=800; }else if (j==1){ i+=800; } j=(i/10)%10; if (j==9){ i-=80; }else if(j==1){ i+=80; } printf("%d",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154069/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154069/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 %rem = srem i32 %0, 10 switch i32 %rem, label %if.end4 [ i32 9, label %if.then i32 1, label %if.then3 ] if.then: ; preds = %entry %sub = add nsw i32 %0, -8 store i32 %sub, ptr %i, align 4, !tbaa !5 br label %if.end4 if.then3: ; preds = %entry %add = add nsw i32 %0, 8 store i32 %add, ptr %i, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %entry, %if.then3, %if.then %1 = phi i32 [ %0, %entry ], [ %add, %if.then3 ], [ %sub, %if.then ] %.off = add i32 %1, -900 %cmp5 = icmp ult i32 %.off, 100 br i1 %cmp5, label %if.then6, label %if.else8 if.then6: ; preds = %if.end4 %sub7 = add nsw i32 %1, -800 store i32 %sub7, ptr %i, align 4, !tbaa !5 br label %if.end13 if.else8: ; preds = %if.end4 %.off29 = add i32 %1, -100 %cmp9 = icmp ult i32 %.off29, 100 br i1 %cmp9, label %if.then10, label %if.end13 if.then10: ; preds = %if.else8 %add11 = add nuw nsw i32 %1, 800 store i32 %add11, ptr %i, align 4, !tbaa !5 br label %if.end13 if.end13: ; preds = %if.else8, %if.then10, %if.then6 %2 = phi i32 [ %1, %if.else8 ], [ %add11, %if.then10 ], [ %sub7, %if.then6 ] %div14 = sdiv i32 %2, 10 %rem15 = srem i32 %div14, 10 switch i32 %rem15, label %if.end24 [ i32 9, label %if.then17 i32 1, label %if.then21 ] if.then17: ; preds = %if.end13 %sub18 = add nsw i32 %2, -80 store i32 %sub18, ptr %i, align 4, !tbaa !5 br label %if.end24 if.then21: ; preds = %if.end13 %add22 = add nsw i32 %2, 80 store i32 %add22, ptr %i, align 4, !tbaa !5 br label %if.end24 if.end24: ; preds = %if.end13, %if.then21, %if.then17 %3 = phi i32 [ %2, %if.end13 ], [ %add22, %if.then21 ], [ %sub18, %if.then17 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void) { char num[5]; scanf("%s", num); int i, l; l = strlen(num); for(i = 0; i < l; i++) { if(num[i] == '1') { printf("9"); } else { printf("1"); } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154119/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %num) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num) #6 %conv = trunc i64 %call2 to i32 %cmp14 = icmp sgt i32 %conv, 0 br i1 %cmp14, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds [5 x i8], ptr %num, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp5 = icmp eq i8 %0, 49 %. = select i1 %cmp5, i32 57, i32 49 %putchar13 = call i32 @putchar(i32 %.) %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 !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %num) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> #define si(n) scanf("%d",&n) #define rep(i,n) for(i=0;i<n;i++) #define REP(i,a,b) for(i=a;i<b;i++) #define pn printf("\n") #define ps printf(" ") #define pi(n) printf("%d",n) #define pll(n) printf("%lld",n) #define ss(s) scanf("%s",s) typedef long long LL; //inline int readint() //{int n=0;char c;while(1){ c=getchar_unlocked();if(c=='\n'||c==' ')break;n=n*10+c-'0';}return n;} int abs(int a){ if(a<0)return -1*a; return a;} int big(int a,int b){if(a>b)return a;return b;} int small(int a,int b){if(a<b)return a;return b;} int compare(const void *a, const void *b) { int *p1=(int*)a; int *p2=(int*)b; return *p1-*p2; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++ typedef struct pair {int x;int y;}pair; //+++++++++++++++++++++++++++++++++++++++++ typedef struct quad {int L;int R;int D;int U;}quad; //++++++++++++++++++++++++++++++++++++++ pair b[2500]; int a[50][50]={}; quad c[50][50]={}; //++++++++++++++++++++++++++++++++++++++++++++++++++++++ int main() { char s[52]; int m,n,i,j,k=0,x,y,t; si(n);si(m); rep(i,n) { ss(s); rep(j,m) { if(s[j]=='W')a[i][j]=0; else { a[i][j]=1; b[k].y=i;b[k++].x=j; } } } rep(i,n) { int last=m; for(j=m-1;j>=0;j--) { if(a[i][j]==0)last=j; else c[i][j].R=last; } } rep(i,n) { int last=-1; rep(j,m) { if(a[i][j]==0)last=j; else c[i][j].L=last; } } rep(i,m) { int last=n; for(j=n-1;j>=0;j--) { if(a[j][i]==0)last=j; else c[j][i].D=last; } } rep(i,m) { int last=-1; rep(j,n) { if(a[j][i]==0)last=j; else c[j][i].U=last; } } rep(i,k) { int xx=b[i].x; int yy=b[i].y; } int correct=1; rep(i,k) { int x1=b[i].x; int y1=b[i].y; for(j=i+1;j<k;j++) { int x2=b[j].x; int y2=b[j].y; if(x2==x1) { if(c[y1][x1].D>y2) { continue; } correct=0; break; } if(x2>x1) { if(((c[y1][x1].R>x2)&&(c[y1][x2].D>y2))||(c[y1][x1].D>y2)&&(c[y2][x1].R>x2))continue; correct=0; break; } if(x2<x1) { if(((c[y1][x1].L<x2)&&(c[y1][x2].D>y2))||((c[y1][x1].D>y2)&&(c[y2][x1].L<x2)))continue; correct=0; break; } } if(correct==0)break; } if(correct)printf("YES"); else printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15417/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15417/source.c" target datalayout = "e-m:e-p270: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.quad = type { i32, i32, i32, i32 } %struct.pair = type { i32, i32 } @a = dso_local local_unnamed_addr global [50 x [50 x i32]] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [50 x [50 x %struct.quad]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @b = dso_local local_unnamed_addr global [2500 x %struct.pair] 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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @abs(i32 noundef %a) local_unnamed_addr #0 { entry: %retval.0 = tail call i32 @llvm.abs.i32(i32 %a, i1 true) ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @big(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @small(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %s = alloca [52 x i8], align 16 %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %s) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp402 = icmp sgt i32 %0, 0 br i1 %cmp402, label %for.body, label %for.cond137.preheader for.cond26.preheader: ; preds = %for.inc23 %cmp27411 = icmp sgt i32 %12, 0 br i1 %cmp27411, label %for.body29.lr.ph, label %for.cond80.preheader for.body29.lr.ph: ; preds = %for.cond26.preheader %cmp31408 = icmp sgt i32 %7, 0 br i1 %cmp31408, label %for.body29.us.preheader, label %for.cond137.preheader for.body29.us.preheader: ; preds = %for.body29.lr.ph %1 = zext i32 %7 to i64 %wide.trip.count451 = zext i32 %12 to i64 %2 = add nsw i64 %1, -1 %xtraiter = and i64 %1, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %indvars.iv.next445.prol = add nsw i64 %1, -1 %indvars.prol = trunc i64 %indvars.iv.next445.prol to i32 %idxprom36.us.prol = and i64 %indvars.iv.next445.prol, 4294967295 %3 = icmp eq i64 %2, 0 br label %for.body29.us for.body29.us: ; preds = %for.body29.us.preheader, %for.cond30.for.end48_crit_edge.us %indvars.iv447 = phi i64 [ 0, %for.body29.us.preheader ], [ %indvars.iv.next448, %for.cond30.for.end48_crit_edge.us ] br i1 %lcmp.mod.not, label %for.body33.us.prol.loopexit, label %for.body33.us.prol for.body33.us.prol: ; preds = %for.body29.us %arrayidx37.us.prol = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv447, i64 %idxprom36.us.prol %4 = load i32, ptr %arrayidx37.us.prol, align 4, !tbaa !5 %cmp38.us.prol = icmp eq i32 %4, 0 br i1 %cmp38.us.prol, label %for.body33.us.prol.loopexit, label %if.else41.us.prol if.else41.us.prol: ; preds = %for.body33.us.prol %R.us.prol = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv447, i64 %idxprom36.us.prol, i32 1 store i32 %7, ptr %R.us.prol, align 4, !tbaa !9 br label %for.body33.us.prol.loopexit for.body33.us.prol.loopexit: ; preds = %for.body33.us.prol, %if.else41.us.prol, %for.body29.us %indvars.iv444.unr = phi i64 [ %1, %for.body29.us ], [ %indvars.iv.next445.prol, %if.else41.us.prol ], [ %indvars.iv.next445.prol, %for.body33.us.prol ] %last.0409.us.unr = phi i32 [ %7, %for.body29.us ], [ %7, %if.else41.us.prol ], [ %indvars.prol, %for.body33.us.prol ] br i1 %3, label %for.cond30.for.end48_crit_edge.us, label %for.body33.us for.body33.us: ; preds = %for.body33.us.prol.loopexit, %for.inc47.us.1 %indvars.iv444 = phi i64 [ %indvars.iv.next445.1, %for.inc47.us.1 ], [ %indvars.iv444.unr, %for.body33.us.prol.loopexit ] %last.0409.us = phi i32 [ %last.1.us.1, %for.inc47.us.1 ], [ %last.0409.us.unr, %for.body33.us.prol.loopexit ] %indvars.iv.next445 = add nsw i64 %indvars.iv444, -1 %indvars = trunc i64 %indvars.iv.next445 to i32 %idxprom36.us = and i64 %indvars.iv.next445, 4294967295 %arrayidx37.us = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv447, i64 %idxprom36.us %5 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 %cmp38.us = icmp eq i32 %5, 0 br i1 %cmp38.us, label %for.inc47.us, label %if.else41.us if.else41.us: ; preds = %for.body33.us %R.us = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv447, i64 %idxprom36.us, i32 1 store i32 %last.0409.us, ptr %R.us, align 4, !tbaa !9 br label %for.inc47.us for.inc47.us: ; preds = %if.else41.us, %for.body33.us %last.1.us = phi i32 [ %last.0409.us, %if.else41.us ], [ %indvars, %for.body33.us ] %indvars.iv.next445.1 = add nsw i64 %indvars.iv444, -2 %indvars.1 = trunc i64 %indvars.iv.next445.1 to i32 %idxprom36.us.1 = and i64 %indvars.iv.next445.1, 4294967295 %arrayidx37.us.1 = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv447, i64 %idxprom36.us.1 %6 = load i32, ptr %arrayidx37.us.1, align 4, !tbaa !5 %cmp38.us.1 = icmp eq i32 %6, 0 br i1 %cmp38.us.1, label %for.inc47.us.1, label %if.else41.us.1 if.else41.us.1: ; preds = %for.inc47.us %R.us.1 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv447, i64 %idxprom36.us.1, i32 1 store i32 %last.1.us, ptr %R.us.1, align 4, !tbaa !9 br label %for.inc47.us.1 for.inc47.us.1: ; preds = %if.else41.us.1, %for.inc47.us %last.1.us.1 = phi i32 [ %last.1.us, %if.else41.us.1 ], [ %indvars.1, %for.inc47.us ] %cmp31.us.1 = icmp sgt i64 %indvars.iv444, 2 br i1 %cmp31.us.1, label %for.body33.us, label %for.cond30.for.end48_crit_edge.us, !llvm.loop !11 for.cond30.for.end48_crit_edge.us: ; preds = %for.inc47.us.1, %for.body33.us.prol.loopexit %indvars.iv.next448 = add nuw nsw i64 %indvars.iv447, 1 %exitcond452.not = icmp eq i64 %indvars.iv.next448, %wide.trip.count451 br i1 %exitcond452.not, label %for.cond52.preheader, label %for.body29.us, !llvm.loop !13 for.body: ; preds = %entry, %for.inc23 %indvars.iv441 = phi i64 [ %indvars.iv.next442, %for.inc23 ], [ 0, %entry ] %k.0403 = phi i32 [ %k.1.lcssa, %for.inc23 ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp4399 = icmp sgt i32 %7, 0 br i1 %cmp4399, label %for.body5.lr.ph, label %for.inc23 for.body5.lr.ph: ; preds = %for.body %wide.trip.count = zext i32 %7 to i64 %8 = trunc i64 %indvars.iv441 to i32 br label %for.body5 for.body5: ; preds = %for.body5.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.inc ] %k.1400 = phi i32 [ %k.0403, %for.body5.lr.ph ], [ %k.2, %for.inc ] %arrayidx = getelementptr inbounds [52 x i8], ptr %s, i64 0, i64 %indvars.iv %9 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp6 = icmp eq i8 %9, 87 br i1 %cmp6, label %for.inc, label %if.else if.else: ; preds = %for.body5 %idxprom16 = sext i32 %k.1400 to i64 %arrayidx17 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %idxprom16 %y18 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %idxprom16, i32 1 store i32 %8, ptr %y18, align 4, !tbaa !15 %inc = add nsw i32 %k.1400, 1 %10 = trunc i64 %indvars.iv to i32 store i32 %10, ptr %arrayidx17, align 8, !tbaa !17 br label %for.inc for.inc: ; preds = %for.body5, %if.else %.sink = phi i32 [ 1, %if.else ], [ 0, %for.body5 ] %k.2 = phi i32 [ %inc, %if.else ], [ %k.1400, %for.body5 ] %11 = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv441, i64 %indvars.iv store i32 %.sink, ptr %11, align 4 %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.inc23, label %for.body5, !llvm.loop !18 for.inc23: ; preds = %for.inc, %for.body %k.1.lcssa = phi i32 [ %k.0403, %for.body ], [ %k.2, %for.inc ] %indvars.iv.next442 = add nuw nsw i64 %indvars.iv441, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp = icmp slt i64 %indvars.iv.next442, %13 br i1 %cmp, label %for.body, label %for.cond26.preheader, !llvm.loop !19 for.cond52.preheader: ; preds = %for.cond30.for.end48_crit_edge.us br i1 %cmp27411, label %for.cond57.preheader.lr.ph, label %for.cond80.preheader for.cond57.preheader.lr.ph: ; preds = %for.cond52.preheader %cmp58413 = icmp sgt i32 %7, 0 br i1 %cmp58413, label %for.cond57.preheader.us.preheader, label %for.cond137.preheader for.cond57.preheader.us.preheader: ; preds = %for.cond57.preheader.lr.ph %wide.trip.count463 = zext i32 %12 to i64 %xtraiter597 = and i64 %1, 1 %14 = icmp eq i64 %2, 0 %unroll_iter = and i64 %1, 4294967294 %lcmp.mod598.not = icmp eq i64 %xtraiter597, 0 br label %for.cond57.preheader.us for.cond57.preheader.us: ; preds = %for.cond57.preheader.us.preheader, %for.cond57.for.end76_crit_edge.us %indvars.iv459 = phi i64 [ 0, %for.cond57.preheader.us.preheader ], [ %indvars.iv.next460, %for.cond57.for.end76_crit_edge.us ] br i1 %14, label %for.cond57.for.end76_crit_edge.us.unr-lcssa, label %for.body60.us for.body60.us: ; preds = %for.cond57.preheader.us, %for.inc74.us.1 %indvars.iv453 = phi i64 [ %indvars.iv.next454.1, %for.inc74.us.1 ], [ 0, %for.cond57.preheader.us ] %last56.0414.us = phi i32 [ %last56.1.us.1, %for.inc74.us.1 ], [ -1, %for.cond57.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc74.us.1 ], [ 0, %for.cond57.preheader.us ] %arrayidx64.us = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv459, i64 %indvars.iv453 %15 = load i32, ptr %arrayidx64.us, align 8, !tbaa !5 %cmp65.us = icmp eq i32 %15, 0 %16 = trunc i64 %indvars.iv453 to i32 br i1 %cmp65.us, label %for.inc74.us, label %if.else68.us if.else68.us: ; preds = %for.body60.us %arrayidx72.us = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv459, i64 %indvars.iv453 store i32 %last56.0414.us, ptr %arrayidx72.us, align 16, !tbaa !20 br label %for.inc74.us for.inc74.us: ; preds = %if.else68.us, %for.body60.us %last56.1.us = phi i32 [ %last56.0414.us, %if.else68.us ], [ %16, %for.body60.us ] %indvars.iv.next454 = or i64 %indvars.iv453, 1 %arrayidx64.us.1 = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv459, i64 %indvars.iv.next454 %17 = load i32, ptr %arrayidx64.us.1, align 4, !tbaa !5 %cmp65.us.1 = icmp eq i32 %17, 0 %18 = trunc i64 %indvars.iv.next454 to i32 br i1 %cmp65.us.1, label %for.inc74.us.1, label %if.else68.us.1 if.else68.us.1: ; preds = %for.inc74.us %arrayidx72.us.1 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv459, i64 %indvars.iv.next454 store i32 %last56.1.us, ptr %arrayidx72.us.1, align 16, !tbaa !20 br label %for.inc74.us.1 for.inc74.us.1: ; preds = %if.else68.us.1, %for.inc74.us %last56.1.us.1 = phi i32 [ %last56.1.us, %if.else68.us.1 ], [ %18, %for.inc74.us ] %indvars.iv.next454.1 = add nuw nsw i64 %indvars.iv453, 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.cond57.for.end76_crit_edge.us.unr-lcssa, label %for.body60.us, !llvm.loop !21 for.cond57.for.end76_crit_edge.us.unr-lcssa: ; preds = %for.inc74.us.1, %for.cond57.preheader.us %indvars.iv453.unr = phi i64 [ 0, %for.cond57.preheader.us ], [ %indvars.iv.next454.1, %for.inc74.us.1 ] %last56.0414.us.unr = phi i32 [ -1, %for.cond57.preheader.us ], [ %last56.1.us.1, %for.inc74.us.1 ] br i1 %lcmp.mod598.not, label %for.cond57.for.end76_crit_edge.us, label %for.body60.us.epil for.body60.us.epil: ; preds = %for.cond57.for.end76_crit_edge.us.unr-lcssa %arrayidx64.us.epil = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv459, i64 %indvars.iv453.unr %19 = load i32, ptr %arrayidx64.us.epil, align 4, !tbaa !5 %cmp65.us.epil = icmp eq i32 %19, 0 br i1 %cmp65.us.epil, label %for.cond57.for.end76_crit_edge.us, label %if.else68.us.epil if.else68.us.epil: ; preds = %for.body60.us.epil %arrayidx72.us.epil = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv459, i64 %indvars.iv453.unr store i32 %last56.0414.us.unr, ptr %arrayidx72.us.epil, align 16, !tbaa !20 br label %for.cond57.for.end76_crit_edge.us for.cond57.for.end76_crit_edge.us: ; preds = %for.body60.us.epil, %if.else68.us.epil, %for.cond57.for.end76_crit_edge.us.unr-lcssa %indvars.iv.next460 = add nuw nsw i64 %indvars.iv459, 1 %exitcond464.not = icmp eq i64 %indvars.iv.next460, %wide.trip.count463 br i1 %exitcond464.not, label %for.cond80.preheader, label %for.cond57.preheader.us, !llvm.loop !22 for.cond80.preheader: ; preds = %for.cond57.for.end76_crit_edge.us, %for.cond26.preheader, %for.cond52.preheader %cmp27411508513 = phi i1 [ false, %for.cond52.preheader ], [ false, %for.cond26.preheader ], [ %cmp27411, %for.cond57.for.end76_crit_edge.us ] %cmp81422 = icmp sgt i32 %7, 0 %brmerge.not = and i1 %cmp81422, %cmp27411508513 br i1 %brmerge.not, label %for.cond86.preheader.us.preheader, label %for.cond137.preheader for.cond86.preheader.us.preheader: ; preds = %for.cond80.preheader %20 = zext i32 %12 to i64 %wide.trip.count473 = zext i32 %7 to i64 br label %for.cond86.preheader.us for.cond86.preheader.us: ; preds = %for.cond86.preheader.us.preheader, %for.cond86.for.end105_crit_edge.us %indvars.iv469 = phi i64 [ 0, %for.cond86.preheader.us.preheader ], [ %indvars.iv.next470, %for.cond86.for.end105_crit_edge.us ] br label %for.body89.us for.body89.us: ; preds = %for.cond86.preheader.us, %for.inc103.us %indvars.iv465 = phi i64 [ %20, %for.cond86.preheader.us ], [ %indvars.iv.next466, %for.inc103.us ] %last84.0420.us = phi i32 [ %12, %for.cond86.preheader.us ], [ %last84.1.us, %for.inc103.us ] %indvars.iv.next466 = add nsw i64 %indvars.iv465, -1 %indvars467 = trunc i64 %indvars.iv.next466 to i32 %idxprom90.us = and i64 %indvars.iv.next466, 4294967295 %arrayidx93.us = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %idxprom90.us, i64 %indvars.iv469 %21 = load i32, ptr %arrayidx93.us, align 4, !tbaa !5 %cmp94.us = icmp eq i32 %21, 0 br i1 %cmp94.us, label %for.inc103.us, label %if.else97.us if.else97.us: ; preds = %for.body89.us %D.us = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom90.us, i64 %indvars.iv469, i32 2 store i32 %last84.0420.us, ptr %D.us, align 8, !tbaa !23 br label %for.inc103.us for.inc103.us: ; preds = %if.else97.us, %for.body89.us %last84.1.us = phi i32 [ %last84.0420.us, %if.else97.us ], [ %indvars467, %for.body89.us ] %cmp87.us = icmp sgt i64 %indvars.iv465, 1 br i1 %cmp87.us, label %for.body89.us, label %for.cond86.for.end105_crit_edge.us, !llvm.loop !24 for.cond86.for.end105_crit_edge.us: ; preds = %for.inc103.us %indvars.iv.next470 = add nuw nsw i64 %indvars.iv469, 1 %exitcond474.not = icmp eq i64 %indvars.iv.next470, %wide.trip.count473 br i1 %exitcond474.not, label %for.cond114.preheader.lr.ph, label %for.cond86.preheader.us, !llvm.loop !25 for.cond114.preheader.lr.ph: ; preds = %for.cond86.for.end105_crit_edge.us br i1 %cmp27411508513, label %for.cond114.preheader.us.preheader, label %for.cond137.preheader for.cond114.preheader.us.preheader: ; preds = %for.cond114.preheader.lr.ph %wide.trip.count485 = zext i32 %7 to i64 %xtraiter599 = and i64 %20, 1 %22 = icmp eq i32 %12, 1 %unroll_iter601 = and i64 %20, 4294967294 %lcmp.mod600.not = icmp eq i64 %xtraiter599, 0 br label %for.cond114.preheader.us for.cond114.preheader.us: ; preds = %for.cond114.preheader.us.preheader, %for.cond114.for.end133_crit_edge.us %indvars.iv481 = phi i64 [ 0, %for.cond114.preheader.us.preheader ], [ %indvars.iv.next482, %for.cond114.for.end133_crit_edge.us ] br i1 %22, label %for.cond114.for.end133_crit_edge.us.unr-lcssa, label %for.body117.us for.body117.us: ; preds = %for.cond114.preheader.us, %for.inc131.us.1 %indvars.iv475 = phi i64 [ %indvars.iv.next476.1, %for.inc131.us.1 ], [ 0, %for.cond114.preheader.us ] %last113.0426.us = phi i32 [ %last113.1.us.1, %for.inc131.us.1 ], [ -1, %for.cond114.preheader.us ] %niter602 = phi i64 [ %niter602.next.1, %for.inc131.us.1 ], [ 0, %for.cond114.preheader.us ] %arrayidx121.us = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv475, i64 %indvars.iv481 %23 = load i32, ptr %arrayidx121.us, align 4, !tbaa !5 %cmp122.us = icmp eq i32 %23, 0 %24 = trunc i64 %indvars.iv475 to i32 br i1 %cmp122.us, label %for.inc131.us, label %if.else125.us if.else125.us: ; preds = %for.body117.us %U.us = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv475, i64 %indvars.iv481, i32 3 store i32 %last113.0426.us, ptr %U.us, align 4, !tbaa !26 br label %for.inc131.us for.inc131.us: ; preds = %if.else125.us, %for.body117.us %last113.1.us = phi i32 [ %last113.0426.us, %if.else125.us ], [ %24, %for.body117.us ] %indvars.iv.next476 = or i64 %indvars.iv475, 1 %arrayidx121.us.1 = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv.next476, i64 %indvars.iv481 %25 = load i32, ptr %arrayidx121.us.1, align 4, !tbaa !5 %cmp122.us.1 = icmp eq i32 %25, 0 %26 = trunc i64 %indvars.iv.next476 to i32 br i1 %cmp122.us.1, label %for.inc131.us.1, label %if.else125.us.1 if.else125.us.1: ; preds = %for.inc131.us %U.us.1 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv.next476, i64 %indvars.iv481, i32 3 store i32 %last113.1.us, ptr %U.us.1, align 4, !tbaa !26 br label %for.inc131.us.1 for.inc131.us.1: ; preds = %if.else125.us.1, %for.inc131.us %last113.1.us.1 = phi i32 [ %last113.1.us, %if.else125.us.1 ], [ %26, %for.inc131.us ] %indvars.iv.next476.1 = add nuw nsw i64 %indvars.iv475, 2 %niter602.next.1 = add i64 %niter602, 2 %niter602.ncmp.1 = icmp eq i64 %niter602.next.1, %unroll_iter601 br i1 %niter602.ncmp.1, label %for.cond114.for.end133_crit_edge.us.unr-lcssa, label %for.body117.us, !llvm.loop !27 for.cond114.for.end133_crit_edge.us.unr-lcssa: ; preds = %for.inc131.us.1, %for.cond114.preheader.us %indvars.iv475.unr = phi i64 [ 0, %for.cond114.preheader.us ], [ %indvars.iv.next476.1, %for.inc131.us.1 ] %last113.0426.us.unr = phi i32 [ -1, %for.cond114.preheader.us ], [ %last113.1.us.1, %for.inc131.us.1 ] br i1 %lcmp.mod600.not, label %for.cond114.for.end133_crit_edge.us, label %for.body117.us.epil for.body117.us.epil: ; preds = %for.cond114.for.end133_crit_edge.us.unr-lcssa %arrayidx121.us.epil = getelementptr inbounds [50 x [50 x i32]], ptr @a, i64 0, i64 %indvars.iv475.unr, i64 %indvars.iv481 %27 = load i32, ptr %arrayidx121.us.epil, align 4, !tbaa !5 %cmp122.us.epil = icmp eq i32 %27, 0 br i1 %cmp122.us.epil, label %for.cond114.for.end133_crit_edge.us, label %if.else125.us.epil if.else125.us.epil: ; preds = %for.body117.us.epil %U.us.epil = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %indvars.iv475.unr, i64 %indvars.iv481, i32 3 store i32 %last113.0426.us.unr, ptr %U.us.epil, align 4, !tbaa !26 br label %for.cond114.for.end133_crit_edge.us for.cond114.for.end133_crit_edge.us: ; preds = %for.body117.us.epil, %if.else125.us.epil, %for.cond114.for.end133_crit_edge.us.unr-lcssa %indvars.iv.next482 = add nuw nsw i64 %indvars.iv481, 1 %exitcond486.not = icmp eq i64 %indvars.iv.next482, %wide.trip.count485 br i1 %exitcond486.not, label %for.cond137.preheader, label %for.cond114.preheader.us, !llvm.loop !28 for.cond137.preheader: ; preds = %for.cond114.for.end133_crit_edge.us, %for.cond80.preheader, %entry, %for.body29.lr.ph, %for.cond57.preheader.lr.ph, %for.cond114.preheader.lr.ph %k.0.lcssa506517541552 = phi i32 [ %k.1.lcssa, %for.cond114.preheader.lr.ph ], [ %k.1.lcssa, %for.cond80.preheader ], [ %k.1.lcssa, %for.cond57.preheader.lr.ph ], [ %k.1.lcssa, %for.body29.lr.ph ], [ 0, %entry ], [ %k.1.lcssa, %for.cond114.for.end133_crit_edge.us ] %smax = call i32 @llvm.smax.i32(i32 %k.0.lcssa506517541552, i32 0) %wide.trip.count498 = zext i32 %smax to i64 br label %for.cond150 for.cond150: ; preds = %for.cond137.preheader, %for.end258 %indvars.iv494 = phi i64 [ 0, %for.cond137.preheader ], [ %indvars.iv.next495, %for.end258 ] %indvars.iv487 = phi i64 [ 1, %for.cond137.preheader ], [ %indvars.iv.next488, %for.end258 ] %correct.0 = phi i32 [ 1, %for.cond137.preheader ], [ %correct.3, %for.end258 ] %exitcond499.not = icmp eq i64 %indvars.iv494, %wide.trip.count498 br i1 %exitcond499.not, label %if.end274, label %for.body153 for.body153: ; preds = %for.cond150 %arrayidx155 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %indvars.iv494 %28 = load i32, ptr %arrayidx155, align 8, !tbaa !17 %indvars.iv.next495 = add nuw nsw i64 %indvars.iv494, 1 %29 = trunc i64 %indvars.iv.next495 to i32 %cmp161430 = icmp sgt i32 %k.0.lcssa506517541552, %29 br i1 %cmp161430, label %for.body163.lr.ph, label %for.end258 for.body163.lr.ph: ; preds = %for.body153 %y159 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %indvars.iv494, i32 1 %30 = load i32, ptr %y159, align 4, !tbaa !15 %idxprom221 = sext i32 %30 to i64 %idxprom223 = sext i32 %28 to i64 %arrayidx224 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom221, i64 %idxprom223 %D241 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom221, i64 %idxprom223, i32 2 %R190 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom221, i64 %idxprom223, i32 1 br label %for.body163 for.body163: ; preds = %for.body163.lr.ph, %for.inc256 %indvars.iv489 = phi i64 [ %indvars.iv487, %for.body163.lr.ph ], [ %indvars.iv.next490, %for.inc256 ] %arrayidx165 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %indvars.iv489 %31 = load i32, ptr %arrayidx165, align 8, !tbaa !17 %y169 = getelementptr inbounds [2500 x %struct.pair], ptr @b, i64 0, i64 %indvars.iv489, i32 1 %32 = load i32, ptr %y169, align 4, !tbaa !15 %cmp170 = icmp eq i32 %31, %28 br i1 %cmp170, label %cleanup, label %if.end182 if.end182: ; preds = %for.body163 %cmp183 = icmp sgt i32 %31, %28 br i1 %cmp183, label %if.then185, label %if.end217 if.then185: ; preds = %if.end182 %33 = load i32, ptr %R190, align 4, !tbaa !9 %cmp191 = icmp sgt i32 %33, %31 br i1 %cmp191, label %land.lhs.true, label %lor.lhs.false land.lhs.true: ; preds = %if.then185 %idxprom195 = sext i32 %31 to i64 %D197 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom221, i64 %idxprom195, i32 2 %34 = load i32, ptr %D197, align 8, !tbaa !23 %cmp198 = icmp sgt i32 %34, %32 br i1 %cmp198, label %for.inc256, label %lor.lhs.false lor.lhs.false: ; preds = %land.lhs.true, %if.then185 %35 = load i32, ptr %D241, align 8, !tbaa !23 %cmp205 = icmp sgt i32 %35, %32 br i1 %cmp205, label %land.lhs.true207, label %if.end274 land.lhs.true207: ; preds = %lor.lhs.false %idxprom208 = sext i32 %32 to i64 %R212 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom208, i64 %idxprom223, i32 1 %36 = load i32, ptr %R212, align 4, !tbaa !9 %cmp213 = icmp sgt i32 %36, %31 br i1 %cmp213, label %for.inc256, label %if.end274 if.end217: ; preds = %if.end182 %cmp218 = icmp slt i32 %31, %28 br i1 %cmp218, label %if.then220, label %for.inc256 if.then220: ; preds = %if.end217 %37 = load i32, ptr %arrayidx224, align 16, !tbaa !20 %cmp226 = icmp slt i32 %37, %31 br i1 %cmp226, label %land.lhs.true228, label %lor.lhs.false236 land.lhs.true228: ; preds = %if.then220 %idxprom231 = sext i32 %31 to i64 %D233 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom221, i64 %idxprom231, i32 2 %38 = load i32, ptr %D233, align 8, !tbaa !23 %cmp234 = icmp sgt i32 %38, %32 br i1 %cmp234, label %for.inc256, label %lor.lhs.false236 lor.lhs.false236: ; preds = %land.lhs.true228, %if.then220 %39 = load i32, ptr %D241, align 8, !tbaa !23 %cmp242 = icmp sgt i32 %39, %32 br i1 %cmp242, label %land.lhs.true244, label %if.end274 land.lhs.true244: ; preds = %lor.lhs.false236 %idxprom245 = sext i32 %32 to i64 %arrayidx248 = getelementptr inbounds [50 x [50 x %struct.quad]], ptr @c, i64 0, i64 %idxprom245, i64 %idxprom223 %40 = load i32, ptr %arrayidx248, align 16, !tbaa !20 %cmp250 = icmp slt i32 %40, %31 br i1 %cmp250, label %for.inc256, label %if.end274 cleanup: ; preds = %for.body163 %41 = load i32, ptr %D241, align 8, !tbaa !23 %cmp178.not = icmp sgt i32 %41, %32 br i1 %cmp178.not, label %for.inc256, label %for.end258 for.inc256: ; preds = %if.end217, %land.lhs.true228, %land.lhs.true244, %land.lhs.true, %land.lhs.true207, %cleanup %indvars.iv.next490 = add nuw nsw i64 %indvars.iv489, 1 %lftr.wideiv = trunc i64 %indvars.iv.next490 to i32 %exitcond493.not = icmp eq i32 %k.0.lcssa506517541552, %lftr.wideiv br i1 %exitcond493.not, label %for.end258, label %for.body163, !llvm.loop !29 for.end258: ; preds = %for.inc256, %cleanup, %for.body153 %correct.3 = phi i32 [ %correct.0, %for.body153 ], [ 0, %cleanup ], [ %correct.0, %for.inc256 ] %cmp259 = icmp eq i32 %correct.3, 0 %indvars.iv.next488 = add nuw nsw i64 %indvars.iv487, 1 br i1 %cmp259, label %if.end274, label %for.cond150 if.end274: ; preds = %for.end258, %for.cond150, %lor.lhs.false236, %land.lhs.true244, %lor.lhs.false, %land.lhs.true207 %.str.3.sink = phi ptr [ @.str.3, %land.lhs.true207 ], [ @.str.3, %lor.lhs.false ], [ @.str.3, %land.lhs.true244 ], [ @.str.3, %lor.lhs.false236 ], [ @.str.2, %for.cond150 ], [ @.str.3, %for.end258 ] %call273 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %s) #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #6 ; 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 norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 = !{!10, !6, i64 4} !10 = !{!"quad", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = !{!7, !7, i64 0} !15 = !{!16, !6, i64 4} !16 = !{!"pair", !6, i64 0, !6, i64 4} !17 = !{!16, !6, i64 0} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12} !20 = !{!10, !6, i64 0} !21 = distinct !{!21, !12} !22 = distinct !{!22, !12} !23 = !{!10, !6, i64 8} !24 = distinct !{!24, !12} !25 = distinct !{!25, !12} !26 = !{!10, !6, i64 12} !27 = distinct !{!27, !12} !28 = distinct !{!28, !12} !29 = distinct !{!29, !12}
/* nash007 (Nishant Agrawal) IIIT Hyderabad */ #include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #define MAX 1000000007 #define swap(a,b) a=a+b-(b=a) //a -> 97; A -> 65; 0 -> 48 int cmp(const void *a,const void *b) { return (*(int*)a - *(int*)b); } int main() { int i,j,a[3][3],b[3][3]={0}; for(i=0;i<3;i++) { for(j=0;j<3;j++) { scanf("%d",&a[i][j]); b[i][j]+=a[i][j]; if(i>0) b[i-1][j]+=a[i][j]; if(j>0) b[i][j-1]+=a[i][j]; if(i!=2) b[i+1][j]+=a[i][j]; if(j!=2) b[i][j+1]+=a[i][j]; } } for(i=0;i<3;i++) { for(j=0;j<3;j++) { if(b[i][j]%2==0) printf("1"); else printf("0"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca [3 x [3 x i32]], align 16 %b = alloca [3 x [3 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %b) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %b, i8 0, i64 36, i1 false) %arrayidx60.us = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 1 %arrayidx5.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr %a, i64 0, i64 0, i64 1 %arrayidx13.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 1 %arrayidx60.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 2 %arrayidx5.us.2 = getelementptr inbounds [3 x [3 x i32]], ptr %a, i64 0, i64 0, i64 2 %arrayidx13.us.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 2 %call.us.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 16, !tbaa !5 %1 = load i32, ptr %b, align 16, !tbaa !5 %add.us.peel = add nsw i32 %1, %0 store i32 %add.us.peel, ptr %b, align 16, !tbaa !5 %arrayidx47.us.peel = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 0 %2 = load i32, ptr %arrayidx47.us.peel, align 4, !tbaa !5 %add48.us.peel = add nsw i32 %2, %0 store i32 %add48.us.peel, ptr %arrayidx47.us.peel, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx60.us, align 4, !tbaa !5 %add61.us.peel = add nsw i32 %3, %0 %call.us.1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.us.1) %4 = load i32, ptr %arrayidx5.us.1, align 4, !tbaa !5 %add.us.1.peel = add nsw i32 %add61.us.peel, %4 store i32 %add.us.1.peel, ptr %arrayidx13.us.1, align 4, !tbaa !5 %5 = load i32, ptr %b, align 16, !tbaa !5 %add35.us.1.peel = add nsw i32 %5, %4 store i32 %add35.us.1.peel, ptr %b, align 16, !tbaa !5 %arrayidx47.us.1.peel = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 1 %6 = load i32, ptr %arrayidx47.us.1.peel, align 16, !tbaa !5 %add48.us.1.peel = add nsw i32 %6, %4 store i32 %add48.us.1.peel, ptr %arrayidx47.us.1.peel, align 16, !tbaa !5 %7 = load i32, ptr %arrayidx60.us.1, align 8, !tbaa !5 %add61.us.1.peel = add nsw i32 %7, %4 %call.us.2.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.us.2) %8 = load i32, ptr %arrayidx5.us.2, align 8, !tbaa !5 %add.us.2.peel = add nsw i32 %add61.us.1.peel, %8 store i32 %add.us.2.peel, ptr %arrayidx13.us.2, align 8, !tbaa !5 %9 = load i32, ptr %arrayidx13.us.1, align 4, !tbaa !5 %add35.us.2.peel = add nsw i32 %9, %8 store i32 %add35.us.2.peel, ptr %arrayidx13.us.1, align 4, !tbaa !5 %arrayidx47.2.peel = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 2 %10 = load i32, ptr %arrayidx47.2.peel, align 4, !tbaa !5 %add48.2.peel = add nsw i32 %10, %8 store i32 %add48.2.peel, ptr %arrayidx47.2.peel, align 4, !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc63 %indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %for.inc63 ] %11 = add nuw nsw i64 %indvars.iv, 4294967295 %idxprom19 = and i64 %11, 4294967295 %cmp37.not = icmp eq i64 %indvars.iv, 2 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx5 = getelementptr inbounds [3 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 0 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %12 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 0 %13 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %add = add nsw i32 %13, %12 store i32 %add, ptr %arrayidx13, align 4, !tbaa !5 %arrayidx22 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %idxprom19, i64 0 %14 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %add23 = add nsw i32 %14, %12 store i32 %add23, ptr %arrayidx22, align 4, !tbaa !5 br i1 %cmp37.not, label %if.end36.1, label %if.then38 if.then38: ; preds = %for.cond1.preheader %arrayidx47 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv.next, i64 0 %15 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %add48 = add nsw i32 %15, %12 store i32 %add48, ptr %arrayidx47, align 4, !tbaa !5 br label %if.end36.1 if.end36.1: ; preds = %if.then38, %for.cond1.preheader %arrayidx60 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 1 %16 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %add61 = add nsw i32 %16, %12 store i32 %add61, ptr %arrayidx60, align 4, !tbaa !5 %arrayidx5.1 = getelementptr inbounds [3 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %17 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %arrayidx13.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 1 %add.1 = add nsw i32 %add61, %17 store i32 %add.1, ptr %arrayidx13.1, align 4, !tbaa !5 %arrayidx22.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %idxprom19, i64 1 %18 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5 %add23.1 = add nsw i32 %18, %17 store i32 %add23.1, ptr %arrayidx22.1, align 4, !tbaa !5 %19 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %add35.1 = add nsw i32 %19, %17 store i32 %add35.1, ptr %arrayidx13, align 4, !tbaa !5 br i1 %cmp37.not, label %if.end36.2, label %if.then38.1 if.then38.1: ; preds = %if.end36.1 %arrayidx47.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv.next, i64 1 %20 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5 %add48.1 = add nsw i32 %20, %17 store i32 %add48.1, ptr %arrayidx47.1, align 4, !tbaa !5 br label %if.end36.2 if.end36.2: ; preds = %if.then38.1, %if.end36.1 %arrayidx60.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 2 %21 = load i32, ptr %arrayidx60.1, align 4, !tbaa !5 %add61.1 = add nsw i32 %21, %17 store i32 %add61.1, ptr %arrayidx60.1, align 4, !tbaa !5 %arrayidx5.2 = getelementptr inbounds [3 x [3 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2) %22 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5 %arrayidx13.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv, i64 2 %add.2 = add nsw i32 %add61.1, %22 store i32 %add.2, ptr %arrayidx13.2, align 4, !tbaa !5 %arrayidx22.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %idxprom19, i64 2 %23 = load i32, ptr %arrayidx22.2, align 4, !tbaa !5 %add23.2 = add nsw i32 %23, %22 store i32 %add23.2, ptr %arrayidx22.2, align 4, !tbaa !5 %24 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5 %add35.2 = add nsw i32 %24, %22 store i32 %add35.2, ptr %arrayidx13.1, align 4, !tbaa !5 br i1 %cmp37.not, label %for.cond69.preheader.preheader, label %for.inc63 for.inc63: ; preds = %if.end36.2 %arrayidx47.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 %indvars.iv.next, i64 2 %25 = load i32, ptr %arrayidx47.2, align 4, !tbaa !5 %add48.2 = add nsw i32 %25, %22 store i32 %add48.2, ptr %arrayidx47.2, align 4, !tbaa !5 %exitcond.not = icmp eq i64 %indvars.iv.next, 3 br i1 %exitcond.not, label %for.cond69.preheader.preheader, label %for.cond1.preheader, !llvm.loop !9 for.cond69.preheader.preheader: ; preds = %if.end36.2, %for.inc63 %26 = load i32, ptr %b, align 16, !tbaa !5 %27 = and i32 %26, 1 %. = xor i32 %27, 49 %putchar123 = call i32 @putchar(i32 %.) %arrayidx75.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 1 %28 = load i32, ptr %arrayidx75.1, align 4, !tbaa !5 %29 = and i32 %28, 1 %.sink163 = xor i32 %29, 49 %putchar123.1 = call i32 @putchar(i32 %.sink163) %arrayidx75.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 0, i64 2 %30 = load i32, ptr %arrayidx75.2, align 8, !tbaa !5 %31 = and i32 %30, 1 %.sink164 = xor i32 %31, 49 %putchar123.2 = call i32 @putchar(i32 %.sink164) %putchar = call i32 @putchar(i32 10) %arrayidx75.1145 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 0 %32 = load i32, ptr %arrayidx75.1145, align 4, !tbaa !5 %33 = and i32 %32, 1 %.sink165 = xor i32 %33, 49 %putchar123.1149 = call i32 @putchar(i32 %.sink165) %arrayidx75.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 1 %34 = load i32, ptr %arrayidx75.1.1, align 16, !tbaa !5 %35 = and i32 %34, 1 %.sink166 = xor i32 %35, 49 %putchar123.1.1 = call i32 @putchar(i32 %.sink166) %arrayidx75.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 1, i64 2 %36 = load i32, ptr %arrayidx75.2.1, align 4, !tbaa !5 %37 = and i32 %36, 1 %.sink167 = xor i32 %37, 49 %putchar123.2.1 = call i32 @putchar(i32 %.sink167) %putchar.1 = call i32 @putchar(i32 10) %arrayidx75.2152 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 2, i64 0 %38 = load i32, ptr %arrayidx75.2152, align 8, !tbaa !5 %39 = and i32 %38, 1 %.sink168 = xor i32 %39, 49 %putchar123.2156 = call i32 @putchar(i32 %.sink168) %arrayidx75.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 2, i64 1 %40 = load i32, ptr %arrayidx75.1.2, align 4, !tbaa !5 %41 = and i32 %40, 1 %.sink169 = xor i32 %41, 49 %putchar123.1.2 = call i32 @putchar(i32 %.sink169) %arrayidx75.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %b, i64 0, i64 2, i64 2 %42 = load i32, ptr %arrayidx75.2.2, align 16, !tbaa !5 %43 = and i32 %42, 1 %.sink170 = xor i32 %43, 49 %putchar123.2.2 = call i32 @putchar(i32 %.sink170) %putchar.2 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char w[11], t[1001]; int ans[26] = {0}; int i = 0; int ch; while ((ch = getchar()) != EOF) { if (ch >= 'A' && ch <= 'Z') { ch = ch - 'A' + 'a'; } ch -= 'a'; ans[ch]++; } for (i = 0; i < 26; i++) { printf("%c : %d\n", i + 'a', ans[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154320/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154320/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ans = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %ans) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %ans, i8 0, i64 104, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i17 = tail call i32 @getc(ptr noundef %0) %cmp.not18 = icmp eq i32 %call.i17, -1 br i1 %cmp.not18, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %while.body %.pre = load i32, ptr %ans, align 16, !tbaa !9 %arrayidx7.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 1 %.pre23 = load i32, ptr %arrayidx7.1.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 2 %.pre24 = load i32, ptr %arrayidx7.2.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 3 %.pre25 = load i32, ptr %arrayidx7.3.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 4 %.pre26 = load i32, ptr %arrayidx7.4.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 5 %.pre27 = load i32, ptr %arrayidx7.5.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 6 %.pre28 = load i32, ptr %arrayidx7.6.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 7 %.pre29 = load i32, ptr %arrayidx7.7.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 8 %.pre30 = load i32, ptr %arrayidx7.8.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 9 %.pre31 = load i32, ptr %arrayidx7.9.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 10 %.pre32 = load i32, ptr %arrayidx7.10.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 11 %.pre33 = load i32, ptr %arrayidx7.11.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 12 %.pre34 = load i32, ptr %arrayidx7.12.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 13 %.pre35 = load i32, ptr %arrayidx7.13.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 14 %.pre36 = load i32, ptr %arrayidx7.14.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 15 %.pre37 = load i32, ptr %arrayidx7.15.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 16 %.pre38 = load i32, ptr %arrayidx7.16.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 17 %.pre39 = load i32, ptr %arrayidx7.17.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 18 %.pre40 = load i32, ptr %arrayidx7.18.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 19 %.pre41 = load i32, ptr %arrayidx7.19.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 20 %.pre42 = load i32, ptr %arrayidx7.20.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 21 %.pre43 = load i32, ptr %arrayidx7.21.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 22 %.pre44 = load i32, ptr %arrayidx7.22.phi.trans.insert, align 8, !tbaa !9 %arrayidx7.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 23 %.pre45 = load i32, ptr %arrayidx7.23.phi.trans.insert, align 4, !tbaa !9 %arrayidx7.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 24 %.pre46 = load i32, ptr %arrayidx7.24.phi.trans.insert, align 16, !tbaa !9 %arrayidx7.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 25 %.pre47 = load i32, ptr %arrayidx7.25.phi.trans.insert, align 4, !tbaa !9 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %1 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre31, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre30, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre29, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre28, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre27, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre26, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre25, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre24, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre23, %for.cond.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %26) %call8.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %25) %call8.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %24) %call8.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %23) %call8.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %22) %call8.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %21) %call8.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %20) %call8.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %19) %call8.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %18) %call8.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %17) %call8.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %16) %call8.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %15) %call8.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %14) %call8.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %13) %call8.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %12) %call8.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %11) %call8.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %10) %call8.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %9) %call8.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %8) %call8.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %7) %call8.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %6) %call8.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %5) %call8.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %4) %call8.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %3) %call8.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %2) %call8.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %ans) #4 ret i32 0 while.body: ; preds = %entry, %while.body %call.i19 = phi i32 [ %call.i, %while.body ], [ %call.i17, %entry ] %27 = add i32 %call.i19, -65 %or.cond = icmp ult i32 %27, 26 %add = add nsw i32 %call.i19, 32 %spec.select = select i1 %or.cond, i32 %add, i32 %call.i19 %sub3 = add nsw i32 %spec.select, -97 %idxprom = sext i32 %sub3 to i64 %arrayidx = getelementptr inbounds [26 x i32], ptr %ans, i64 0, i64 %idxprom %28 = load i32, ptr %arrayidx, align 4, !tbaa !9 %inc = add nsw i32 %28, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !9 %29 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %29) %cmp.not = icmp eq i32 %call.i, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture 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 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <ctype.h> int main(void) { int i, n = 1; for( i = 'a'; i < 'z'; ++i ) ++n; int ch, sum[n]; for( i = 0; i < n; ++i ) sum[i] = 0; while( ch = getchar(), ch != EOF ){ if( isalpha(ch) ){ ch = tolower(ch); sum[ch-'a'] += 1; } } for( i = 0; i < n; ++i ) printf("%c : %d\n", 'a'+i, sum[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154364/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154364/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %vla65 = alloca [26 x i32], align 16 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %vla65, i8 0, i64 104, i1 false), !tbaa !5 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i58 = tail call i32 @getc(ptr noundef %0) %cmp8.not59 = icmp eq i32 %call.i58, -1 br i1 %cmp8.not59, label %for.cond24.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %call9 = tail call ptr @__ctype_b_loc() #4 br label %while.body for.cond24.preheader.loopexit: ; preds = %if.end23 %.pre = load i32, ptr %vla65, align 16, !tbaa !5 br label %for.cond24.preheader for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %entry %1 = phi i32 [ %.pre, %for.cond24.preheader.loopexit ], [ 0, %entry ] %call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %1) %arrayidx30.1 = getelementptr inbounds i32, ptr %vla65, i64 1 %2 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %call31.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %2) %arrayidx30.2 = getelementptr inbounds i32, ptr %vla65, i64 2 %3 = load i32, ptr %arrayidx30.2, align 8, !tbaa !5 %call31.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %3) %arrayidx30.3 = getelementptr inbounds i32, ptr %vla65, i64 3 %4 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 %call31.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %4) %arrayidx30.4 = getelementptr inbounds i32, ptr %vla65, i64 4 %5 = load i32, ptr %arrayidx30.4, align 16, !tbaa !5 %call31.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %5) %arrayidx30.5 = getelementptr inbounds i32, ptr %vla65, i64 5 %6 = load i32, ptr %arrayidx30.5, align 4, !tbaa !5 %call31.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %6) %arrayidx30.6 = getelementptr inbounds i32, ptr %vla65, i64 6 %7 = load i32, ptr %arrayidx30.6, align 8, !tbaa !5 %call31.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %7) %arrayidx30.7 = getelementptr inbounds i32, ptr %vla65, i64 7 %8 = load i32, ptr %arrayidx30.7, align 4, !tbaa !5 %call31.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %8) %arrayidx30.8 = getelementptr inbounds i32, ptr %vla65, i64 8 %9 = load i32, ptr %arrayidx30.8, align 16, !tbaa !5 %call31.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %9) %arrayidx30.9 = getelementptr inbounds i32, ptr %vla65, i64 9 %10 = load i32, ptr %arrayidx30.9, align 4, !tbaa !5 %call31.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %10) %arrayidx30.10 = getelementptr inbounds i32, ptr %vla65, i64 10 %11 = load i32, ptr %arrayidx30.10, align 8, !tbaa !5 %call31.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %11) %arrayidx30.11 = getelementptr inbounds i32, ptr %vla65, i64 11 %12 = load i32, ptr %arrayidx30.11, align 4, !tbaa !5 %call31.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %12) %arrayidx30.12 = getelementptr inbounds i32, ptr %vla65, i64 12 %13 = load i32, ptr %arrayidx30.12, align 16, !tbaa !5 %call31.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %13) %arrayidx30.13 = getelementptr inbounds i32, ptr %vla65, i64 13 %14 = load i32, ptr %arrayidx30.13, align 4, !tbaa !5 %call31.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %14) %arrayidx30.14 = getelementptr inbounds i32, ptr %vla65, i64 14 %15 = load i32, ptr %arrayidx30.14, align 8, !tbaa !5 %call31.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %15) %arrayidx30.15 = getelementptr inbounds i32, ptr %vla65, i64 15 %16 = load i32, ptr %arrayidx30.15, align 4, !tbaa !5 %call31.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %16) %arrayidx30.16 = getelementptr inbounds i32, ptr %vla65, i64 16 %17 = load i32, ptr %arrayidx30.16, align 16, !tbaa !5 %call31.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %17) %arrayidx30.17 = getelementptr inbounds i32, ptr %vla65, i64 17 %18 = load i32, ptr %arrayidx30.17, align 4, !tbaa !5 %call31.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %18) %arrayidx30.18 = getelementptr inbounds i32, ptr %vla65, i64 18 %19 = load i32, ptr %arrayidx30.18, align 8, !tbaa !5 %call31.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %19) %arrayidx30.19 = getelementptr inbounds i32, ptr %vla65, i64 19 %20 = load i32, ptr %arrayidx30.19, align 4, !tbaa !5 %call31.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %20) %arrayidx30.20 = getelementptr inbounds i32, ptr %vla65, i64 20 %21 = load i32, ptr %arrayidx30.20, align 16, !tbaa !5 %call31.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %21) %arrayidx30.21 = getelementptr inbounds i32, ptr %vla65, i64 21 %22 = load i32, ptr %arrayidx30.21, align 4, !tbaa !5 %call31.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %22) %arrayidx30.22 = getelementptr inbounds i32, ptr %vla65, i64 22 %23 = load i32, ptr %arrayidx30.22, align 8, !tbaa !5 %call31.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %23) %arrayidx30.23 = getelementptr inbounds i32, ptr %vla65, i64 23 %24 = load i32, ptr %arrayidx30.23, align 4, !tbaa !5 %call31.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %24) %arrayidx30.24 = getelementptr inbounds i32, ptr %vla65, i64 24 %25 = load i32, ptr %arrayidx30.24, align 16, !tbaa !5 %call31.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %25) %arrayidx30.25 = getelementptr inbounds i32, ptr %vla65, i64 25 %26 = load i32, ptr %arrayidx30.25, align 4, !tbaa !5 %call31.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %26) ret i32 0 while.body: ; preds = %while.body.lr.ph, %if.end23 %call.i60 = phi i32 [ %call.i58, %while.body.lr.ph ], [ %call.i, %if.end23 ] %27 = load ptr, ptr %call9, align 8, !tbaa !9 %idxprom10 = sext i32 %call.i60 to i64 %arrayidx11 = getelementptr inbounds i16, ptr %27, i64 %idxprom10 %28 = load i16, ptr %arrayidx11, align 2, !tbaa !11 %29 = and i16 %28, 1024 %tobool.not = icmp eq i16 %29, 0 br i1 %tobool.not, label %if.end23, label %if.else if.else: ; preds = %while.body %30 = add i32 %call.i60, 128 %or.cond.i = icmp ult i32 %30, 384 br i1 %or.cond.i, label %if.end.sink.split, label %if.end if.end.sink.split: ; preds = %if.else %call.i54 = tail call ptr @__ctype_tolower_loc() #4 %31 = load ptr, ptr %call.i54, align 8, !tbaa !9 %arrayidx.i = getelementptr inbounds i32, ptr %31, i64 %idxprom10 %32 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.end.sink.split, %if.else %__res.0 = phi i32 [ %call.i60, %if.else ], [ %32, %if.end.sink.split ] %sub = add nsw i32 %__res.0, -97 %idxprom21 = sext i32 %sub to i64 %arrayidx22 = getelementptr inbounds i32, ptr %vla65, i64 %idxprom21 %33 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %add = add nsw i32 %33, 1 store i32 %add, ptr %arrayidx22, align 4, !tbaa !5 br label %if.end23 if.end23: ; preds = %if.end, %while.body %34 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = tail call i32 @getc(ptr noundef %34) %cmp8.not = icmp eq i32 %call.i, -1 br i1 %cmp8.not, label %for.cond24.preheader.loopexit, label %while.body, !llvm.loop !13 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; 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 nofree nosync nounwind willreturn memory(none) "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"short", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int i,j; int count[27] = {0}; char c; while(scanf("%c",&c) != EOF){ for(j = 97;j < 123;j++){ if(c >= 65 && c <= 90){ c+=32; }else if(c < 97 || c > 122){ continue; } if(c == j){ count[j-97]++; } } } for(i = 0;i+97 < 123;i++){ printf("%c : %d\n",i+97,count[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154414/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154414/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %count = alloca [27 x i32], align 16 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(108) %count, i8 0, i64 108, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 %call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %cmp.not49 = icmp eq i32 %call48, -1 br i1 %cmp.not49, label %for.cond23.preheader, label %for.cond.preheader while.cond.loopexit: ; preds = %for.inc %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond23.preheader.loopexit, label %for.cond.preheader, !llvm.loop !5 for.cond.preheader: ; preds = %entry, %while.cond.loopexit %c.promoted = load i8, ptr %c, align 1 br label %for.body for.cond23.preheader.loopexit: ; preds = %while.cond.loopexit %.pre = load i32, ptr %count, align 16, !tbaa !7 %arrayidx30.1.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 1 %.pre57 = load i32, ptr %arrayidx30.1.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.2.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 2 %.pre58 = load i32, ptr %arrayidx30.2.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.3.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 3 %.pre59 = load i32, ptr %arrayidx30.3.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.4.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 4 %.pre60 = load i32, ptr %arrayidx30.4.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.5.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 5 %.pre61 = load i32, ptr %arrayidx30.5.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.6.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 6 %.pre62 = load i32, ptr %arrayidx30.6.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.7.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 7 %.pre63 = load i32, ptr %arrayidx30.7.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.8.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 8 %.pre64 = load i32, ptr %arrayidx30.8.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.9.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 9 %.pre65 = load i32, ptr %arrayidx30.9.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.10.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 10 %.pre66 = load i32, ptr %arrayidx30.10.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.11.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 11 %.pre67 = load i32, ptr %arrayidx30.11.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.12.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 12 %.pre68 = load i32, ptr %arrayidx30.12.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.13.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 13 %.pre69 = load i32, ptr %arrayidx30.13.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.14.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 14 %.pre70 = load i32, ptr %arrayidx30.14.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.15.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 15 %.pre71 = load i32, ptr %arrayidx30.15.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.16.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 16 %.pre72 = load i32, ptr %arrayidx30.16.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.17.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 17 %.pre73 = load i32, ptr %arrayidx30.17.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.18.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 18 %.pre74 = load i32, ptr %arrayidx30.18.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.19.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 19 %.pre75 = load i32, ptr %arrayidx30.19.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.20.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 20 %.pre76 = load i32, ptr %arrayidx30.20.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.21.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 21 %.pre77 = load i32, ptr %arrayidx30.21.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.22.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 22 %.pre78 = load i32, ptr %arrayidx30.22.phi.trans.insert, align 8, !tbaa !7 %arrayidx30.23.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 23 %.pre79 = load i32, ptr %arrayidx30.23.phi.trans.insert, align 4, !tbaa !7 %arrayidx30.24.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 24 %.pre80 = load i32, ptr %arrayidx30.24.phi.trans.insert, align 16, !tbaa !7 %arrayidx30.25.phi.trans.insert = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 25 %.pre81 = load i32, ptr %arrayidx30.25.phi.trans.insert, align 4, !tbaa !7 br label %for.cond23.preheader for.cond23.preheader: ; preds = %for.cond23.preheader.loopexit, %entry %0 = phi i32 [ %.pre81, %for.cond23.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre80, %for.cond23.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre79, %for.cond23.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre78, %for.cond23.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre77, %for.cond23.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre76, %for.cond23.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre75, %for.cond23.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre74, %for.cond23.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre73, %for.cond23.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre72, %for.cond23.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre71, %for.cond23.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre70, %for.cond23.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre69, %for.cond23.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre68, %for.cond23.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre67, %for.cond23.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre66, %for.cond23.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre65, %for.cond23.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre64, %for.cond23.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre63, %for.cond23.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre62, %for.cond23.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre61, %for.cond23.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre60, %for.cond23.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre59, %for.cond23.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre58, %for.cond23.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre57, %for.cond23.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond23.preheader.loopexit ], [ 0, %entry ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call31.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call31.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call31.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call31.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call31.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call31.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call31.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call31.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call31.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call31.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call31.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call31.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call31.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call31.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call31.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call31.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call31.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call31.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call31.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call31.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call31.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call31.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call31.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call31.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call31.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %count) #4 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ 97, %for.cond.preheader ], [ %indvars.iv.next, %for.inc ] %add4546 = phi i8 [ %c.promoted, %for.cond.preheader ], [ %add43, %for.inc ] %26 = add i8 %add4546, -65 %or.cond = icmp ult i8 %26, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nuw nsw i8 %add4546, 32 store i8 %add, ptr %c, align 1, !tbaa !11 %27 = zext i8 %add to i64 %cmp18.old = icmp eq i64 %indvars.iv, %27 br i1 %cmp18.old, label %if.then20, label %for.inc if.else: ; preds = %for.body %28 = add i8 %add4546, -97 %or.cond35 = icmp ult i8 %28, 26 %conv17 = sext i8 %add4546 to i64 %29 = and i64 %conv17, 4294967295 %cmp18 = icmp eq i64 %indvars.iv, %29 %or.cond42 = and i1 %or.cond35, %cmp18 br i1 %or.cond42, label %if.then20, label %for.inc if.then20: ; preds = %if.else, %if.then %add44 = phi i8 [ %add4546, %if.else ], [ %add, %if.then ] %30 = add nsw i64 %indvars.iv, -97 %arrayidx = getelementptr inbounds [27 x i32], ptr %count, i64 0, i64 %30 %31 = load i32, ptr %arrayidx, align 4, !tbaa !7 %inc = add nsw i32 %31, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %if.then, %if.then20, %if.else %add43 = phi i8 [ %add, %if.then ], [ %add44, %if.then20 ], [ %add4546, %if.else ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 123 br i1 %exitcond.not, label %while.cond.loopexit, label %for.body, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = !{!9, !9, i64 0} !12 = distinct !{!12, !6}
#include<stdio.h> #define SIZE 1210 int main(){ char x[SIZE]; int str[26]={0},i=0,num=0; while(fgets(x,SIZE,stdin) != NULL){ for(i = 0;x[i]!=NULL;i++){ if(x[i] >='a' && 'z'>=x[i]){ num=x[i]-'a'; str[num]++; }else if(x[i] >='A' && 'Z'>=x[i]){ num=x[i]-'A'; str[num]++; } } } for(i=0;i<26;i++) printf("%c : %d\n",i+'a',str[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [1210 x i8], align 16 %str = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1210, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %str) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %str, i8 0, i64 104, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call64 = call ptr @fgets(ptr noundef nonnull %x, i32 noundef 1210, ptr noundef %0) %cmp.not65 = icmp eq ptr %call64, null br i1 %cmp.not65, label %for.cond39.preheader, label %for.cond.preheader while.cond.loopexit: ; preds = %for.inc, %for.cond.preheader %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %x, i32 noundef 1210, ptr noundef %1) %cmp.not = icmp eq ptr %call, null br i1 %cmp.not, label %for.cond39.preheader.loopexit, label %for.cond.preheader, !llvm.loop !9 for.cond.preheader: ; preds = %entry, %while.cond.loopexit %2 = load i8, ptr %x, align 16, !tbaa !11 %cmp1.not62 = icmp eq i8 %2, 0 br i1 %cmp1.not62, label %while.cond.loopexit, label %for.body for.cond39.preheader.loopexit: ; preds = %while.cond.loopexit %.pre = load i32, ptr %str, align 16, !tbaa !12 %arrayidx44.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 1 %.pre71 = load i32, ptr %arrayidx44.1.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 2 %.pre72 = load i32, ptr %arrayidx44.2.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 3 %.pre73 = load i32, ptr %arrayidx44.3.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 4 %.pre74 = load i32, ptr %arrayidx44.4.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 5 %.pre75 = load i32, ptr %arrayidx44.5.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 6 %.pre76 = load i32, ptr %arrayidx44.6.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 7 %.pre77 = load i32, ptr %arrayidx44.7.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 8 %.pre78 = load i32, ptr %arrayidx44.8.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 9 %.pre79 = load i32, ptr %arrayidx44.9.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 10 %.pre80 = load i32, ptr %arrayidx44.10.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 11 %.pre81 = load i32, ptr %arrayidx44.11.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 12 %.pre82 = load i32, ptr %arrayidx44.12.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 13 %.pre83 = load i32, ptr %arrayidx44.13.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 14 %.pre84 = load i32, ptr %arrayidx44.14.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 15 %.pre85 = load i32, ptr %arrayidx44.15.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 16 %.pre86 = load i32, ptr %arrayidx44.16.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 17 %.pre87 = load i32, ptr %arrayidx44.17.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 18 %.pre88 = load i32, ptr %arrayidx44.18.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 19 %.pre89 = load i32, ptr %arrayidx44.19.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 20 %.pre90 = load i32, ptr %arrayidx44.20.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 21 %.pre91 = load i32, ptr %arrayidx44.21.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 22 %.pre92 = load i32, ptr %arrayidx44.22.phi.trans.insert, align 8, !tbaa !12 %arrayidx44.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 23 %.pre93 = load i32, ptr %arrayidx44.23.phi.trans.insert, align 4, !tbaa !12 %arrayidx44.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 24 %.pre94 = load i32, ptr %arrayidx44.24.phi.trans.insert, align 16, !tbaa !12 %arrayidx44.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 25 %.pre95 = load i32, ptr %arrayidx44.25.phi.trans.insert, align 4, !tbaa !12 br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.cond39.preheader.loopexit, %entry %3 = phi i32 [ %.pre95, %for.cond39.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre94, %for.cond39.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre93, %for.cond39.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre92, %for.cond39.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre91, %for.cond39.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre90, %for.cond39.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre89, %for.cond39.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre88, %for.cond39.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre87, %for.cond39.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre86, %for.cond39.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre85, %for.cond39.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre84, %for.cond39.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre83, %for.cond39.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre82, %for.cond39.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre81, %for.cond39.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre80, %for.cond39.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre79, %for.cond39.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre78, %for.cond39.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre77, %for.cond39.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre76, %for.cond39.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre75, %for.cond39.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre74, %for.cond39.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre73, %for.cond39.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre72, %for.cond39.preheader.loopexit ], [ 0, %entry ] %27 = phi i32 [ %.pre71, %for.cond39.preheader.loopexit ], [ 0, %entry ] %28 = phi i32 [ %.pre, %for.cond39.preheader.loopexit ], [ 0, %entry ] %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %28) %call45.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %27) %call45.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %26) %call45.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %25) %call45.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %24) %call45.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %23) %call45.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %22) %call45.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %21) %call45.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %20) %call45.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %19) %call45.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %18) %call45.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %17) %call45.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %16) %call45.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %15) %call45.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %14) %call45.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %13) %call45.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %12) %call45.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %11) %call45.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %10) %call45.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %9) %call45.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %8) %call45.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %7) %call45.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %6) %call45.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %5) %call45.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %4) %call45.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %str) #4 call void @llvm.lifetime.end.p0(i64 1210, ptr nonnull %x) #4 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond.preheader ] %29 = phi i8 [ %33, %for.inc ], [ %2, %for.cond.preheader ] %conv5 = sext i8 %29 to i64 %30 = add i8 %29, -97 %or.cond = icmp ult i8 %30, 26 br i1 %or.cond, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %31 = add i8 %29, -65 %or.cond61 = icmp ult i8 %31, 26 br i1 %or.cond61, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %.sink = phi i64 [ 4294967199, %for.body ], [ 4294967231, %if.else ] %sub33 = add nsw i64 %.sink, %conv5 %idxprom34 = and i64 %sub33, 4294967295 %arrayidx35 = getelementptr inbounds [26 x i32], ptr %str, i64 0, i64 %idxprom34 %32 = load i32, ptr %arrayidx35, align 4, !tbaa !12 %inc = add nsw i32 %32, 1 store i32 %inc, ptr %arrayidx35, align 4, !tbaa !12 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1210 x i8], ptr %x, i64 0, i64 %indvars.iv.next %33 = load i8, ptr %arrayidx, align 1, !tbaa !11 %cmp1.not = icmp eq i8 %33, 0 br i1 %cmp1.not, label %while.cond.loopexit, label %for.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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 = !{!"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 = !{!7, !7, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0} !14 = distinct !{!14, !10}
#include<stdio.h> int main() { char ch; int num = 0, counter[26] = { 0 }; while ((ch=getchar()) != EOF) { if ('a' <= ch&&ch <= 'z') { num = ch - 'a'; counter[num]++; } if ('A' <= ch&&ch <= 'Z') { num = ch - 'A'; counter[num]++; } } for(num=0;num<26;num++) { printf("%c : %d\n", num + 'a', counter[num]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154508/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154508/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %counter = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %counter) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %counter, i8 0, i64 104, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i42 = tail call i32 @getc(ptr noundef %0) %sext43 = shl i32 %call.i42, 24 %cmp.not45 = icmp eq i32 %sext43, -16777216 br i1 %cmp.not45, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end23 %.pre = load i32, ptr %counter, align 16, !tbaa !9 %arrayidx27.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 1 %.pre51 = load i32, ptr %arrayidx27.1.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 2 %.pre52 = load i32, ptr %arrayidx27.2.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 3 %.pre53 = load i32, ptr %arrayidx27.3.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 4 %.pre54 = load i32, ptr %arrayidx27.4.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 5 %.pre55 = load i32, ptr %arrayidx27.5.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 6 %.pre56 = load i32, ptr %arrayidx27.6.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 7 %.pre57 = load i32, ptr %arrayidx27.7.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 8 %.pre58 = load i32, ptr %arrayidx27.8.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 9 %.pre59 = load i32, ptr %arrayidx27.9.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 10 %.pre60 = load i32, ptr %arrayidx27.10.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 11 %.pre61 = load i32, ptr %arrayidx27.11.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 12 %.pre62 = load i32, ptr %arrayidx27.12.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 13 %.pre63 = load i32, ptr %arrayidx27.13.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 14 %.pre64 = load i32, ptr %arrayidx27.14.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 15 %.pre65 = load i32, ptr %arrayidx27.15.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 16 %.pre66 = load i32, ptr %arrayidx27.16.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 17 %.pre67 = load i32, ptr %arrayidx27.17.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 18 %.pre68 = load i32, ptr %arrayidx27.18.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 19 %.pre69 = load i32, ptr %arrayidx27.19.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 20 %.pre70 = load i32, ptr %arrayidx27.20.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 21 %.pre71 = load i32, ptr %arrayidx27.21.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 22 %.pre72 = load i32, ptr %arrayidx27.22.phi.trans.insert, align 8, !tbaa !9 %arrayidx27.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 23 %.pre73 = load i32, ptr %arrayidx27.23.phi.trans.insert, align 4, !tbaa !9 %arrayidx27.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 24 %.pre74 = load i32, ptr %arrayidx27.24.phi.trans.insert, align 16, !tbaa !9 %arrayidx27.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 25 %.pre75 = load i32, ptr %arrayidx27.25.phi.trans.insert, align 4, !tbaa !9 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %1 = phi i32 [ %.pre75, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre74, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre73, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre72, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre71, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre70, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre69, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre68, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre67, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre66, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre65, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre64, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre63, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %26) %call28.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %25) %call28.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %24) %call28.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %23) %call28.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %22) %call28.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %21) %call28.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %20) %call28.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %19) %call28.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %18) %call28.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %17) %call28.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %16) %call28.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %15) %call28.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %14) %call28.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %13) %call28.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %12) %call28.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %11) %call28.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %10) %call28.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %9) %call28.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %8) %call28.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %7) %call28.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %6) %call28.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %5) %call28.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %4) %call28.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %3) %call28.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %2) %call28.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %counter) #4 ret i32 0 while.body: ; preds = %entry, %if.end23 %sext46 = phi i32 [ %sext, %if.end23 ], [ %sext43, %entry ] %conv147 = ashr exact i32 %sext46, 24 %27 = add i32 %sext46, -1610612737 %or.cond = icmp ult i32 %27, 452984831 br i1 %or.cond, label %if.end23.sink.split, label %if.end if.end: ; preds = %while.body %28 = add i32 %sext46, -1073741825 %or.cond30 = icmp ult i32 %28, 452984831 br i1 %or.cond30, label %if.end23.sink.split, label %if.end23 if.end23.sink.split: ; preds = %if.end, %while.body %.sink = phi i32 [ -97, %while.body ], [ -65, %if.end ] %sub19 = add nsw i32 %conv147, %.sink %idxprom20 = zext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 %idxprom20 %29 = load i32, ptr %arrayidx21, align 4, !tbaa !9 %inc = add nsw i32 %29, 1 store i32 %inc, ptr %arrayidx21, align 4, !tbaa !9 br label %if.end23 if.end23: ; preds = %if.end23.sink.split, %if.end %30 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %30) %sext = shl i32 %call.i, 24 %cmp.not = icmp eq i32 %sext, -16777216 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture 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 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ char ch; int alpha[26]={0},i; while(scanf("%c",&ch)!=EOF){ if('A'<=ch && ch<= 'Z'){ alpha[ch-'A']++; } else if('a'<=ch && ch<= 'z'){ alpha[ch-'a']++; } } for(i=0;i<26;i++){ printf("%c : %d\n",'a'+i,alpha[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154551/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154551/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 %alpha = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alpha, i8 0, i64 104, i1 false) %call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not32 = icmp eq i32 %call31, -1 br i1 %cmp.not32, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end20 %.pre = load i32, ptr %alpha, align 16, !tbaa !5 %arrayidx24.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 1 %.pre36 = load i32, ptr %arrayidx24.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 2 %.pre37 = load i32, ptr %arrayidx24.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 3 %.pre38 = load i32, ptr %arrayidx24.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 4 %.pre39 = load i32, ptr %arrayidx24.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 5 %.pre40 = load i32, ptr %arrayidx24.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 6 %.pre41 = load i32, ptr %arrayidx24.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 7 %.pre42 = load i32, ptr %arrayidx24.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 8 %.pre43 = load i32, ptr %arrayidx24.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 9 %.pre44 = load i32, ptr %arrayidx24.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 10 %.pre45 = load i32, ptr %arrayidx24.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 11 %.pre46 = load i32, ptr %arrayidx24.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 12 %.pre47 = load i32, ptr %arrayidx24.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 13 %.pre48 = load i32, ptr %arrayidx24.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 14 %.pre49 = load i32, ptr %arrayidx24.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 15 %.pre50 = load i32, ptr %arrayidx24.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 16 %.pre51 = load i32, ptr %arrayidx24.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 17 %.pre52 = load i32, ptr %arrayidx24.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 18 %.pre53 = load i32, ptr %arrayidx24.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 19 %.pre54 = load i32, ptr %arrayidx24.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 20 %.pre55 = load i32, ptr %arrayidx24.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 21 %.pre56 = load i32, ptr %arrayidx24.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 22 %.pre57 = load i32, ptr %arrayidx24.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 23 %.pre58 = load i32, ptr %arrayidx24.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 24 %.pre59 = load i32, ptr %arrayidx24.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 25 %.pre60 = load i32, ptr %arrayidx24.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call25.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call25.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call25.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call25.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call25.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call25.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call25.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call25.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call25.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call25.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call25.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call25.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call25.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call25.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call25.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call25.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call25.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call25.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call25.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call25.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call25.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call25.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 ret i32 0 while.body: ; preds = %entry, %if.end20 %26 = load i8, ptr %ch, align 1 %conv = sext i8 %26 to i64 %27 = add i8 %26, -65 %or.cond = icmp ult i8 %27, 26 br i1 %or.cond, label %if.end20.sink.split, label %if.else if.else: ; preds = %while.body %28 = add i8 %26, -97 %or.cond27 = icmp ult i8 %28, 26 br i1 %or.cond27, label %if.end20.sink.split, label %if.end20 if.end20.sink.split: ; preds = %if.else, %while.body %.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 %idxprom %29 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc19 = add nsw i32 %29, 1 store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.end20.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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"}
#include <stdio.h> static int ints[256]; int main(void) { int c; while ((c = getchar()) != EOF) { if (c >= 'A' && c <= 'Z') c ^= 0x20; ++ints[c]; } for (c = 'a'; c <= 'z'; ++c) printf("%c : %d\n", c, ints[c]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154595/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154595/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ints = internal unnamed_addr global [256 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i15 = tail call i32 @getc(ptr noundef %0) %cmp.not16 = icmp eq i32 %call.i15, -1 br i1 %cmp.not16, label %for.cond.preheader, label %while.body for.cond.preheader: ; preds = %while.body, %entry %1 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 97), align 4, !tbaa !9 %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %1) %2 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 98), align 8, !tbaa !9 %call6.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %2) %3 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 99), align 4, !tbaa !9 %call6.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %3) %4 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 100), align 16, !tbaa !9 %call6.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %4) %5 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 101), align 4, !tbaa !9 %call6.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %5) %6 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 102), align 8, !tbaa !9 %call6.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %6) %7 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 103), align 4, !tbaa !9 %call6.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %7) %8 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 104), align 16, !tbaa !9 %call6.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %8) %9 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 105), align 4, !tbaa !9 %call6.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %9) %10 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 106), align 8, !tbaa !9 %call6.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %10) %11 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 107), align 4, !tbaa !9 %call6.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %11) %12 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 108), align 16, !tbaa !9 %call6.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %12) %13 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 109), align 4, !tbaa !9 %call6.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %13) %14 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 110), align 8, !tbaa !9 %call6.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %14) %15 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 111), align 4, !tbaa !9 %call6.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %15) %16 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 112), align 16, !tbaa !9 %call6.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %16) %17 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 113), align 4, !tbaa !9 %call6.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %17) %18 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 114), align 8, !tbaa !9 %call6.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %18) %19 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 115), align 4, !tbaa !9 %call6.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %19) %20 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 116), align 16, !tbaa !9 %call6.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %20) %21 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 117), align 4, !tbaa !9 %call6.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %21) %22 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 118), align 8, !tbaa !9 %call6.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %22) %23 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 119), align 4, !tbaa !9 %call6.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %23) %24 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 120), align 16, !tbaa !9 %call6.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %24) %25 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 121), align 4, !tbaa !9 %call6.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %25) %26 = load i32, ptr getelementptr inbounds ([256 x i32], ptr @ints, i64 0, i64 122), align 8, !tbaa !9 %call6.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %26) ret i32 0 while.body: ; preds = %entry, %while.body %call.i17 = phi i32 [ %call.i, %while.body ], [ %call.i15, %entry ] %27 = add i32 %call.i17, -65 %or.cond = icmp ult i32 %27, 26 %xor = xor i32 %call.i17, 32 %spec.select = select i1 %or.cond, i32 %xor, i32 %call.i17 %idxprom = sext i32 %spec.select to i64 %arrayidx = getelementptr inbounds [256 x i32], ptr @ints, i64 0, i64 %idxprom %28 = load i32, ptr %arrayidx, align 4, !tbaa !9 %inc = add nsw i32 %28, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !9 %29 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %29) %cmp.not = icmp eq i32 %call.i, -1 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !11 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ char ch; int alpha[26]={0},i; while(scanf("%c",&ch)!=EOF){ if('A'<=ch && ch<= 'Z'){ alpha[ch-'A']++; } else if('a'<=ch && ch<= 'z'){ alpha[ch-'a']++; } } for(i=0;i<26;i++){ printf("%c : %d\n",'a'+i,alpha[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154652/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154652/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 %alpha = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alpha, i8 0, i64 104, i1 false) %call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not32 = icmp eq i32 %call31, -1 br i1 %cmp.not32, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end20 %.pre = load i32, ptr %alpha, align 16, !tbaa !5 %arrayidx24.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 1 %.pre36 = load i32, ptr %arrayidx24.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 2 %.pre37 = load i32, ptr %arrayidx24.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 3 %.pre38 = load i32, ptr %arrayidx24.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 4 %.pre39 = load i32, ptr %arrayidx24.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 5 %.pre40 = load i32, ptr %arrayidx24.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 6 %.pre41 = load i32, ptr %arrayidx24.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 7 %.pre42 = load i32, ptr %arrayidx24.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 8 %.pre43 = load i32, ptr %arrayidx24.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 9 %.pre44 = load i32, ptr %arrayidx24.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 10 %.pre45 = load i32, ptr %arrayidx24.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 11 %.pre46 = load i32, ptr %arrayidx24.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 12 %.pre47 = load i32, ptr %arrayidx24.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 13 %.pre48 = load i32, ptr %arrayidx24.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 14 %.pre49 = load i32, ptr %arrayidx24.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 15 %.pre50 = load i32, ptr %arrayidx24.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 16 %.pre51 = load i32, ptr %arrayidx24.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 17 %.pre52 = load i32, ptr %arrayidx24.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 18 %.pre53 = load i32, ptr %arrayidx24.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 19 %.pre54 = load i32, ptr %arrayidx24.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 20 %.pre55 = load i32, ptr %arrayidx24.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 21 %.pre56 = load i32, ptr %arrayidx24.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 22 %.pre57 = load i32, ptr %arrayidx24.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx24.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 23 %.pre58 = load i32, ptr %arrayidx24.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx24.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 24 %.pre59 = load i32, ptr %arrayidx24.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx24.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 25 %.pre60 = load i32, ptr %arrayidx24.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call25.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call25.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call25.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call25.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call25.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call25.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call25.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call25.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call25.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call25.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call25.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call25.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call25.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call25.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call25.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call25.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call25.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call25.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call25.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call25.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call25.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call25.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alpha) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 ret i32 0 while.body: ; preds = %entry, %if.end20 %26 = load i8, ptr %ch, align 1 %conv = sext i8 %26 to i64 %27 = add i8 %26, -65 %or.cond = icmp ult i8 %27, 26 br i1 %or.cond, label %if.end20.sink.split, label %if.else if.else: ; preds = %while.body %28 = add i8 %26, -97 %or.cond27 = icmp ult i8 %28, 26 br i1 %or.cond27, label %if.end20.sink.split, label %if.end20 if.end20.sink.split: ; preds = %if.else, %while.body %.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 %idxprom %29 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc19 = add nsw i32 %29, 1 store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.end20.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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"}
#include <stdio.h> int main(int argc, const char * argv[]) { char ch; int x=0,y=97; char z; int w[25]={0}; while( scanf("%c", &ch) != EOF ) { if('A'<=ch && ch<='Z') { ch=ch+32; } if('a'<=ch && ch<='z') { w[ch-97]++; } x++; } for(y=97; y<=122;y++) { z=y; printf("%c : %d\n",z,w[y-97]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154696/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154696/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%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: %ch = alloca i8, align 1 %w = alloca [25 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %w) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %w, i8 0, i64 100, i1 false) %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not33 = icmp eq i32 %call32, -1 br i1 %cmp.not33, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end17 %.pre = load i32, ptr %w, align 16, !tbaa !5 %arrayidx25.1.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 1 %.pre37 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.2.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 2 %.pre38 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.3.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 3 %.pre39 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.4.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 4 %.pre40 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.5.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 5 %.pre41 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.6.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 6 %.pre42 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.7.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 7 %.pre43 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.8.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 8 %.pre44 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.9.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 9 %.pre45 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.10.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 10 %.pre46 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.11.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 11 %.pre47 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.12.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 12 %.pre48 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.13.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 13 %.pre49 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.14.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 14 %.pre50 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.15.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 15 %.pre51 = load i32, ptr %arrayidx25.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.16.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 16 %.pre52 = load i32, ptr %arrayidx25.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.17.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 17 %.pre53 = load i32, ptr %arrayidx25.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.18.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 18 %.pre54 = load i32, ptr %arrayidx25.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.19.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 19 %.pre55 = load i32, ptr %arrayidx25.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.20.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 20 %.pre56 = load i32, ptr %arrayidx25.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.21.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 21 %.pre57 = load i32, ptr %arrayidx25.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.22.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 22 %.pre58 = load i32, ptr %arrayidx25.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.23.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 23 %.pre59 = load i32, ptr %arrayidx25.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.24.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 24 %.pre60 = load i32, ptr %arrayidx25.24.phi.trans.insert, align 16, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %24) %call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %23) %call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %22) %call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %21) %call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %20) %call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %19) %call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %18) %call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %17) %call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %16) %call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %15) %call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %14) %call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %13) %call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %12) %call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %11) %call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %10) %call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %9) %call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %8) %call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %7) %call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %6) %call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %5) %call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %4) %call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %3) %call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %2) %call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %1) %call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %0) %arrayidx25.25 = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 25 %25 = load i32, ptr %arrayidx25.25, align 4, !tbaa !5 %call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %25) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 ret i32 0 while.body: ; preds = %entry, %if.end17 %26 = load i8, ptr %ch, align 1 %27 = add i8 %26, -65 %or.cond = icmp ult i8 %27, 26 br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %while.body %add = add nuw nsw i8 %26, 32 store i8 %add, ptr %ch, align 1, !tbaa !9 br label %if.end if.end: ; preds = %if.then, %while.body %28 = phi i8 [ %add, %if.then ], [ %26, %while.body ] %29 = add i8 %28, -97 %or.cond28 = icmp ult i8 %29, 26 br i1 %or.cond28, label %if.then15, label %if.end17 if.then15: ; preds = %if.end %conv8 = zext i8 %28 to i64 %sub = add nuw nsw i64 %conv8, 4294967199 %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [25 x i32], ptr %w, i64 0, i64 %idxprom %30 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %30, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.then15, %if.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !10 } ; 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { int memo[124]; int i,a; char c; char *base = "abcdefghijklmnopqrstuvwxyz"; memset(memo,0,sizeof(memo)); while(scanf("%c",&c)!=EOF) { if('A'<=c&&c<='Z') a=(int)(c-'A'+'a'); else a=(int)c; memo[a]++; } for (i=0;i<26;i++) printf("%c : %d\n",base[i],memo[(int)base[i]]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154746/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154746/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %memo = alloca [124 x i32], align 16 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 496, ptr nonnull %memo) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(496) %memo, i8 0, i64 496, i1 false) %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c) %cmp.not25 = icmp eq i32 %call24, -1 br i1 %cmp.not25, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %while.body %arrayidx17.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 97 %.pre = load i32, ptr %arrayidx17.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.1.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 98 %.pre28 = load i32, ptr %arrayidx17.1.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.2.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 99 %.pre29 = load i32, ptr %arrayidx17.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.3.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 100 %.pre30 = load i32, ptr %arrayidx17.3.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.4.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 101 %.pre31 = load i32, ptr %arrayidx17.4.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.5.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 102 %.pre32 = load i32, ptr %arrayidx17.5.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.6.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 103 %.pre33 = load i32, ptr %arrayidx17.6.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.7.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 104 %.pre34 = load i32, ptr %arrayidx17.7.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.8.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 105 %.pre35 = load i32, ptr %arrayidx17.8.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.9.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 106 %.pre36 = load i32, ptr %arrayidx17.9.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.10.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 107 %.pre37 = load i32, ptr %arrayidx17.10.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.11.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 108 %.pre38 = load i32, ptr %arrayidx17.11.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.12.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 109 %.pre39 = load i32, ptr %arrayidx17.12.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.13.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 110 %.pre40 = load i32, ptr %arrayidx17.13.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.14.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 111 %.pre41 = load i32, ptr %arrayidx17.14.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.15.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 112 %.pre42 = load i32, ptr %arrayidx17.15.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.16.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 113 %.pre43 = load i32, ptr %arrayidx17.16.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.17.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 114 %.pre44 = load i32, ptr %arrayidx17.17.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.18.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 115 %.pre45 = load i32, ptr %arrayidx17.18.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.19.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 116 %.pre46 = load i32, ptr %arrayidx17.19.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.20.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 117 %.pre47 = load i32, ptr %arrayidx17.20.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.21.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 118 %.pre48 = load i32, ptr %arrayidx17.21.phi.trans.insert, align 8, !tbaa !5 %arrayidx17.22.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 119 %.pre49 = load i32, ptr %arrayidx17.22.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.23.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 120 %.pre50 = load i32, ptr %arrayidx17.23.phi.trans.insert, align 16, !tbaa !5 %arrayidx17.24.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 121 %.pre51 = load i32, ptr %arrayidx17.24.phi.trans.insert, align 4, !tbaa !5 %arrayidx17.25.phi.trans.insert = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 122 %.pre52 = load i32, ptr %arrayidx17.25.phi.trans.insert, align 8, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre31, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre30, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre29, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre28, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 97, i32 noundef %25) %call18.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 98, i32 noundef %24) %call18.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 99, i32 noundef %23) %call18.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 100, i32 noundef %22) %call18.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 101, i32 noundef %21) %call18.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 102, i32 noundef %20) %call18.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 103, i32 noundef %19) %call18.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 104, i32 noundef %18) %call18.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 105, i32 noundef %17) %call18.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 106, i32 noundef %16) %call18.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 107, i32 noundef %15) %call18.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 108, i32 noundef %14) %call18.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 109, i32 noundef %13) %call18.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 110, i32 noundef %12) %call18.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 111, i32 noundef %11) %call18.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 112, i32 noundef %10) %call18.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 113, i32 noundef %9) %call18.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 114, i32 noundef %8) %call18.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 115, i32 noundef %7) %call18.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 116, i32 noundef %6) %call18.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 117, i32 noundef %5) %call18.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 118, i32 noundef %4) %call18.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 119, i32 noundef %3) %call18.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 120, i32 noundef %2) %call18.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 121, i32 noundef %1) %call18.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 496, ptr nonnull %memo) #4 ret i32 0 while.body: ; preds = %entry, %while.body %26 = load i8, ptr %c, align 1 %conv = sext i8 %26 to i32 %27 = add i8 %26, -65 %or.cond = icmp ult i8 %27, 26 %add = add nsw i32 %conv, 32 %a.0 = select i1 %or.cond, i32 %add, i32 %conv %idxprom = sext i32 %a.0 to i64 %arrayidx = getelementptr inbounds [124 x i32], ptr %memo, i64 0, i64 %idxprom %28 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %28, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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"}
#include<stdio.h> #include<stdlib.h> int compare(const void *a,const void *b) { int *A=(int*)a; int *B=(int*)b; if(A[0]>B[0])return 1; if(A[0]<B[0])return -1; if(A[1]>B[1])return 1; if(A[1]<B[1])return -1; } void print_RU(int R,int U) { #ifdef D printf("\n"); #endif for(int i=0;i<R;i++)printf("R"); for(int i=0;i<U;i++)printf("U"); return; } int main() { int t; scanf("%d",&t); for(int i=0;i<t;i++) { int n; scanf("%d",&n); int pos[1005][2]={0}; for(int j=0;j<n;j++)scanf("%d%d",&pos[j][0],&pos[j][1]); qsort(pos,n,2*sizeof(int),compare); #ifdef I for(int j=0;j<n;j++)printf("%d %d\n",pos[j][0],pos[j][1]); #endif int path[2010]={0}; int possible=1; for(int j=1;j<n;j++) { if(pos[j][1]<pos[j-1][1]) { possible=0; break; } } printf("%s\n",possible?"YES":"NO"); if(possible) { print_RU(pos[0][0],pos[0][1]); for(int j=1;j<n;j++) { print_RU(pos[j][0]-pos[j-1][0],pos[j][1]-pos[j-1][1]); } printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15479/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15479/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp slt i32 %0, %1 br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 1 %2 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx8 = getelementptr inbounds i32, ptr %b, i64 1 %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %2, %3 %spec.select = select i1 %cmp9, i32 1, i32 -1 br label %cleanup cleanup: ; preds = %if.end6, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ %spec.select, %if.end6 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print_RU(i32 noundef %R, i32 noundef %U) local_unnamed_addr #2 { entry: %cmp13 = icmp sgt i32 %R, 0 br i1 %cmp13, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %cmp315 = icmp sgt i32 %U, 0 br i1 %cmp315, label %for.body5, label %for.cond.cleanup4 for.body: ; preds = %entry, %for.body %i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar12 = tail call i32 @putchar(i32 82) %inc = add nuw nsw i32 %i.014, 1 %exitcond.not = icmp eq i32 %inc, %R br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !9 for.cond.cleanup4: ; preds = %for.body5, %for.cond2.preheader ret void for.body5: ; preds = %for.cond2.preheader, %for.body5 %i1.016 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond2.preheader ] %putchar = tail call i32 @putchar(i32 85) %inc8 = add nuw nsw i32 %i1.016, 1 %exitcond17.not = icmp eq i32 %inc8, %U br i1 %exitcond17.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !11 } ; 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 %pos = alloca [1005 x [2 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp101 = icmp sgt i32 %0, 0 br i1 %cmp101, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %arrayidx34 = getelementptr inbounds [2 x i32], ptr %pos, i64 0, i64 1 br label %for.body for.cond.cleanup: ; preds = %if.end62, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #7 ret i32 0 for.body: ; preds = %for.body.lr.ph, %if.end62 %i.0102 = phi i32 [ 0, %for.body.lr.ph ], [ %inc64, %if.end62 ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 8040, ptr nonnull %pos) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8040) %pos, i8 0, i64 8040, i1 false) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp395 = icmp sgt i32 %1, 0 br i1 %cmp395, label %for.body5, label %for.body.for.cond.cleanup4_crit_edge for.body.for.cond.cleanup4_crit_edge: ; preds = %for.body %.pre113 = sext i32 %1 to i64 br label %for.cond.cleanup4 for.cond.cleanup4: ; preds = %for.body5, %for.body.for.cond.cleanup4_crit_edge %conv.pre-phi = phi i64 [ %.pre113, %for.body.for.cond.cleanup4_crit_edge ], [ %4, %for.body5 ] call void @qsort(ptr noundef nonnull %pos, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @compare) #7 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp1397 = icmp sgt i32 %2, 1 br i1 %cmp1397, label %for.body16.preheader, label %if.then30 for.body16.preheader: ; preds = %for.cond.cleanup4 %wide.trip.count = zext i32 %2 to i64 %.pre = load i32, ptr %arrayidx34, align 4, !tbaa !5 br label %for.body16 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %indvars.iv %arrayidx9 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %indvars.iv, i64 1 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !12 for.cond12: ; preds = %for.body16 %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %exitcond.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count br i1 %exitcond.not, label %if.then30, label %for.body16, !llvm.loop !13 for.body16: ; preds = %for.body16.preheader, %for.cond12 %5 = phi i32 [ %.pre, %for.body16.preheader ], [ %6, %for.cond12 ] %indvars.iv105 = phi i64 [ 1, %for.body16.preheader ], [ %indvars.iv.next106, %for.cond12 ] %arrayidx19 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %indvars.iv105, i64 1 %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp23 = icmp slt i32 %6, %5 br i1 %cmp23, label %cleanup, label %for.cond12 cleanup: ; preds = %for.body16 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @.str.6) br label %if.end62 if.then30: ; preds = %for.cond12, %for.cond.cleanup4 %puts.c = call i32 @puts(ptr nonnull dereferenceable(1) @.str.5) %7 = load i32, ptr %pos, align 16, !tbaa !5 %8 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %cmp13.i = icmp sgt i32 %7, 0 br i1 %cmp13.i, label %for.body.i, label %for.cond2.preheader.i for.cond2.preheader.i: ; preds = %for.body.i, %if.then30 %cmp315.i = icmp sgt i32 %8, 0 br i1 %cmp315.i, label %for.body5.i, label %print_RU.exit for.body.i: ; preds = %if.then30, %for.body.i %i.014.i = phi i32 [ %inc.i, %for.body.i ], [ 0, %if.then30 ] %putchar12.i = call i32 @putchar(i32 82) %inc.i = add nuw nsw i32 %i.014.i, 1 %exitcond.not.i = icmp eq i32 %inc.i, %7 br i1 %exitcond.not.i, label %for.cond2.preheader.i, label %for.body.i, !llvm.loop !9 for.body5.i: ; preds = %for.cond2.preheader.i, %for.body5.i %i1.016.i = phi i32 [ %inc8.i, %for.body5.i ], [ 0, %for.cond2.preheader.i ] %putchar.i = call i32 @putchar(i32 85) %inc8.i = add nuw nsw i32 %i1.016.i, 1 %exitcond17.not.i = icmp eq i32 %inc8.i, %8 br i1 %exitcond17.not.i, label %print_RU.exit, label %for.body5.i, !llvm.loop !11 print_RU.exit: ; preds = %for.body5.i, %for.cond2.preheader.i %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp3799 = icmp sgt i32 %9, 1 br i1 %cmp3799, label %for.body40, label %for.cond.cleanup39 for.cond.cleanup39: ; preds = %print_RU.exit94, %print_RU.exit %putchar = call i32 @putchar(i32 10) br label %if.end62 for.body40: ; preds = %print_RU.exit, %print_RU.exit94 %indvars.iv109 = phi i64 [ %indvars.iv.next110, %print_RU.exit94 ], [ 1, %print_RU.exit ] %arrayidx42 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %indvars.iv109 %10 = load i32, ptr %arrayidx42, align 8, !tbaa !5 %11 = add nsw i64 %indvars.iv109, -1 %arrayidx46 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %11 %12 = load i32, ptr %arrayidx46, align 8, !tbaa !5 %sub48 = sub nsw i32 %10, %12 %arrayidx51 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %indvars.iv109, i64 1 %13 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %arrayidx55 = getelementptr inbounds [1005 x [2 x i32]], ptr %pos, i64 0, i64 %11, i64 1 %14 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %sub56 = sub nsw i32 %13, %14 %cmp13.i81 = icmp sgt i32 %sub48, 0 br i1 %cmp13.i81, label %for.body.i89, label %for.cond2.preheader.i82 for.cond2.preheader.i82: ; preds = %for.body.i89, %for.body40 %cmp315.i83 = icmp sgt i32 %sub56, 0 br i1 %cmp315.i83, label %for.body5.i84, label %print_RU.exit94 for.body.i89: ; preds = %for.body40, %for.body.i89 %i.014.i90 = phi i32 [ %inc.i92, %for.body.i89 ], [ 0, %for.body40 ] %putchar12.i91 = call i32 @putchar(i32 82) %inc.i92 = add nuw nsw i32 %i.014.i90, 1 %exitcond.not.i93 = icmp eq i32 %inc.i92, %sub48 br i1 %exitcond.not.i93, label %for.cond2.preheader.i82, label %for.body.i89, !llvm.loop !9 for.body5.i84: ; preds = %for.cond2.preheader.i82, %for.body5.i84 %i1.016.i85 = phi i32 [ %inc8.i87, %for.body5.i84 ], [ 0, %for.cond2.preheader.i82 ] %putchar.i86 = call i32 @putchar(i32 85) %inc8.i87 = add nuw nsw i32 %i1.016.i85, 1 %exitcond17.not.i88 = icmp eq i32 %inc8.i87, %sub56 br i1 %exitcond17.not.i88, label %print_RU.exit94, label %for.body5.i84, !llvm.loop !11 print_RU.exit94: ; preds = %for.body5.i84, %for.cond2.preheader.i82 %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp37 = icmp slt i64 %indvars.iv.next110, %16 br i1 %cmp37, label %for.body40, label %for.cond.cleanup39, !llvm.loop !14 if.end62: ; preds = %cleanup, %for.cond.cleanup39 call void @llvm.lifetime.end.p0(i64 8040, ptr nonnull %pos) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 %inc64 = add nuw nsw i32 %i.0102, 1 %17 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc64, %17 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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}
#include <stdio.h> #include <string.h> int main() { char x; int count[128] = {0}; while (scanf("%c", &x) != EOF) { count[x]++; } for (char c = 'a'; c <= 'z'; c++) { printf("%c : %d\n", c, count[c] + count[c - 32]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154832/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154832/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i8, align 1 %count = alloca [128 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %count, i8 0, i64 512, i1 false) %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not16 = icmp eq i32 %call15, -1 br i1 %cmp.not16, label %for.cond.preheader, label %while.body for.cond.preheader: ; preds = %while.body, %entry %arrayidx5 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 97 %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %arrayidx8 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 65 %1 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %add) %arrayidx5.1 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 98 %2 = load i32, ptr %arrayidx5.1, align 8, !tbaa !5 %arrayidx8.1 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 66 %3 = load i32, ptr %arrayidx8.1, align 8, !tbaa !5 %add.1 = add nsw i32 %3, %2 %call9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %add.1) %arrayidx5.2 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 99 %4 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5 %arrayidx8.2 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 67 %5 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5 %add.2 = add nsw i32 %5, %4 %call9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %add.2) %arrayidx5.3 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 100 %6 = load i32, ptr %arrayidx5.3, align 16, !tbaa !5 %arrayidx8.3 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 68 %7 = load i32, ptr %arrayidx8.3, align 16, !tbaa !5 %add.3 = add nsw i32 %7, %6 %call9.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %add.3) %arrayidx5.4 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 101 %8 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5 %arrayidx8.4 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 69 %9 = load i32, ptr %arrayidx8.4, align 4, !tbaa !5 %add.4 = add nsw i32 %9, %8 %call9.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %add.4) %arrayidx5.5 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 102 %10 = load i32, ptr %arrayidx5.5, align 8, !tbaa !5 %arrayidx8.5 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 70 %11 = load i32, ptr %arrayidx8.5, align 8, !tbaa !5 %add.5 = add nsw i32 %11, %10 %call9.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %add.5) %arrayidx5.6 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 103 %12 = load i32, ptr %arrayidx5.6, align 4, !tbaa !5 %arrayidx8.6 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 71 %13 = load i32, ptr %arrayidx8.6, align 4, !tbaa !5 %add.6 = add nsw i32 %13, %12 %call9.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %add.6) %arrayidx5.7 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 104 %14 = load i32, ptr %arrayidx5.7, align 16, !tbaa !5 %arrayidx8.7 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 72 %15 = load i32, ptr %arrayidx8.7, align 16, !tbaa !5 %add.7 = add nsw i32 %15, %14 %call9.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %add.7) %arrayidx5.8 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 105 %16 = load i32, ptr %arrayidx5.8, align 4, !tbaa !5 %arrayidx8.8 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 73 %17 = load i32, ptr %arrayidx8.8, align 4, !tbaa !5 %add.8 = add nsw i32 %17, %16 %call9.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %add.8) %arrayidx5.9 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 106 %18 = load i32, ptr %arrayidx5.9, align 8, !tbaa !5 %arrayidx8.9 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 74 %19 = load i32, ptr %arrayidx8.9, align 8, !tbaa !5 %add.9 = add nsw i32 %19, %18 %call9.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %add.9) %arrayidx5.10 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 107 %20 = load i32, ptr %arrayidx5.10, align 4, !tbaa !5 %arrayidx8.10 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 75 %21 = load i32, ptr %arrayidx8.10, align 4, !tbaa !5 %add.10 = add nsw i32 %21, %20 %call9.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %add.10) %arrayidx5.11 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 108 %22 = load i32, ptr %arrayidx5.11, align 16, !tbaa !5 %arrayidx8.11 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 76 %23 = load i32, ptr %arrayidx8.11, align 16, !tbaa !5 %add.11 = add nsw i32 %23, %22 %call9.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %add.11) %arrayidx5.12 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 109 %24 = load i32, ptr %arrayidx5.12, align 4, !tbaa !5 %arrayidx8.12 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 77 %25 = load i32, ptr %arrayidx8.12, align 4, !tbaa !5 %add.12 = add nsw i32 %25, %24 %call9.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %add.12) %arrayidx5.13 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 110 %26 = load i32, ptr %arrayidx5.13, align 8, !tbaa !5 %arrayidx8.13 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 78 %27 = load i32, ptr %arrayidx8.13, align 8, !tbaa !5 %add.13 = add nsw i32 %27, %26 %call9.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %add.13) %arrayidx5.14 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 111 %28 = load i32, ptr %arrayidx5.14, align 4, !tbaa !5 %arrayidx8.14 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 79 %29 = load i32, ptr %arrayidx8.14, align 4, !tbaa !5 %add.14 = add nsw i32 %29, %28 %call9.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %add.14) %arrayidx5.15 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 112 %30 = load i32, ptr %arrayidx5.15, align 16, !tbaa !5 %arrayidx8.15 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 80 %31 = load i32, ptr %arrayidx8.15, align 16, !tbaa !5 %add.15 = add nsw i32 %31, %30 %call9.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %add.15) %arrayidx5.16 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 113 %32 = load i32, ptr %arrayidx5.16, align 4, !tbaa !5 %arrayidx8.16 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 81 %33 = load i32, ptr %arrayidx8.16, align 4, !tbaa !5 %add.16 = add nsw i32 %33, %32 %call9.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %add.16) %arrayidx5.17 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 114 %34 = load i32, ptr %arrayidx5.17, align 8, !tbaa !5 %arrayidx8.17 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 82 %35 = load i32, ptr %arrayidx8.17, align 8, !tbaa !5 %add.17 = add nsw i32 %35, %34 %call9.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %add.17) %arrayidx5.18 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 115 %36 = load i32, ptr %arrayidx5.18, align 4, !tbaa !5 %arrayidx8.18 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 83 %37 = load i32, ptr %arrayidx8.18, align 4, !tbaa !5 %add.18 = add nsw i32 %37, %36 %call9.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %add.18) %arrayidx5.19 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 116 %38 = load i32, ptr %arrayidx5.19, align 16, !tbaa !5 %arrayidx8.19 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 84 %39 = load i32, ptr %arrayidx8.19, align 16, !tbaa !5 %add.19 = add nsw i32 %39, %38 %call9.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %add.19) %arrayidx5.20 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 117 %40 = load i32, ptr %arrayidx5.20, align 4, !tbaa !5 %arrayidx8.20 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 85 %41 = load i32, ptr %arrayidx8.20, align 4, !tbaa !5 %add.20 = add nsw i32 %41, %40 %call9.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %add.20) %arrayidx5.21 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 118 %42 = load i32, ptr %arrayidx5.21, align 8, !tbaa !5 %arrayidx8.21 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 86 %43 = load i32, ptr %arrayidx8.21, align 8, !tbaa !5 %add.21 = add nsw i32 %43, %42 %call9.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %add.21) %arrayidx5.22 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 119 %44 = load i32, ptr %arrayidx5.22, align 4, !tbaa !5 %arrayidx8.22 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 87 %45 = load i32, ptr %arrayidx8.22, align 4, !tbaa !5 %add.22 = add nsw i32 %45, %44 %call9.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %add.22) %arrayidx5.23 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 120 %46 = load i32, ptr %arrayidx5.23, align 16, !tbaa !5 %arrayidx8.23 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 88 %47 = load i32, ptr %arrayidx8.23, align 16, !tbaa !5 %add.23 = add nsw i32 %47, %46 %call9.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %add.23) %arrayidx5.24 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 121 %48 = load i32, ptr %arrayidx5.24, align 4, !tbaa !5 %arrayidx8.24 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 89 %49 = load i32, ptr %arrayidx8.24, align 4, !tbaa !5 %add.24 = add nsw i32 %49, %48 %call9.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %add.24) %arrayidx5.25 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 122 %50 = load i32, ptr %arrayidx5.25, align 8, !tbaa !5 %arrayidx8.25 = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 90 %51 = load i32, ptr %arrayidx8.25, align 8, !tbaa !5 %add.25 = add nsw i32 %51, %50 %call9.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %add.25) call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %count) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #4 ret i32 0 while.body: ; preds = %entry, %while.body %52 = load i8, ptr %x, align 1, !tbaa !9 %idxprom = sext i8 %52 to i64 %arrayidx = getelementptr inbounds [128 x i32], ptr %count, i64 0, i64 %idxprom %53 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %53, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !10 } ; 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { char ch; int count[26] = {0}; int i; while(scanf("%c",&ch) != EOF){ if (ch >='A' && ch <='Z') { i = ch - 'A'; count[i]++; } else if(ch >='a' && ch <='z') { i = ch - 'a'; count[i]++; } } ch = 'a'; for(i = 0;i < 26;i++){ printf("%c : %d\n" ,ch,count[i]); ch++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154876/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154876/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 %count = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false) %call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not35 = icmp eq i32 %call34, -1 br i1 %cmp.not35, label %while.end, label %while.body while.body: ; preds = %entry, %if.end20 %0 = load i8, ptr %ch, align 1 %conv = sext i8 %0 to i64 %1 = add i8 %0, -65 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.end20.sink.split, label %if.else if.else: ; preds = %while.body %2 = add i8 %0, -97 %or.cond29 = icmp ult i8 %2, 26 br i1 %or.cond29, label %if.end20.sink.split, label %if.end20 if.end20.sink.split: ; preds = %if.else, %while.body %.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %idxprom %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc19 = add nsw i32 %3, 1 store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.end20.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !9 while.end.loopexit: ; preds = %if.end20 %.pre = load i32, ptr %count, align 16, !tbaa !5 %arrayidx25.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1 %.pre38 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2 %.pre39 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3 %.pre40 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4 %.pre41 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5 %.pre42 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6 %.pre43 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7 %.pre44 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8 %.pre45 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9 %.pre46 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10 %.pre47 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11 %.pre48 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12 %.pre49 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13 %.pre50 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14 %.pre51 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %4 = phi i32 [ %.pre51, %while.end.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre50, %while.end.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre49, %while.end.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre48, %while.end.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre47, %while.end.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre46, %while.end.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre45, %while.end.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre44, %while.end.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre43, %while.end.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre42, %while.end.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre41, %while.end.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre40, %while.end.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre39, %while.end.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre38, %while.end.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre, %while.end.loopexit ], [ 0, %entry ] store i8 97, ptr %ch, align 1, !tbaa !11 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %18) %19 = load i8, ptr %ch, align 1, !tbaa !11 %inc27 = add i8 %19, 1 store i8 %inc27, ptr %ch, align 1, !tbaa !11 %conv23.1 = sext i8 %inc27 to i32 %call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.1, i32 noundef %17) %20 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.1 = add i8 %20, 1 store i8 %inc27.1, ptr %ch, align 1, !tbaa !11 %conv23.2 = sext i8 %inc27.1 to i32 %call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.2, i32 noundef %16) %21 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.2 = add i8 %21, 1 store i8 %inc27.2, ptr %ch, align 1, !tbaa !11 %conv23.3 = sext i8 %inc27.2 to i32 %call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.3, i32 noundef %15) %22 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.3 = add i8 %22, 1 store i8 %inc27.3, ptr %ch, align 1, !tbaa !11 %conv23.4 = sext i8 %inc27.3 to i32 %call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.4, i32 noundef %14) %23 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.4 = add i8 %23, 1 store i8 %inc27.4, ptr %ch, align 1, !tbaa !11 %conv23.5 = sext i8 %inc27.4 to i32 %call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.5, i32 noundef %13) %24 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.5 = add i8 %24, 1 store i8 %inc27.5, ptr %ch, align 1, !tbaa !11 %conv23.6 = sext i8 %inc27.5 to i32 %call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.6, i32 noundef %12) %25 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.6 = add i8 %25, 1 store i8 %inc27.6, ptr %ch, align 1, !tbaa !11 %conv23.7 = sext i8 %inc27.6 to i32 %call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.7, i32 noundef %11) %26 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.7 = add i8 %26, 1 store i8 %inc27.7, ptr %ch, align 1, !tbaa !11 %conv23.8 = sext i8 %inc27.7 to i32 %call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.8, i32 noundef %10) %27 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.8 = add i8 %27, 1 store i8 %inc27.8, ptr %ch, align 1, !tbaa !11 %conv23.9 = sext i8 %inc27.8 to i32 %call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.9, i32 noundef %9) %28 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.9 = add i8 %28, 1 store i8 %inc27.9, ptr %ch, align 1, !tbaa !11 %conv23.10 = sext i8 %inc27.9 to i32 %call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.10, i32 noundef %8) %29 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.10 = add i8 %29, 1 store i8 %inc27.10, ptr %ch, align 1, !tbaa !11 %conv23.11 = sext i8 %inc27.10 to i32 %call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.11, i32 noundef %7) %30 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.11 = add i8 %30, 1 store i8 %inc27.11, ptr %ch, align 1, !tbaa !11 %conv23.12 = sext i8 %inc27.11 to i32 %call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.12, i32 noundef %6) %31 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.12 = add i8 %31, 1 store i8 %inc27.12, ptr %ch, align 1, !tbaa !11 %conv23.13 = sext i8 %inc27.12 to i32 %call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.13, i32 noundef %5) %32 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.13 = add i8 %32, 1 store i8 %inc27.13, ptr %ch, align 1, !tbaa !11 %conv23.14 = sext i8 %inc27.13 to i32 %call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.14, i32 noundef %4) %33 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.14 = add i8 %33, 1 store i8 %inc27.14, ptr %ch, align 1, !tbaa !11 %conv23.15 = sext i8 %inc27.14 to i32 %arrayidx25.15 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15 %34 = load i32, ptr %arrayidx25.15, align 4, !tbaa !5 %call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.15, i32 noundef %34) %35 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.15 = add i8 %35, 1 store i8 %inc27.15, ptr %ch, align 1, !tbaa !11 %conv23.16 = sext i8 %inc27.15 to i32 %arrayidx25.16 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16 %36 = load i32, ptr %arrayidx25.16, align 16, !tbaa !5 %call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.16, i32 noundef %36) %37 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.16 = add i8 %37, 1 store i8 %inc27.16, ptr %ch, align 1, !tbaa !11 %conv23.17 = sext i8 %inc27.16 to i32 %arrayidx25.17 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17 %38 = load i32, ptr %arrayidx25.17, align 4, !tbaa !5 %call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.17, i32 noundef %38) %39 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.17 = add i8 %39, 1 store i8 %inc27.17, ptr %ch, align 1, !tbaa !11 %conv23.18 = sext i8 %inc27.17 to i32 %arrayidx25.18 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18 %40 = load i32, ptr %arrayidx25.18, align 8, !tbaa !5 %call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.18, i32 noundef %40) %41 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.18 = add i8 %41, 1 store i8 %inc27.18, ptr %ch, align 1, !tbaa !11 %conv23.19 = sext i8 %inc27.18 to i32 %arrayidx25.19 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19 %42 = load i32, ptr %arrayidx25.19, align 4, !tbaa !5 %call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.19, i32 noundef %42) %43 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.19 = add i8 %43, 1 store i8 %inc27.19, ptr %ch, align 1, !tbaa !11 %conv23.20 = sext i8 %inc27.19 to i32 %arrayidx25.20 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20 %44 = load i32, ptr %arrayidx25.20, align 16, !tbaa !5 %call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.20, i32 noundef %44) %45 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.20 = add i8 %45, 1 store i8 %inc27.20, ptr %ch, align 1, !tbaa !11 %conv23.21 = sext i8 %inc27.20 to i32 %arrayidx25.21 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21 %46 = load i32, ptr %arrayidx25.21, align 4, !tbaa !5 %call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.21, i32 noundef %46) %47 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.21 = add i8 %47, 1 store i8 %inc27.21, ptr %ch, align 1, !tbaa !11 %conv23.22 = sext i8 %inc27.21 to i32 %arrayidx25.22 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22 %48 = load i32, ptr %arrayidx25.22, align 8, !tbaa !5 %call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.22, i32 noundef %48) %49 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.22 = add i8 %49, 1 store i8 %inc27.22, ptr %ch, align 1, !tbaa !11 %conv23.23 = sext i8 %inc27.22 to i32 %arrayidx25.23 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23 %50 = load i32, ptr %arrayidx25.23, align 4, !tbaa !5 %call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.23, i32 noundef %50) %51 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.23 = add i8 %51, 1 store i8 %inc27.23, ptr %ch, align 1, !tbaa !11 %conv23.24 = sext i8 %inc27.23 to i32 %arrayidx25.24 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24 %52 = load i32, ptr %arrayidx25.24, align 16, !tbaa !5 %call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.24, i32 noundef %52) %53 = load i8, ptr %ch, align 1, !tbaa !11 %inc27.24 = add i8 %53, 1 store i8 %inc27.24, ptr %ch, align 1, !tbaa !11 %conv23.25 = sext i8 %inc27.24 to i32 %arrayidx25.25 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25 %54 = load i32, ptr %arrayidx25.25, align 4, !tbaa !5 %call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.25, i32 noundef %54) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %count) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #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 = !{!7, !7, i64 0}
#include <stdio.h> int main() { char ch; int x,c[26]= {0}; while(scanf("%c",&ch)!=EOF) { if(ch>='A' && ch<='Z') { x=ch-'A'; c[x]+=1; } else if(ch>='a' && ch<='z') { x=ch-'a'; c[x]+=1; } } for(x=0,ch='a'; x<26; x++,ch++) { printf("%c : %d\n",ch,c[x]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154919/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154919/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 %c = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false) %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not34 = icmp eq i32 %call33, -1 br i1 %cmp.not34, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end20 %.pre = load i32, ptr %c, align 16, !tbaa !5 %arrayidx25.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 1 %.pre37 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 2 %.pre38 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 3 %.pre39 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 4 %.pre40 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 5 %.pre41 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 6 %.pre42 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 7 %.pre43 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 8 %.pre44 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 9 %.pre45 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 10 %.pre46 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 11 %.pre47 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 12 %.pre48 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 13 %.pre49 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 14 %.pre50 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] store i8 97, ptr %ch, align 1, !tbaa !9 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %14) %15 = load i8, ptr %ch, align 1, !tbaa !9 %inc27 = add i8 %15, 1 store i8 %inc27, ptr %ch, align 1, !tbaa !9 %conv23.1 = sext i8 %inc27 to i32 %call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.1, i32 noundef %13) %16 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.1 = add i8 %16, 1 store i8 %inc27.1, ptr %ch, align 1, !tbaa !9 %conv23.2 = sext i8 %inc27.1 to i32 %call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.2, i32 noundef %12) %17 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.2 = add i8 %17, 1 store i8 %inc27.2, ptr %ch, align 1, !tbaa !9 %conv23.3 = sext i8 %inc27.2 to i32 %call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.3, i32 noundef %11) %18 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.3 = add i8 %18, 1 store i8 %inc27.3, ptr %ch, align 1, !tbaa !9 %conv23.4 = sext i8 %inc27.3 to i32 %call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.4, i32 noundef %10) %19 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.4 = add i8 %19, 1 store i8 %inc27.4, ptr %ch, align 1, !tbaa !9 %conv23.5 = sext i8 %inc27.4 to i32 %call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.5, i32 noundef %9) %20 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.5 = add i8 %20, 1 store i8 %inc27.5, ptr %ch, align 1, !tbaa !9 %conv23.6 = sext i8 %inc27.5 to i32 %call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.6, i32 noundef %8) %21 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.6 = add i8 %21, 1 store i8 %inc27.6, ptr %ch, align 1, !tbaa !9 %conv23.7 = sext i8 %inc27.6 to i32 %call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.7, i32 noundef %7) %22 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.7 = add i8 %22, 1 store i8 %inc27.7, ptr %ch, align 1, !tbaa !9 %conv23.8 = sext i8 %inc27.7 to i32 %call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.8, i32 noundef %6) %23 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.8 = add i8 %23, 1 store i8 %inc27.8, ptr %ch, align 1, !tbaa !9 %conv23.9 = sext i8 %inc27.8 to i32 %call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.9, i32 noundef %5) %24 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.9 = add i8 %24, 1 store i8 %inc27.9, ptr %ch, align 1, !tbaa !9 %conv23.10 = sext i8 %inc27.9 to i32 %call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.10, i32 noundef %4) %25 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.10 = add i8 %25, 1 store i8 %inc27.10, ptr %ch, align 1, !tbaa !9 %conv23.11 = sext i8 %inc27.10 to i32 %call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.11, i32 noundef %3) %26 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.11 = add i8 %26, 1 store i8 %inc27.11, ptr %ch, align 1, !tbaa !9 %conv23.12 = sext i8 %inc27.11 to i32 %call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.12, i32 noundef %2) %27 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.12 = add i8 %27, 1 store i8 %inc27.12, ptr %ch, align 1, !tbaa !9 %conv23.13 = sext i8 %inc27.12 to i32 %call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.13, i32 noundef %1) %28 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.13 = add i8 %28, 1 store i8 %inc27.13, ptr %ch, align 1, !tbaa !9 %conv23.14 = sext i8 %inc27.13 to i32 %call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.14, i32 noundef %0) %29 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.14 = add i8 %29, 1 store i8 %inc27.14, ptr %ch, align 1, !tbaa !9 %conv23.15 = sext i8 %inc27.14 to i32 %arrayidx25.15 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 15 %30 = load i32, ptr %arrayidx25.15, align 4, !tbaa !5 %call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.15, i32 noundef %30) %31 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.15 = add i8 %31, 1 store i8 %inc27.15, ptr %ch, align 1, !tbaa !9 %conv23.16 = sext i8 %inc27.15 to i32 %arrayidx25.16 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16 %32 = load i32, ptr %arrayidx25.16, align 16, !tbaa !5 %call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.16, i32 noundef %32) %33 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.16 = add i8 %33, 1 store i8 %inc27.16, ptr %ch, align 1, !tbaa !9 %conv23.17 = sext i8 %inc27.16 to i32 %arrayidx25.17 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17 %34 = load i32, ptr %arrayidx25.17, align 4, !tbaa !5 %call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.17, i32 noundef %34) %35 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.17 = add i8 %35, 1 store i8 %inc27.17, ptr %ch, align 1, !tbaa !9 %conv23.18 = sext i8 %inc27.17 to i32 %arrayidx25.18 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 18 %36 = load i32, ptr %arrayidx25.18, align 8, !tbaa !5 %call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.18, i32 noundef %36) %37 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.18 = add i8 %37, 1 store i8 %inc27.18, ptr %ch, align 1, !tbaa !9 %conv23.19 = sext i8 %inc27.18 to i32 %arrayidx25.19 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 19 %38 = load i32, ptr %arrayidx25.19, align 4, !tbaa !5 %call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.19, i32 noundef %38) %39 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.19 = add i8 %39, 1 store i8 %inc27.19, ptr %ch, align 1, !tbaa !9 %conv23.20 = sext i8 %inc27.19 to i32 %arrayidx25.20 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 20 %40 = load i32, ptr %arrayidx25.20, align 16, !tbaa !5 %call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.20, i32 noundef %40) %41 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.20 = add i8 %41, 1 store i8 %inc27.20, ptr %ch, align 1, !tbaa !9 %conv23.21 = sext i8 %inc27.20 to i32 %arrayidx25.21 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 21 %42 = load i32, ptr %arrayidx25.21, align 4, !tbaa !5 %call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.21, i32 noundef %42) %43 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.21 = add i8 %43, 1 store i8 %inc27.21, ptr %ch, align 1, !tbaa !9 %conv23.22 = sext i8 %inc27.21 to i32 %arrayidx25.22 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 22 %44 = load i32, ptr %arrayidx25.22, align 8, !tbaa !5 %call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.22, i32 noundef %44) %45 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.22 = add i8 %45, 1 store i8 %inc27.22, ptr %ch, align 1, !tbaa !9 %conv23.23 = sext i8 %inc27.22 to i32 %arrayidx25.23 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 23 %46 = load i32, ptr %arrayidx25.23, align 4, !tbaa !5 %call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.23, i32 noundef %46) %47 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.23 = add i8 %47, 1 store i8 %inc27.23, ptr %ch, align 1, !tbaa !9 %conv23.24 = sext i8 %inc27.23 to i32 %arrayidx25.24 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 24 %48 = load i32, ptr %arrayidx25.24, align 16, !tbaa !5 %call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.24, i32 noundef %48) %49 = load i8, ptr %ch, align 1, !tbaa !9 %inc27.24 = add i8 %49, 1 store i8 %inc27.24, ptr %ch, align 1, !tbaa !9 %conv23.25 = sext i8 %inc27.24 to i32 %arrayidx25.25 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25 %50 = load i32, ptr %arrayidx25.25, align 4, !tbaa !5 %call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.25, i32 noundef %50) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 ret i32 0 while.body: ; preds = %entry, %if.end20 %51 = load i8, ptr %ch, align 1 %conv = sext i8 %51 to i64 %52 = add i8 %51, -65 %or.cond = icmp ult i8 %52, 26 br i1 %or.cond, label %if.end20.sink.split, label %if.else if.else: ; preds = %while.body %53 = add i8 %51, -97 %or.cond28 = icmp ult i8 %53, 26 br i1 %or.cond28, label %if.end20.sink.split, label %if.end20 if.end20.sink.split: ; preds = %if.else, %while.body %.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %idxprom %54 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add19 = add nsw i32 %54, 1 store i32 %add19, ptr %arrayidx, align 4, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.end20.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !10 } ; 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #define MAX 1200 int main(void) { char str[MAX], *p; int i, c; int count[26]; // 26个英文单词 // 初始化数组 for (i = 0; i < 26; i++) count[i] = 0; while(fgets(str, MAX, stdin) != NULL) { p = str; while(*(char *)p != '\0') { c = *(char *)(p++); if ( c >= 'a' && c <= 'z') count[c - 'a']++; else if (c >= 'A' && c <= 'Z') count[c - 'A']++; } } // 输出统计结果 for (i = 0; i < 26; i++) printf("%c : %d\n", (char) (i + 'a'), count[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154962/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154962/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1200 x i8], align 16 %count = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %str) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false), !tbaa !5 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call57 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 1200, ptr noundef %0) %cmp1.not58 = icmp eq ptr %call57, null br i1 %cmp1.not58, label %for.cond27.preheader, label %while.cond3.preheader while.cond.loopexit: ; preds = %if.end25, %while.cond3.preheader %1 = load ptr, ptr @stdin, align 8, !tbaa !9 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 1200, ptr noundef %1) %cmp1.not = icmp eq ptr %call, null br i1 %cmp1.not, label %for.cond27.preheader.loopexit, label %while.cond3.preheader, !llvm.loop !11 while.cond3.preheader: ; preds = %entry, %while.cond.loopexit %2 = load i8, ptr %str, align 16, !tbaa !13 %cmp4.not54 = icmp eq i8 %2, 0 br i1 %cmp4.not54, label %while.cond.loopexit, label %while.body6 for.cond27.preheader.loopexit: ; preds = %while.cond.loopexit %.pre = load i32, ptr %count, align 16, !tbaa !5 %arrayidx34.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1 %.pre63 = load i32, ptr %arrayidx34.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2 %.pre64 = load i32, ptr %arrayidx34.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3 %.pre65 = load i32, ptr %arrayidx34.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4 %.pre66 = load i32, ptr %arrayidx34.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5 %.pre67 = load i32, ptr %arrayidx34.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6 %.pre68 = load i32, ptr %arrayidx34.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7 %.pre69 = load i32, ptr %arrayidx34.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8 %.pre70 = load i32, ptr %arrayidx34.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9 %.pre71 = load i32, ptr %arrayidx34.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10 %.pre72 = load i32, ptr %arrayidx34.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11 %.pre73 = load i32, ptr %arrayidx34.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12 %.pre74 = load i32, ptr %arrayidx34.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13 %.pre75 = load i32, ptr %arrayidx34.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14 %.pre76 = load i32, ptr %arrayidx34.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15 %.pre77 = load i32, ptr %arrayidx34.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16 %.pre78 = load i32, ptr %arrayidx34.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17 %.pre79 = load i32, ptr %arrayidx34.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18 %.pre80 = load i32, ptr %arrayidx34.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19 %.pre81 = load i32, ptr %arrayidx34.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20 %.pre82 = load i32, ptr %arrayidx34.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21 %.pre83 = load i32, ptr %arrayidx34.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22 %.pre84 = load i32, ptr %arrayidx34.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx34.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23 %.pre85 = load i32, ptr %arrayidx34.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx34.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24 %.pre86 = load i32, ptr %arrayidx34.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx34.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25 %.pre87 = load i32, ptr %arrayidx34.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %entry %3 = phi i32 [ %.pre87, %for.cond27.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre86, %for.cond27.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre85, %for.cond27.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre84, %for.cond27.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre83, %for.cond27.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre82, %for.cond27.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre81, %for.cond27.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre80, %for.cond27.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre79, %for.cond27.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre78, %for.cond27.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre77, %for.cond27.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre76, %for.cond27.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre75, %for.cond27.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre74, %for.cond27.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre73, %for.cond27.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre72, %for.cond27.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre71, %for.cond27.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre70, %for.cond27.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre69, %for.cond27.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre68, %for.cond27.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre67, %for.cond27.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre66, %for.cond27.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre65, %for.cond27.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre64, %for.cond27.preheader.loopexit ], [ 0, %entry ] %27 = phi i32 [ %.pre63, %for.cond27.preheader.loopexit ], [ 0, %entry ] %28 = phi i32 [ %.pre, %for.cond27.preheader.loopexit ], [ 0, %entry ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %28) %call35.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %27) %call35.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %26) %call35.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %25) %call35.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %24) %call35.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %23) %call35.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %22) %call35.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %21) %call35.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %20) %call35.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %19) %call35.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %18) %call35.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %17) %call35.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %16) %call35.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %15) %call35.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %14) %call35.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %13) %call35.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %12) %call35.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %11) %call35.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %10) %call35.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %9) %call35.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %8) %call35.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %7) %call35.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %6) %call35.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %5) %call35.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %4) %call35.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %count) #4 call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %str) #4 ret i32 0 while.body6: ; preds = %while.cond3.preheader, %if.end25 %29 = phi i8 [ %33, %if.end25 ], [ %2, %while.cond3.preheader ] %p.055 = phi ptr [ %incdec.ptr, %if.end25 ], [ %str, %while.cond3.preheader ] %conv56 = sext i8 %29 to i64 %incdec.ptr = getelementptr inbounds i8, ptr %p.055, i64 1 %30 = add i8 %29, -97 %or.cond = icmp ult i8 %30, 26 br i1 %or.cond, label %if.end25.sink.split, label %if.else if.else: ; preds = %while.body6 %31 = add i8 %29, -65 %or.cond39 = icmp ult i8 %31, 26 br i1 %or.cond39, label %if.end25.sink.split, label %if.end25 if.end25.sink.split: ; preds = %if.else, %while.body6 %.sink = phi i64 [ 4294967199, %while.body6 ], [ 4294967231, %if.else ] %sub = add nsw i64 %.sink, %conv56 %idxprom12 = and i64 %sub, 4294967295 %arrayidx13 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %idxprom12 %32 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %inc24 = add nsw i32 %32, 1 store i32 %inc24, ptr %arrayidx13, align 4, !tbaa !5 br label %if.end25 if.end25: ; preds = %if.end25.sink.split, %if.else %33 = load i8, ptr %incdec.ptr, align 1, !tbaa !13 %cmp4.not = icmp eq i8 %33, 0 br i1 %cmp4.not, label %while.cond.loopexit, label %while.body6, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !12}
#include<stdio.h> int main() { int a,b,i,j,max,p=0,q=0; scanf("%d",&a); int ara[a+10]; for(i=0;i<a;i++) { scanf("%d",&ara[i]); p=p+ara[i]; } max=ara[0]; for(j=0;j<a;j++) { if(ara[j]>max) { max=ara[j]; } } if(p-max>max) { printf("Yes\n"); } else { printf("No\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155004/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155004/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %0, 10 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %a, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %3, 0 br i1 %cmp32, label %for.body, label %if.else for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %p.033 = phi i32 [ %add4, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add4 = add nsw i32 %4, %p.033 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %a, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %.pre = load i32, ptr %vla, align 16, !tbaa !5 %cmp736 = icmp sgt i32 %5, 0 br i1 %cmp736, label %for.body8.preheader, label %for.end16 for.body8.preheader: ; preds = %for.end %wide.trip.count = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %5, 8 br i1 %min.iters.check, label %for.body8.preheader55, label %vector.ph vector.ph: ; preds = %for.body8.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %9, %vector.body ] %vec.phi53 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %10, %vector.body ] %7 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load54 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %10 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load54, <4 x i32> %vec.phi53) %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %10) %12 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end16, label %for.body8.preheader55 for.body8.preheader55: ; preds = %for.body8.preheader, %middle.block %indvars.iv42.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ] %max.037.ph = phi i32 [ %.pre, %for.body8.preheader ], [ %12, %middle.block ] br label %for.body8 for.body8: ; preds = %for.body8.preheader55, %for.body8 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body8 ], [ %indvars.iv42.ph, %for.body8.preheader55 ] %max.037 = phi i32 [ %spec.select, %for.body8 ], [ %max.037.ph, %for.body8.preheader55 ] %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv42 %13 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %13, i32 %max.037) %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end16, label %for.body8, !llvm.loop !14 for.end16: ; preds = %for.body8, %middle.block, %for.end %max.0.lcssa = phi i32 [ %.pre, %for.end ], [ %12, %middle.block ], [ %spec.select, %for.body8 ] %sub = sub nsw i32 %add4, %max.0.lcssa %cmp17 = icmp sgt i32 %sub, %max.0.lcssa br i1 %cmp17, label %if.end21, label %if.else if.else: ; preds = %entry, %for.end16 br label %if.end21 if.end21: ; preds = %for.end16, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end16 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12}
#include<stdio.h> int main(void){ int n,i,a,max=1,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); if(max<a){max=a;} sum+=a; } printf(2*max<sum?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155055/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %sum.011 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.010 = phi i32 [ %spec.select, %for.body ], [ 1, %entry ] %i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %max.010, i32 %1) %add = add nsw i32 %1, %sum.011 %inc = add nuw nsw i32 %i.09, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %3 = shl nuw nsw i32 %spec.select, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %max.0.lcssa = phi i32 [ 2, %entry ], [ %3, %for.end.loopexit ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.end.loopexit ] %cmp3 = icmp slt i32 %max.0.lcssa, %sum.0.lcssa %cond = select i1 %cmp3, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int n,i,a,max=0,sum=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a); sum+=a; if(a>max) { max=a; } } sum=sum-max; if(max<sum) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: 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) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %0, 0 br i1 %cmp14, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %sum.017 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.016 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %i.015 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.017 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.016) %inc = add nuw nsw i32 %i.015, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp3 = icmp slt i32 %max.0.lcssa, %sub %str.3.str = select i1 %cmp3, 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 %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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.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"}
#include<stdio.h> int main(){ int N, L[20]; int i, max=0, sum=0; scanf("%d", &N); for(i=0; i<N; i++){ scanf("%d", &L[i]); sum += L[i]; if(L[i]>max){ max = L[i]; } } if(max<(sum-max)){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155149/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155149/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %L = alloca [20 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %L) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %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 ] %sum.025 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.024 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %L, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.025 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.024) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp9 = icmp slt i32 %max.0.lcssa, %sub %.str.1..str.2 = select i1 %cmp9, ptr @.str.1, ptr @.str.2 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %L) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int n;scanf("%d",&n); int l[n]; int sum=0,max=0; for(int i=0;i<n;i++){ scanf("%d",&l[i]); sum+=l[i]; max=(max<l[i])?l[i]:max; } if(sum-max>max)printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155192/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155192/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = 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 %cmp22 = icmp sgt i32 %3, 0 br i1 %cmp22, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %max.0.lcssa = phi i32 [ 0, %entry ], [ %.max.0, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp9 = icmp sgt i32 %sub, %max.0.lcssa %str.3.str = select i1 %cmp9, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %max.024 = phi i32 [ %.max.0, %for.body ], [ 0, %entry ] %sum.023 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %sum.023 %.max.0 = call i32 @llvm.smax.i32(i32 %max.024, i32 %4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 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 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int N; scanf("%d",&N); int max = 0; int sum = 0; int i; for(i = 0;i<N;i++){ int L; scanf("%d",&L); if(L > max)max = L; sum += L; } if(max < sum - max) printf("Yes\n"); else printf("No\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155235/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155235/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %L = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 0 br i1 %cmp13, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.016 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %sum.015 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.014 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L) %1 = load i32, ptr %L, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.014) %add = add nsw i32 %1, %sum.015 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #5 %inc = add nuw nsw i32 %i.016, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp3 = icmp slt i32 %max.0.lcssa, %sub %str.3.str = select i1 %cmp3, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind 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"}
#include <stdio.h> int main(){ int n; scanf("%d",&n); int l[n]; int max = 0; int sum = 0; for(int i = 0;i < n;i++){ scanf("%d",&l[i]); if(l[i] > max){ sum += max; max = l[i]; }else{ sum += l[i]; } } if(sum > max) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155293/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155293/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %3, 0 br i1 %cmp25, label %for.body, label %if.else13 for.cond.cleanup: ; preds = %for.body %cmp10 = icmp sgt i32 %sum.1, %.max.0 br i1 %cmp10, label %if.end15, label %if.else13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.027 = phi i32 [ %sum.1, %for.body ], [ 0, %entry ] %max.026 = phi i32 [ %.max.0, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %.max.0 = call i32 @llvm.smax.i32(i32 %4, i32 %max.026) %max.0. = call i32 @llvm.smin.i32(i32 %4, i32 %max.026) %sum.1 = add nsw i32 %max.0., %sum.027 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 if.else13: ; preds = %entry, %for.cond.cleanup br label %if.end15 if.end15: ; preds = %for.cond.cleanup, %if.else13 %.str.2.sink = phi ptr [ @.str.2, %if.else13 ], [ @.str.1, %for.cond.cleanup ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %2) 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int i,n,l[100],max=0,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&l[i]); sum+=l[i]; if(l[i]>max) max=l[i]; } if(sum-max>max){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155336/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %l = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %l) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.026 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.025 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %l, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.026 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.025) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp9 = icmp sgt i32 %sub, %max.0.lcssa %str.3.str = select i1 %cmp9, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %l) #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 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.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"}
#include <stdio.h> long long S[200002]; long long D[200002]; void mS(long long s[], long long d[], int o, int t) { int i, j, k; int c = o + t >> 1; if (o < c) { mS(d, s, o, c); } if (c + 1 < t) { mS(d, s, c + 1, t); } i = o; j = c + 1; k = o; while (i <= c && j <= t) { if (s[i] > s[j]) { d[k] = s[i]; i++; } else { d[k] = s[j]; j++; } k++; } while (i <= c) { d[k] = s[i]; i++; k++; } while (j <= t) { d[k] = s[j]; j++; k++; } } int main() { int i; int T; int n, k; long long R; scanf("%d", &T); while (T--) { scanf("%d %d", &n, &k); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } for (i = 0; i < n; i++) { D[i] = S[i]; } mS(S, D, 0, n - 1); if (k >= n) { k = n - 1; } for (i = 1; i <= k; i++) { D[0] += D[i]; } R = D[0]; printf("%I64d\n", R); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15538/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15538/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @S = dso_local global [200002 x i64] zeroinitializer, align 16 @D = dso_local global [200002 x i64] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @mS(ptr nocapture noundef %s, ptr nocapture noundef %d, i32 noundef %o, i32 noundef %t) local_unnamed_addr #0 { entry: %s130 = ptrtoint ptr %s to i64 %d129 = ptrtoint ptr %d to i64 %s123 = ptrtoint ptr %s to i64 %d122 = ptrtoint ptr %d to i64 %add = add nsw i32 %t, %o %shr = ashr i32 %add, 1 %cmp = icmp sgt i32 %shr, %o br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry tail call void @mS(ptr noundef %d, ptr noundef %s, i32 noundef %o, i32 noundef %shr) br label %if.end if.end: ; preds = %if.then, %entry %add1 = add nsw i32 %shr, 1 %cmp2 = icmp slt i32 %add1, %t br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end tail call void @mS(ptr noundef %d, ptr noundef %s, i32 noundef %add1, i32 noundef %t) br label %if.end5 if.end5: ; preds = %if.then3, %if.end %cmp789 = icmp sge i32 %shr, %o %cmp890 = icmp slt i32 %shr, %t %0 = and i1 %cmp789, %cmp890 br i1 %0, label %while.body.preheader, label %while.cond24.preheader while.body.preheader: ; preds = %if.end5 %1 = sext i32 %o to i64 br label %while.body while.cond24.preheader.loopexit: ; preds = %while.body %2 = trunc i64 %indvars.iv.next to i32 br label %while.cond24.preheader while.cond24.preheader: ; preds = %while.cond24.preheader.loopexit, %if.end5 %j.0.lcssa = phi i32 [ %add1, %if.end5 ], [ %j.1, %while.cond24.preheader.loopexit ] %k.0.lcssa = phi i32 [ %o, %if.end5 ], [ %2, %while.cond24.preheader.loopexit ] %i.0.lcssa = phi i32 [ %o, %if.end5 ], [ %i.1, %while.cond24.preheader.loopexit ] %cmp25.not96 = icmp sgt i32 %i.0.lcssa, %shr br i1 %cmp25.not96, label %while.cond34.preheader, label %while.body26.preheader while.body26.preheader: ; preds = %while.cond24.preheader %3 = sext i32 %i.0.lcssa to i64 %4 = sext i32 %k.0.lcssa to i64 %5 = sub i32 %shr, %i.0.lcssa %6 = zext i32 %5 to i64 %7 = add nuw nsw i64 %6, 1 %min.iters.check = icmp ult i32 %5, 11 br i1 %min.iters.check, label %while.body26.preheader151, label %vector.memcheck vector.memcheck: ; preds = %while.body26.preheader %8 = shl nsw i64 %4, 3 %9 = add i64 %8, %d122 %10 = shl nsw i64 %3, 3 %11 = add i64 %10, %s123 %12 = sub i64 %9, %11 %diff.check = icmp ult i64 %12, 32 br i1 %diff.check, label %while.body26.preheader151, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %7, 8589934588 %ind.end = add nsw i64 %n.vec, %4 %ind.end124 = add nsw i64 %n.vec, %3 %invariant.gep = getelementptr i64, ptr %s, i64 %3 %invariant.gep156 = getelementptr i64, ptr %d, i64 %4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i64, ptr %invariant.gep, i64 %index %wide.load = load <2 x i64>, ptr %gep, align 8, !tbaa !5 %13 = getelementptr inbounds i64, ptr %gep, i64 2 %wide.load127 = load <2 x i64>, ptr %13, align 8, !tbaa !5 %gep157 = getelementptr i64, ptr %invariant.gep156, i64 %index store <2 x i64> %wide.load, ptr %gep157, align 8, !tbaa !5 %14 = getelementptr inbounds i64, ptr %gep157, i64 2 store <2 x i64> %wide.load127, ptr %14, align 8, !tbaa !5 %index.next = add nuw i64 %index, 4 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %while.cond34.preheader.loopexit, label %while.body26.preheader151 while.body26.preheader151: ; preds = %vector.memcheck, %while.body26.preheader, %middle.block %indvars.iv107.ph = phi i64 [ %4, %vector.memcheck ], [ %4, %while.body26.preheader ], [ %ind.end, %middle.block ] %indvars.iv105.ph = phi i64 [ %3, %vector.memcheck ], [ %3, %while.body26.preheader ], [ %ind.end124, %middle.block ] %16 = add nsw i32 %shr, 1 %17 = trunc i64 %indvars.iv105.ph to i32 %18 = sub i32 %16, %17 %19 = sub i32 %shr, %17 %xtraiter = and i32 %18, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body26.prol.loopexit, label %while.body26.prol while.body26.prol: ; preds = %while.body26.preheader151, %while.body26.prol %indvars.iv107.prol = phi i64 [ %indvars.iv.next108.prol, %while.body26.prol ], [ %indvars.iv107.ph, %while.body26.preheader151 ] %indvars.iv105.prol = phi i64 [ %indvars.iv.next106.prol, %while.body26.prol ], [ %indvars.iv105.ph, %while.body26.preheader151 ] %prol.iter = phi i32 [ %prol.iter.next, %while.body26.prol ], [ 0, %while.body26.preheader151 ] %arrayidx28.prol = getelementptr inbounds i64, ptr %s, i64 %indvars.iv105.prol %20 = load i64, ptr %arrayidx28.prol, align 8, !tbaa !5 %arrayidx30.prol = getelementptr inbounds i64, ptr %d, i64 %indvars.iv107.prol store i64 %20, ptr %arrayidx30.prol, align 8, !tbaa !5 %indvars.iv.next106.prol = add nsw i64 %indvars.iv105.prol, 1 %indvars.iv.next108.prol = add nsw i64 %indvars.iv107.prol, 1 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %while.body26.prol.loopexit, label %while.body26.prol, !llvm.loop !13 while.body26.prol.loopexit: ; preds = %while.body26.prol, %while.body26.preheader151 %indvars.iv.next108.lcssa152.unr = phi i64 [ undef, %while.body26.preheader151 ], [ %indvars.iv.next108.prol, %while.body26.prol ] %indvars.iv107.unr = phi i64 [ %indvars.iv107.ph, %while.body26.preheader151 ], [ %indvars.iv.next108.prol, %while.body26.prol ] %indvars.iv105.unr = phi i64 [ %indvars.iv105.ph, %while.body26.preheader151 ], [ %indvars.iv.next106.prol, %while.body26.prol ] %21 = icmp ult i32 %19, 3 br i1 %21, label %while.cond34.preheader.loopexit, label %while.body26.preheader151.new while.body26.preheader151.new: ; preds = %while.body26.prol.loopexit %invariant.gep158 = getelementptr i64, ptr %s, i64 1 %invariant.gep160 = getelementptr i64, ptr %d, i64 1 %invariant.gep162 = getelementptr i64, ptr %s, i64 2 %invariant.gep164 = getelementptr i64, ptr %d, i64 2 %invariant.gep166 = getelementptr i64, ptr %s, i64 3 %invariant.gep168 = getelementptr i64, ptr %d, i64 3 br label %while.body26 while.body: ; preds = %while.body.preheader, %while.body %indvars.iv = phi i64 [ %1, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %i.093 = phi i32 [ %o, %while.body.preheader ], [ %i.1, %while.body ] %j.091 = phi i32 [ %add1, %while.body.preheader ], [ %j.1, %while.body ] %idxprom = sext i32 %i.093 to i64 %arrayidx = getelementptr inbounds i64, ptr %s, i64 %idxprom %22 = load i64, ptr %arrayidx, align 8, !tbaa !5 %idxprom9 = sext i32 %j.091 to i64 %arrayidx10 = getelementptr inbounds i64, ptr %s, i64 %idxprom9 %23 = load i64, ptr %arrayidx10, align 8, !tbaa !5 %cmp11 = icmp sle i64 %22, %23 %.sink = tail call i64 @llvm.smax.i64(i64 %22, i64 %23) %inc21 = zext i1 %cmp11 to i32 %j.1 = add nsw i32 %j.091, %inc21 %not.cmp11 = xor i1 %cmp11, true %inc = zext i1 %not.cmp11 to i32 %i.1 = add nsw i32 %i.093, %inc %24 = getelementptr inbounds i64, ptr %d, i64 %indvars.iv store i64 %.sink, ptr %24, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %cmp7 = icmp sle i32 %i.1, %shr %cmp8 = icmp sle i32 %j.1, %t %25 = select i1 %cmp7, i1 %cmp8, i1 false br i1 %25, label %while.body, label %while.cond24.preheader.loopexit, !llvm.loop !15 while.cond34.preheader.loopexit: ; preds = %while.body26.prol.loopexit, %while.body26, %middle.block %indvars.iv.next108.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next108.lcssa152.unr, %while.body26.prol.loopexit ], [ %indvars.iv.next108.3, %while.body26 ] %26 = trunc i64 %indvars.iv.next108.lcssa to i32 br label %while.cond34.preheader while.cond34.preheader: ; preds = %while.cond34.preheader.loopexit, %while.cond24.preheader %k.1.lcssa = phi i32 [ %k.0.lcssa, %while.cond24.preheader ], [ %26, %while.cond34.preheader.loopexit ] %cmp35.not100 = icmp sgt i32 %j.0.lcssa, %t br i1 %cmp35.not100, label %while.end43, label %while.body36.preheader while.body36.preheader: ; preds = %while.cond34.preheader %27 = sext i32 %k.1.lcssa to i64 %28 = sext i32 %j.0.lcssa to i64 %29 = add i32 %t, 1 %30 = sub i32 %t, %j.0.lcssa %31 = zext i32 %30 to i64 %32 = add nuw nsw i64 %31, 1 %min.iters.check134 = icmp ult i32 %30, 11 br i1 %min.iters.check134, label %while.body36.preheader150, label %vector.memcheck128 vector.memcheck128: ; preds = %while.body36.preheader %33 = shl nsw i64 %27, 3 %34 = add i64 %33, %d129 %35 = shl nsw i64 %28, 3 %36 = add i64 %35, %s130 %37 = sub i64 %34, %36 %diff.check131 = icmp ult i64 %37, 32 br i1 %diff.check131, label %while.body36.preheader150, label %vector.ph135 vector.ph135: ; preds = %vector.memcheck128 %n.vec137 = and i64 %32, 8589934588 %ind.end138 = add nsw i64 %n.vec137, %28 %ind.end140 = add nsw i64 %n.vec137, %27 %invariant.gep170 = getelementptr i64, ptr %s, i64 %28 %invariant.gep172 = getelementptr i64, ptr %d, i64 %27 br label %vector.body143 vector.body143: ; preds = %vector.body143, %vector.ph135 %index144 = phi i64 [ 0, %vector.ph135 ], [ %index.next149, %vector.body143 ] %gep171 = getelementptr i64, ptr %invariant.gep170, i64 %index144 %wide.load147 = load <2 x i64>, ptr %gep171, align 8, !tbaa !5 %38 = getelementptr inbounds i64, ptr %gep171, i64 2 %wide.load148 = load <2 x i64>, ptr %38, align 8, !tbaa !5 %gep173 = getelementptr i64, ptr %invariant.gep172, i64 %index144 store <2 x i64> %wide.load147, ptr %gep173, align 8, !tbaa !5 %39 = getelementptr inbounds i64, ptr %gep173, i64 2 store <2 x i64> %wide.load148, ptr %39, align 8, !tbaa !5 %index.next149 = add nuw i64 %index144, 4 %40 = icmp eq i64 %index.next149, %n.vec137 br i1 %40, label %middle.block132, label %vector.body143, !llvm.loop !16 middle.block132: ; preds = %vector.body143 %cmp.n142 = icmp eq i64 %32, %n.vec137 br i1 %cmp.n142, label %while.end43, label %while.body36.preheader150 while.body36.preheader150: ; preds = %vector.memcheck128, %while.body36.preheader, %middle.block132 %indvars.iv115.ph = phi i64 [ %28, %vector.memcheck128 ], [ %28, %while.body36.preheader ], [ %ind.end138, %middle.block132 ] %indvars.iv113.ph = phi i64 [ %27, %vector.memcheck128 ], [ %27, %while.body36.preheader ], [ %ind.end140, %middle.block132 ] %41 = add i32 %t, 1 %42 = trunc i64 %indvars.iv115.ph to i32 %43 = sub i32 %41, %42 %44 = sub i32 %t, %42 %xtraiter153 = and i32 %43, 3 %lcmp.mod154.not = icmp eq i32 %xtraiter153, 0 br i1 %lcmp.mod154.not, label %while.body36.prol.loopexit, label %while.body36.prol while.body36.prol: ; preds = %while.body36.preheader150, %while.body36.prol %indvars.iv115.prol = phi i64 [ %indvars.iv.next116.prol, %while.body36.prol ], [ %indvars.iv115.ph, %while.body36.preheader150 ] %indvars.iv113.prol = phi i64 [ %indvars.iv.next114.prol, %while.body36.prol ], [ %indvars.iv113.ph, %while.body36.preheader150 ] %prol.iter155 = phi i32 [ %prol.iter155.next, %while.body36.prol ], [ 0, %while.body36.preheader150 ] %arrayidx38.prol = getelementptr inbounds i64, ptr %s, i64 %indvars.iv115.prol %45 = load i64, ptr %arrayidx38.prol, align 8, !tbaa !5 %arrayidx40.prol = getelementptr inbounds i64, ptr %d, i64 %indvars.iv113.prol store i64 %45, ptr %arrayidx40.prol, align 8, !tbaa !5 %indvars.iv.next116.prol = add nsw i64 %indvars.iv115.prol, 1 %indvars.iv.next114.prol = add nsw i64 %indvars.iv113.prol, 1 %prol.iter155.next = add i32 %prol.iter155, 1 %prol.iter155.cmp.not = icmp eq i32 %prol.iter155.next, %xtraiter153 br i1 %prol.iter155.cmp.not, label %while.body36.prol.loopexit, label %while.body36.prol, !llvm.loop !17 while.body36.prol.loopexit: ; preds = %while.body36.prol, %while.body36.preheader150 %indvars.iv115.unr = phi i64 [ %indvars.iv115.ph, %while.body36.preheader150 ], [ %indvars.iv.next116.prol, %while.body36.prol ] %indvars.iv113.unr = phi i64 [ %indvars.iv113.ph, %while.body36.preheader150 ], [ %indvars.iv.next114.prol, %while.body36.prol ] %46 = icmp ult i32 %44, 3 br i1 %46, label %while.end43, label %while.body36.preheader150.new while.body36.preheader150.new: ; preds = %while.body36.prol.loopexit %invariant.gep174 = getelementptr i64, ptr %s, i64 1 %invariant.gep176 = getelementptr i64, ptr %d, i64 1 %invariant.gep178 = getelementptr i64, ptr %s, i64 2 %invariant.gep180 = getelementptr i64, ptr %d, i64 2 %invariant.gep182 = getelementptr i64, ptr %s, i64 3 %invariant.gep184 = getelementptr i64, ptr %d, i64 3 br label %while.body36 while.body26: ; preds = %while.body26, %while.body26.preheader151.new %indvars.iv107 = phi i64 [ %indvars.iv107.unr, %while.body26.preheader151.new ], [ %indvars.iv.next108.3, %while.body26 ] %indvars.iv105 = phi i64 [ %indvars.iv105.unr, %while.body26.preheader151.new ], [ %indvars.iv.next106.3, %while.body26 ] %arrayidx28 = getelementptr inbounds i64, ptr %s, i64 %indvars.iv105 %47 = load i64, ptr %arrayidx28, align 8, !tbaa !5 %arrayidx30 = getelementptr inbounds i64, ptr %d, i64 %indvars.iv107 store i64 %47, ptr %arrayidx30, align 8, !tbaa !5 %gep159 = getelementptr i64, ptr %invariant.gep158, i64 %indvars.iv105 %48 = load i64, ptr %gep159, align 8, !tbaa !5 %gep161 = getelementptr i64, ptr %invariant.gep160, i64 %indvars.iv107 store i64 %48, ptr %gep161, align 8, !tbaa !5 %gep163 = getelementptr i64, ptr %invariant.gep162, i64 %indvars.iv105 %49 = load i64, ptr %gep163, align 8, !tbaa !5 %gep165 = getelementptr i64, ptr %invariant.gep164, i64 %indvars.iv107 store i64 %49, ptr %gep165, align 8, !tbaa !5 %gep167 = getelementptr i64, ptr %invariant.gep166, i64 %indvars.iv105 %50 = load i64, ptr %gep167, align 8, !tbaa !5 %gep169 = getelementptr i64, ptr %invariant.gep168, i64 %indvars.iv107 store i64 %50, ptr %gep169, align 8, !tbaa !5 %indvars.iv.next106.3 = add nsw i64 %indvars.iv105, 4 %indvars.iv.next108.3 = add nsw i64 %indvars.iv107, 4 %lftr.wideiv.3 = trunc i64 %indvars.iv.next106.3 to i32 %exitcond.not.3 = icmp eq i32 %add1, %lftr.wideiv.3 br i1 %exitcond.not.3, label %while.cond34.preheader.loopexit, label %while.body26, !llvm.loop !18 while.body36: ; preds = %while.body36, %while.body36.preheader150.new %indvars.iv115 = phi i64 [ %indvars.iv115.unr, %while.body36.preheader150.new ], [ %indvars.iv.next116.3, %while.body36 ] %indvars.iv113 = phi i64 [ %indvars.iv113.unr, %while.body36.preheader150.new ], [ %indvars.iv.next114.3, %while.body36 ] %arrayidx38 = getelementptr inbounds i64, ptr %s, i64 %indvars.iv115 %51 = load i64, ptr %arrayidx38, align 8, !tbaa !5 %arrayidx40 = getelementptr inbounds i64, ptr %d, i64 %indvars.iv113 store i64 %51, ptr %arrayidx40, align 8, !tbaa !5 %gep175 = getelementptr i64, ptr %invariant.gep174, i64 %indvars.iv115 %52 = load i64, ptr %gep175, align 8, !tbaa !5 %gep177 = getelementptr i64, ptr %invariant.gep176, i64 %indvars.iv113 store i64 %52, ptr %gep177, align 8, !tbaa !5 %gep179 = getelementptr i64, ptr %invariant.gep178, i64 %indvars.iv115 %53 = load i64, ptr %gep179, align 8, !tbaa !5 %gep181 = getelementptr i64, ptr %invariant.gep180, i64 %indvars.iv113 store i64 %53, ptr %gep181, align 8, !tbaa !5 %gep183 = getelementptr i64, ptr %invariant.gep182, i64 %indvars.iv115 %54 = load i64, ptr %gep183, align 8, !tbaa !5 %gep185 = getelementptr i64, ptr %invariant.gep184, i64 %indvars.iv113 store i64 %54, ptr %gep185, align 8, !tbaa !5 %indvars.iv.next116.3 = add nsw i64 %indvars.iv115, 4 %indvars.iv.next114.3 = add nsw i64 %indvars.iv113, 4 %lftr.wideiv120.3 = trunc i64 %indvars.iv.next116.3 to i32 %exitcond121.not.3 = icmp eq i32 %29, %lftr.wideiv120.3 br i1 %exitcond121.not.3, label %while.end43, label %while.body36, !llvm.loop !19 while.end43: ; preds = %while.body36.prol.loopexit, %while.body36, %middle.block132, %while.cond34.preheader ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %T = alloca i32, align 4 %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !20 %dec42 = add nsw i32 %0, -1 store i32 %dec42, ptr %T, align 4, !tbaa !20 %tobool.not43 = icmp eq i32 %0, 0 br i1 %tobool.not43, label %while.end, label %while.body while.body: ; preds = %entry, %for.end22 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k) %1 = load i32, ptr %n, align 4, !tbaa !20 %cmp34 = icmp sgt i32 %1, 0 br i1 %cmp34, label %for.body, label %for.end12 for.cond3.preheader: ; preds = %for.body %cmp436 = icmp sgt i32 %4, 0 br i1 %cmp436, label %for.body5.preheader, label %for.end12 for.body5.preheader: ; preds = %for.cond3.preheader %2 = zext i32 %4 to i64 %3 = shl nuw nsw i64 %2, 3 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @D, ptr nonnull align 16 @S, i64 %3, i1 false), !tbaa !5 br label %for.end12 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [200002 x i64], ptr @S, i64 0, 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 %4 = load i32, ptr %n, align 4, !tbaa !20 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !22 for.end12: ; preds = %while.body, %for.body5.preheader, %for.cond3.preheader %.lcssa54 = phi i32 [ %4, %for.body5.preheader ], [ %4, %for.cond3.preheader ], [ %1, %while.body ] %sub = add nsw i32 %.lcssa54, -1 call void @mS(ptr noundef nonnull @S, ptr noundef nonnull @D, i32 noundef 0, i32 noundef %sub) %6 = load i32, ptr %k, align 4, !tbaa !20 %cmp13.not = icmp slt i32 %6, %.lcssa54 br i1 %cmp13.not, label %if.end, label %if.then if.then: ; preds = %for.end12 store i32 %sub, ptr %k, align 4, !tbaa !20 br label %if.end if.end: ; preds = %if.then, %for.end12 %7 = phi i32 [ %sub, %if.then ], [ %6, %for.end12 ] %D.promoted = load i64, ptr @D, align 16, !tbaa !5 %cmp16.not39 = icmp slt i32 %7, 1 br i1 %cmp16.not39, label %for.end22, label %for.body17.preheader for.body17.preheader: ; preds = %if.end %8 = add nuw nsw i32 %7, 1 %wide.trip.count = zext i32 %8 to i64 %9 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %7, 4 br i1 %min.iters.check, label %for.body17.preheader57, label %vector.ph vector.ph: ; preds = %for.body17.preheader %n.vec = and i64 %9, -4 %ind.end = or i64 %n.vec, 1 %10 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %D.promoted, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %10, %vector.ph ], [ %13, %vector.body ] %vec.phi55 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %offset.idx = or i64 %index, 1 %11 = getelementptr inbounds [200002 x i64], ptr @D, i64 0, i64 %offset.idx %wide.load = load <2 x i64>, ptr %11, align 8, !tbaa !5 %12 = getelementptr inbounds i64, ptr %11, i64 2 %wide.load56 = load <2 x i64>, ptr %12, align 8, !tbaa !5 %13 = add <2 x i64> %vec.phi, %wide.load %14 = add <2 x i64> %vec.phi55, %wide.load56 %index.next = add nuw i64 %index, 4 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !23 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %14, %13 %16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %for.cond15.for.end22_crit_edge, label %for.body17.preheader57 for.body17.preheader57: ; preds = %for.body17.preheader, %middle.block %indvars.iv49.ph = phi i64 [ 1, %for.body17.preheader ], [ %ind.end, %middle.block ] %add3840.ph = phi i64 [ %D.promoted, %for.body17.preheader ], [ %16, %middle.block ] br label %for.body17 for.body17: ; preds = %for.body17.preheader57, %for.body17 %indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body17 ], [ %indvars.iv49.ph, %for.body17.preheader57 ] %add3840 = phi i64 [ %add, %for.body17 ], [ %add3840.ph, %for.body17.preheader57 ] %arrayidx19 = getelementptr inbounds [200002 x i64], ptr @D, i64 0, i64 %indvars.iv49 %17 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add = add nsw i64 %add3840, %17 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %exitcond.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count br i1 %exitcond.not, label %for.cond15.for.end22_crit_edge, label %for.body17, !llvm.loop !24 for.cond15.for.end22_crit_edge: ; preds = %for.body17, %middle.block %add.lcssa = phi i64 [ %16, %middle.block ], [ %add, %for.body17 ] store i64 %add.lcssa, ptr @D, align 16, !tbaa !5 br label %for.end22 for.end22: ; preds = %for.cond15.for.end22_crit_edge, %if.end %18 = phi i64 [ %add.lcssa, %for.cond15.for.end22_crit_edge ], [ %D.promoted, %if.end ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %18) %19 = load i32, ptr %T, align 4, !tbaa !20 %dec = add nsw i32 %19, -1 store i32 %dec, ptr %T, align 4, !tbaa !20 %tobool.not = icmp eq i32 %19, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !25 while.end: ; preds = %for.end22, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 ; 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) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !14} !18 = distinct !{!18, !10, !11} !19 = distinct !{!19, !10, !11} !20 = !{!21, !21, i64 0} !21 = !{!"int", !7, i64 0} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10, !11, !12} !24 = distinct !{!24, !10, !12, !11} !25 = distinct !{!25, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <string.h> /*以下便利なマクロを定義する。*/ #define rep(i, min, max) for(i=min; i<=max; i=i+1) #define if_forall(i, min, max, prop)\ \ rep(i, min, max)\ {\ if(!(prop))\ {\ break;\ }\ }\ \ if(i==max+1)\ #define if_exists(i, min, max, prop)\ \ rep(i, min, max)\ {\ if(prop)\ {\ break;\ }\ }\ \ if(i<max+1)\ #define sum(i, min, max, sequence, answer)\ {\ answer=0;\ rep(i, min, max)\ {\ answer=answer+sequence;\ }\ }\ #define prod(i, min, max, sequence, answer)\ {\ answer=1;\ rep(i, min, max)\ {\ answer=answer*sequence;\ }\ }\ /*以下便利な関数を定義する。*/ void fill_int(int array[], int min, int max, int element) { int i=min; rep(i, min, max) { array[i]=element; } } void fill_char(char array[], int min, int max, char element) { int i=min; rep(i, min, max) { array[i]=element; } } void swap_int(int* x, int* y) { int tmp; tmp = *x; *x = *y; *y = tmp; } void swap_int_array(int x[], int y[], int min, int max) { int i; rep(i, min, max) { swap_int(&x[i], &y[i]); } } void swap_char(char* x, char* y) { char tmp; tmp = *x; *x = *y; *y = tmp; } void swap_char_array(char x[], char y[], int min, int max) { int i; rep(i, min, max) { swap_char(&x[i], &y[i]); } } void reverse_char(char array[], int min, int max) { int i; rep(i, min, (min+max)/2) { swap_char(&array[i], &array[min+max-i]); } } int max_int(int var1, int var2) { int answer=var1; if(answer<var2) { answer=var2; } return answer; } int min_int(int var1, int var2) { int answer=var1; if(answer>var2) { answer=var2; } return answer; } long int pow_int(int base, unsigned int exponent) { long int answer=1; answer=(long int)pow((double)base, (double)exponent); return answer; } long int pow_int_mod(int base, unsigned int exponent, int mod) { long int answer=1; while (exponent>0) { if (exponent&1) { answer=(answer*(base%mod))%mod; if(answer==0) { break; } } base=(base*base)%mod; exponent=exponent>>1; } return answer; } unsigned long int factorial(unsigned int num) { unsigned int i=0; unsigned long int answer=1; rep(i, 2, num) { answer=answer*i; } return answer; } unsigned long int factorial_mod(unsigned int num, int mod) { unsigned int i=0; unsigned long int answer=1; rep(i, 2, num) { answer=(answer*(i%mod))%mod; if(answer==0) { break; } } return answer; } unsigned long int combination(unsigned int n, unsigned int k) { unsigned int i=0; unsigned long int numerator=1; unsigned long int denominator=1; k=min_int(k, n-k); rep(i, 2, k) { numerator=numerator*(n+1-i); denominator=denominator*i; } return numerator/denominator; } double combination_general(double alpha, unsigned int k) { unsigned int i; double numerator=1; unsigned long int denominator=1; rep(i, 1, k) { numerator=numerator*(alpha+1-i); denominator=denominator*i; } return numerator/denominator; } int gcd(int a, int b) { if(a<b) { swap_int(&a, &b); } int r=a%b; while(r!=0) { a=b; b=r; r=a%b; } return b; } int lcm(int a, int b) { return (a/gcd(a, b))*b; } int order(long int num) { int answer=-1; while(num!=0) { num=num/10; answer=answer+1; } return answer; } long int convert_adic_int(char num[], unsigned int p_adic, unsigned int q_adic) { int i=0; long int answer=0; bool sgn=0; long int tmp=strtol(num, NULL, p_adic); if(tmp<0) { sgn=1; tmp=-tmp; } while(tmp>0) { answer=answer+(tmp%q_adic)*pow_int(10, i); tmp=tmp/q_adic; i=i+1; } if(sgn==0) { return answer; } else { return -answer; } } void convert_adic_char(char num[], unsigned int p_adic, unsigned int q_adic) { int i=0; int mod[32]={0}; bool sgn=0; int digit=0; long int tmp=strtol(num, NULL, p_adic); if(tmp<0) { sgn=1; tmp=-tmp; } while(tmp>0) { mod[i]=tmp%q_adic; digit=i; tmp=tmp/q_adic; i=i+1; } fill_char(num, 0, strlen(num)-1, '\0'); if(sgn==1) { num[0]='-'; } rep(i, 0, digit) { if(mod[i]<10) { num[sgn+digit-i]='0'+mod[i]; } else if(mod[i]<q_adic) { num[sgn+digit-i]='a'+(mod[i]-10); } } } int count_mod(int min, int max, int num) { if(min>0) { return max/num-(min-1)/num; } else if(min==0) { return max/num+1; } else { return -1; } } void shift_char(char array[], int min, int max, int num) { int i; for(i=max; i>=min; i=i-1) { array[i+num]=array[i]; } rep(i, min, min+num-1) { array[i]='\0'; } } void convert_char(char array[], int min, int max, char pre, char post) { int i=min; rep(i, min, max) { if(array[i]==pre) { array[i]=post; } } } void sort_asc_int(int array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(array[i]>array[j]) { swap_int(&array[i], &array[j]); } } } } void sort_des_int(int array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(array[i]<array[j]) { swap_int(&array[i], &array[j]); } } } } void sort_asc_char_dic(char array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(&array[i], &array[j])>0) { swap_char(&array[i], &array[j]); } } } } void sort_asc_char_array_dic(int size, char array[][size], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(array[i], array[j])>0) { swap_char_array(array[i], array[j], 0, size-1); } } } } void sort_des_char_dic(char array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(&array[i], &array[j])<0) { swap_char(&array[i], &array[j]); } } } } void sort_des_char_array_dic(int size, char array[][size], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(array[i], array[j])<0) { swap_char_array(array[i], array[j], 0, size-1); } } } } int max_int_array(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { answer=max_int(answer, array[i]); } return answer; } void max_int_array_num(int array[], int min, int max, int answer[]) { int i=min; int count=0; int max_value=max_int_array(array, min, max); fill_int(answer, 0, max-min, -1); rep(i, min, max) { if(array[i]==max_value) { answer[count]=i; count=count+1; } } } int min_int_array(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { answer=min_int(answer, array[i]); } return answer; } void min_int_array_num(int array[], int min, int max, int answer[]) { int i=min; int count=0; int min_value=min_int_array(array, min, max); fill_int(answer, 0, max-min, -1); rep(i, min, max) { if(array[i]==min_value) { answer[count]=i; count=count+1; } } } int max_char_array_dic(int size, char array[][size], int min, int max) { int i; int answer=min; rep(i, min+1, max) { if(strcmp(array[answer], array[i])<0) { answer=i; } } return answer; } int min_char_array_dic(int size, char array[][size], int min, int max) { int i; int answer=min; rep(i, min+1, max) { if(strcmp(array[answer], array[i])>0) { answer=i; } } return answer; } int sum_array(int array[], int min, int max) { int i=min; int answer=0; rep(i, min, max) { answer=answer+array[i]; } return answer; } bool detect_int(int array[], int min, int max, int element) { int i; bool answer=0; if_exists(i, min, max, array[i]==element) { answer=1; } return answer; } bool detect_char(char array[], int min, int max, char element) { int i; bool answer=0; if_exists(i, min, max, array[i]==element) { answer=1; } return answer; } bool detect_char_array(char array[], int min, int max, char element[], int start, int goal) { int i, j; bool answer=0; if(goal-start<=max-min) { rep(i, min, max-(goal-start)) { if_forall(j, start, goal, array[i+j-start]==element[j]) { answer=1; break; } } } return answer; } int count_differentelement_int(int array[], int min, int max) { int i=min; int pickup[max]; fill_int(pickup, 0, max, 0); int answer=0; rep(i, min, max) { if(detect_int(pickup, 0, answer-1, array[i])==0) { pickup[answer]=array[i]; answer=answer+1; } } return answer; } int count_differentelement_char(char array[], int min, int max) { int i=min; char pickup[max]; fill_char(pickup, 0, max, '\0'); int answer=0; rep(i, min, max) { if(detect_char_array(pickup, 0, answer-1, array, i, i)==0) { pickup[answer]=array[i]; answer=answer+1; } } return answer; } int count_equalelement_int(int array[], int min, int max, int element) { int i; int answer=0; rep(i, min, max) { if(array[i]==element) { answer=answer+1; } } return answer; } int count_equalelement_char(char array[], int min, int max, char element) { int i; int answer=0; rep(i, min, max) { if(array[i]==element) { answer=answer+1; } } return answer; } int count_equalelement_char_array(int size, char array[][size], int min, int max, char element[]) { int i; int answer=0; rep(i, min, max) { if(strcmp(array[i], element)==0) { answer=answer+1; } } return answer; } void scanf_int_array(int array[], int min, int max) { int i; rep(i, min, max) { scanf("%d", &array[i]); } } void scanf_int_array_2(int array1[], int array2[], int min, int max) { int i; rep(i, min, max) { scanf("%d %d", &array1[i], &array2[i]); } } void scanf_int_array_3(int array1[], int array2[], int array3[], int min, int max) { int i; rep(i, min, max) { scanf("%d %d %d", &array1[i], &array2[i], &array3[i]); } } void scanf_char_array(char array[], int num) { scanf("%s", array); shift_char(array, 0, strlen(array)-1, num); } void printf_int_array(int array[], int min, int max) { int i; rep(i, min, max) { printf("%d\n", array[i]); } } void printf_char_array(char array[], int min, int max) { int i; for(i=min; i<=max; i=i+1) { printf("%c", array[i]); } } int main() { int i; int X; scanf("%d", &X); int p[8]={0}; rep(i, 2, 7) { p[i]=(int)pow(floor(pow(X, 1/((float)i))), i); } printf("%d\n", max_int_array(p, 2, 7)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable define dso_local void @fill_int(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #0 { entry: %cmp.not4 = icmp sgt i32 %min, %max br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 store <4 x i32> %broadcast.splat, ptr %5, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader7 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv store i32 %element, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %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: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @fill_char(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #2 { entry: %cmp.not4 = icmp sgt i32 %min, %max br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %scevgep = getelementptr i8, ptr %array, i64 %0 %1 = sub i32 %max, %min %2 = zext i32 %1 to i64 %3 = add nuw nsw i64 %2, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 %element, i64 %3, i1 false), !tbaa !14 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_int(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_int_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 15 br i1 %min.iters.check, label %for.body.preheader15, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %5 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %x, i64 %5 %6 = sub i32 %max, %min %7 = zext i32 %6 to i64 %8 = add nsw i64 %0, %7 %9 = shl nsw i64 %8, 2 %10 = add nsw i64 %9, 4 %scevgep9 = getelementptr i8, ptr %x, i64 %10 %scevgep10 = getelementptr i8, ptr %y, i64 %5 %scevgep11 = getelementptr i8, ptr %y, i64 %10 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %11 = getelementptr inbounds i32, ptr %x, i64 %offset.idx %12 = getelementptr inbounds i32, ptr %y, i64 %offset.idx %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %13 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load12 = load <4 x i32>, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %wide.load13 = load <4 x i32>, ptr %12, align 4, !tbaa !5, !alias.scope !18 %14 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load14 = load <4 x i32>, ptr %14, align 4, !tbaa !5, !alias.scope !18 store <4 x i32> %wide.load13, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18 store <4 x i32> %wide.load14, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18 store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5, !alias.scope !18 store <4 x i32> %wide.load12, ptr %14, align 4, !tbaa !5, !alias.scope !18 %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %16 = add i32 %max, 1 %17 = trunc i64 %indvars.iv.ph to i32 %18 = sub i32 %16, %17 %xtraiter = and i32 %18, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader15 %arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.ph %19 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5 store i32 %20, ptr %arrayidx.prol, align 4, !tbaa !5 store i32 %19, ptr %arrayidx2.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader15 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader15 ], [ %indvars.iv.next.prol, %for.body.prol ] %21 = icmp eq i32 %17, %max br i1 %21, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %22 = load i32, ptr %arrayidx, align 4, !tbaa !5 %23 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %23, ptr %arrayidx, align 4, !tbaa !5 store i32 %22, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %24 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %25 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 store i32 %25, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %24, ptr %arrayidx2.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_char(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 { entry: %0 = load i8, ptr %x, align 1, !tbaa !14 %1 = load i8, ptr %y, align 1, !tbaa !14 store i8 %1, ptr %x, align 1, !tbaa !14 store i8 %0, ptr %y, align 1, !tbaa !14 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_char_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %scevgep = getelementptr i8, ptr %x, i64 %0 %5 = sub i32 %max, %min %6 = zext i32 %5 to i64 %7 = add nsw i64 %0, %6 %8 = add nsw i64 %7, 1 %scevgep9 = getelementptr i8, ptr %x, i64 %8 %scevgep10 = getelementptr i8, ptr %y, i64 %0 %scevgep11 = getelementptr i8, ptr %y, i64 %8 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check12 = icmp ult i32 %2, 31 br i1 %min.iters.check12, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, 8589934560 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %9 = getelementptr inbounds i8, ptr %x, i64 %offset.idx %10 = getelementptr inbounds i8, ptr %y, i64 %offset.idx %wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25 %11 = getelementptr inbounds i8, ptr %9, i64 16 %wide.load13 = load <16 x i8>, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25 %wide.load14 = load <16 x i8>, ptr %10, align 1, !tbaa !14, !alias.scope !25 %12 = getelementptr inbounds i8, ptr %10, i64 16 %wide.load15 = load <16 x i8>, ptr %12, align 1, !tbaa !14, !alias.scope !25 store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25 store <16 x i8> %wide.load15, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25 store <16 x i8> %wide.load, ptr %10, align 1, !tbaa !14, !alias.scope !25 store <16 x i8> %wide.load13, ptr %12, align 1, !tbaa !14, !alias.scope !25 %index.next = add nuw i64 %index, 32 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !27 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end18 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %4, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec17 = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec17, %0 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index20 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ] %offset.idx21 = add i64 %index20, %0 %14 = getelementptr inbounds i8, ptr %x, i64 %offset.idx21 %15 = getelementptr inbounds i8, ptr %y, i64 %offset.idx21 %wide.load22 = load <8 x i8>, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31 %wide.load23 = load <8 x i8>, ptr %15, align 1, !tbaa !14, !alias.scope !31 store <8 x i8> %wide.load23, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31 store <8 x i8> %wide.load22, ptr %15, align 1, !tbaa !14, !alias.scope !31 %index.next24 = add nuw i64 %index20, 8 %16 = icmp eq i64 %index.next24, %n.vec17 br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !33 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n19 = icmp eq i64 %4, %n.vec17 br i1 %cmp.n19, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end18, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %17 = add i32 %max, 1 %18 = trunc i64 %indvars.iv.ph to i32 %19 = sub i32 %17, %18 %xtraiter = and i32 %19, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.ph %20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14 %21 = load i8, ptr %arrayidx2.prol, align 1, !tbaa !14 store i8 %21, ptr %arrayidx.prol, align 1, !tbaa !14 store i8 %20, ptr %arrayidx2.prol, align 1, !tbaa !14 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %22 = icmp eq i32 %18, %max br i1 %22, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv %23 = load i8, ptr %arrayidx, align 1, !tbaa !14 %24 = load i8, ptr %arrayidx2, align 1, !tbaa !14 store i8 %24, ptr %arrayidx, align 1, !tbaa !14 store i8 %23, ptr %arrayidx2, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.next %25 = load i8, ptr %arrayidx.1, align 1, !tbaa !14 %26 = load i8, ptr %arrayidx2.1, align 1, !tbaa !14 store i8 %26, ptr %arrayidx.1, align 1, !tbaa !14 store i8 %25, ptr %arrayidx2.1, align 1, !tbaa !14 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !34 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @reverse_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %add = add nsw i32 %max, %min %div = sdiv i32 %add, 2 %cmp.not12 = icmp slt i32 %div, %min br i1 %cmp.not12, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = sext i32 %add to i64 %2 = add nsw i32 %div, 1 %3 = add nsw i32 %div, 1 %4 = sub i32 %3, %min %xtraiter = and i32 %4, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds i8, ptr %array, i64 %0 %5 = sub nsw i64 %1, %0 %arrayidx3.prol = getelementptr inbounds i8, ptr %array, i64 %5 %6 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14 %7 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !14 store i8 %7, ptr %arrayidx.prol, align 1, !tbaa !14 store i8 %6, ptr %arrayidx3.prol, align 1, !tbaa !14 %indvars.iv.next.prol = add nsw i64 %0, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %8 = icmp eq i32 %div, %min br i1 %8, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %9 = sub nsw i64 %1, %indvars.iv %arrayidx3 = getelementptr inbounds i8, ptr %array, i64 %9 %10 = load i8, ptr %arrayidx, align 1, !tbaa !14 %11 = load i8, ptr %arrayidx3, align 1, !tbaa !14 store i8 %11, ptr %arrayidx, align 1, !tbaa !14 store i8 %10, ptr %arrayidx3, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next %12 = sub nsw i64 %1, %indvars.iv.next %arrayidx3.1 = getelementptr inbounds i8, ptr %array, i64 %12 %13 = load i8, ptr %arrayidx.1, align 1, !tbaa !14 %14 = load i8, ptr %arrayidx3.1, align 1, !tbaa !14 store i8 %14, ptr %arrayidx.1, align 1, !tbaa !14 store i8 %13, ptr %arrayidx3.1, align 1, !tbaa !14 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %2, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !35 for.end: ; preds = %for.body.prol.loopexit, %for.body, %entry ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %var1, i32 %var2) ret i32 %spec.select } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %var1, i32 %var2) ret i32 %spec.select } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable define dso_local i64 @pow_int(i32 noundef %base, i32 noundef %exponent) local_unnamed_addr #6 { entry: %conv = sitofp i32 %base to double %conv1 = uitofp i32 %exponent to double %call = tail call double @pow(double noundef %conv, double noundef %conv1) #25 %conv2 = fptosi double %call to i64 ret i64 %conv2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #7 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @pow_int_mod(i32 noundef %base, i32 noundef %exponent, i32 noundef %mod) local_unnamed_addr #8 { entry: %cmp.not17 = icmp eq i32 %exponent, 0 br i1 %cmp.not17, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %conv1 = sext i32 %mod to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end6 %answer.020 = phi i64 [ 1, %while.body.lr.ph ], [ %answer.1, %if.end6 ] %base.addr.019 = phi i32 [ %base, %while.body.lr.ph ], [ %rem8, %if.end6 ] %exponent.addr.018 = phi i32 [ %exponent, %while.body.lr.ph ], [ %shr, %if.end6 ] %and = and i32 %exponent.addr.018, 1 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %if.end6, label %if.then if.then: ; preds = %while.body %rem = srem i32 %base.addr.019, %mod %conv = sext i32 %rem to i64 %mul = mul nsw i64 %answer.020, %conv %rem2 = srem i64 %mul, %conv1 %cmp3 = icmp eq i64 %rem2, 0 br i1 %cmp3, label %while.end, label %if.end6 if.end6: ; preds = %if.then, %while.body %answer.1 = phi i64 [ %rem2, %if.then ], [ %answer.020, %while.body ] %mul7 = mul nsw i32 %base.addr.019, %base.addr.019 %rem8 = srem i32 %mul7, %mod %shr = lshr i32 %exponent.addr.018, 1 %cmp.not = icmp ult i32 %exponent.addr.018, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !36 while.end: ; preds = %if.end6, %if.then, %entry %answer.2 = phi i64 [ 1, %entry ], [ 0, %if.then ], [ %answer.1, %if.end6 ] ret i64 %answer.2 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @factorial(i32 noundef %num) local_unnamed_addr #9 { entry: %cmp.not4 = icmp ult i32 %num, 2 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add i32 %num, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -2 %2 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %1, 7 %3 = icmp ult i64 %2, 7 br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %1, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.7, %for.body ] %answer.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul i64 %answer.06, %indvars.iv %indvars.iv.next = or i64 %indvars.iv, 1 %mul.1 = mul i64 %mul, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %mul.2 = mul i64 %mul.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %mul.3 = mul i64 %mul.2, %indvars.iv.next.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %mul.4 = mul i64 %mul.3, %indvars.iv.next.3 %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5 %mul.5 = mul i64 %mul.4, %indvars.iv.next.4 %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv, 6 %mul.6 = mul i64 %mul.5, %indvars.iv.next.5 %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv, 7 %mul.7 = mul i64 %mul.6, %indvars.iv.next.6 %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !37 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.7, %for.body ] %answer.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %answer.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %answer.06.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 i64 %answer.06.epil, %indvars.iv.epil %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 !38 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %answer.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @factorial_mod(i32 noundef %num, i32 noundef %mod) local_unnamed_addr #8 { entry: %cmp.not10 = icmp ult i32 %num, 2 br i1 %cmp.not10, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %conv1 = sext i32 %mod to i64 br label %for.body for.cond: ; preds = %for.body %add = add i32 %i.011, 1 %cmp.not = icmp ugt i32 %add, %num br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !40 for.body: ; preds = %for.body.lr.ph, %for.cond %answer.012 = phi i64 [ 1, %for.body.lr.ph ], [ %rem2, %for.cond ] %i.011 = phi i32 [ 2, %for.body.lr.ph ], [ %add, %for.cond ] %rem = urem i32 %i.011, %mod %conv = zext i32 %rem to i64 %mul = mul i64 %answer.012, %conv %rem2 = urem i64 %mul, %conv1 %cmp3 = icmp eq i64 %rem2, 0 br i1 %cmp3, label %for.end, label %for.cond for.end: ; preds = %for.cond, %for.body, %entry %answer.1 = phi i64 [ 1, %entry ], [ 0, %for.body ], [ %rem2, %for.cond ] ret i64 %answer.1 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @combination(i32 noundef %n, i32 noundef %k) local_unnamed_addr #9 { entry: %sub = sub i32 %n, %k %spec.select.i = tail call i32 @llvm.smin.i32(i32 %k, i32 %sub) %cmp.not13 = icmp ult i32 %spec.select.i, 2 br i1 %cmp.not13, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add i32 %n, 1 %0 = add i32 %spec.select.i, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -2 %2 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %1, 3 %3 = icmp ult i64 %2, 3 br i1 %3, 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 %1, -4 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ] %denominator.016 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul3.3, %for.body ] %numerator.015 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.3, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %4 = trunc i64 %indvars.iv to i32 %sub1 = sub i32 %add, %4 %conv = zext i32 %sub1 to i64 %mul = mul i64 %numerator.015, %conv %mul3 = mul i64 %denominator.016, %indvars.iv %indvars.iv.next = or i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 %sub1.1 = sub i32 %add, %5 %conv.1 = zext i32 %sub1.1 to i64 %mul.1 = mul i64 %mul, %conv.1 %mul3.1 = mul i64 %mul3, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %6 = trunc i64 %indvars.iv.next.1 to i32 %sub1.2 = sub i32 %add, %6 %conv.2 = zext i32 %sub1.2 to i64 %mul.2 = mul i64 %mul.1, %conv.2 %mul3.2 = mul i64 %mul3.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %7 = trunc i64 %indvars.iv.next.2 to i32 %sub1.3 = sub i32 %add, %7 %conv.3 = zext i32 %sub1.3 to i64 %mul.3 = mul i64 %mul.2, %conv.3 %mul3.3 = mul i64 %mul3.2, %indvars.iv.next.2 %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 !41 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ] %mul3.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul3.3, %for.body ] %indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ] %denominator.016.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul3.3, %for.body ] %numerator.015.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.loopexit, 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 ] %denominator.016.epil = phi i64 [ %mul3.epil, %for.body.epil ], [ %denominator.016.unr, %for.end.loopexit.unr-lcssa ] %numerator.015.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %numerator.015.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %8 = trunc i64 %indvars.iv.epil to i32 %sub1.epil = sub i32 %add, %8 %conv.epil = zext i32 %sub1.epil to i64 %mul.epil = mul i64 %numerator.015.epil, %conv.epil %mul3.epil = mul i64 %denominator.016.epil, %indvars.iv.epil %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.loopexit, label %for.body.epil, !llvm.loop !42 for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa %mul.lcssa = phi i64 [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] %mul3.lcssa = phi i64 [ %mul3.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul3.epil, %for.body.epil ] %9 = udiv i64 %mul.lcssa, %mul3.lcssa br label %for.end for.end: ; preds = %for.end.loopexit, %entry %div = phi i64 [ 1, %entry ], [ %9, %for.end.loopexit ] ret i64 %div } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local double @combination_general(double noundef %alpha, i32 noundef %k) local_unnamed_addr #9 { entry: %cmp.not10 = icmp eq i32 %k, 0 br i1 %cmp.not10, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = fadd double %alpha, 1.000000e+00 %0 = add i32 %k, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 2) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -1 %2 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %1, 3 %3 = icmp ult i64 %2, 3 br i1 %3, 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 %1, -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 ] %denominator.013 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul2.3, %for.body ] %numerator.012 = phi double [ 1.000000e+00, %for.body.lr.ph.new ], [ %mul.3, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %4 = trunc i64 %indvars.iv to i32 %conv = uitofp i32 %4 to double %sub = fsub double %add, %conv %mul = fmul double %numerator.012, %sub %mul2 = mul i64 %denominator.013, %indvars.iv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 %conv.1 = uitofp i32 %5 to double %sub.1 = fsub double %add, %conv.1 %mul.1 = fmul double %mul, %sub.1 %mul2.1 = mul i64 %mul2, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %6 = trunc i64 %indvars.iv.next.1 to i32 %conv.2 = uitofp i32 %6 to double %sub.2 = fsub double %add, %conv.2 %mul.2 = fmul double %mul.1, %sub.2 %mul2.2 = mul i64 %mul2.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %7 = trunc i64 %indvars.iv.next.2 to i32 %conv.3 = uitofp i32 %7 to double %sub.3 = fsub double %add, %conv.3 %mul.3 = fmul double %mul.2, %sub.3 %mul2.3 = mul i64 %mul2.2, %indvars.iv.next.2 %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 !43 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %mul.lcssa.ph = phi double [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ] %mul2.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul2.3, %for.body ] %indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ] %denominator.013.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul2.3, %for.body ] %numerator.012.unr = phi double [ 1.000000e+00, %for.body.lr.ph ], [ %mul.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.loopexit, 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 ] %denominator.013.epil = phi i64 [ %mul2.epil, %for.body.epil ], [ %denominator.013.unr, %for.end.loopexit.unr-lcssa ] %numerator.012.epil = phi double [ %mul.epil, %for.body.epil ], [ %numerator.012.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %8 = trunc i64 %indvars.iv.epil to i32 %conv.epil = uitofp i32 %8 to double %sub.epil = fsub double %add, %conv.epil %mul.epil = fmul double %numerator.012.epil, %sub.epil %mul2.epil = mul i64 %denominator.013.epil, %indvars.iv.epil %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.loopexit, label %for.body.epil, !llvm.loop !44 for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa %mul.lcssa = phi double [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] %mul2.lcssa = phi i64 [ %mul2.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul2.epil, %for.body.epil ] %9 = uitofp i64 %mul2.lcssa to double %10 = fdiv double %mul.lcssa, %9 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %div = phi double [ 1.000000e+00, %entry ], [ %10, %for.end.loopexit ] ret double %div } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select8 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select, %spec.select8 %cmp1.not9 = icmp eq i32 %rem, 0 br i1 %cmp1.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.011 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ] %b.addr.110 = phi i32 [ %r.011, %while.body ], [ %spec.select8, %entry ] %rem2 = srem i32 %b.addr.110, %r.011 %cmp1.not = icmp eq i32 %rem2, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !45 while.end: ; preds = %while.body, %entry %b.addr.1.lcssa = phi i32 [ %spec.select8, %entry ], [ %r.011, %while.body ] ret i32 %b.addr.1.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 { entry: %spec.select.i = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select8.i = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %rem.i = srem i32 %spec.select.i, %spec.select8.i %cmp1.not9.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not9.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %r.011.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ] %b.addr.110.i = phi i32 [ %r.011.i, %while.body.i ], [ %spec.select8.i, %entry ] %rem2.i = srem i32 %b.addr.110.i, %r.011.i %cmp1.not.i = icmp eq i32 %rem2.i, 0 br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !45 gcd.exit: ; preds = %while.body.i, %entry %b.addr.1.lcssa.i = phi i32 [ %spec.select8.i, %entry ], [ %r.011.i, %while.body.i ] %div = sdiv i32 %a, %b.addr.1.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @order(i64 noundef %num) local_unnamed_addr #8 { entry: %cmp.not3 = icmp eq i64 %num, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %answer.05 = phi i32 [ %add, %while.body ], [ -1, %entry ] %num.addr.04 = phi i64 [ %div, %while.body ], [ %num, %entry ] %div = sdiv i64 %num.addr.04, 10 %add = add nsw i32 %answer.05, 1 %num.addr.04.off = add i64 %num.addr.04, 9 %cmp.not = icmp ult i64 %num.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !46 while.end: ; preds = %while.body, %entry %answer.0.lcssa = phi i32 [ -1, %entry ], [ %add, %while.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @convert_adic_int(ptr nocapture noundef readonly %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 { entry: %call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #25 %cmp122.not = icmp eq i64 %call, 0 br i1 %cmp122.not, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true) %conv = zext i32 %q_adic to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %tmp.125 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ] %answer.024 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ] %i.023 = phi i32 [ 0, %while.body.lr.ph ], [ %add4, %while.body ] %rem = urem i64 %tmp.125, %conv %conv1.i = uitofp i32 %i.023 to double %call.i = tail call double @pow(double noundef 1.000000e+01, double noundef %conv1.i) #25 %conv2.i = fptosi double %call.i to i64 %mul = mul nsw i64 %rem, %conv2.i %add = add nsw i64 %mul, %answer.024 %div = udiv i64 %tmp.125, %conv %add4 = add nuw nsw i32 %i.023, 1 %cmp1.not = icmp ult i64 %tmp.125, %conv br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !47 while.end: ; preds = %while.body, %entry %answer.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] %sub9 = sub nsw i64 0, %answer.0.lcssa %cmp621 = icmp slt i64 %call, 0 %retval.0 = select i1 %cmp621, i64 %sub9, i64 %answer.0.lcssa ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #11 ; Function Attrs: nofree nounwind uwtable define dso_local void @convert_adic_char(ptr nocapture noundef %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 { entry: %mod = alloca [32 x i32], align 16 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %mod) #25 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %mod, i8 0, i64 128, i1 false) %call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #25 %cmp = icmp slt i64 %call, 0 %cmp174.not = icmp eq i64 %call, 0 br i1 %cmp174.not, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true) %conv = zext i32 %q_adic to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ] %tmp.176 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ] %rem = urem i64 %tmp.176, %conv %conv2 = trunc i64 %rem to i32 %arrayidx = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv store i32 %conv2, ptr %arrayidx, align 4, !tbaa !5 %div = udiv i64 %tmp.176, %conv %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp1.not = icmp ult i64 %tmp.176, %conv br i1 %cmp1.not, label %while.end.loopexit, label %while.body, !llvm.loop !48 while.end.loopexit: ; preds = %while.body %0 = trunc i64 %indvars.iv to i32 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %digit.0.lcssa = phi i32 [ 0, %entry ], [ %0, %while.end.loopexit ] %call4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num) #26 %1 = trunc i64 %call4 to i32 %conv6 = add i32 %1, -1 %cmp.not4.i = icmp slt i32 %conv6, 0 br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %while.end %2 = zext i32 %conv6 to i64 %3 = add nuw nsw i64 %2, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %num, i8 0, i64 %3, i1 false), !tbaa !14 br label %fill_char.exit fill_char.exit: ; preds = %while.end, %for.body.preheader.i %call.lobit = lshr i64 %call, 63 %conv7 = trunc i64 %call.lobit to i32 br i1 %cmp, label %if.then10, label %if.end12 if.then10: ; preds = %fill_char.exit store i8 45, ptr %num, align 1, !tbaa !14 br label %if.end12 if.end12: ; preds = %if.then10, %fill_char.exit %add42 = add nuw nsw i32 %digit.0.lcssa, %conv7 %4 = add i32 %digit.0.lcssa, 1 %wide.trip.count = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 16 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %if.end12 %5 = add nsw i64 %wide.trip.count, -1 %6 = add i32 %digit.0.lcssa, %conv7 %7 = trunc i64 %5 to i32 %8 = sub i32 %6, %7 %9 = icmp sgt i32 %8, %6 %10 = icmp ugt i64 %5, 4294967295 %11 = or i1 %9, %10 br i1 %11, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %vector.scevcheck %n.vec = and i64 %wide.trip.count, 4294967292 %ind.end = sub nsw i64 0, %n.vec %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %q_adic, 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 = %pred.store.continue95, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue95 ] %12 = trunc i64 %index to i32 %13 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = icmp slt <4 x i32> %wide.load, <i32 10, i32 10, i32 10, i32 10> %15 = icmp ult <4 x i32> %wide.load, %broadcast.splat %16 = xor <4 x i1> %14, <i1 true, i1 true, i1 true, i1 true> %17 = select <4 x i1> %16, <4 x i1> %15, <4 x i1> zeroinitializer %predphi = select <4 x i1> %17, <4 x i8> <i8 87, i8 87, i8 87, i8 87>, <4 x i8> <i8 48, i8 48, i8 48, i8 48> %18 = or <4 x i1> %17, %14 %19 = extractelement <4 x i1> %18, i64 0 br i1 %19, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %20 = sub i32 %add42, %12 %21 = sext i32 %20 to i64 %22 = bitcast <4 x i32> %wide.load to <16 x i8> %23 = extractelement <16 x i8> %22, i64 0 %24 = getelementptr inbounds i8, ptr %num, i64 %21 %25 = extractelement <4 x i8> %predphi, i64 0 %26 = add i8 %25, %23 store i8 %26, ptr %24, align 1, !tbaa !14 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %27 = extractelement <4 x i1> %18, i64 1 br i1 %27, label %pred.store.if90, label %pred.store.continue91 pred.store.if90: ; preds = %pred.store.continue %28 = xor i32 %12, -1 %29 = add i32 %add42, %28 %30 = sext i32 %29 to i64 %31 = bitcast <4 x i32> %wide.load to <16 x i8> %32 = extractelement <16 x i8> %31, i64 4 %33 = getelementptr inbounds i8, ptr %num, i64 %30 %34 = extractelement <4 x i8> %predphi, i64 1 %35 = add i8 %34, %32 store i8 %35, ptr %33, align 1, !tbaa !14 br label %pred.store.continue91 pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue %36 = extractelement <4 x i1> %18, i64 2 br i1 %36, label %pred.store.if92, label %pred.store.continue93 pred.store.if92: ; preds = %pred.store.continue91 %reass.sub = sub i32 %add42, %12 %37 = add i32 %reass.sub, -2 %38 = sext i32 %37 to i64 %39 = bitcast <4 x i32> %wide.load to <16 x i8> %40 = extractelement <16 x i8> %39, i64 8 %41 = getelementptr inbounds i8, ptr %num, i64 %38 %42 = extractelement <4 x i8> %predphi, i64 2 %43 = add i8 %42, %40 store i8 %43, ptr %41, align 1, !tbaa !14 br label %pred.store.continue93 pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91 %44 = extractelement <4 x i1> %18, i64 3 br i1 %44, label %pred.store.if94, label %pred.store.continue95 pred.store.if94: ; preds = %pred.store.continue93 %reass.sub96 = sub i32 %add42, %12 %45 = add i32 %reass.sub96, -3 %46 = sext i32 %45 to i64 %47 = bitcast <4 x i32> %wide.load to <16 x i8> %48 = extractelement <16 x i8> %47, i64 12 %49 = getelementptr inbounds i8, ptr %num, i64 %46 %50 = extractelement <4 x i8> %predphi, i64 3 %51 = add i8 %50, %48 store i8 %51, ptr %49, align 1, !tbaa !14 br label %pred.store.continue95 pred.store.continue95: ; preds = %pred.store.if94, %pred.store.continue93 %index.next = add nuw i64 %index, 4 %52 = icmp eq i64 %index.next, %n.vec br i1 %52, label %middle.block, label %vector.body, !llvm.loop !49 middle.block: ; preds = %pred.store.continue95 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %if.end12, %middle.block %indvars.iv82.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %n.vec, %middle.block ] %indvars.iv80.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %ind.end, %middle.block ] %xtraiter = and i64 %wide.trip.count, 1 %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.preheader %arrayidx16.prol = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82.ph %53 = load i32, ptr %arrayidx16.prol, align 16, !tbaa !5 %cmp17.prol = icmp slt i32 %53, 10 br i1 %cmp17.prol, label %for.inc.sink.split.prol, label %if.else.prol if.else.prol: ; preds = %for.body.prol %cmp32.prol = icmp ult i32 %53, %q_adic br i1 %cmp32.prol, label %for.inc.sink.split.prol, label %for.inc.prol for.inc.sink.split.prol: ; preds = %if.else.prol, %for.body.prol %.sink88.prol = phi i8 [ 48, %for.body.prol ], [ 87, %if.else.prol ] %54 = trunc i32 %53 to i8 %conv23.prol = add i8 %.sink88.prol, %54 %55 = trunc i64 %indvars.iv80.ph to i32 %sub27.prol = add i32 %add42, %55 %idxprom28.prol = sext i32 %sub27.prol to i64 %arrayidx29.prol = getelementptr inbounds i8, ptr %num, i64 %idxprom28.prol store i8 %conv23.prol, ptr %arrayidx29.prol, align 1, !tbaa !14 br label %for.inc.prol for.inc.prol: ; preds = %for.inc.sink.split.prol, %if.else.prol %indvars.iv.next83.prol = or i64 %indvars.iv82.ph, 1 %indvars.iv.next81.prol = add nsw i64 %indvars.iv80.ph, -1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader %indvars.iv82.unr = phi i64 [ %indvars.iv82.ph, %for.body.preheader ], [ %indvars.iv.next83.prol, %for.inc.prol ] %indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body.preheader ], [ %indvars.iv.next81.prol, %for.inc.prol ] %56 = sub nsw i64 0, %wide.trip.count %57 = xor i64 %indvars.iv82.ph, %56 %58 = icmp eq i64 %57, -1 br i1 %58, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.inc.1 %indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %for.inc.1 ], [ %indvars.iv82.unr, %for.body.prol.loopexit ] %indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %for.inc.1 ], [ %indvars.iv80.unr, %for.body.prol.loopexit ] %arrayidx16 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82 %59 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp slt i32 %59, 10 br i1 %cmp17, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %cmp32 = icmp ult i32 %59, %q_adic br i1 %cmp32, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %.sink88 = phi i8 [ 48, %for.body ], [ 87, %if.else ] %60 = trunc i32 %59 to i8 %conv23 = add i8 %.sink88, %60 %61 = trunc i64 %indvars.iv80 to i32 %sub27 = add i32 %add42, %61 %idxprom28 = sext i32 %sub27 to i64 %arrayidx29 = getelementptr inbounds i8, ptr %num, i64 %idxprom28 store i8 %conv23, ptr %arrayidx29, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %arrayidx16.1 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv.next83 %62 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %cmp17.1 = icmp slt i32 %62, 10 br i1 %cmp17.1, label %for.inc.sink.split.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp32.1 = icmp ult i32 %62, %q_adic br i1 %cmp32.1, label %for.inc.sink.split.1, label %for.inc.1 for.inc.sink.split.1: ; preds = %if.else.1, %for.inc %.sink88.1 = phi i8 [ 48, %for.inc ], [ 87, %if.else.1 ] %63 = trunc i32 %62 to i8 %conv23.1 = add i8 %.sink88.1, %63 %64 = trunc i64 %indvars.iv80 to i32 %65 = add i32 %64, -1 %sub27.1 = add i32 %add42, %65 %idxprom28.1 = sext i32 %sub27.1 to i64 %arrayidx29.1 = getelementptr inbounds i8, ptr %num, i64 %idxprom28.1 store i8 %conv23.1, ptr %arrayidx29.1, align 1, !tbaa !14 br label %for.inc.1 for.inc.1: ; preds = %for.inc.sink.split.1, %if.else.1 %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2 %indvars.iv.next81.1 = add nsw i64 %indvars.iv80, -2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next83.1, %wide.trip.count br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !50 for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %middle.block call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %mod) #25 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @count_mod(i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #14 { entry: %cmp = icmp sgt i32 %min, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %div = sdiv i32 %max, %num %sub = add nsw i32 %min, -1 %div1 = sdiv i32 %sub, %num %sub2 = sub nsw i32 %div, %div1 br label %return if.else: ; preds = %entry %cmp3 = icmp eq i32 %min, 0 br i1 %cmp3, label %if.then4, label %return if.then4: ; preds = %if.else %div5 = sdiv i32 %max, %num %add = add nsw i32 %div5, 1 br label %return return: ; preds = %if.else, %if.then4, %if.then %retval.0 = phi i32 [ %sub2, %if.then ], [ %add, %if.then4 ], [ -1, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @shift_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #15 { entry: %array39 = ptrtoint ptr %array to i64 %cmp.not24 = icmp slt i32 %max, %min br i1 %cmp.not24, label %for.cond3.preheader, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %num to i64 %2 = sext i32 %min to i64 %invariant.gep = getelementptr i8, ptr %array, i64 %1 %3 = add nsw i64 %0, 1 %4 = sub nsw i64 %3, %2 %min.iters.check = icmp ult i64 %4, 4 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %5 = sub nsw i64 %0, %2 %6 = getelementptr i8, ptr %array, i64 %1 %scevgep34 = getelementptr i8, ptr %6, i64 %0 %7 = sub nsw i64 0, %5 %8 = getelementptr i8, ptr %scevgep34, i64 %7 %9 = icmp ugt ptr %8, %scevgep34 %scevgep35 = getelementptr i8, ptr %array, i64 %0 %10 = sub nsw i64 0, %5 %11 = getelementptr i8, ptr %scevgep35, i64 %10 %12 = icmp ugt ptr %11, %scevgep35 %13 = or i1 %9, %12 br i1 %13, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %14 = add i64 %array39, %0 %15 = add i64 %array39, %1 %16 = add i64 %15, %0 %17 = sub i64 %14, %16 %diff.check = icmp ult i64 %17, 16 br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check40 = icmp ult i64 %4, 16 br i1 %min.iters.check40, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, -16 %invariant.gep52 = getelementptr i8, ptr %array, i64 -15 %invariant.gep54 = getelementptr i8, ptr %invariant.gep, i64 -15 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %0, %index %gep53 = getelementptr i8, ptr %invariant.gep52, i64 %offset.idx %wide.load = load <16 x i8>, ptr %gep53, align 1, !tbaa !14 %gep55 = getelementptr i8, ptr %invariant.gep54, i64 %offset.idx store <16 x i8> %wide.load, ptr %gep55, align 1, !tbaa !14 %index.next = add nuw i64 %index, 16 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !51 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.cond3.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end44 = sub nsw i64 %0, %n.vec %n.vec.remaining = and i64 %4, 12 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec43 = and i64 %4, -4 %ind.end = sub nsw i64 %0, %n.vec43 %invariant.gep56 = getelementptr i8, ptr %array, i64 -3 %invariant.gep58 = getelementptr i8, ptr %invariant.gep, i64 -3 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index46 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ] %offset.idx47 = sub i64 %0, %index46 %gep57 = getelementptr i8, ptr %invariant.gep56, i64 %offset.idx47 %wide.load48 = load <4 x i8>, ptr %gep57, align 1, !tbaa !14 %gep59 = getelementptr i8, ptr %invariant.gep58, i64 %offset.idx47 store <4 x i8> %wide.load48, ptr %gep59, align 1, !tbaa !14 %index.next51 = add nuw i64 %index46, 4 %19 = icmp eq i64 %index.next51, %n.vec43 br i1 %19, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !52 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n45 = icmp eq i64 %4, %n.vec43 br i1 %cmp.n45, label %for.cond3.preheader, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %0, %vector.scevcheck ], [ %ind.end44, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] br label %for.body for.cond3.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %cmp6.not.not26 = icmp sgt i32 %num, 0 br i1 %cmp6.not.not26, label %for.body7.preheader, label %for.end12 for.body7.preheader: ; preds = %for.cond3.preheader %add4 = add i32 %num, %min %20 = sext i32 %min to i64 %scevgep = getelementptr i8, ptr %array, i64 %20 %21 = add i32 %min, 1 %smax = tail call i32 @llvm.smax.i32(i32 %add4, i32 %21) %22 = xor i32 %min, -1 %23 = add i32 %smax, %22 %24 = zext i32 %23 to i64 %25 = add nuw nsw i64 %24, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %25, i1 false), !tbaa !14 br label %for.end12 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %26 = load i8, ptr %arrayidx, align 1, !tbaa !14 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv store i8 %26, ptr %gep, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp.not.not = icmp sgt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !53 for.end12: ; preds = %for.body7.preheader, %for.cond3.preheader ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @convert_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %pre, i8 noundef signext %post) local_unnamed_addr #4 { entry: %cmp.not11 = icmp sgt i32 %min, %max br i1 %cmp.not11, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check14 = icmp ult i32 %2, 31 br i1 %min.iters.check14, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, 8589934560 %broadcast.splatinsert = insertelement <16 x i8> poison, i8 %pre, i64 0 %broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer %invariant.gep = getelementptr i8, ptr %array, i64 1 %invariant.gep104 = getelementptr i8, ptr %array, i64 2 %invariant.gep106 = getelementptr i8, ptr %array, i64 3 %invariant.gep108 = getelementptr i8, ptr %array, i64 4 %invariant.gep110 = getelementptr i8, ptr %array, i64 5 %invariant.gep112 = getelementptr i8, ptr %array, i64 6 %invariant.gep114 = getelementptr i8, ptr %array, i64 7 %invariant.gep116 = getelementptr i8, ptr %array, i64 8 %invariant.gep118 = getelementptr i8, ptr %array, i64 9 %invariant.gep120 = getelementptr i8, ptr %array, i64 10 %invariant.gep122 = getelementptr i8, ptr %array, i64 11 %invariant.gep124 = getelementptr i8, ptr %array, i64 12 %invariant.gep126 = getelementptr i8, ptr %array, i64 13 %invariant.gep128 = getelementptr i8, ptr %array, i64 14 %invariant.gep130 = getelementptr i8, ptr %array, i64 15 %invariant.gep132 = getelementptr i8, ptr %array, i64 16 %invariant.gep134 = getelementptr i8, ptr %array, i64 17 %invariant.gep136 = getelementptr i8, ptr %array, i64 18 %invariant.gep138 = getelementptr i8, ptr %array, i64 19 %invariant.gep140 = getelementptr i8, ptr %array, i64 20 %invariant.gep142 = getelementptr i8, ptr %array, i64 21 %invariant.gep144 = getelementptr i8, ptr %array, i64 22 %invariant.gep146 = getelementptr i8, ptr %array, i64 23 %invariant.gep148 = getelementptr i8, ptr %array, i64 24 %invariant.gep150 = getelementptr i8, ptr %array, i64 25 %invariant.gep152 = getelementptr i8, ptr %array, i64 26 %invariant.gep154 = getelementptr i8, ptr %array, i64 27 %invariant.gep156 = getelementptr i8, ptr %array, i64 28 %invariant.gep158 = getelementptr i8, ptr %array, i64 29 %invariant.gep160 = getelementptr i8, ptr %array, i64 30 %invariant.gep162 = getelementptr i8, ptr %array, i64 31 br label %vector.body vector.body: ; preds = %pred.store.continue77, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue77 ] %offset.idx = add i64 %index, %0 %5 = getelementptr inbounds i8, ptr %array, i64 %offset.idx %wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !14 %6 = getelementptr inbounds i8, ptr %5, i64 16 %wide.load15 = load <16 x i8>, ptr %6, align 1, !tbaa !14 %7 = icmp eq <16 x i8> %wide.load, %broadcast.splat %8 = icmp eq <16 x i8> %wide.load15, %broadcast.splat %9 = extractelement <16 x i1> %7, i64 0 br i1 %9, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %10 = getelementptr inbounds i8, ptr %array, i64 %offset.idx store i8 %post, ptr %10, align 1, !tbaa !14 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %11 = extractelement <16 x i1> %7, i64 1 br i1 %11, label %pred.store.if16, label %pred.store.continue17 pred.store.if16: ; preds = %pred.store.continue %gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx store i8 %post, ptr %gep, align 1, !tbaa !14 br label %pred.store.continue17 pred.store.continue17: ; preds = %pred.store.if16, %pred.store.continue %12 = extractelement <16 x i1> %7, i64 2 br i1 %12, label %pred.store.if18, label %pred.store.continue19 pred.store.if18: ; preds = %pred.store.continue17 %gep105 = getelementptr i8, ptr %invariant.gep104, i64 %offset.idx store i8 %post, ptr %gep105, align 1, !tbaa !14 br label %pred.store.continue19 pred.store.continue19: ; preds = %pred.store.if18, %pred.store.continue17 %13 = extractelement <16 x i1> %7, i64 3 br i1 %13, label %pred.store.if20, label %pred.store.continue21 pred.store.if20: ; preds = %pred.store.continue19 %gep107 = getelementptr i8, ptr %invariant.gep106, i64 %offset.idx store i8 %post, ptr %gep107, align 1, !tbaa !14 br label %pred.store.continue21 pred.store.continue21: ; preds = %pred.store.if20, %pred.store.continue19 %14 = extractelement <16 x i1> %7, i64 4 br i1 %14, label %pred.store.if22, label %pred.store.continue23 pred.store.if22: ; preds = %pred.store.continue21 %gep109 = getelementptr i8, ptr %invariant.gep108, i64 %offset.idx store i8 %post, ptr %gep109, align 1, !tbaa !14 br label %pred.store.continue23 pred.store.continue23: ; preds = %pred.store.if22, %pred.store.continue21 %15 = extractelement <16 x i1> %7, i64 5 br i1 %15, label %pred.store.if24, label %pred.store.continue25 pred.store.if24: ; preds = %pred.store.continue23 %gep111 = getelementptr i8, ptr %invariant.gep110, i64 %offset.idx store i8 %post, ptr %gep111, align 1, !tbaa !14 br label %pred.store.continue25 pred.store.continue25: ; preds = %pred.store.if24, %pred.store.continue23 %16 = extractelement <16 x i1> %7, i64 6 br i1 %16, label %pred.store.if26, label %pred.store.continue27 pred.store.if26: ; preds = %pred.store.continue25 %gep113 = getelementptr i8, ptr %invariant.gep112, i64 %offset.idx store i8 %post, ptr %gep113, align 1, !tbaa !14 br label %pred.store.continue27 pred.store.continue27: ; preds = %pred.store.if26, %pred.store.continue25 %17 = extractelement <16 x i1> %7, i64 7 br i1 %17, label %pred.store.if28, label %pred.store.continue29 pred.store.if28: ; preds = %pred.store.continue27 %gep115 = getelementptr i8, ptr %invariant.gep114, i64 %offset.idx store i8 %post, ptr %gep115, align 1, !tbaa !14 br label %pred.store.continue29 pred.store.continue29: ; preds = %pred.store.if28, %pred.store.continue27 %18 = extractelement <16 x i1> %7, i64 8 br i1 %18, label %pred.store.if30, label %pred.store.continue31 pred.store.if30: ; preds = %pred.store.continue29 %gep117 = getelementptr i8, ptr %invariant.gep116, i64 %offset.idx store i8 %post, ptr %gep117, align 1, !tbaa !14 br label %pred.store.continue31 pred.store.continue31: ; preds = %pred.store.if30, %pred.store.continue29 %19 = extractelement <16 x i1> %7, i64 9 br i1 %19, label %pred.store.if32, label %pred.store.continue33 pred.store.if32: ; preds = %pred.store.continue31 %gep119 = getelementptr i8, ptr %invariant.gep118, i64 %offset.idx store i8 %post, ptr %gep119, align 1, !tbaa !14 br label %pred.store.continue33 pred.store.continue33: ; preds = %pred.store.if32, %pred.store.continue31 %20 = extractelement <16 x i1> %7, i64 10 br i1 %20, label %pred.store.if34, label %pred.store.continue35 pred.store.if34: ; preds = %pred.store.continue33 %gep121 = getelementptr i8, ptr %invariant.gep120, i64 %offset.idx store i8 %post, ptr %gep121, align 1, !tbaa !14 br label %pred.store.continue35 pred.store.continue35: ; preds = %pred.store.if34, %pred.store.continue33 %21 = extractelement <16 x i1> %7, i64 11 br i1 %21, label %pred.store.if36, label %pred.store.continue37 pred.store.if36: ; preds = %pred.store.continue35 %gep123 = getelementptr i8, ptr %invariant.gep122, i64 %offset.idx store i8 %post, ptr %gep123, align 1, !tbaa !14 br label %pred.store.continue37 pred.store.continue37: ; preds = %pred.store.if36, %pred.store.continue35 %22 = extractelement <16 x i1> %7, i64 12 br i1 %22, label %pred.store.if38, label %pred.store.continue39 pred.store.if38: ; preds = %pred.store.continue37 %gep125 = getelementptr i8, ptr %invariant.gep124, i64 %offset.idx store i8 %post, ptr %gep125, align 1, !tbaa !14 br label %pred.store.continue39 pred.store.continue39: ; preds = %pred.store.if38, %pred.store.continue37 %23 = extractelement <16 x i1> %7, i64 13 br i1 %23, label %pred.store.if40, label %pred.store.continue41 pred.store.if40: ; preds = %pred.store.continue39 %gep127 = getelementptr i8, ptr %invariant.gep126, i64 %offset.idx store i8 %post, ptr %gep127, align 1, !tbaa !14 br label %pred.store.continue41 pred.store.continue41: ; preds = %pred.store.if40, %pred.store.continue39 %24 = extractelement <16 x i1> %7, i64 14 br i1 %24, label %pred.store.if42, label %pred.store.continue43 pred.store.if42: ; preds = %pred.store.continue41 %gep129 = getelementptr i8, ptr %invariant.gep128, i64 %offset.idx store i8 %post, ptr %gep129, align 1, !tbaa !14 br label %pred.store.continue43 pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue41 %25 = extractelement <16 x i1> %7, i64 15 br i1 %25, label %pred.store.if44, label %pred.store.continue45 pred.store.if44: ; preds = %pred.store.continue43 %gep131 = getelementptr i8, ptr %invariant.gep130, i64 %offset.idx store i8 %post, ptr %gep131, align 1, !tbaa !14 br label %pred.store.continue45 pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43 %26 = extractelement <16 x i1> %8, i64 0 br i1 %26, label %pred.store.if46, label %pred.store.continue47 pred.store.if46: ; preds = %pred.store.continue45 %gep133 = getelementptr i8, ptr %invariant.gep132, i64 %offset.idx store i8 %post, ptr %gep133, align 1, !tbaa !14 br label %pred.store.continue47 pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45 %27 = extractelement <16 x i1> %8, i64 1 br i1 %27, label %pred.store.if48, label %pred.store.continue49 pred.store.if48: ; preds = %pred.store.continue47 %gep135 = getelementptr i8, ptr %invariant.gep134, i64 %offset.idx store i8 %post, ptr %gep135, align 1, !tbaa !14 br label %pred.store.continue49 pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47 %28 = extractelement <16 x i1> %8, i64 2 br i1 %28, label %pred.store.if50, label %pred.store.continue51 pred.store.if50: ; preds = %pred.store.continue49 %gep137 = getelementptr i8, ptr %invariant.gep136, i64 %offset.idx store i8 %post, ptr %gep137, align 1, !tbaa !14 br label %pred.store.continue51 pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49 %29 = extractelement <16 x i1> %8, i64 3 br i1 %29, label %pred.store.if52, label %pred.store.continue53 pred.store.if52: ; preds = %pred.store.continue51 %gep139 = getelementptr i8, ptr %invariant.gep138, i64 %offset.idx store i8 %post, ptr %gep139, align 1, !tbaa !14 br label %pred.store.continue53 pred.store.continue53: ; preds = %pred.store.if52, %pred.store.continue51 %30 = extractelement <16 x i1> %8, i64 4 br i1 %30, label %pred.store.if54, label %pred.store.continue55 pred.store.if54: ; preds = %pred.store.continue53 %gep141 = getelementptr i8, ptr %invariant.gep140, i64 %offset.idx store i8 %post, ptr %gep141, align 1, !tbaa !14 br label %pred.store.continue55 pred.store.continue55: ; preds = %pred.store.if54, %pred.store.continue53 %31 = extractelement <16 x i1> %8, i64 5 br i1 %31, label %pred.store.if56, label %pred.store.continue57 pred.store.if56: ; preds = %pred.store.continue55 %gep143 = getelementptr i8, ptr %invariant.gep142, i64 %offset.idx store i8 %post, ptr %gep143, align 1, !tbaa !14 br label %pred.store.continue57 pred.store.continue57: ; preds = %pred.store.if56, %pred.store.continue55 %32 = extractelement <16 x i1> %8, i64 6 br i1 %32, label %pred.store.if58, label %pred.store.continue59 pred.store.if58: ; preds = %pred.store.continue57 %gep145 = getelementptr i8, ptr %invariant.gep144, i64 %offset.idx store i8 %post, ptr %gep145, align 1, !tbaa !14 br label %pred.store.continue59 pred.store.continue59: ; preds = %pred.store.if58, %pred.store.continue57 %33 = extractelement <16 x i1> %8, i64 7 br i1 %33, label %pred.store.if60, label %pred.store.continue61 pred.store.if60: ; preds = %pred.store.continue59 %gep147 = getelementptr i8, ptr %invariant.gep146, i64 %offset.idx store i8 %post, ptr %gep147, align 1, !tbaa !14 br label %pred.store.continue61 pred.store.continue61: ; preds = %pred.store.if60, %pred.store.continue59 %34 = extractelement <16 x i1> %8, i64 8 br i1 %34, label %pred.store.if62, label %pred.store.continue63 pred.store.if62: ; preds = %pred.store.continue61 %gep149 = getelementptr i8, ptr %invariant.gep148, i64 %offset.idx store i8 %post, ptr %gep149, align 1, !tbaa !14 br label %pred.store.continue63 pred.store.continue63: ; preds = %pred.store.if62, %pred.store.continue61 %35 = extractelement <16 x i1> %8, i64 9 br i1 %35, label %pred.store.if64, label %pred.store.continue65 pred.store.if64: ; preds = %pred.store.continue63 %gep151 = getelementptr i8, ptr %invariant.gep150, i64 %offset.idx store i8 %post, ptr %gep151, align 1, !tbaa !14 br label %pred.store.continue65 pred.store.continue65: ; preds = %pred.store.if64, %pred.store.continue63 %36 = extractelement <16 x i1> %8, i64 10 br i1 %36, label %pred.store.if66, label %pred.store.continue67 pred.store.if66: ; preds = %pred.store.continue65 %gep153 = getelementptr i8, ptr %invariant.gep152, i64 %offset.idx store i8 %post, ptr %gep153, align 1, !tbaa !14 br label %pred.store.continue67 pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65 %37 = extractelement <16 x i1> %8, i64 11 br i1 %37, label %pred.store.if68, label %pred.store.continue69 pred.store.if68: ; preds = %pred.store.continue67 %gep155 = getelementptr i8, ptr %invariant.gep154, i64 %offset.idx store i8 %post, ptr %gep155, align 1, !tbaa !14 br label %pred.store.continue69 pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67 %38 = extractelement <16 x i1> %8, i64 12 br i1 %38, label %pred.store.if70, label %pred.store.continue71 pred.store.if70: ; preds = %pred.store.continue69 %gep157 = getelementptr i8, ptr %invariant.gep156, i64 %offset.idx store i8 %post, ptr %gep157, align 1, !tbaa !14 br label %pred.store.continue71 pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69 %39 = extractelement <16 x i1> %8, i64 13 br i1 %39, label %pred.store.if72, label %pred.store.continue73 pred.store.if72: ; preds = %pred.store.continue71 %gep159 = getelementptr i8, ptr %invariant.gep158, i64 %offset.idx store i8 %post, ptr %gep159, align 1, !tbaa !14 br label %pred.store.continue73 pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71 %40 = extractelement <16 x i1> %8, i64 14 br i1 %40, label %pred.store.if74, label %pred.store.continue75 pred.store.if74: ; preds = %pred.store.continue73 %gep161 = getelementptr i8, ptr %invariant.gep160, i64 %offset.idx store i8 %post, ptr %gep161, align 1, !tbaa !14 br label %pred.store.continue75 pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73 %41 = extractelement <16 x i1> %8, i64 15 br i1 %41, label %pred.store.if76, label %pred.store.continue77 pred.store.if76: ; preds = %pred.store.continue75 %gep163 = getelementptr i8, ptr %invariant.gep162, i64 %offset.idx store i8 %post, ptr %gep163, align 1, !tbaa !14 br label %pred.store.continue77 pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75 %index.next = add nuw i64 %index, 32 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !54 middle.block: ; preds = %pred.store.continue77 %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end80 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %4, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec79 = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec79, %0 %broadcast.splatinsert85 = insertelement <8 x i8> poison, i8 %pre, i64 0 %broadcast.splat86 = shufflevector <8 x i8> %broadcast.splatinsert85, <8 x i8> poison, <8 x i32> zeroinitializer %invariant.gep164 = getelementptr i8, ptr %array, i64 1 %invariant.gep166 = getelementptr i8, ptr %array, i64 2 %invariant.gep168 = getelementptr i8, ptr %array, i64 3 %invariant.gep170 = getelementptr i8, ptr %array, i64 4 %invariant.gep172 = getelementptr i8, ptr %array, i64 5 %invariant.gep174 = getelementptr i8, ptr %array, i64 6 %invariant.gep176 = getelementptr i8, ptr %array, i64 7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %pred.store.continue102, %vec.epilog.ph %index82 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next103, %pred.store.continue102 ] %offset.idx83 = add i64 %index82, %0 %43 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83 %wide.load84 = load <8 x i8>, ptr %43, align 1, !tbaa !14 %44 = icmp eq <8 x i8> %wide.load84, %broadcast.splat86 %45 = extractelement <8 x i1> %44, i64 0 br i1 %45, label %pred.store.if87, label %pred.store.continue88 pred.store.if87: ; preds = %vec.epilog.vector.body %46 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83 store i8 %post, ptr %46, align 1, !tbaa !14 br label %pred.store.continue88 pred.store.continue88: ; preds = %pred.store.if87, %vec.epilog.vector.body %47 = extractelement <8 x i1> %44, i64 1 br i1 %47, label %pred.store.if89, label %pred.store.continue90 pred.store.if89: ; preds = %pred.store.continue88 %gep165 = getelementptr i8, ptr %invariant.gep164, i64 %offset.idx83 store i8 %post, ptr %gep165, align 1, !tbaa !14 br label %pred.store.continue90 pred.store.continue90: ; preds = %pred.store.if89, %pred.store.continue88 %48 = extractelement <8 x i1> %44, i64 2 br i1 %48, label %pred.store.if91, label %pred.store.continue92 pred.store.if91: ; preds = %pred.store.continue90 %gep167 = getelementptr i8, ptr %invariant.gep166, i64 %offset.idx83 store i8 %post, ptr %gep167, align 1, !tbaa !14 br label %pred.store.continue92 pred.store.continue92: ; preds = %pred.store.if91, %pred.store.continue90 %49 = extractelement <8 x i1> %44, i64 3 br i1 %49, label %pred.store.if93, label %pred.store.continue94 pred.store.if93: ; preds = %pred.store.continue92 %gep169 = getelementptr i8, ptr %invariant.gep168, i64 %offset.idx83 store i8 %post, ptr %gep169, align 1, !tbaa !14 br label %pred.store.continue94 pred.store.continue94: ; preds = %pred.store.if93, %pred.store.continue92 %50 = extractelement <8 x i1> %44, i64 4 br i1 %50, label %pred.store.if95, label %pred.store.continue96 pred.store.if95: ; preds = %pred.store.continue94 %gep171 = getelementptr i8, ptr %invariant.gep170, i64 %offset.idx83 store i8 %post, ptr %gep171, align 1, !tbaa !14 br label %pred.store.continue96 pred.store.continue96: ; preds = %pred.store.if95, %pred.store.continue94 %51 = extractelement <8 x i1> %44, i64 5 br i1 %51, label %pred.store.if97, label %pred.store.continue98 pred.store.if97: ; preds = %pred.store.continue96 %gep173 = getelementptr i8, ptr %invariant.gep172, i64 %offset.idx83 store i8 %post, ptr %gep173, align 1, !tbaa !14 br label %pred.store.continue98 pred.store.continue98: ; preds = %pred.store.if97, %pred.store.continue96 %52 = extractelement <8 x i1> %44, i64 6 br i1 %52, label %pred.store.if99, label %pred.store.continue100 pred.store.if99: ; preds = %pred.store.continue98 %gep175 = getelementptr i8, ptr %invariant.gep174, i64 %offset.idx83 store i8 %post, ptr %gep175, align 1, !tbaa !14 br label %pred.store.continue100 pred.store.continue100: ; preds = %pred.store.if99, %pred.store.continue98 %53 = extractelement <8 x i1> %44, i64 7 br i1 %53, label %pred.store.if101, label %pred.store.continue102 pred.store.if101: ; preds = %pred.store.continue100 %gep177 = getelementptr i8, ptr %invariant.gep176, i64 %offset.idx83 store i8 %post, ptr %gep177, align 1, !tbaa !14 br label %pred.store.continue102 pred.store.continue102: ; preds = %pred.store.if101, %pred.store.continue100 %index.next103 = add nuw i64 %index82, 8 %54 = icmp eq i64 %index.next103, %n.vec79 br i1 %54, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !55 vec.epilog.middle.block: ; preds = %pred.store.continue102 %cmp.n81 = icmp eq i64 %4, %n.vec79 br i1 %cmp.n81, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %55 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp2 = icmp eq i8 %55, %pre br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body store i8 %post, ptr %arrayidx, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !56 for.end: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !57 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !58 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !59 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp slt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !60 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_char_dic(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !61 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv30 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #26 %cmp6 = icmp sgt i32 %call, 0 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 %4 = load i8, ptr %arrayidx, align 1, !tbaa !14 %5 = load i8, ptr %arrayidx5, align 1, !tbaa !14 store i8 %5, ptr %arrayidx, align 1, !tbaa !14 store i8 %4, ptr %arrayidx5, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !62 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_char_array_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %0 = zext i32 %size to i64 %cmp.not29 = icmp sgt i32 %min, %max %cmp.not6.i = icmp slt i32 %size, 1 %or.cond = or i1 %cmp.not29, %cmp.not6.i br i1 %or.cond, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sext i32 %max to i64 %2 = sext i32 %min to i64 %3 = add i32 %max, 1 %4 = add nsw i64 %2, 1 %5 = add i32 %min, 1 %min.iters.check = icmp ult i32 %size, 8 %min.iters.check45 = icmp ult i32 %size, 32 %n.vec = and i64 %0, 4294967264 %cmp.n = icmp eq i64 %n.vec, %0 %n.vec.remaining = and i64 %0, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 %n.vec50 = and i64 %0, 4294967288 %cmp.n51 = icmp eq i64 %n.vec50, %0 %xtraiter = and i64 %0, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %6 = sub nsw i64 0, %0 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next38 to i32 %exitcond.not = icmp eq i32 %3, %lftr.wideiv %indvar.next = add i64 %indvar, 1 br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !63 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %7 = add i64 %indvar, %2 %8 = mul i64 %7, %0 %scevgep = getelementptr i8, ptr %array, i64 %8 %9 = add i64 %4, %indvar %10 = mul i64 %9, %0 %scevgep40 = getelementptr i8, ptr %array, i64 %10 %11 = trunc i64 %indvar to i32 %12 = add i32 %5, %11 %13 = sext i32 %12 to i64 %14 = add nsw i64 %13, 1 %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next38 = add nsw i64 %indvars.iv37, 1 %cmp2.not27.not = icmp slt i64 %indvars.iv37, %1 br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %15 = sext i32 %indvars.iv to i64 %16 = mul nsw i64 %indvars.iv37, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %16 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ] %indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ] %17 = add i64 %indvar41, %13 %18 = mul i64 %17, %0 %scevgep43 = getelementptr i8, ptr %array, i64 %18 %19 = add i64 %14, %indvar41 %20 = mul i64 %19, %0 %scevgep44 = getelementptr i8, ptr %array, i64 %20 %21 = mul nsw i64 %indvars.iv34, %0 %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #26 %cmp6 = icmp slt i32 %call, 1 br i1 %cmp6, label %for.inc, label %iter.check iter.check: ; preds = %for.body3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %bound0 = icmp ult ptr %scevgep, %scevgep44 %bound1 = icmp ult ptr %scevgep43, %scevgep40 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body vector.body: ; preds = %vector.main.loop.iter.check, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ] %22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index %23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index %wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !64, !noalias !67 %24 = getelementptr inbounds i8, ptr %22, i64 16 %wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !64, !noalias !67 %wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !67 %25 = getelementptr inbounds i8, ptr %23, i64 16 %wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !67 store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !64, !noalias !67 store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !64, !noalias !67 store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !67 store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !67 %index.next = add nuw i64 %index, 32 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !69 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ] %27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52 %28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52 %wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !70, !noalias !73 %wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !73 store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !70, !noalias !73 store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !73 %index.next55 = add nuw i64 %index52, 8 %29 = icmp eq i64 %index.next55, %n.vec50 br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !75 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ] 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 %arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph %arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph %30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14 store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14 store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body.i.prol.loopexit 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 ] %32 = xor i64 %indvars.iv.i.ph, %6 %33 = icmp eq i64 %32, -1 br i1 %33, label %for.inc, label %for.body.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i %arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i %34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14 store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14 store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i %arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i %36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14 store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14 store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %38 = icmp eq i64 %indvars.iv.next.i.1, %0 br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !76 for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3 %indvars.iv.next35 = add nsw i64 %indvars.iv34, 1 %cmp2.not.not = icmp slt i64 %indvars.iv34, %1 %indvar.next42 = add i64 %indvar41, 1 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !77 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_char_dic(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !78 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv30 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #26 %cmp6 = icmp slt i32 %call, 0 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 %4 = load i8, ptr %arrayidx, align 1, !tbaa !14 %5 = load i8, ptr %arrayidx5, align 1, !tbaa !14 store i8 %5, ptr %arrayidx, align 1, !tbaa !14 store i8 %4, ptr %arrayidx5, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !79 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_char_array_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %0 = zext i32 %size to i64 %cmp.not29 = icmp sgt i32 %min, %max %cmp.not6.i = icmp slt i32 %size, 1 %or.cond = or i1 %cmp.not29, %cmp.not6.i br i1 %or.cond, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sext i32 %max to i64 %2 = sext i32 %min to i64 %3 = add i32 %max, 1 %4 = add nsw i64 %2, 1 %5 = add i32 %min, 1 %min.iters.check = icmp ult i32 %size, 8 %min.iters.check45 = icmp ult i32 %size, 32 %n.vec = and i64 %0, 4294967264 %cmp.n = icmp eq i64 %n.vec, %0 %n.vec.remaining = and i64 %0, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 %n.vec50 = and i64 %0, 4294967288 %cmp.n51 = icmp eq i64 %n.vec50, %0 %xtraiter = and i64 %0, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %6 = sub nsw i64 0, %0 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next38 to i32 %exitcond.not = icmp eq i32 %3, %lftr.wideiv %indvar.next = add i64 %indvar, 1 br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !80 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %7 = add i64 %indvar, %2 %8 = mul i64 %7, %0 %scevgep = getelementptr i8, ptr %array, i64 %8 %9 = add i64 %4, %indvar %10 = mul i64 %9, %0 %scevgep40 = getelementptr i8, ptr %array, i64 %10 %11 = trunc i64 %indvar to i32 %12 = add i32 %5, %11 %13 = sext i32 %12 to i64 %14 = add nsw i64 %13, 1 %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next38 = add nsw i64 %indvars.iv37, 1 %cmp2.not27.not = icmp slt i64 %indvars.iv37, %1 br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %15 = sext i32 %indvars.iv to i64 %16 = mul nsw i64 %indvars.iv37, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %16 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ] %indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ] %17 = add i64 %indvar41, %13 %18 = mul i64 %17, %0 %scevgep43 = getelementptr i8, ptr %array, i64 %18 %19 = add i64 %14, %indvar41 %20 = mul i64 %19, %0 %scevgep44 = getelementptr i8, ptr %array, i64 %20 %21 = mul nsw i64 %indvars.iv34, %0 %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #26 %cmp6 = icmp sgt i32 %call, -1 br i1 %cmp6, label %for.inc, label %iter.check iter.check: ; preds = %for.body3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %bound0 = icmp ult ptr %scevgep, %scevgep44 %bound1 = icmp ult ptr %scevgep43, %scevgep40 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body vector.body: ; preds = %vector.main.loop.iter.check, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ] %22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index %23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index %wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !81, !noalias !84 %24 = getelementptr inbounds i8, ptr %22, i64 16 %wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !81, !noalias !84 %wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !84 %25 = getelementptr inbounds i8, ptr %23, i64 16 %wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !84 store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !81, !noalias !84 store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !81, !noalias !84 store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !84 store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !84 %index.next = add nuw i64 %index, 32 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !86 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ] %27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52 %28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52 %wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !87, !noalias !90 %wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !90 store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !87, !noalias !90 store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !90 %index.next55 = add nuw i64 %index52, 8 %29 = icmp eq i64 %index.next55, %n.vec50 br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !92 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ] 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 %arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph %arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph %30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14 store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14 store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body.i.prol.loopexit 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 ] %32 = xor i64 %indvars.iv.i.ph, %6 %33 = icmp eq i64 %32, -1 br i1 %33, label %for.inc, label %for.body.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i %arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i %34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14 store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14 store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i %arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i %36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14 store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14 store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %38 = icmp eq i64 %indvars.iv.next.i.1, %0 br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !93 for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3 %indvars.iv.next35 = add nsw i64 %indvars.iv34, 1 %cmp2.not.not = icmp slt i64 %indvars.iv34, %1 %indvar.next42 = add i64 %indvar41, 1 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !94 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @max_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not9 = icmp slt i32 %min, %max br i1 %cmp.not.not9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14) %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !95 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select.i = tail call i32 @llvm.smax.i32(i32 %answer.011, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !96 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @max_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 { entry: %idxprom.i = sext i32 %min to i64 %arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i %0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.not.not9.i = icmp slt i32 %min, %max br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %max_int_array.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count.i, %idxprom.i %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom.i %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27) %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !97 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %max_int_array.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ] %answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %spec.select.i.i = tail call i32 @llvm.smax.i32(i32 %answer.011.i, i32 %8) %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %max_int_array.exit, label %for.body.i, !llvm.loop !98 max_int_array.exit: ; preds = %for.body.i, %middle.block, %entry %answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ] %sub = sub nsw i32 %max, %min %cmp.not4.i = icmp slt i32 %sub, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16 for.body.preheader.i16: ; preds = %max_int_array.exit %9 = add nuw i32 %sub, 1 %10 = zext i32 %9 to i64 %11 = shl nuw nsw i64 %10, 2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i16, %max_int_array.exit %cmp.not22 = icmp sgt i32 %min, %max br i1 %cmp.not22, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %12 = add i32 %max, 1 %13 = sub i32 %12, %min %xtraiter = and i32 %13, 1 %14 = icmp eq i32 %max, %min br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %13, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %15 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %15, %answer.0.lcssa.i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %idxprom2 = sext i32 %count.023 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2 %16 = trunc i64 %indvars.iv to i32 store i32 %16, ptr %arrayidx3, align 4, !tbaa !5 %add = add nsw i32 %count.023, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %idxprom2.1 = sext i32 %count.1 to i64 %arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5 %add.1 = add nsw i32 %count.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ] %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !99 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1 %19 = sext i32 %count.1.1 to i64 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ] %count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr %20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr %21 = trunc i64 %indvars.iv.unr to i32 store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @min_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not9 = icmp slt i32 %min, %max br i1 %cmp.not.not9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14) %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !100 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select.i = tail call i32 @llvm.smin.i32(i32 %answer.011, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !101 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @min_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 { entry: %idxprom.i = sext i32 %min to i64 %arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i %0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.not.not9.i = icmp slt i32 %min, %max br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %min_int_array.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count.i, %idxprom.i %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom.i %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27) %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !102 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %min_int_array.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ] %answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %spec.select.i.i = tail call i32 @llvm.smin.i32(i32 %answer.011.i, i32 %8) %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %min_int_array.exit, label %for.body.i, !llvm.loop !103 min_int_array.exit: ; preds = %for.body.i, %middle.block, %entry %answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ] %sub = sub nsw i32 %max, %min %cmp.not4.i = icmp slt i32 %sub, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16 for.body.preheader.i16: ; preds = %min_int_array.exit %9 = add nuw i32 %sub, 1 %10 = zext i32 %9 to i64 %11 = shl nuw nsw i64 %10, 2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i16, %min_int_array.exit %cmp.not22 = icmp sgt i32 %min, %max br i1 %cmp.not22, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %12 = add i32 %max, 1 %13 = sub i32 %12, %min %xtraiter = and i32 %13, 1 %14 = icmp eq i32 %max, %min br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %13, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %15 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %15, %answer.0.lcssa.i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %idxprom2 = sext i32 %count.023 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2 %16 = trunc i64 %indvars.iv to i32 store i32 %16, ptr %arrayidx3, align 4, !tbaa !5 %add = add nsw i32 %count.023, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %idxprom2.1 = sext i32 %count.1 to i64 %arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5 %add.1 = add nsw i32 %count.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ] %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !104 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1 %19 = sext i32 %count.1.1 to i64 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ] %count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr %20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr %21 = trunc i64 %indvars.iv.unr to i32 store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit ret void } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @max_char_array_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 { entry: %0 = zext i32 %size to i64 %cmp.not.not11 = icmp slt i32 %min, %max br i1 %cmp.not.not11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = sext i32 %min to i64 %wide.trip.count = sext i32 %max to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %idxprom = sext i32 %answer.013 to i64 %2 = mul nsw i64 %idxprom, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %2 %3 = mul nsw i64 %indvars.iv.next, %0 %arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #26 %cmp3 = icmp slt i32 %call, 0 %4 = trunc i64 %indvars.iv.next to i32 %spec.select = select i1 %cmp3, i32 %4, i32 %answer.013 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !105 for.end: ; preds = %for.body, %entry %answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @min_char_array_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 { entry: %0 = zext i32 %size to i64 %cmp.not.not11 = icmp slt i32 %min, %max br i1 %cmp.not.not11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = sext i32 %min to i64 %wide.trip.count = sext i32 %max to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %idxprom = sext i32 %answer.013 to i64 %2 = mul nsw i64 %idxprom, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %2 %3 = mul nsw i64 %indvars.iv.next, %0 %arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #26 %cmp3 = icmp sgt i32 %call, 0 %4 = trunc i64 %indvars.iv.next to i32 %spec.select = select i1 %cmp3, i32 %4, i32 %answer.013 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !106 for.end: ; preds = %for.body, %entry %answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @sum_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #19 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load11, %vec.phi10 %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 !107 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %add, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %10, %answer.08 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !108 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @detect_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 { entry: %cmp.not10 = icmp sgt i32 %min, %max br i1 %cmp.not10, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, %element br i1 %cmp1, label %for.end.loopexit.split.loop.exit, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !109 for.end.loopexit.split.loop.exit: ; preds = %for.body %3 = trunc i64 %indvars.iv to i32 br label %for.end for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry %i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ] %cmp3.not = icmp sle i32 %i.0.lcssa, %max ret i1 %cmp3.not } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @detect_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #19 { entry: %cmp.not13 = icmp sgt i32 %min, %max br i1 %cmp.not13, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp2 = icmp eq i8 %2, %element br i1 %cmp2, label %for.end.loopexit.split.loop.exit, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !110 for.end.loopexit.split.loop.exit: ; preds = %for.body %3 = trunc i64 %indvars.iv to i32 br label %for.end for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry %i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ] %cmp5.not = icmp sle i32 %i.0.lcssa, %max ret i1 %cmp5.not } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @detect_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element, i32 noundef %start, i32 noundef %goal) local_unnamed_addr #19 { entry: %sub = sub nsw i32 %goal, %start %sub1 = sub nsw i32 %max, %min %cmp.not = icmp sgt i32 %sub, %sub1 br i1 %cmp.not, label %if.end24, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub3 = sub nsw i32 %max, %sub %cmp4.not42 = icmp slt i32 %sub3, %min br i1 %cmp4.not42, label %if.end24, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %for.cond.preheader %cmp6.not39 = icmp sgt i32 %start, %goal %add16 = add i32 %goal, 1 br i1 %cmp6.not39, label %for.cond5.preheader.lr.ph.split.us, label %for.cond5.preheader.preheader for.cond5.preheader.preheader: ; preds = %for.cond5.preheader.lr.ph %0 = sext i32 %start to i64 br label %for.cond5.preheader for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph %cmp17.us = icmp eq i32 %add16, %start br label %if.end24 for.cond5.preheader: ; preds = %for.end, %for.cond5.preheader.preheader %i.043 = phi i32 [ %min, %for.cond5.preheader.preheader ], [ %add22, %for.end ] %add = sub i32 %i.043, %start br label %for.body7 for.body7: ; preds = %for.cond5.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.cond5.preheader ], [ %indvars.iv.next, %for.inc ] %1 = trunc i64 %indvars.iv to i32 %sub8 = add i32 %add, %1 %idxprom = sext i32 %sub8 to i64 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %idxprom %2 = load i8, ptr %arrayidx, align 1, !tbaa !14 %arrayidx10 = getelementptr inbounds i8, ptr %element, i64 %indvars.iv %3 = load i8, ptr %arrayidx10, align 1, !tbaa !14 %cmp12 = icmp eq i8 %2, %3 br i1 %cmp12, label %for.inc, label %for.end for.inc: ; preds = %for.body7 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %add16, %lftr.wideiv br i1 %exitcond.not, label %if.end24, label %for.body7, !llvm.loop !111 for.end: ; preds = %for.body7 %cmp17 = icmp eq i32 %add16, %1 %add22 = add nsw i32 %i.043, 1 %cmp4.not.not = icmp sge i32 %i.043, %sub3 %or.cond.not = or i1 %cmp4.not.not, %cmp17 br i1 %or.cond.not, label %if.end24, label %for.cond5.preheader, !llvm.loop !112 if.end24: ; preds = %for.end, %for.inc, %for.cond5.preheader.lr.ph.split.us, %for.cond.preheader, %entry %answer.0 = phi i1 [ false, %entry ], [ false, %for.cond.preheader ], [ %cmp17.us, %for.cond5.preheader.lr.ph.split.us ], [ true, %for.inc ], [ %cmp17, %for.end ] ret i1 %answer.0 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_differentelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %0 = zext i32 %max to i64 %vla = alloca i32, i64 %0, align 16 %cmp.not4.i = icmp slt i32 %max, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %1 = add nuw i32 %max, 1 %2 = zext i32 %1 to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i, %entry %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %4 = sext i32 %min to i64 %5 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %answer.030 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not10.i = icmp slt i32 %answer.030, 1 br i1 %cmp.not10.i, label %detect_int.exit, label %for.body.i19.preheader for.body.i19.preheader: ; preds = %for.body %zext = zext i32 %answer.030 to i64 br label %for.body.i19 for.body.i19: ; preds = %for.body.i19.preheader, %for.inc.i %indvars.iv.i20 = phi i64 [ %indvars.iv.next.i22, %for.inc.i ], [ 0, %for.body.i19.preheader ] %arrayidx.i21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i20 %7 = load i32, ptr %arrayidx.i21, align 4, !tbaa !5 %cmp1.i = icmp eq i32 %7, %6 br i1 %cmp1.i, label %for.end.loopexit.split.loop.exit.i, label %for.inc.i for.inc.i: ; preds = %for.body.i19 %indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i20, 1 %8 = icmp eq i64 %indvars.iv.next.i22, %zext br i1 %8, label %if.then, label %for.body.i19, !llvm.loop !109 for.end.loopexit.split.loop.exit.i: ; preds = %for.body.i19 %9 = trunc i64 %indvars.iv.i20 to i32 br label %detect_int.exit detect_int.exit: ; preds = %for.body, %for.end.loopexit.split.loop.exit.i %i.0.lcssa.i = phi i32 [ 0, %for.body ], [ %9, %for.end.loopexit.split.loop.exit.i ] %cmp3.not.i.not.not = icmp slt i32 %i.0.lcssa.i, %answer.030 br i1 %cmp3.not.i.not.not, label %for.inc, label %if.then if.then: ; preds = %for.inc.i, %detect_int.exit %idxprom5 = sext i32 %answer.030 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 store i32 %6, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %answer.030, 1 br label %for.inc for.inc: ; preds = %detect_int.exit, %if.then %answer.1 = phi i32 [ %add, %if.then ], [ %answer.030, %detect_int.exit ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %5, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !113 for.end: ; preds = %for.inc, %fill_int.exit %answer.0.lcssa = phi i32 [ 0, %fill_int.exit ], [ %answer.1, %for.inc ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_differentelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %0 = zext i32 %max to i64 %vla = alloca i8, i64 %0, align 16 %cmp.not4.i = icmp slt i32 %max, 0 br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %1 = add nuw nsw i64 %0, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %1, i1 false), !tbaa !14 br label %fill_char.exit fill_char.exit: ; preds = %entry, %for.body.preheader.i %cmp.not20 = icmp sgt i32 %min, %max br i1 %cmp.not20, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_char.exit %2 = sext i32 %min to i64 %3 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv26 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next27, %for.inc ] %answer.022 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ] %cmp.not.i = icmp slt i32 %answer.022, 1 br i1 %cmp.not.i, label %for.body.if.then_crit_edge, label %for.cond5.preheader.lr.ph.i for.body.if.then_crit_edge: ; preds = %for.body %arrayidx.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26 %.pre30 = load i8, ptr %arrayidx.phi.trans.insert, align 1, !tbaa !14 br label %if.then for.cond5.preheader.lr.ph.i: ; preds = %for.body %4 = zext i32 %answer.022 to i64 %arrayidx10.i.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26 %.pre = load i8, ptr %arrayidx10.i.phi.trans.insert, align 1, !tbaa !14 br label %for.cond5.preheader.i for.cond.i: ; preds = %for.cond5.preheader.i %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %4 br i1 %exitcond.not, label %if.then, label %for.cond5.preheader.i, !llvm.loop !112 for.cond5.preheader.i: ; preds = %for.cond.i, %for.cond5.preheader.lr.ph.i %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.i ], [ 0, %for.cond5.preheader.lr.ph.i ] %arrayidx.i = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %5 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %cmp12.i = icmp eq i8 %5, %.pre br i1 %cmp12.i, label %for.inc, label %for.cond.i if.then: ; preds = %for.cond.i, %for.body.if.then_crit_edge %6 = phi i8 [ %.pre30, %for.body.if.then_crit_edge ], [ %.pre, %for.cond.i ] %idxprom3 = sext i32 %answer.022 to i64 %arrayidx4 = getelementptr inbounds i8, ptr %vla, i64 %idxprom3 store i8 %6, ptr %arrayidx4, align 1, !tbaa !14 %add = add nsw i32 %answer.022, 1 br label %for.inc for.inc: ; preds = %for.cond5.preheader.i, %if.then %answer.1 = phi i32 [ %add, %if.then ], [ %answer.022, %for.cond5.preheader.i ] %indvars.iv.next27 = add nsw i64 %indvars.iv26, 1 %lftr.wideiv = trunc i64 %indvars.iv.next27 to i32 %exitcond29.not = icmp eq i32 %3, %lftr.wideiv br i1 %exitcond29.not, label %for.end, label %for.body, !llvm.loop !114 for.end: ; preds = %for.inc, %fill_char.exit %answer.0.lcssa = phi i32 [ 0, %fill_char.exit ], [ %answer.1, %for.inc ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = icmp eq <4 x i32> %wide.load, %broadcast.splat %7 = icmp eq <4 x i32> %wide.load11, %broadcast.splat %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi10, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !115 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %spec.select, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %14 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %14, %element %add = zext i1 %cmp1 to i32 %spec.select = add nuw nsw i32 %answer.08, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !116 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #19 { entry: %cmp.not8 = icmp sgt i32 %min, %max br i1 %cmp.not8, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i8> poison, i8 %element, i64 0 %broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i8, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %gep = getelementptr i8, ptr %invariant.gep, i64 %index %wide.load = load <4 x i8>, ptr %gep, align 1, !tbaa !14 %5 = getelementptr inbounds i8, ptr %gep, i64 4 %wide.load13 = load <4 x i8>, ptr %5, align 1, !tbaa !14 %6 = icmp eq <4 x i8> %wide.load, %broadcast.splat %7 = icmp eq <4 x i8> %wide.load13, %broadcast.splat %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi12, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !117 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader14 for.body.preheader14: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.010.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader14, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ] %answer.010 = phi i32 [ %spec.select, %for.body ], [ %answer.010.ph, %for.body.preheader14 ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %14 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp2 = icmp eq i8 %14, %element %add = zext i1 %cmp2 to i32 %spec.select = add nuw nsw i32 %answer.010, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !118 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_char_array(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element) local_unnamed_addr #18 { entry: %0 = zext i32 %size to i64 %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %answer.08 = phi i32 [ 0, %for.body.preheader ], [ %spec.select, %for.body ] %3 = mul nsw i64 %indvars.iv, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %3 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %element) #26 %cmp1 = icmp eq i32 %call, 0 %add = zext i1 %cmp1 to i32 %spec.select = add nuw nsw i32 %answer.08, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !119 for.end: ; preds = %for.body, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array(ptr noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 %array, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !120 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array_2(ptr noundef %array1, ptr noundef %array2, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 %array1, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx2) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !121 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array_3(ptr noundef %array1, ptr noundef %array2, ptr noundef %array3, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not9 = icmp sgt i32 %min, %max br i1 %cmp.not9, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 %array1, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv %arrayidx4 = getelementptr inbounds i32, ptr %array3, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx, ptr noundef %arrayidx2, ptr noundef %arrayidx4) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !122 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_char_array(ptr noundef %array, i32 noundef %num) local_unnamed_addr #10 { entry: %array8 = ptrtoint ptr %array to i64 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %array) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %array) #26 %0 = trunc i64 %call1 to i32 %conv = add i32 %0, -1 %cmp.not24.i = icmp slt i32 %conv, 0 br i1 %cmp.not24.i, label %for.cond3.preheader.i, label %iter.check iter.check: ; preds = %entry %1 = zext i32 %conv to i64 %2 = sext i32 %num to i64 %invariant.gep.i = getelementptr i8, ptr %array, i64 %2 %3 = add nuw nsw i64 %1, 1 %min.iters.check = icmp ult i32 %conv, 3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %4 = getelementptr i8, ptr %array, i64 %2 %scevgep = getelementptr i8, ptr %4, i64 %1 %5 = icmp ugt ptr %4, %scevgep %scevgep4 = getelementptr i8, ptr %array, i64 %1 %6 = icmp ult ptr %scevgep4, %array %7 = or i1 %5, %6 br i1 %7, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %8 = add i64 %array8, %1 %9 = add i64 %array8, %2 %10 = add i64 %9, %1 %11 = sub i64 %8, %10 %diff.check = icmp ult i64 %11, 16 br i1 %diff.check, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check9 = icmp ult i32 %conv, 15 br i1 %min.iters.check9, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %3, 8589934576 %invariant.gep = getelementptr i8, ptr %array, i64 -15 %invariant.gep21 = getelementptr i8, ptr %invariant.gep.i, i64 -15 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %1, %index %gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx %wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !14 %gep22 = getelementptr i8, ptr %invariant.gep21, i64 %offset.idx store <16 x i8> %wide.load, ptr %gep22, align 1, !tbaa !14 %index.next = add nuw i64 %index, 16 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !123 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.cond3.preheader.i, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end13 = sub nsw i64 %1, %n.vec %n.vec.remaining = and i64 %3, 12 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec12 = and i64 %3, 8589934588 %ind.end = sub nsw i64 %1, %n.vec12 %invariant.gep23 = getelementptr i8, ptr %array, i64 -3 %invariant.gep25 = getelementptr i8, ptr %invariant.gep.i, i64 -3 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index15 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next20, %vec.epilog.vector.body ] %offset.idx16 = sub i64 %1, %index15 %gep24 = getelementptr i8, ptr %invariant.gep23, i64 %offset.idx16 %wide.load17 = load <4 x i8>, ptr %gep24, align 1, !tbaa !14 %gep26 = getelementptr i8, ptr %invariant.gep25, i64 %offset.idx16 store <4 x i8> %wide.load17, ptr %gep26, align 1, !tbaa !14 %index.next20 = add nuw i64 %index15, 4 %13 = icmp eq i64 %index.next20, %n.vec12 br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !124 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n14 = icmp eq i64 %3, %n.vec12 br i1 %cmp.n14, label %for.cond3.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ %1, %iter.check ], [ %1, %vector.memcheck ], [ %1, %vector.scevcheck ], [ %ind.end13, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %14 = add nsw i64 %indvars.iv.i.ph, 1 %xtraiter = and i64 %14, 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 ] %arrayidx.i.prol = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i.prol %15 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %gep.i.prol = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i.prol store i8 %15, ptr %gep.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = add 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 !125 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 ] %16 = icmp ult i64 %indvars.iv.i.ph, 3 br i1 %16, label %for.cond3.preheader.i, label %for.body.i for.cond3.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %entry %cmp6.not.not26.i = icmp sgt i32 %num, 0 br i1 %cmp6.not.not26.i, label %for.body7.preheader.i, label %shift_char.exit for.body7.preheader.i: ; preds = %for.cond3.preheader.i %17 = zext i32 %num to i64 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %array, i8 0, i64 %17, i1 false), !tbaa !14 br label %shift_char.exit 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 ] %arrayidx.i = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i %18 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i store i8 %18, ptr %gep.i, align 1, !tbaa !14 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i %19 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %gep.i.1 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i store i8 %19, ptr %gep.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, -2 %arrayidx.i.2 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.1 %20 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !14 %gep.i.2 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1 store i8 %20, ptr %gep.i.2, align 1, !tbaa !14 %indvars.iv.next.i.2 = add nsw i64 %indvars.iv.i, -3 %arrayidx.i.3 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.2 %21 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !14 %gep.i.3 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2 store i8 %21, ptr %gep.i.3, align 1, !tbaa !14 %indvars.iv.next.i.3 = add nsw i64 %indvars.iv.i, -4 %cmp.not.not.i.not.3 = icmp eq i64 %indvars.iv.next.i.2, 0 br i1 %cmp.not.not.i.not.3, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !126 shift_char.exit: ; preds = %for.cond3.preheader.i, %for.body7.preheader.i ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printf_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 %array, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %2) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !127 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @printf_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 i8, ptr %array, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !14 %conv = sext i8 %2 to i32 %putchar = tail call i32 @putchar(i32 %conv) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !128 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #21 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #25 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %sqrt = call double @sqrt(double %conv) #25 %abs = call double @llvm.fabs.f64(double %sqrt) %1 = call double @llvm.floor.f64(double %abs) %square = fmul double %1, %1 %conv6 = fptosi double %square to i32 %2 = load i32, ptr %X, align 4, !tbaa !5 %conv.1 = sitofp i32 %2 to double %call3.1 = call double @pow(double noundef %conv.1, double noundef 0x3FD5555560000000) #25 %3 = call double @llvm.floor.f64(double %call3.1) %call5.1 = call double @pow(double noundef %3, double noundef 3.000000e+00) #25 %conv6.1 = fptosi double %call5.1 to i32 %4 = load i32, ptr %X, align 4, !tbaa !5 %conv.2 = sitofp i32 %4 to double %call3.2 = call double @pow(double noundef %conv.2, double noundef 2.500000e-01) #25 %5 = call double @llvm.floor.f64(double %call3.2) %call5.2 = call double @pow(double noundef %5, double noundef 4.000000e+00) #25 %conv6.2 = fptosi double %call5.2 to i32 %6 = load i32, ptr %X, align 4, !tbaa !5 %conv.3 = sitofp i32 %6 to double %call3.3 = call double @pow(double noundef %conv.3, double noundef 0x3FC99999A0000000) #25 %7 = call double @llvm.floor.f64(double %call3.3) %call5.3 = call double @pow(double noundef %7, double noundef 5.000000e+00) #25 %conv6.3 = fptosi double %call5.3 to i32 %8 = load i32, ptr %X, align 4, !tbaa !5 %conv.4 = sitofp i32 %8 to double %call3.4 = call double @pow(double noundef %conv.4, double noundef 0x3FC5555560000000) #25 %9 = call double @llvm.floor.f64(double %call3.4) %call5.4 = call double @pow(double noundef %9, double noundef 6.000000e+00) #25 %conv6.4 = fptosi double %call5.4 to i32 %10 = load i32, ptr %X, align 4, !tbaa !5 %conv.5 = sitofp i32 %10 to double %call3.5 = call double @pow(double noundef %conv.5, double noundef 0x3FC24924A0000000) #25 %11 = call double @llvm.floor.f64(double %call3.5) %call5.5 = call double @pow(double noundef %11, double noundef 7.000000e+00) #25 %conv6.5 = fptosi double %call5.5 to i32 %spec.select.i.i = call i32 @llvm.smax.i32(i32 %conv6, i32 %conv6.1) %spec.select.i.i.1 = call i32 @llvm.smax.i32(i32 %spec.select.i.i, i32 %conv6.2) %spec.select.i.i.2 = call i32 @llvm.smax.i32(i32 %spec.select.i.i.1, i32 %conv6.3) %spec.select.i.i.3 = call i32 @llvm.smax.i32(i32 %spec.select.i.i.2, i32 %conv6.4) %spec.select.i.i.4 = call i32 @llvm.smax.i32(i32 %spec.select.i.i.3, i32 %conv6.5) %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %spec.select.i.i.4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #25 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.floor.f64(double) #22 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #24 declare double @sqrt(double) local_unnamed_addr ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #24 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(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 #7 = { 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 #8 = { 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 #9 = { 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 #10 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #13 = { 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 #14 = { 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 #15 = { 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 #16 = { nofree 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 #17 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { 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 #19 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #20 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #22 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #23 = { nofree nounwind } attributes #24 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #25 = { nounwind } attributes #26 = { 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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = !{!7, !7, i64 0} !15 = !{!16} !16 = distinct !{!16, !17} !17 = distinct !{!17, !"LVerDomain"} !18 = !{!19} !19 = distinct !{!19, !17} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !10, !11} !22 = !{!23} !23 = distinct !{!23, !24} !24 = distinct !{!24, !"LVerDomain"} !25 = !{!26} !26 = distinct !{!26, !24} !27 = distinct !{!27, !10, !11, !12} !28 = !{!29} !29 = distinct !{!29, !30} !30 = distinct !{!30, !"LVerDomain"} !31 = !{!32} !32 = distinct !{!32, !30} !33 = distinct !{!33, !10, !11, !12} !34 = distinct !{!34, !10, !11} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !39} !39 = !{!"llvm.loop.unroll.disable"} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10} !42 = distinct !{!42, !39} !43 = distinct !{!43, !10} !44 = distinct !{!44, !39} !45 = distinct !{!45, !10} !46 = distinct !{!46, !10} !47 = distinct !{!47, !10} !48 = distinct !{!48, !10} !49 = distinct !{!49, !10, !11, !12} !50 = distinct !{!50, !10, !11} !51 = distinct !{!51, !10, !11, !12} !52 = distinct !{!52, !10, !11, !12} !53 = distinct !{!53, !10, !11} !54 = distinct !{!54, !10, !11, !12} !55 = distinct !{!55, !10, !11, !12} !56 = distinct !{!56, !10, !12, !11} !57 = distinct !{!57, !10} !58 = distinct !{!58, !10} !59 = distinct !{!59, !10} !60 = distinct !{!60, !10} !61 = distinct !{!61, !10} !62 = distinct !{!62, !10} !63 = distinct !{!63, !10} !64 = !{!65} !65 = distinct !{!65, !66} !66 = distinct !{!66, !"LVerDomain"} !67 = !{!68} !68 = distinct !{!68, !66} !69 = distinct !{!69, !10, !11, !12} !70 = !{!71} !71 = distinct !{!71, !72} !72 = distinct !{!72, !"LVerDomain"} !73 = !{!74} !74 = distinct !{!74, !72} !75 = distinct !{!75, !10, !11, !12} !76 = distinct !{!76, !10, !11} !77 = distinct !{!77, !10} !78 = distinct !{!78, !10} !79 = distinct !{!79, !10} !80 = distinct !{!80, !10} !81 = !{!82} !82 = distinct !{!82, !83} !83 = distinct !{!83, !"LVerDomain"} !84 = !{!85} !85 = distinct !{!85, !83} !86 = distinct !{!86, !10, !11, !12} !87 = !{!88} !88 = distinct !{!88, !89} !89 = distinct !{!89, !"LVerDomain"} !90 = !{!91} !91 = distinct !{!91, !89} !92 = distinct !{!92, !10, !11, !12} !93 = distinct !{!93, !10, !11} !94 = distinct !{!94, !10} !95 = distinct !{!95, !10, !11, !12} !96 = distinct !{!96, !10, !12, !11} !97 = distinct !{!97, !10, !11, !12} !98 = distinct !{!98, !10, !12, !11} !99 = distinct !{!99, !10} !100 = distinct !{!100, !10, !11, !12} !101 = distinct !{!101, !10, !12, !11} !102 = distinct !{!102, !10, !11, !12} !103 = distinct !{!103, !10, !12, !11} !104 = distinct !{!104, !10} !105 = distinct !{!105, !10} !106 = distinct !{!106, !10} !107 = distinct !{!107, !10, !11, !12} !108 = distinct !{!108, !10, !12, !11} !109 = distinct !{!109, !10} !110 = distinct !{!110, !10} !111 = distinct !{!111, !10} !112 = distinct !{!112, !10} !113 = distinct !{!113, !10} !114 = distinct !{!114, !10} !115 = distinct !{!115, !10, !11, !12} !116 = distinct !{!116, !10, !12, !11} !117 = distinct !{!117, !10, !11, !12} !118 = distinct !{!118, !10, !12, !11} !119 = distinct !{!119, !10} !120 = distinct !{!120, !10} !121 = distinct !{!121, !10} !122 = distinct !{!122, !10} !123 = distinct !{!123, !10, !11, !12} !124 = distinct !{!124, !10, !11, !12} !125 = distinct !{!125, !39} !126 = distinct !{!126, !10, !11} !127 = distinct !{!127, !10} !128 = distinct !{!128, !10}
#include<stdio.h> #include<math.h> #include<stdlib.h> int jo(int a, int b) { int i, j; j = a; for (i = 1; i < b; i++) { a *= j; } return a; } int main() { int i, j, k, l, m, n, x; scanf("%d",&x); m = 1; for (i = 2; i <= x; i++) { j = 2; k = jo(i, j); while (k <= x) { m = m < k ? k : m; j++; k = jo(i, j); } } printf("%d", m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @jo(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %b, 1 br i1 %cmp4, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = add i32 %b, -1 %min.iters.check = icmp ult i32 %b, 9 br i1 %min.iters.check, label %for.body.preheader8, 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 %a, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %1, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = 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.phi7, %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 !5 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 %for.end, label %for.body.preheader8 for.body.preheader8: ; preds = %for.body.preheader, %middle.block %a.addr.06.ph = phi i32 [ %a, %for.body.preheader ], [ %5, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader8, %for.body %a.addr.06 = phi i32 [ %mul, %for.body ], [ %a.addr.06.ph, %for.body.preheader8 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader8 ] %mul = mul nsw i32 %a.addr.06, %a %inc = add nuw nsw i32 %i.05, 1 %exitcond.not = icmp eq i32 %inc, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %middle.block, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %5, %middle.block ], [ %mul, %for.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %x = alloca 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 !10 %cmp.not27 = icmp slt i32 %0, 2 br i1 %cmp.not27, label %for.end, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry, %for.inc %indvars.iv31 = phi i32 [ %indvars.iv.next32, %for.inc ], [ 4, %entry ] %m.028 = phi i32 [ %m.1.lcssa, %for.inc ], [ 1, %entry ] %1 = phi <2 x i32> [ %9, %for.inc ], [ <i32 5, i32 2>, %entry ] %cmp2.not23 = icmp sgt i32 %indvars.iv31, %0 br i1 %cmp2.not23, label %for.inc, label %while.body.preheader while.body.preheader: ; preds = %for.body.i.preheader %2 = extractelement <2 x i32> %1, i64 1 %3 = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison> %4 = shufflevector <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, <4 x i32> %3, <4 x i32> <i32 5, i32 1, i32 2, i32 3> %broadcast.splat = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1> br label %while.body while.body: ; preds = %while.body.preheader, %jo.exit22 %m.126 = phi i32 [ %cond, %jo.exit22 ], [ %m.028, %while.body.preheader ] %j.025 = phi i32 [ %inc, %jo.exit22 ], [ 2, %while.body.preheader ] %k.024 = phi i32 [ %mul.i19.lcssa, %jo.exit22 ], [ %indvars.iv31, %while.body.preheader ] %cond = call i32 @llvm.smax.i32(i32 %m.126, i32 %k.024) %min.iters.check = icmp ult i32 %j.025, 8 br i1 %min.iters.check, label %for.body.i16.preheader, label %vector.ph vector.ph: ; preds = %while.body %n.vec = and i32 %j.025, 2147483640 %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> [ %4, %vector.ph ], [ %5, %vector.body ] %vec.phi33 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %6, %vector.body ] %5 = mul <4 x i32> %vec.phi, %broadcast.splat %6 = mul <4 x i32> %vec.phi33, %broadcast.splat %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 !14 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 %j.025, %n.vec br i1 %cmp.n, label %jo.exit22, label %for.body.i16.preheader for.body.i16.preheader: ; preds = %while.body, %middle.block %a.addr.06.i17.ph = phi i32 [ %2, %while.body ], [ %8, %middle.block ] %i.05.i18.ph = phi i32 [ 1, %while.body ], [ %ind.end, %middle.block ] br label %for.body.i16 for.body.i16: ; preds = %for.body.i16.preheader, %for.body.i16 %a.addr.06.i17 = phi i32 [ %mul.i19, %for.body.i16 ], [ %a.addr.06.i17.ph, %for.body.i16.preheader ] %i.05.i18 = phi i32 [ %inc.i20, %for.body.i16 ], [ %i.05.i18.ph, %for.body.i16.preheader ] %mul.i19 = mul nsw i32 %a.addr.06.i17, %2 %inc.i20 = add nuw nsw i32 %i.05.i18, 1 %exitcond.not.i21 = icmp eq i32 %i.05.i18, %j.025 br i1 %exitcond.not.i21, label %jo.exit22, label %for.body.i16, !llvm.loop !15 jo.exit22: ; preds = %for.body.i16, %middle.block %mul.i19.lcssa = phi i32 [ %8, %middle.block ], [ %mul.i19, %for.body.i16 ] %inc = add nuw nsw i32 %j.025, 1 %cmp2.not = icmp sgt i32 %mul.i19.lcssa, %0 br i1 %cmp2.not, label %for.inc, label %while.body, !llvm.loop !16 for.inc: ; preds = %jo.exit22, %for.body.i.preheader %m.1.lcssa = phi i32 [ %m.028, %for.body.i.preheader ], [ %cond, %jo.exit22 ] %9 = add <2 x i32> %1, <i32 2, i32 1> %10 = extractelement <2 x i32> %1, i64 0 %indvars.iv.next32 = add i32 %indvars.iv31, %10 %11 = extractelement <2 x i32> %1, i64 1 %exitcond.not = icmp eq i32 %11, %0 br i1 %exitcond.not, label %for.end, label %for.body.i.preheader, !llvm.loop !17 for.end: ; preds = %for.inc, %entry %m.0.lcssa = phi i32 [ 1, %entry ], [ %m.1.lcssa, %for.inc ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %m.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6, !7, !8} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!"llvm.loop.isvectorized", i32 1} !8 = !{!"llvm.loop.unroll.runtime.disable"} !9 = distinct !{!9, !6, !8, !7} !10 = !{!11, !11, i64 0} !11 = !{!"int", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"} !14 = distinct !{!14, !6, !7, !8} !15 = distinct !{!15, !6, !8, !7} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6}
#include<stdio.h> #include<math.h> int main(){ int x,ans=1,t,xx; scanf("%d",&x); xx=(int)sqrt(x); for(int i=2; i<=xx; i++) { t=i; while(t<=x) t*=i; ans=(ans>t/i)?ans:t/i; } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = 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 %conv = sitofp i32 %0 to double %call1 = call double @sqrt(double noundef %conv) #5 %conv2 = fptosi double %call1 to i32 %cmp.not22 = icmp slt i32 %conv2, 2 br i1 %cmp.not22, label %for.cond.cleanup, label %while.cond.preheader.lr.ph while.cond.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %x, align 4, !tbaa !5 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %while.end %i.024 = phi i32 [ 2, %while.cond.preheader.lr.ph ], [ %inc, %while.end ] %ans.023 = phi i32 [ 1, %while.cond.preheader.lr.ph ], [ %ans.0.div, %while.end ] %cmp4.not20 = icmp sgt i32 %i.024, %1 br i1 %cmp4.not20, label %while.end, label %while.body for.cond.cleanup: ; preds = %while.end, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.0.div, %while.end ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 ret i32 0 while.body: ; preds = %while.cond.preheader, %while.body %t.021 = phi i32 [ %mul, %while.body ], [ %i.024, %while.cond.preheader ] %mul = mul nuw nsw i32 %t.021, %i.024 %cmp4.not = icmp sgt i32 %mul, %1 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %while.cond.preheader %t.0.lcssa = phi i32 [ %i.024, %while.cond.preheader ], [ %mul, %while.body ] %div = udiv i32 %t.0.lcssa, %i.024 %ans.0.div = call i32 @llvm.smax.i32(i32 %ans.023, i32 %div) %inc = add nuw i32 %i.024, 1 %exitcond.not = icmp eq i32 %i.024, %conv2 br i1 %exitcond.not, label %for.cond.cleanup, label %while.cond.preheader, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(void){ int a, tei, j, max = 0; scanf("%d", &a); for (tei = 2; tei*tei<=a; tei++) { for (j = 2; (int)pow(tei, j)<=a; j++) { max = (int)pow(tei, j) > max ? (int)pow(tei, j) : max; } } if (a == 1 || a == 2 || a == 3) { max = 1; } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155552/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155552/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4 %cmp.not46 = icmp slt i32 %0, 4 br i1 %cmp.not46, label %for.end20, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc18 %1 = phi i32 [ %3, %for.inc18 ], [ %0, %entry ] %max.048 = phi i32 [ %max.1.lcssa, %for.inc18 ], [ 0, %entry ] %tei.047 = phi i32 [ %inc19, %for.inc18 ], [ 2, %entry ] %conv = sitofp i32 %tei.047 to double %square = fmul double %conv, %conv %conv441 = fptosi double %square to i32 %cmp5.not42 = icmp slt i32 %1, %conv441 br i1 %cmp5.not42, label %for.inc18, label %for.body7 for.body7: ; preds = %for.cond1.preheader, %cond.end %conv245 = phi double [ %conv2, %cond.end ], [ 2.000000e+00, %for.cond1.preheader ] %max.144 = phi i32 [ %cond, %cond.end ], [ %max.048, %for.cond1.preheader ] %j.043 = phi i32 [ %inc, %cond.end ], [ 2, %for.cond1.preheader ] %call10 = call double @pow(double noundef %conv, double noundef %conv245) #4 %conv11 = fptosi double %call10 to i32 %cmp12 = icmp slt i32 %max.144, %conv11 br i1 %cmp12, label %cond.true, label %cond.end cond.true: ; preds = %for.body7 %call16 = call double @pow(double noundef %conv, double noundef %conv245) #4 %conv17 = fptosi double %call16 to i32 br label %cond.end cond.end: ; preds = %for.body7, %cond.true %cond = phi i32 [ %conv17, %cond.true ], [ %max.144, %for.body7 ] %inc = add nuw nsw i32 %j.043, 1 %conv2 = sitofp i32 %inc to double %call3 = call double @pow(double noundef %conv, double noundef %conv2) #4 %conv4 = fptosi double %call3 to i32 %2 = load i32, ptr %a, align 4 %cmp5.not = icmp slt i32 %2, %conv4 br i1 %cmp5.not, label %for.inc18, label %for.body7, !llvm.loop !5 for.inc18: ; preds = %cond.end, %for.cond1.preheader %3 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %cond.end ] %max.1.lcssa = phi i32 [ %max.048, %for.cond1.preheader ], [ %cond, %cond.end ] %inc19 = add nuw nsw i32 %tei.047, 1 %mul = mul nsw i32 %inc19, %inc19 %cmp.not = icmp sgt i32 %mul, %3 br i1 %cmp.not, label %for.end20, label %for.cond1.preheader, !llvm.loop !7 for.end20: ; preds = %for.inc18, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %max.1.lcssa, %for.inc18 ] %.lcssa = phi i32 [ %0, %entry ], [ %3, %for.inc18 ] %4 = add i32 %.lcssa, -1 %or.cond29 = icmp ult i32 %4, 3 %spec.select = select i1 %or.cond29, i32 1, i32 %max.0.lcssa %call28 = 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 %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 nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6}
#include<stdio.h> int a[10000],b[10000]; int main(void) { int n,k,i,c,x[501]; while(1){ c=0; scanf("%d",&n); scanf("%d",&k); if(n==0&&k==0){ break; } for(i=0;i<=n;i++){ a[i]=0; b[i]=0; x[i]=0; } x[1]=1; for(i=0;i<k;i++){ scanf("%d %d",&a[i],&b[i]); if(a[i]==1){ x[b[i]]=1; c++; } } for(i=0;i<k;i++){ if(x[a[i]]==1&&x[b[i]]==0){ x[b[i]]=3; c++; } if(x[b[i]]==1&&x[a[i]]==0){ x[a[i]]=3; c++; } } printf("%d\n",c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155596/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155596/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [10000 x i32] zeroinitializer, align 16 @b = dso_local global [10000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %x = alloca [501 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 2004, ptr nonnull %x) #4 %call104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1105 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp106 = icmp eq i32 %0, 0 %1 = load i32, ptr %k, align 4 %cmp2107 = icmp eq i32 %1, 0 %or.cond108 = select i1 %cmp106, i1 %cmp2107, i1 false br i1 %or.cond108, label %while.end, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %entry %arrayidx8 = getelementptr inbounds [501 x i32], ptr %x, i64 0, i64 1 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %for.end71 %2 = phi i32 [ %1, %for.cond.preheader.lr.ph ], [ %17, %for.end71 ] %3 = phi i32 [ %0, %for.cond.preheader.lr.ph ], [ %16, %for.end71 ] %cmp3.not94 = icmp slt i32 %3, 0 br i1 %cmp3.not94, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add nuw i32 %3, 1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @a, i8 0, i64 %6, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @b, i8 0, i64 %6, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %x, i8 0, i64 %6, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %for.cond.preheader store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %cmp1096 = icmp sgt i32 %2, 0 br i1 %cmp1096, label %for.body11, label %for.end71 for.cond30.preheader: ; preds = %for.inc27 %cmp31100 = icmp sgt i32 %9, 0 br i1 %cmp31100, label %for.body32.preheader, label %for.end71 for.body32.preheader: ; preds = %for.cond30.preheader %wide.trip.count = zext i32 %9 to i64 br label %for.body32 for.body11: ; preds = %for.end, %for.inc27 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc27 ], [ 0, %for.end ] %c.098 = phi i32 [ %c.1, %for.inc27 ], [ 0, %for.end ] %arrayidx13 = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv %arrayidx15 = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx13, ptr noundef nonnull %arrayidx15) %7 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp19 = icmp eq i32 %7, 1 br i1 %cmp19, label %if.then20, label %for.inc27 if.then20: ; preds = %for.body11 %8 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %idxprom23 = sext i32 %8 to i64 %arrayidx24 = getelementptr inbounds [501 x i32], ptr %x, i64 0, i64 %idxprom23 store i32 1, ptr %arrayidx24, align 4, !tbaa !5 %inc25 = add nsw i32 %c.098, 1 br label %for.inc27 for.inc27: ; preds = %for.body11, %if.then20 %c.1 = phi i32 [ %inc25, %if.then20 ], [ %c.098, %for.body11 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %k, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp10 = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp10, label %for.body11, label %for.cond30.preheader, !llvm.loop !9 for.body32: ; preds = %for.body32.preheader, %for.inc69 %indvars.iv112 = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next113, %for.inc69 ] %c.2102 = phi i32 [ %c.1, %for.body32.preheader ], [ %c.4, %for.inc69 ] %arrayidx34 = getelementptr inbounds [10000 x i32], ptr @a, i64 0, i64 %indvars.iv112 %11 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %idxprom35 = sext i32 %11 to i64 %arrayidx36 = getelementptr inbounds [501 x i32], ptr %x, i64 0, i64 %idxprom35 %12 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp37 = icmp eq i32 %12, 1 %arrayidx40 = getelementptr inbounds [10000 x i32], ptr @b, i64 0, i64 %indvars.iv112 %13 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %idxprom41 = sext i32 %13 to i64 %arrayidx42 = getelementptr inbounds [501 x i32], ptr %x, i64 0, i64 %idxprom41 %14 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %cmp43 = icmp eq i32 %14, 0 %or.cond121 = select i1 %cmp37, i1 %cmp43, i1 false br i1 %or.cond121, label %for.inc69.sink.split, label %if.end50 if.end50: ; preds = %for.body32 %cmp55 = icmp eq i32 %14, 1 br i1 %cmp55, label %land.lhs.true56, label %for.inc69 land.lhs.true56: ; preds = %if.end50 %15 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp61 = icmp eq i32 %15, 0 br i1 %cmp61, label %for.inc69.sink.split, label %for.inc69 for.inc69.sink.split: ; preds = %land.lhs.true56, %for.body32 %arrayidx42.sink = phi ptr [ %arrayidx42, %for.body32 ], [ %arrayidx36, %land.lhs.true56 ] store i32 3, ptr %arrayidx42.sink, align 4, !tbaa !5 %inc49 = add nsw i32 %c.2102, 1 br label %for.inc69 for.inc69: ; preds = %for.inc69.sink.split, %if.end50, %land.lhs.true56 %c.4 = phi i32 [ %c.2102, %land.lhs.true56 ], [ %c.2102, %if.end50 ], [ %inc49, %for.inc69.sink.split ] %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count br i1 %exitcond.not, label %for.end71, label %for.body32, !llvm.loop !11 for.end71: ; preds = %for.inc69, %for.end, %for.cond30.preheader %c.2.lcssa = phi i32 [ %c.1, %for.cond30.preheader ], [ 0, %for.end ], [ %c.4, %for.inc69 ] %call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.2.lcssa) %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 %k) %16 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %16, 0 %17 = load i32, ptr %k, align 4 %cmp2 = icmp eq i32 %17, 0 %or.cond = select i1 %cmp, i1 %cmp2, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end71, %entry call void @llvm.lifetime.end.p0(i64 2004, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 n,w,h,x,y,i,j,s,max; while(scanf("%d",&n),n){ int d[510][510]={0}; scanf("%d %d",&w,&h); while(n--){ scanf("%d %d",&x,&y); d[y][x]=1; } for(i=max=0;i<h;i++){ for(j=0;j<w;j++)d[i+1][j+1]=d[i+1][j+1]+d[i][j+1]+d[i+1][j]-d[i][j]; } scanf("%d %d",&x,&y); for(i=y;i<=h;i++){ for(j=x;j<=w;j++){ s=d[i][j]-d[i-y][j]-d[i][j-x]+d[i-y][j-x]; if(max<s)max=s; } } printf("%d\n",max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155646/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155646/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %w = alloca i32, align 4 %h = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %d = alloca [510 x [510 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 %w) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #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 %call122 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not123 = icmp eq i32 %0, 0 br i1 %tobool.not123, label %while.end79, label %while.body while.body: ; preds = %entry, %for.end77 call void @llvm.lifetime.start.p0(i64 1040400, ptr nonnull %d) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1040400) %d, i8 0, i64 1040400, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h) %1 = load i32, ptr %n, align 4, !tbaa !5 %dec109 = add nsw i32 %1, -1 store i32 %dec109, ptr %n, align 4, !tbaa !5 %tobool3.not110 = icmp eq i32 %1, 0 br i1 %tobool3.not110, label %for.cond.preheader, label %while.body4 for.cond.preheader: ; preds = %while.body4, %while.body %2 = load i32, ptr %h, align 4, !tbaa !5 %cmp113 = icmp sgt i32 %2, 0 br i1 %cmp113, label %for.cond8.preheader.lr.ph, label %for.end40 for.cond8.preheader.lr.ph: ; preds = %for.cond.preheader %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp9111 = icmp sgt i32 %3, 0 br i1 %cmp9111, label %for.cond8.preheader.us.preheader, label %for.end40 for.cond8.preheader.us.preheader: ; preds = %for.cond8.preheader.lr.ph %wide.trip.count130 = zext i32 %2 to i64 %wide.trip.count = zext i32 %3 to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %3, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond8.preheader.us for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.inc38_crit_edge.us %indvars.iv127 = phi i64 [ 0, %for.cond8.preheader.us.preheader ], [ %indvars.iv.next128, %for.cond8.for.inc38_crit_edge.us ] %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1 %arrayidx26.us.phi.trans.insert = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv.next128, i64 0 %.pre = load i32, ptr %arrayidx26.us.phi.trans.insert, align 8, !tbaa !5 %arrayidx31.us.phi.trans.insert = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv127, i64 0 %.pre143 = load i32, ptr %arrayidx31.us.phi.trans.insert, align 8, !tbaa !5 br i1 %4, label %for.cond8.for.inc38_crit_edge.us.unr-lcssa, label %for.body10.us for.body10.us: ; preds = %for.cond8.preheader.us, %for.body10.us %5 = phi i32 [ %10, %for.body10.us ], [ %.pre143, %for.cond8.preheader.us ] %6 = phi i32 [ %sub.us.1, %for.body10.us ], [ %.pre, %for.cond8.preheader.us ] %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body10.us ], [ 0, %for.cond8.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.body10.us ], [ 0, %for.cond8.preheader.us ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx15.us = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv.next128, i64 %indvars.iv.next %7 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %arrayidx20.us = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv127, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5 %add21.us = add nsw i32 %8, %7 %add27.us = add nsw i32 %add21.us, %6 %sub.us = sub i32 %add27.us, %5 store i32 %sub.us, ptr %arrayidx15.us, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx15.us.1 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv.next128, i64 %indvars.iv.next.1 %9 = load i32, ptr %arrayidx15.us.1, align 8, !tbaa !5 %arrayidx20.us.1 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv127, i64 %indvars.iv.next.1 %10 = load i32, ptr %arrayidx20.us.1, align 8, !tbaa !5 %add21.us.1 = add nsw i32 %10, %9 %add27.us.1 = add nsw i32 %add21.us.1, %sub.us %sub.us.1 = sub i32 %add27.us.1, %8 store i32 %sub.us.1, ptr %arrayidx15.us.1, align 8, !tbaa !5 %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.cond8.for.inc38_crit_edge.us.unr-lcssa, label %for.body10.us, !llvm.loop !9 for.cond8.for.inc38_crit_edge.us.unr-lcssa: ; preds = %for.body10.us, %for.cond8.preheader.us %.unr = phi i32 [ %.pre143, %for.cond8.preheader.us ], [ %10, %for.body10.us ] %.unr154 = phi i32 [ %.pre, %for.cond8.preheader.us ], [ %sub.us.1, %for.body10.us ] %indvars.iv.unr = phi i64 [ 0, %for.cond8.preheader.us ], [ %indvars.iv.next.1, %for.body10.us ] br i1 %lcmp.mod.not, label %for.cond8.for.inc38_crit_edge.us, label %for.body10.us.epil for.body10.us.epil: ; preds = %for.cond8.for.inc38_crit_edge.us.unr-lcssa %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 %arrayidx15.us.epil = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv.next128, i64 %indvars.iv.next.epil %11 = load i32, ptr %arrayidx15.us.epil, align 4, !tbaa !5 %arrayidx20.us.epil = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv127, i64 %indvars.iv.next.epil %12 = load i32, ptr %arrayidx20.us.epil, align 4, !tbaa !5 %add21.us.epil = add nsw i32 %12, %11 %add27.us.epil = add nsw i32 %add21.us.epil, %.unr154 %sub.us.epil = sub i32 %add27.us.epil, %.unr store i32 %sub.us.epil, ptr %arrayidx15.us.epil, align 4, !tbaa !5 br label %for.cond8.for.inc38_crit_edge.us for.cond8.for.inc38_crit_edge.us: ; preds = %for.cond8.for.inc38_crit_edge.us.unr-lcssa, %for.body10.us.epil %exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130 br i1 %exitcond131.not, label %for.end40, label %for.cond8.preheader.us, !llvm.loop !11 while.body4: ; preds = %while.body, %while.body4 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %13 = load i32, ptr %y, align 4, !tbaa !5 %idxprom = sext i32 %13 to i64 %14 = load i32, ptr %x, align 4, !tbaa !5 %idxprom6 = sext i32 %14 to i64 %arrayidx7 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %15 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %15, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool3.not = icmp eq i32 %15, 0 br i1 %tobool3.not, label %for.cond.preheader, label %while.body4, !llvm.loop !12 for.end40: ; preds = %for.cond8.for.inc38_crit_edge.us, %for.cond8.preheader.lr.ph, %for.cond.preheader %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %16 = load i32, ptr %y, align 4, !tbaa !5 %17 = load i32, ptr %h, align 4, !tbaa !5 %cmp43.not118 = icmp sgt i32 %16, %17 br i1 %cmp43.not118, label %for.end77, label %for.body44.lr.ph for.body44.lr.ph: ; preds = %for.end40 %18 = load i32, ptr %x, align 4, !tbaa !5 %19 = load i32, ptr %w, align 4, !tbaa !5 %cmp46.not115 = icmp sgt i32 %18, %19 br i1 %cmp46.not115, label %for.end77, label %for.body44.preheader for.body44.preheader: ; preds = %for.body44.lr.ph %20 = sext i32 %18 to i64 %21 = add i32 %19, 1 %22 = sext i32 %16 to i64 %23 = add i32 %17, 1 %24 = sub i32 %19, %18 %25 = zext i32 %24 to i64 %26 = add nuw nsw i64 %25, 1 %min.iters.check = icmp ult i32 %24, 7 %n.vec = and i64 %26, 8589934584 %ind.end = add nsw i64 %n.vec, %20 %cmp.n = icmp eq i64 %26, %n.vec br label %for.body44 for.body44: ; preds = %for.body44.preheader, %for.cond45.for.inc75_crit_edge %indvars.iv137 = phi i64 [ %22, %for.body44.preheader ], [ %indvars.iv.next138, %for.cond45.for.inc75_crit_edge ] %max.0120 = phi i32 [ 0, %for.body44.preheader ], [ %spec.select.lcssa, %for.cond45.for.inc75_crit_edge ] %27 = sub nsw i64 %indvars.iv137, %22 br i1 %min.iters.check, label %for.body47.preheader, label %vector.ph vector.ph: ; preds = %for.body44 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %max.0120, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %42, %vector.body ] %vec.phi144 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %43, %vector.body ] %offset.idx = add i64 %index, %20 %28 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv137, i64 %offset.idx %wide.load = load <4 x i32>, ptr %28, align 4, !tbaa !5 %29 = getelementptr inbounds i32, ptr %28, i64 4 %wide.load145 = load <4 x i32>, ptr %29, align 4, !tbaa !5 %30 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %27, i64 %offset.idx %wide.load146 = load <4 x i32>, ptr %30, align 4, !tbaa !5 %31 = getelementptr inbounds i32, ptr %30, i64 4 %wide.load147 = load <4 x i32>, ptr %31, align 4, !tbaa !5 %32 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv137, i64 %index %wide.load148 = load <4 x i32>, ptr %32, align 8, !tbaa !5 %33 = getelementptr inbounds i32, ptr %32, i64 4 %wide.load149 = load <4 x i32>, ptr %33, align 8, !tbaa !5 %34 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %27, i64 %index %wide.load150 = load <4 x i32>, ptr %34, align 8, !tbaa !5 %35 = getelementptr inbounds i32, ptr %34, i64 4 %wide.load151 = load <4 x i32>, ptr %35, align 8, !tbaa !5 %36 = add <4 x i32> %wide.load146, %wide.load148 %37 = add <4 x i32> %wide.load147, %wide.load149 %38 = sub <4 x i32> %wide.load, %36 %39 = sub <4 x i32> %wide.load145, %37 %40 = add nsw <4 x i32> %38, %wide.load150 %41 = add nsw <4 x i32> %39, %wide.load151 %42 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %40) %43 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi144, <4 x i32> %41) %index.next = add nuw i64 %index, 8 %44 = icmp eq i64 %index.next, %n.vec br i1 %44, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %42, <4 x i32> %43) %45 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) br i1 %cmp.n, label %for.cond45.for.inc75_crit_edge, label %for.body47.preheader for.body47.preheader: ; preds = %for.body44, %middle.block %indvars.iv132.ph = phi i64 [ %20, %for.body44 ], [ %ind.end, %middle.block ] %max.1117.ph = phi i32 [ %max.0120, %for.body44 ], [ %45, %middle.block ] br label %for.body47 for.body47: ; preds = %for.body47.preheader, %for.body47 %indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.body47 ], [ %indvars.iv132.ph, %for.body47.preheader ] %max.1117 = phi i32 [ %spec.select, %for.body47 ], [ %max.1117.ph, %for.body47.preheader ] %arrayidx51 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv137, i64 %indvars.iv132 %46 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %arrayidx56 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %27, i64 %indvars.iv132 %47 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %48 = sub nsw i64 %indvars.iv132, %20 %arrayidx62 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %indvars.iv137, i64 %48 %49 = load i32, ptr %arrayidx62, align 4, !tbaa !5 %arrayidx69 = getelementptr inbounds [510 x [510 x i32]], ptr %d, i64 0, i64 %27, i64 %48 %50 = load i32, ptr %arrayidx69, align 4, !tbaa !5 %51 = add i32 %47, %49 %sub63 = sub i32 %46, %51 %add70 = add nsw i32 %sub63, %50 %spec.select = call i32 @llvm.smax.i32(i32 %max.1117, i32 %add70) %indvars.iv.next133 = add nsw i64 %indvars.iv132, 1 %lftr.wideiv = trunc i64 %indvars.iv.next133 to i32 %exitcond136.not = icmp eq i32 %21, %lftr.wideiv br i1 %exitcond136.not, label %for.cond45.for.inc75_crit_edge, label %for.body47, !llvm.loop !16 for.cond45.for.inc75_crit_edge: ; preds = %for.body47, %middle.block %spec.select.lcssa = phi i32 [ %45, %middle.block ], [ %spec.select, %for.body47 ] %indvars.iv.next138 = add nsw i64 %indvars.iv137, 1 %lftr.wideiv141 = trunc i64 %indvars.iv.next138 to i32 %exitcond142.not = icmp eq i32 %23, %lftr.wideiv141 br i1 %exitcond142.not, label %for.end77, label %for.body44, !llvm.loop !17 for.end77: ; preds = %for.cond45.for.inc75_crit_edge, %for.body44.lr.ph, %for.end40 %max.0.lcssa = phi i32 [ 0, %for.end40 ], [ 0, %for.body44.lr.ph ], [ %spec.select.lcssa, %for.cond45.for.inc75_crit_edge ] %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 1040400, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %52 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %52, 0 br i1 %tobool.not, label %while.end79, label %while.body, !llvm.loop !18 while.end79: ; preds = %for.end77, %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 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include <stdio.h> int n, l[200009], b[200009], count, ans; int main(){ scanf("%d", &n); for(int i = 0; i < n; i++){ scanf("%d", &l[i]); } for(int i = n - 1; i >= 0; i--){ if(b[l[i]]) continue; b[l[i]] = 1; ans = l[i]; } printf("%d\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15569/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @l = dso_local global [200009 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [200009 x i32] zeroinitializer, align 16 @ans = 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 @count = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %cmp429 = icmp sgt i32 %5, 0 br i1 %cmp429, label %for.body6.preheader, label %for.cond.cleanup5 for.body6.preheader: ; preds = %for.cond3.preheader %1 = zext i32 %5 to i64 %xtraiter = and i64 %1, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body6.prol.loopexit, label %for.body6.prol for.body6.prol: ; preds = %for.body6.preheader %indvars.iv.next34.prol = add nsw i64 %1, -1 %idxprom7.prol = and i64 %indvars.iv.next34.prol, 4294967295 %arrayidx8.prol = getelementptr inbounds [200009 x i32], ptr @l, i64 0, i64 %idxprom7.prol %2 = load i32, ptr %arrayidx8.prol, align 4, !tbaa !5 %idxprom9.prol = sext i32 %2 to i64 %arrayidx10.prol = getelementptr inbounds [200009 x i32], ptr @b, i64 0, i64 %idxprom9.prol %3 = load i32, ptr %arrayidx10.prol, align 4, !tbaa !5 %tobool.not.prol = icmp eq i32 %3, 0 br i1 %tobool.not.prol, label %if.end.prol, label %for.body6.prol.loopexit if.end.prol: ; preds = %for.body6.prol store i32 1, ptr %arrayidx10.prol, align 4, !tbaa !5 store i32 %2, ptr @ans, align 4, !tbaa !5 br label %for.body6.prol.loopexit for.body6.prol.loopexit: ; preds = %for.body6.prol, %if.end.prol, %for.body6.preheader %indvars.iv33.unr = phi i64 [ %1, %for.body6.preheader ], [ %indvars.iv.next34.prol, %if.end.prol ], [ %indvars.iv.next34.prol, %for.body6.prol ] %4 = icmp eq i32 %5, 1 br i1 %4, label %for.cond.cleanup5, label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200009 x i32], ptr @l, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.body6.prol.loopexit, %for.inc17.1, %entry, %for.cond3.preheader %7 = load i32, ptr @ans, align 4, !tbaa !5 %call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) ret i32 0 for.body6: ; preds = %for.body6.prol.loopexit, %for.inc17.1 %indvars.iv33 = phi i64 [ %indvars.iv.next34.1, %for.inc17.1 ], [ %indvars.iv33.unr, %for.body6.prol.loopexit ] %indvars.iv.next34 = add nsw i64 %indvars.iv33, -1 %idxprom7 = and i64 %indvars.iv.next34, 4294967295 %arrayidx8 = getelementptr inbounds [200009 x i32], ptr @l, i64 0, i64 %idxprom7 %8 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %idxprom9 = sext i32 %8 to i64 %arrayidx10 = getelementptr inbounds [200009 x i32], ptr @b, i64 0, i64 %idxprom9 %9 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %tobool.not = icmp eq i32 %9, 0 br i1 %tobool.not, label %if.end, label %for.inc17 if.end: ; preds = %for.body6 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 store i32 %8, ptr @ans, align 4, !tbaa !5 br label %for.inc17 for.inc17: ; preds = %for.body6, %if.end %indvars.iv.next34.1 = add nsw i64 %indvars.iv33, -2 %idxprom7.1 = and i64 %indvars.iv.next34.1, 4294967295 %arrayidx8.1 = getelementptr inbounds [200009 x i32], ptr @l, i64 0, i64 %idxprom7.1 %10 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %idxprom9.1 = sext i32 %10 to i64 %arrayidx10.1 = getelementptr inbounds [200009 x i32], ptr @b, i64 0, i64 %idxprom9.1 %11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %11, 0 br i1 %tobool.not.1, label %if.end.1, label %for.inc17.1 if.end.1: ; preds = %for.inc17 store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 %10, ptr @ans, align 4, !tbaa !5 br label %for.inc17.1 for.inc17.1: ; preds = %if.end.1, %for.inc17 %cmp4.1 = icmp ugt i64 %indvars.iv.next34, 1 br i1 %cmp4.1, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include <stdint.h> #include <string.h> uint32_t numList[200000]; uint32_t numListSorted[200000]; int cmpfunc(const void * a, const void * b) { return *(uint32_t *)a - *(uint32_t *)b; } static void printMedians(const uint32_t * const numList, const uint32_t * const numListSorted, const uint32_t listSize) { const uint32_t medianLeft = numListSorted[listSize / 2 - 1]; const uint32_t medianRight = numListSorted[listSize / 2]; for (uint32_t idx = 0; idx < listSize; idx++) { if (numList[idx] <= medianLeft) { printf("%I32u\n", medianRight); } else { printf("%I32u\n", medianLeft); } } } int main(void) { uint32_t listSize; scanf("%I32u\n", &listSize); for (uint32_t idx = 0; idx < listSize - 1; idx++) { scanf("%I32u ", &(numList[idx])); } scanf("%I32u", &(numList[listSize - 1])); memcpy(numListSorted, numList, sizeof(uint32_t)*listSize); qsort(numListSorted, listSize, sizeof(uint32_t), cmpfunc); printMedians(numList, numListSorted, listSize); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155754/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%I32u\0A\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%I32u \00", align 1 @numList = dso_local global [200000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [6 x i8] c"%I32u\00", align 1 @numListSorted = dso_local global [200000 x i32] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpfunc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %listSize = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %listSize) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %listSize) %0 = load i32, ptr %listSize, align 4, !tbaa !5 %cmp10.not = icmp eq i32 %0, 1 br i1 %cmp10.not, label %for.cond.cleanup, label %for.body for.cond.cleanup.loopexit: ; preds = %for.body %1 = zext i32 %sub to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %entry, %for.cond.cleanup.loopexit %sub.lcssa = phi i64 [ %1, %for.cond.cleanup.loopexit ], [ 0, %entry ] %arrayidx4 = getelementptr inbounds [200000 x i32], ptr @numList, i64 0, i64 %sub.lcssa %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx4) %2 = load i32, ptr %listSize, align 4, !tbaa !5 %conv = zext i32 %2 to i64 %mul = shl nuw nsw i64 %conv, 2 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @numListSorted, ptr nonnull align 16 @numList, i64 %mul, i1 false) call void @qsort(ptr noundef nonnull @numListSorted, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @cmpfunc) #6 %3 = load i32, ptr %listSize, align 4, !tbaa !5 %div14.i = lshr i32 %3, 1 %sub.i = add nsw i32 %div14.i, -1 %idxprom.i = zext i32 %sub.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr @numListSorted, i64 %idxprom.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom2.i = zext i32 %div14.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr @numListSorted, i64 %idxprom2.i %5 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp1.not.i = icmp eq i32 %3, 0 br i1 %cmp1.not.i, label %printMedians.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %for.cond.cleanup %wide.trip.count.i = zext i32 %3 to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx5.i = getelementptr inbounds i32, ptr @numList, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.not.i = icmp ugt i32 %6, %4 %..i = select i1 %cmp6.not.i, i32 %4, i32 %5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %..i) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %printMedians.exit, label %for.body.i, !llvm.loop !9 printMedians.exit: ; preds = %for.body.i, %for.cond.cleanup call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %listSize) #6 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200000 x i32], ptr @numList, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %listSize, align 4, !tbaa !5 %sub = add i32 %7, -1 %8 = zext i32 %sub to i64 %cmp = icmp ult i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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}
#include <stdio.h> int main(void) { int m,n,l, i, c, k; int a[100][100], b[100][100]; scanf("%d%d%d", &n, &m, &l); for(i = 0; n > i; i++){ for(c = 0; m > c; c++){ scanf("%d", &a[i][c]); } } for(i = 0; m > i; i++){ for(c = 0; l > c; c++){ scanf("%d", &b[i][c]); } } for(i = 0; n > i; i++){ for(c = 0; l > c; c++){ long long int buf = 0; for(k = 0; m > k; k++){ buf += a[i][k] * b[k][c]; } printf("%lld", buf); if(c != l-1) printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155798/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 %.pre116 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre116, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre116, %for.cond1.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp280 = icmp sgt i32 %3, 0 br i1 %cmp280, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ] %cmp1186 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1186, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv98, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = trunc i64 %indvars.iv.next to i32 %cmp2 = icmp sgt i32 %8, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next99 = add nuw i64 %indvars.iv98, 1 %12 = trunc i64 %indvars.iv.next99 to i32 %cmp = icmp sgt i32 %10, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1484 = icmp sgt i32 %14, 0 br i1 %cmp1484, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre118 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2893 = icmp sgt i32 %15, 0 br i1 %cmp2893, label %for.cond30.preheader.preheader, label %for.end57 for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv104, i64 %indvars.iv101 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next102 = add nuw i64 %indvars.iv101, 1 %16 = load i32, ptr %l, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv.next102 to i32 %cmp14 = icmp sgt i32 %16, %17 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %18 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next105 = add nuw i64 %indvars.iv104, 1 %20 = trunc i64 %indvars.iv.next105 to i32 %cmp11 = icmp sgt i32 %18, %20 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end53 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.end53 ], [ 0, %for.cond30.preheader.preheader ] %21 = load i32, ptr %l, align 4, !tbaa !5 %cmp3191 = icmp sgt i32 %21, 0 br i1 %cmp3191, label %for.cond33.preheader, label %for.end53 for.cond33.preheader: ; preds = %for.cond30.preheader, %if.end %indvars.iv110 = phi i64 [ %indvars.iv.next111, %if.end ], [ 0, %for.cond30.preheader ] %22 = load i32, ptr %m, align 4, !tbaa !5 %cmp3488 = icmp sgt i32 %22, 0 br i1 %cmp3488, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %22 to i64 %xtraiter = and i64 %wide.trip.count, 1 %23 = icmp eq i32 %22, 1 br i1 %23, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ] %buf.090 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107 %24 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107, i64 %indvars.iv110 %25 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %25, %24 %conv = sext i32 %mul to i64 %add = add nsw i64 %buf.090, %conv %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv.next108 %26 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv110 %27 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %27, %26 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ] %buf.090.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107.unr %28 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv110 %29 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %29, %28 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %buf.090.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %buf.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %buf.0.lcssa) %30 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %30, -1 %31 = zext i32 %sub to i64 %cmp48.not = icmp eq i64 %indvars.iv110, %31 br i1 %cmp48.not, label %if.end, label %if.then if.then: ; preds = %for.end46 %putchar79 = call i32 @putchar(i32 32) %.pre119 = load i32, ptr %l, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.end46 %32 = phi i32 [ %.pre119, %if.then ], [ %30, %for.end46 ] %indvars.iv.next111 = add nuw i64 %indvars.iv110, 1 %33 = trunc i64 %indvars.iv.next111 to i32 %cmp31 = icmp sgt i32 %32, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.end53, !llvm.loop !16 for.end53: ; preds = %if.end, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next114 = add nuw i64 %indvars.iv113, 1 %34 = load i32, ptr %n, align 4, !tbaa !5 %35 = trunc i64 %indvars.iv.next114 to i32 %cmp28 = icmp sgt i32 %34, %35 br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !17 for.end57: ; preds = %for.end53, %for.cond27.preheader 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 %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main( void ) { int a[101][101]; int b[101][101]; long c[101][101]={{0}}; int n,m,l; int i,j,k; scanf( "%d%d%d", &n, &m, &l ); for( i=0; i<n; i++ ) { for( j=0; j<m; j++ ) { scanf( "%d", &a[i][j] ); } } for( i=0; i<m; i++ ) { for( j=0; j<l; j++ ) { scanf( "%d", &b[i][j] ); } } for( i=0; i<n; i++ ) { for( k=0; k<m; k++ ) { for( j=0; j<l; j++ ) { c[i][j]+=a[i][k]*b[k][j]; } } } for( i=0; i<n; i++ ) { for( j=0; j<l; j++ ) { printf( "%ld", c[i][j] ); if( l-1 == j ) { printf( "\n" ); } else { printf( " " ); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155848/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [101 x [101 x i32]], align 16 %b = alloca [101 x [101 x i32]], align 16 %c = alloca [101 x [101 x i64]], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %c, i8 0, i64 81608, i1 false) 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 %l) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp111 = icmp sgt i32 %0, 0 %.pre168 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp111, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre168, 0 br i1 %1, label %for.cond1.preheader, label %for.cond61.preheader.lr.phthread-pre-split for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre168, %for.cond1.preheader.lr.ph ] %indvars.iv140 = phi i64 [ %indvars.iv.next141, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2109 = icmp sgt i32 %3, 0 br i1 %cmp2109, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre168, %entry ], [ %11, %for.inc7 ] %cmp11115 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp11115, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv140, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next141, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %33, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %34, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv146 = phi i64 [ %indvars.iv.next147, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14113 = icmp sgt i32 %14, 0 br i1 %cmp14113, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre170 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre170, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %33, %for.cond27.preheader.loopexit ] %cmp28121 = icmp sgt i32 %15, 0 br i1 %cmp28121, label %for.cond30.preheader.lr.ph, label %for.end79 for.cond30.preheader.lr.ph: ; preds = %for.cond27.preheader %cmp31119 = icmp sgt i32 %.lcssa, 0 %16 = load i32, ptr %l, align 4 br i1 %cmp31119, label %for.cond30.preheader.lr.ph.split.us, label %for.cond61.preheader.lr.ph for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph %cmp34117 = icmp sgt i32 %16, 0 br i1 %cmp34117, label %for.cond30.preheader.us.us.preheader, label %for.end79 for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us %wide.trip.count160 = zext i32 %15 to i64 %wide.trip.count155 = zext i32 %.lcssa to i64 %wide.trip.count = zext i32 %16 to i64 %min.iters.check = icmp ult i32 %16, 4 %n.vec = and i64 %wide.trip.count, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv157 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next158, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv157, i64 %indvars.iv152 %17 = load i32, ptr %arrayidx39.us.us.us, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body35.us.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond33.preheader.us.us.us %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %17, i64 0 %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %18 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv152, i64 %index %wide.load = load <2 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds i32, ptr %18, i64 2 %wide.load198 = load <2 x i32>, ptr %19, align 4, !tbaa !5 %20 = mul nsw <2 x i32> %wide.load, %broadcast.splat %21 = mul nsw <2 x i32> %wide.load198, %broadcast.splat %22 = sext <2 x i32> %20 to <2 x i64> %23 = sext <2 x i32> %21 to <2 x i64> %24 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv157, i64 %index %wide.load199 = load <2 x i64>, ptr %24, align 8, !tbaa !13 %25 = getelementptr inbounds i64, ptr %24, i64 2 %wide.load200 = load <2 x i64>, ptr %25, align 8, !tbaa !13 %26 = add nsw <2 x i64> %wide.load199, %22 %27 = add nsw <2 x i64> %wide.load200, %23 store <2 x i64> %26, ptr %24, align 8, !tbaa !13 store <2 x i64> %27, ptr %25, align 8, !tbaa !13 %index.next = add nuw i64 %index, 4 %28 = icmp eq i64 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.preheader for.body35.us.us.us.preheader: ; preds = %for.cond33.preheader.us.us.us, %middle.block %indvars.iv149.ph = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %n.vec, %middle.block ] br label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.body35.us.us.us.preheader, %for.body35.us.us.us %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body35.us.us.us ], [ %indvars.iv149.ph, %for.body35.us.us.us.preheader ] %arrayidx43.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv152, i64 %indvars.iv149 %29 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %29, %17 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %arrayidx47.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv157, i64 %indvars.iv149 %30 = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %add.us.us.us = add nsw i64 %30, %conv.us.us.us store i64 %add.us.us.us, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count br i1 %exitcond.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us, !llvm.loop !18 for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.body35.us.us.us, %middle.block %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155 br i1 %exitcond156.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !19 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1 %exitcond161.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count160 br i1 %exitcond161.not, label %for.cond61.preheader.lr.phthread-pre-split, label %for.cond30.preheader.us.us, !llvm.loop !20 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv143 = phi i64 [ %indvars.iv.next144, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv146, i64 %indvars.iv143 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1 %31 = load i32, ptr %l, align 4, !tbaa !5 %32 = sext i32 %31 to i64 %cmp14 = icmp slt i64 %indvars.iv.next144, %32 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !21 for.inc24.loopexit: ; preds = %for.body15 %.pre169 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %33 = phi i32 [ %.pre169, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %34 = phi i32 [ %31, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1 %35 = sext i32 %33 to i64 %cmp11 = icmp slt i64 %indvars.iv.next147, %35 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !22 for.cond61.preheader.lr.phthread-pre-split: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond1.preheader.lr.ph %.ph = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %15, %for.cond30.for.inc54_crit_edge.split.us.us.us ] %.pr = load i32, ptr %l, align 4, !tbaa !5 br label %for.cond61.preheader.lr.ph for.cond61.preheader.lr.ph: ; preds = %for.cond61.preheader.lr.phthread-pre-split, %for.cond30.preheader.lr.ph %36 = phi i32 [ %.pr, %for.cond61.preheader.lr.phthread-pre-split ], [ %16, %for.cond30.preheader.lr.ph ] %37 = phi i32 [ %.ph, %for.cond61.preheader.lr.phthread-pre-split ], [ %15, %for.cond30.preheader.lr.ph ] %38 = icmp sgt i32 %36, 0 br i1 %38, label %for.cond61.preheader, label %for.end79 for.cond61.preheader: ; preds = %for.cond61.preheader.lr.ph, %for.inc77 %39 = phi i32 [ %46, %for.inc77 ], [ %37, %for.cond61.preheader.lr.ph ] %40 = phi i32 [ %47, %for.inc77 ], [ %36, %for.cond61.preheader.lr.ph ] %indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.inc77 ], [ 0, %for.cond61.preheader.lr.ph ] %cmp62129 = icmp sgt i32 %40, 0 br i1 %cmp62129, label %for.body64, label %for.inc77 for.body64: ; preds = %for.cond61.preheader, %for.body64 %indvars.iv162 = phi i64 [ %indvars.iv.next163, %for.body64 ], [ 0, %for.cond61.preheader ] %arrayidx68 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv165, i64 %indvars.iv162 %41 = load i64, ptr %arrayidx68, align 8, !tbaa !13 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %41) %42 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %42, -1 %43 = zext i32 %sub to i64 %cmp70 = icmp eq i64 %indvars.iv162, %43 %. = select i1 %cmp70, i32 10, i32 32 %putchar108 = call i32 @putchar(i32 %.) %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1 %44 = load i32, ptr %l, align 4, !tbaa !5 %45 = sext i32 %44 to i64 %cmp62 = icmp slt i64 %indvars.iv.next163, %45 br i1 %cmp62, label %for.body64, label %for.inc77.loopexit, !llvm.loop !23 for.inc77.loopexit: ; preds = %for.body64 %.pre171 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc77 for.inc77: ; preds = %for.inc77.loopexit, %for.cond61.preheader %46 = phi i32 [ %.pre171, %for.inc77.loopexit ], [ %39, %for.cond61.preheader ] %47 = phi i32 [ %44, %for.inc77.loopexit ], [ %40, %for.cond61.preheader ] %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %48 = sext i32 %46 to i64 %cmp58 = icmp slt i64 %indvars.iv.next166, %48 br i1 %cmp58, label %for.cond61.preheader, label %for.end79, !llvm.loop !24 for.end79: ; preds = %for.inc77, %for.cond30.preheader.lr.ph.split.us, %for.cond27.preheader, %for.cond61.preheader.lr.ph call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 40804, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long", !7, i64 0} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10, !12}
#include <stdio.h> int main(void){ int i,j,k; int n,l,m; int mata[100][100] = {}; int matb[100][100] = {}; long long int seki; seki = 0; scanf("%d %d %d",&n,&m,&l); for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%d",&mata[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%d",&matb[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ seki = 0; for(k=0;k<m;k++){ seki = seki + mata[i][k] * matb[k][j]; } if(j+1 == l){ printf("%lld",seki); } else{ printf("%lld ",seki); } } printf("\n"); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155891/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155891/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.3 = 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 i32, align 4 %l = alloca i32, align 4 %m = alloca i32, align 4 %mata = alloca [100 x [100 x i32]], align 16 %matb = alloca [100 x [100 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 %l) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %mata) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %mata, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %matb) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %matb, i8 0, i64 40000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp83 = icmp sgt i32 %0, 0 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp83, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre117, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre117, %for.cond1.preheader.lr.ph ] %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp281 = icmp sgt i32 %3, 0 br i1 %cmp281, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre117, %entry ], [ %11, %for.inc7 ] %cmp1187 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1187, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %mata, i64 0, i64 %indvars.iv99, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next100, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1485 = icmp sgt i32 %14, 0 br i1 %cmp1485, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre119 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre119, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2894 = icmp sgt i32 %15, 0 br i1 %cmp2894, label %for.cond30.preheader.preheader, label %for.end58 for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %matb, i64 0, i64 %indvars.iv105, i64 %indvars.iv102 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %16 = load i32, ptr %l, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp14 = icmp slt i64 %indvars.iv.next103, %17 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre118 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %18 = phi i32 [ %.pre118, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %20 = sext i32 %18 to i64 %cmp11 = icmp slt i64 %indvars.iv.next106, %20 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end54 %indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.end54 ], [ 0, %for.cond30.preheader.preheader ] %21 = load i32, ptr %l, align 4, !tbaa !5 %cmp3192 = icmp sgt i32 %21, 0 br i1 %cmp3192, label %for.cond33.preheader, label %for.end54 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.end46 ], [ 0, %for.cond30.preheader ] %22 = phi i32 [ %32, %for.end46 ], [ %21, %for.cond30.preheader ] %23 = load i32, ptr %m, align 4, !tbaa !5 %cmp3489 = icmp sgt i32 %23, 0 br i1 %cmp3489, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %23 to i64 %xtraiter = and i64 %wide.trip.count, 1 %24 = icmp eq i32 %23, 1 br i1 %24, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv108 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next109.1, %for.body35 ] %seki.091 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %mata, i64 0, i64 %indvars.iv114, i64 %indvars.iv108 %25 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %matb, i64 0, i64 %indvars.iv108, i64 %indvars.iv111 %26 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %26, %25 %conv = sext i32 %mul to i64 %add = add nsw i64 %seki.091, %conv %indvars.iv.next109 = or i64 %indvars.iv108, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %mata, i64 0, i64 %indvars.iv114, i64 %indvars.iv.next109 %27 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %matb, i64 0, i64 %indvars.iv.next109, i64 %indvars.iv111 %28 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %28, %27 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv108.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next109.1, %for.body35 ] %seki.091.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %mata, i64 0, i64 %indvars.iv114, i64 %indvars.iv108.unr %29 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %matb, i64 0, i64 %indvars.iv108.unr, i64 %indvars.iv111 %30 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %30, %29 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %seki.091.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %seki.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %31 = zext i32 %22 to i64 %cmp48 = icmp eq i64 %indvars.iv.next112, %31 %.str.2..str.3 = select i1 %cmp48, ptr @.str.2, ptr @.str.3 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %seki.0.lcssa) %32 = load i32, ptr %l, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp31 = icmp slt i64 %indvars.iv.next112, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.end54, !llvm.loop !16 for.end54: ; preds = %for.end46, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %34 = load i32, ptr %n, align 4, !tbaa !5 %35 = sext i32 %34 to i64 %cmp28 = icmp slt i64 %indvars.iv.next115, %35 br i1 %cmp28, label %for.cond30.preheader, label %for.end58, !llvm.loop !17 for.end58: ; preds = %for.end54, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %matb) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %mata) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main(void){ int c,d,e,f; int n,m,l,i,j,k; int a[101][101]={}; int b[101][101]={}; long g[101][101]={}; scanf("%d %d %d",&n,&m,&l); for(c=1;c<=n;c++){ for(d=1;d<=m;d++){ scanf("%d",&e); a[c][d]=e; //printf("*%d",a[c][d]); } } for(c=1;c<=m;c++){ for(d=1;d<=l;d++){ scanf("%d",&e); b[c][d]=e; //printf("*%d",b[c][d]); } } /*//////////////////////////////////////// for(c=1;c<=n;c++){ for(d=1;d<=m;d++){ printf("a[%d][%d]=%d\n",c,d,a[c][d]); } } for(c=1;c<=m;c++){ for(d=1;d<=l;d++){ printf("b[%d][%d]=%d\n",c,d,b[c][d]); } } ///////////////////////////////////////*/ for(k=1;k<=n;k++){ for(j=1;j<=l;j++){ for(i=1;i<=m;i++){ g[k][j]+=a[k][i]*b[i][j]; } } } for(c=1;c<=n;c++){ for(d=1;d<=l;d++){ printf("%ld",g[c][d]); if(d<l){printf(" ");} } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155934/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155934/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %e = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [101 x [101 x i32]], align 16 %b = alloca [101 x [101 x i32]], align 16 %g = alloca [101 x [101 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 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 %l) #5 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %a, i8 0, i64 40804, i1 false) call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %b, i8 0, i64 40804, i1 false) call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %g) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %g, i8 0, i64 81608, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not109 = icmp slt i32 %0, 1 %.pre163 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp.not109, label %for.cond10.preheader, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp slt i32 %.pre163, 1 br i1 %1, label %for.cond30.preheader.lr.ph, label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %11, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %12, %for.inc7 ], [ %.pre163, %for.cond1.preheader.lr.ph ] %indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc7 ], [ 1, %for.cond1.preheader.lr.ph ] %cmp2.not107 = icmp slt i32 %3, 1 br i1 %cmp2.not107, label %for.inc7, label %for.body3 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %11, %for.inc7 ] %5 = phi i32 [ %.pre163, %entry ], [ %12, %for.inc7 ] %cmp11.not113 = icmp slt i32 %5, 1 %6 = load i32, ptr %l, align 4 %7 = icmp slt i32 %6, 1 %or.cond181 = select i1 %cmp11.not113, i1 true, i1 %7 br i1 %or.cond181, label %for.cond27.preheader, label %for.cond13.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e) %8 = load i32, ptr %e, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv135, i64 %indvars.iv store i32 %8, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %m, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %10 br i1 %cmp2.not.not, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %11 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %12 = phi i32 [ %9, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %13 = sext i32 %11 to i64 %cmp.not.not = icmp slt i64 %indvars.iv135, %13 br i1 %cmp.not.not, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %14 = phi i32 [ %26, %for.inc24 ], [ %5, %for.cond10.preheader ] %15 = phi i32 [ %27, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.inc24 ], [ 1, %for.cond10.preheader ] %cmp14.not111 = icmp slt i32 %15, 1 br i1 %cmp14.not111, label %for.inc24, label %for.body15 for.cond27.preheader.loopexit131: ; preds = %for.inc24 %.pre165 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit131, %for.cond10.preheader %16 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre165, %for.cond27.preheader.loopexit131 ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %26, %for.cond27.preheader.loopexit131 ] %cmp28.not119 = icmp slt i32 %16, 1 br i1 %cmp28.not119, label %for.end79, label %for.cond30.preheader.lr.ph for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %.lcssa171 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre163, %for.cond1.preheader.lr.ph ] %17 = phi i32 [ %16, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %18 = load i32, ptr %l, align 4, !tbaa !5 %cmp31.not117 = icmp slt i32 %18, 1 %cmp34.not115 = icmp slt i32 %.lcssa171, 1 %or.cond = select i1 %cmp31.not117, i1 true, i1 %cmp34.not115 br i1 %or.cond, label %for.cond61.preheader.preheader, label %for.cond30.preheader.preheader for.cond30.preheader.preheader: ; preds = %for.cond30.preheader.lr.ph %19 = add nuw i32 %18, 1 %20 = add nuw i32 %17, 1 %wide.trip.count155 = zext i32 %20 to i64 %wide.trip.count150 = zext i32 %19 to i64 %21 = zext i32 %.lcssa171 to i64 %xtraiter = and i64 %21, 1 %22 = icmp eq i32 %.lcssa171, 1 %unroll_iter = and i64 %21, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv138 = phi i64 [ %indvars.iv.next139, %for.body15 ], [ 1, %for.cond13.preheader ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e) %23 = load i32, ptr %e, align 4, !tbaa !5 %arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv141, i64 %indvars.iv138 store i32 %23, ptr %arrayidx20, align 4, !tbaa !5 %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %24 = load i32, ptr %l, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp14.not.not = icmp slt i64 %indvars.iv138, %25 br i1 %cmp14.not.not, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre164 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %26 = phi i32 [ %.pre164, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %27 = phi i32 [ %24, %for.inc24.loopexit ], [ %15, %for.cond13.preheader ] %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %28 = sext i32 %26 to i64 %cmp11.not.not = icmp slt i64 %indvars.iv141, %28 br i1 %cmp11.not.not, label %for.cond13.preheader, label %for.cond27.preheader.loopexit131, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.cond30.for.inc54_crit_edge.split %indvars.iv152 = phi i64 [ 1, %for.cond30.preheader.preheader ], [ %indvars.iv.next153, %for.cond30.for.inc54_crit_edge.split ] br label %for.cond33.preheader for.cond33.preheader: ; preds = %for.cond30.preheader, %for.cond33.for.inc51_crit_edge %indvars.iv147 = phi i64 [ 1, %for.cond30.preheader ], [ %indvars.iv.next148, %for.cond33.for.inc51_crit_edge ] %arrayidx47 = getelementptr inbounds [101 x [101 x i64]], ptr %g, i64 0, i64 %indvars.iv152, i64 %indvars.iv147 %arrayidx47.promoted = load i64, ptr %arrayidx47, align 8, !tbaa !15 br i1 %22, label %for.cond33.for.inc51_crit_edge.unr-lcssa, label %for.body35 for.body35: ; preds = %for.cond33.preheader, %for.body35 %indvars.iv144 = phi i64 [ %indvars.iv.next145.1, %for.body35 ], [ 1, %for.cond33.preheader ] %29 = phi i64 [ %add.1, %for.body35 ], [ %arrayidx47.promoted, %for.cond33.preheader ] %niter = phi i64 [ %niter.next.1, %for.body35 ], [ 0, %for.cond33.preheader ] %arrayidx39 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 %indvars.iv144 %30 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %arrayidx43 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv144, i64 %indvars.iv147 %31 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %31, %30 %conv = sext i32 %mul to i64 %add = add nsw i64 %29, %conv %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %arrayidx39.1 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 %indvars.iv.next145 %32 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv.next145, i64 %indvars.iv147 %33 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %33, %32 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next145.1 = add nuw nsw i64 %indvars.iv144, 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.cond33.for.inc51_crit_edge.unr-lcssa, label %for.body35, !llvm.loop !17 for.cond33.for.inc51_crit_edge.unr-lcssa: ; preds = %for.body35, %for.cond33.preheader %add.lcssa.ph = phi i64 [ undef, %for.cond33.preheader ], [ %add.1, %for.body35 ] %indvars.iv144.unr = phi i64 [ 1, %for.cond33.preheader ], [ %indvars.iv.next145.1, %for.body35 ] %.unr = phi i64 [ %arrayidx47.promoted, %for.cond33.preheader ], [ %add.1, %for.body35 ] br i1 %lcmp.mod.not, label %for.cond33.for.inc51_crit_edge, label %for.body35.epil for.body35.epil: ; preds = %for.cond33.for.inc51_crit_edge.unr-lcssa %arrayidx39.epil = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv152, i64 %indvars.iv144.unr %34 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv144.unr, i64 %indvars.iv147 %35 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %35, %34 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %.unr, %conv.epil br label %for.cond33.for.inc51_crit_edge for.cond33.for.inc51_crit_edge: ; preds = %for.cond33.for.inc51_crit_edge.unr-lcssa, %for.body35.epil %add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond33.for.inc51_crit_edge.unr-lcssa ], [ %add.epil, %for.body35.epil ] store i64 %add.lcssa, ptr %arrayidx47, align 8, !tbaa !15 %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150 br i1 %exitcond151.not, label %for.cond30.for.inc54_crit_edge.split, label %for.cond33.preheader, !llvm.loop !18 for.cond30.for.inc54_crit_edge.split: ; preds = %for.cond33.for.inc51_crit_edge %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155 br i1 %exitcond156.not, label %for.cond61.preheader.preheader, label %for.cond30.preheader, !llvm.loop !19 for.cond61.preheader.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split, %for.cond30.preheader.lr.ph br label %for.cond61.preheader for.cond61.preheader: ; preds = %for.cond61.preheader.preheader, %for.end75 %indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.end75 ], [ 1, %for.cond61.preheader.preheader ] %36 = load i32, ptr %l, align 4, !tbaa !5 %cmp62.not125 = icmp slt i32 %36, 1 br i1 %cmp62.not125, label %for.end75, label %for.body64 for.body64: ; preds = %for.cond61.preheader, %for.inc73 %indvars.iv157 = phi i64 [ %indvars.iv.next158, %for.inc73 ], [ 1, %for.cond61.preheader ] %arrayidx68 = getelementptr inbounds [101 x [101 x i64]], ptr %g, i64 0, i64 %indvars.iv160, i64 %indvars.iv157 %37 = load i64, ptr %arrayidx68, align 8, !tbaa !15 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %37) %38 = load i32, ptr %l, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp70 = icmp slt i64 %indvars.iv157, %39 br i1 %cmp70, label %if.then, label %for.inc73 if.then: ; preds = %for.body64 %putchar106 = call i32 @putchar(i32 32) %.pre166 = load i32, ptr %l, align 4, !tbaa !5 %.pre167 = sext i32 %.pre166 to i64 br label %for.inc73 for.inc73: ; preds = %for.body64, %if.then %.pre-phi = phi i64 [ %39, %for.body64 ], [ %.pre167, %if.then ] %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1 %cmp62.not.not = icmp slt i64 %indvars.iv157, %.pre-phi br i1 %cmp62.not.not, label %for.body64, label %for.end75, !llvm.loop !20 for.end75: ; preds = %for.inc73, %for.cond61.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1 %40 = load i32, ptr %n, align 4, !tbaa !5 %41 = sext i32 %40 to i64 %cmp58.not.not = icmp slt i64 %indvars.iv160, %41 br i1 %cmp58.not.not, label %for.cond61.preheader, label %for.end79, !llvm.loop !21 for.end79: ; preds = %for.end75, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %g) #5 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = !{!16, !16, i64 0} !16 = !{!"long", !7, i64 0} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10}
#include <stdio.h> int main(void){ int n,m,l,i,j,k; long long int x[101][101],y[101][101],z[101][101]={0}; scanf("%d %d %d",&n,&m,&l); for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%d",&x[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%d",&y[i][j]); } } for(i=0;i<n;i++){ for(k=0;k<m;k++){ for(j=0;j<l;j++){ z[i][j]+=x[i][k]*y[k][j]; } } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ printf("%lld",z[i][j]); if(j!=l-1){ printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155978/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %x = alloca [101 x [101 x i64]], align 16 %y = alloca [101 x [101 x i64]], align 16 %z = alloca [101 x [101 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %y) #5 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %z) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %z, i8 0, i64 81608, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp108 = icmp sgt i32 %0, 0 %.pre164 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp108, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre164, 0 br i1 %1, label %for.cond1.preheader, label %for.cond60.preheader.preheader for.cond60.preheader.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph, %for.cond1.preheader.lr.ph br label %for.cond60.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre164, %for.cond1.preheader.lr.ph ] %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2106 = icmp sgt i32 %3, 0 br i1 %cmp2106, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre164, %entry ], [ %11, %for.inc7 ] %cmp11112 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond187 = select i1 %cmp11112, i1 %7, i1 false br i1 %or.cond187, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [101 x [101 x i64]], ptr %x, i64 0, i64 %indvars.iv136, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next137, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %31, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %32, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14110 = icmp sgt i32 %14, 0 br i1 %cmp14110, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre166 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre166, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %31, %for.cond27.preheader.loopexit ] %cmp28118 = icmp sgt i32 %15, 0 br i1 %cmp28118, label %for.cond30.preheader.lr.ph, label %for.end76 for.cond30.preheader.lr.ph: ; preds = %for.cond27.preheader %cmp31116 = icmp sgt i32 %.lcssa, 0 %16 = load i32, ptr %l, align 4 %cmp34114 = icmp sgt i32 %16, 0 %or.cond = select i1 %cmp31116, i1 %cmp34114, i1 false br i1 %or.cond, label %for.cond30.preheader.us.us.preheader, label %for.cond60.preheader.preheader for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph %wide.trip.count156 = zext i32 %15 to i64 %wide.trip.count151 = zext i32 %.lcssa to i64 %wide.trip.count = zext i32 %16 to i64 %min.iters.check = icmp ult i32 %16, 4 %n.vec = and i64 %wide.trip.count, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv153 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next154, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %x, i64 0, i64 %indvars.iv153, i64 %indvars.iv148 %17 = load i64, ptr %arrayidx39.us.us.us, align 8, !tbaa !13 br i1 %min.iters.check, label %for.body35.us.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond33.preheader.us.us.us %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %17, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %18 = getelementptr inbounds [101 x [101 x i64]], ptr %y, i64 0, i64 %indvars.iv148, i64 %index %wide.load = load <2 x i64>, ptr %18, align 8, !tbaa !13 %19 = getelementptr inbounds i64, ptr %18, i64 2 %wide.load193 = load <2 x i64>, ptr %19, align 8, !tbaa !13 %20 = mul nsw <2 x i64> %wide.load, %broadcast.splat %21 = mul nsw <2 x i64> %wide.load193, %broadcast.splat %22 = getelementptr inbounds [101 x [101 x i64]], ptr %z, i64 0, i64 %indvars.iv153, i64 %index %wide.load194 = load <2 x i64>, ptr %22, align 8, !tbaa !13 %23 = getelementptr inbounds i64, ptr %22, i64 2 %wide.load195 = load <2 x i64>, ptr %23, align 8, !tbaa !13 %24 = add nsw <2 x i64> %wide.load194, %20 %25 = add nsw <2 x i64> %wide.load195, %21 store <2 x i64> %24, ptr %22, align 8, !tbaa !13 store <2 x i64> %25, ptr %23, align 8, !tbaa !13 %index.next = add nuw i64 %index, 4 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.preheader for.body35.us.us.us.preheader: ; preds = %for.cond33.preheader.us.us.us, %middle.block %indvars.iv145.ph = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %n.vec, %middle.block ] br label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.body35.us.us.us.preheader, %for.body35.us.us.us %indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.body35.us.us.us ], [ %indvars.iv145.ph, %for.body35.us.us.us.preheader ] %arrayidx43.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %y, i64 0, i64 %indvars.iv148, i64 %indvars.iv145 %27 = load i64, ptr %arrayidx43.us.us.us, align 8, !tbaa !13 %mul.us.us.us = mul nsw i64 %27, %17 %arrayidx47.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %z, i64 0, i64 %indvars.iv153, i64 %indvars.iv145 %28 = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %add.us.us.us = add nsw i64 %28, %mul.us.us.us store i64 %add.us.us.us, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %exitcond.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count br i1 %exitcond.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us, !llvm.loop !18 for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.body35.us.us.us, %middle.block %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151 br i1 %exitcond152.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !19 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.cond60.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !20 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv139 = phi i64 [ %indvars.iv.next140, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [101 x [101 x i64]], ptr %y, i64 0, i64 %indvars.iv142, i64 %indvars.iv139 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1 %29 = load i32, ptr %l, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp14 = icmp slt i64 %indvars.iv.next140, %30 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !21 for.inc24.loopexit: ; preds = %for.body15 %.pre165 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %31 = phi i32 [ %.pre165, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %32 = phi i32 [ %29, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %33 = sext i32 %31 to i64 %cmp11 = icmp slt i64 %indvars.iv.next143, %33 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !22 for.cond60.preheader: ; preds = %for.cond60.preheader.preheader, %for.end72 %indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.end72 ], [ 0, %for.cond60.preheader.preheader ] %34 = load i32, ptr %l, align 4, !tbaa !5 %cmp61126 = icmp sgt i32 %34, 0 br i1 %cmp61126, label %for.body62, label %for.end72 for.body62: ; preds = %for.cond60.preheader, %for.inc70 %indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.inc70 ], [ 0, %for.cond60.preheader ] %arrayidx66 = getelementptr inbounds [101 x [101 x i64]], ptr %z, i64 0, i64 %indvars.iv161, i64 %indvars.iv158 %35 = load i64, ptr %arrayidx66, align 8, !tbaa !13 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %35) %36 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %36, -1 %37 = zext i32 %sub to i64 %cmp68.not = icmp eq i64 %indvars.iv158, %37 br i1 %cmp68.not, label %for.inc70, label %if.then if.then: ; preds = %for.body62 %putchar105 = call i32 @putchar(i32 32) %.pre167 = load i32, ptr %l, align 4, !tbaa !5 br label %for.inc70 for.inc70: ; preds = %for.body62, %if.then %38 = phi i32 [ %36, %for.body62 ], [ %.pre167, %if.then ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %39 = sext i32 %38 to i64 %cmp61 = icmp slt i64 %indvars.iv.next159, %39 br i1 %cmp61, label %for.body62, label %for.end72, !llvm.loop !23 for.end72: ; preds = %for.inc70, %for.cond60.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %40 = load i32, ptr %n, align 4, !tbaa !5 %41 = sext i32 %40 to i64 %cmp58 = icmp slt i64 %indvars.iv.next162, %41 br i1 %cmp58, label %for.cond60.preheader, label %for.end76, !llvm.loop !24 for.end76: ; preds = %for.end72, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %z) #5 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !7, i64 0} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include <stdio.h> int main(void) { int n, m, l, i, j, k; int a[100][100] = { 0 }, b[100][100] = { 0 }; long int c; scanf("%d %d %d", &n, &m, &l); for (i = 0; i < n; i++) for (j = 0; j < m; j++) scanf("%d", &a[i][j]); for (i = 0; i < m; i++) for (j = 0; j < l; j++) scanf("%d", &b[i][j]); for (i = 0; i < n; i++) for (j = 0; j < l; j++) { c = 0; for (k = 0; k < m; k++) c += a[i][k] * b[k][j]; printf("%ld%s", c, j == l - 1 ? "\n" : " "); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156034/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156034/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%ld%s\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c" \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %a, i8 0, i64 40000, i1 false) 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) %b, i8 0, i64 40000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp79 = icmp sgt i32 %0, 0 %.pre114 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp79, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre114, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre114, %for.cond1.preheader.lr.ph ] %indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp277 = icmp sgt i32 %3, 0 br i1 %cmp277, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre114, %entry ], [ %11, %for.inc7 ] %cmp1183 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1183, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv96, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next97, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1481 = icmp sgt i32 %14, 0 br i1 %cmp1481, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre116 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre116, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2890 = icmp sgt i32 %15, 0 br i1 %cmp2890, label %for.cond30.preheader.lr.ph, label %for.end55 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond30.preheader, label %for.end55 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv102, i64 %indvars.iv99 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %19 = load i32, ptr %l, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next100, %20 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre115 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %21 = phi i32 [ %.pre115, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %23 = sext i32 %21 to i64 %cmp11 = icmp slt i64 %indvars.iv.next103, %23 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc53 %24 = phi i32 [ %38, %for.inc53 ], [ %16, %for.cond30.preheader.lr.ph ] %25 = phi i32 [ %39, %for.inc53 ], [ %17, %for.cond30.preheader.lr.ph ] %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.inc53 ], [ 0, %for.cond30.preheader.lr.ph ] %cmp3188 = icmp sgt i32 %25, 0 br i1 %cmp3188, label %for.cond33.preheader, label %for.inc53 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.end46 ], [ 0, %for.cond30.preheader ] %26 = phi i32 [ %36, %for.end46 ], [ %25, %for.cond30.preheader ] %27 = load i32, ptr %m, align 4, !tbaa !5 %cmp3485 = icmp sgt i32 %27, 0 br i1 %cmp3485, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %27 to i64 %xtraiter = and i64 %wide.trip.count, 1 %28 = icmp eq i32 %27, 1 br i1 %28, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv105 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next106.1, %for.body35 ] %c.087 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv111, i64 %indvars.iv105 %29 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv105, i64 %indvars.iv108 %30 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %30, %29 %conv = sext i32 %mul to i64 %add = add nsw i64 %c.087, %conv %indvars.iv.next106 = or i64 %indvars.iv105, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv111, i64 %indvars.iv.next106 %31 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next106, i64 %indvars.iv108 %32 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %32, %31 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next106.1 = add nuw nsw i64 %indvars.iv105, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv105.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next106.1, %for.body35 ] %c.087.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv111, i64 %indvars.iv105.unr %33 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv105.unr, i64 %indvars.iv108 %34 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %34, %33 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %c.087.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %c.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %sub = add nsw i32 %26, -1 %35 = zext i32 %sub to i64 %cmp47 = icmp eq i64 %indvars.iv108, %35 %cond = select i1 %cmp47, ptr @.str.3, ptr @.str.4 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %c.0.lcssa, ptr noundef nonnull %cond) %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %36 = load i32, ptr %l, align 4, !tbaa !5 %37 = sext i32 %36 to i64 %cmp31 = icmp slt i64 %indvars.iv.next109, %37 br i1 %cmp31, label %for.cond33.preheader, label %for.inc53.loopexit, !llvm.loop !16 for.inc53.loopexit: ; preds = %for.end46 %.pre117 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc53 for.inc53: ; preds = %for.inc53.loopexit, %for.cond30.preheader %38 = phi i32 [ %.pre117, %for.inc53.loopexit ], [ %24, %for.cond30.preheader ] %39 = phi i32 [ %36, %for.inc53.loopexit ], [ %25, %for.cond30.preheader ] %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %40 = sext i32 %38 to i64 %cmp28 = icmp slt i64 %indvars.iv.next112, %40 br i1 %cmp28, label %for.cond30.preheader, label %for.end55, !llvm.loop !17 for.end55: ; preds = %for.inc53, %for.cond30.preheader.lr.ph, %for.cond27.preheader 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 %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12}
#include <stdio.h> int main(void) { int n, m, l; scanf("%d %d %d", &n, &m, &l); long long A[100][100], B[100][100], C[100][100] = {0}; int i, j; for(i = 0; i < n; ++i) { for(j = 0; j < m; ++j) { scanf("%lld", &A[i][j]); } } for(i = 0; i < m; ++i) { for(j = 0; j < l; ++j) { scanf("%lld", &B[i][j]); } } int k; for(i = 0; i < n; ++i) { for(j = 0; j < m; ++j) { for(k = 0; k < l; ++k) { C[i][k] += A[i][j] * B[j][k]; } } } for(i = 0; i < n; ++i) { for(j = 0; j < l; ++j) { printf("%lld%s", C[i][j], j + 1 != l ? " " : "\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156078/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156078/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%lld%s\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c" \00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c"\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 %l = alloca i32, align 4 %A = alloca [100 x [100 x i64]], align 16 %B = alloca [100 x [100 x i64]], align 16 %C = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %C) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %C, i8 0, i64 80000, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp106 = icmp sgt i32 %0, 0 %.pre163 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp106, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre163, 0 br i1 %1, label %for.cond1.preheader, label %for.cond60.preheader.lr.phthread-pre-split for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre163, %for.cond1.preheader.lr.ph ] %indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2104 = icmp sgt i32 %3, 0 br i1 %cmp2104, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre163, %entry ], [ %11, %for.inc7 ] %cmp11110 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp11110, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv135, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next136, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %31, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %32, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14108 = icmp sgt i32 %14, 0 br i1 %cmp14108, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre165 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre165, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %31, %for.cond27.preheader.loopexit ] %cmp28116 = icmp sgt i32 %15, 0 br i1 %cmp28116, label %for.cond30.preheader.lr.ph, label %for.end75 for.cond30.preheader.lr.ph: ; preds = %for.cond27.preheader %cmp31114 = icmp sgt i32 %.lcssa, 0 %16 = load i32, ptr %l, align 4 br i1 %cmp31114, label %for.cond30.preheader.lr.ph.split.us, label %for.cond60.preheader.lr.ph for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph %cmp34112 = icmp sgt i32 %16, 0 br i1 %cmp34112, label %for.cond30.preheader.us.us.preheader, label %for.end75 for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us %wide.trip.count155 = zext i32 %15 to i64 %wide.trip.count150 = zext i32 %.lcssa to i64 %wide.trip.count = zext i32 %16 to i64 %min.iters.check = icmp ult i32 %16, 4 %n.vec = and i64 %wide.trip.count, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv152 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next153, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv152, i64 %indvars.iv147 %17 = load i64, ptr %arrayidx39.us.us.us, align 8, !tbaa !13 br i1 %min.iters.check, label %for.body35.us.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond33.preheader.us.us.us %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %17, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %18 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv147, i64 %index %wide.load = load <2 x i64>, ptr %18, align 16, !tbaa !13 %19 = getelementptr inbounds i64, ptr %18, i64 2 %wide.load193 = load <2 x i64>, ptr %19, align 16, !tbaa !13 %20 = mul nsw <2 x i64> %wide.load, %broadcast.splat %21 = mul nsw <2 x i64> %wide.load193, %broadcast.splat %22 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv152, i64 %index %wide.load194 = load <2 x i64>, ptr %22, align 16, !tbaa !13 %23 = getelementptr inbounds i64, ptr %22, i64 2 %wide.load195 = load <2 x i64>, ptr %23, align 16, !tbaa !13 %24 = add nsw <2 x i64> %wide.load194, %20 %25 = add nsw <2 x i64> %wide.load195, %21 store <2 x i64> %24, ptr %22, align 16, !tbaa !13 store <2 x i64> %25, ptr %23, align 16, !tbaa !13 %index.next = add nuw i64 %index, 4 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.preheader for.body35.us.us.us.preheader: ; preds = %for.cond33.preheader.us.us.us, %middle.block %indvars.iv144.ph = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %n.vec, %middle.block ] br label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.body35.us.us.us.preheader, %for.body35.us.us.us %indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.body35.us.us.us ], [ %indvars.iv144.ph, %for.body35.us.us.us.preheader ] %arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv147, i64 %indvars.iv144 %27 = load i64, ptr %arrayidx43.us.us.us, align 8, !tbaa !13 %mul.us.us.us = mul nsw i64 %27, %17 %arrayidx47.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv152, i64 %indvars.iv144 %28 = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %add.us.us.us = add nsw i64 %28, %mul.us.us.us store i64 %add.us.us.us, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count br i1 %exitcond.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us, !llvm.loop !18 for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.body35.us.us.us, %middle.block %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150 br i1 %exitcond151.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !19 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155 br i1 %exitcond156.not, label %for.cond60.preheader.lr.phthread-pre-split, label %for.cond30.preheader.us.us, !llvm.loop !20 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv138 = phi i64 [ %indvars.iv.next139, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv141, i64 %indvars.iv138 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %29 = load i32, ptr %l, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp14 = icmp slt i64 %indvars.iv.next139, %30 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !21 for.inc24.loopexit: ; preds = %for.body15 %.pre164 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %31 = phi i32 [ %.pre164, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %32 = phi i32 [ %29, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %33 = sext i32 %31 to i64 %cmp11 = icmp slt i64 %indvars.iv.next142, %33 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !22 for.cond60.preheader.lr.phthread-pre-split: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond1.preheader.lr.ph %.ph = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %15, %for.cond30.for.inc54_crit_edge.split.us.us.us ] %.pr = load i32, ptr %l, align 4, !tbaa !5 br label %for.cond60.preheader.lr.ph for.cond60.preheader.lr.ph: ; preds = %for.cond60.preheader.lr.phthread-pre-split, %for.cond30.preheader.lr.ph %34 = phi i32 [ %.pr, %for.cond60.preheader.lr.phthread-pre-split ], [ %16, %for.cond30.preheader.lr.ph ] %35 = phi i32 [ %.ph, %for.cond60.preheader.lr.phthread-pre-split ], [ %15, %for.cond30.preheader.lr.ph ] %36 = icmp sgt i32 %34, 0 br i1 %36, label %for.cond60.preheader, label %for.end75 for.cond60.preheader: ; preds = %for.cond60.preheader.lr.ph, %for.inc73 %37 = phi i32 [ %44, %for.inc73 ], [ %35, %for.cond60.preheader.lr.ph ] %38 = phi i32 [ %45, %for.inc73 ], [ %34, %for.cond60.preheader.lr.ph ] %indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.inc73 ], [ 0, %for.cond60.preheader.lr.ph ] %cmp61124 = icmp sgt i32 %38, 0 br i1 %cmp61124, label %for.body62, label %for.inc73 for.body62: ; preds = %for.cond60.preheader, %for.body62 %indvars.iv157 = phi i64 [ %indvars.iv.next158, %for.body62 ], [ 0, %for.cond60.preheader ] %39 = phi i32 [ %42, %for.body62 ], [ %38, %for.cond60.preheader ] %arrayidx66 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv160, i64 %indvars.iv157 %40 = load i64, ptr %arrayidx66, align 8, !tbaa !13 %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1 %41 = zext i32 %39 to i64 %cmp68.not = icmp eq i64 %indvars.iv.next158, %41 %cond = select i1 %cmp68.not, ptr @.str.4, ptr @.str.3 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %40, ptr noundef nonnull %cond) %42 = load i32, ptr %l, align 4, !tbaa !5 %43 = sext i32 %42 to i64 %cmp61 = icmp slt i64 %indvars.iv.next158, %43 br i1 %cmp61, label %for.body62, label %for.inc73.loopexit, !llvm.loop !23 for.inc73.loopexit: ; preds = %for.body62 %.pre166 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc73 for.inc73: ; preds = %for.inc73.loopexit, %for.cond60.preheader %44 = phi i32 [ %.pre166, %for.inc73.loopexit ], [ %37, %for.cond60.preheader ] %45 = phi i32 [ %42, %for.inc73.loopexit ], [ %38, %for.cond60.preheader ] %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1 %46 = sext i32 %44 to i64 %cmp58 = icmp slt i64 %indvars.iv.next161, %46 br i1 %cmp58, label %for.cond60.preheader, label %for.end75, !llvm.loop !24 for.end75: ; preds = %for.inc73, %for.cond30.preheader.lr.ph.split.us, %for.cond27.preheader, %for.cond60.preheader.lr.ph call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !7, i64 0} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10, !12}
#include <stdio.h> int main(){ int n,m,l,i,j,k,a[100][100],b[100][100]; long long c[100][100]={0}; scanf("%d %d %d",&n,&m,&l); for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%d",&a[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%d",&b[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ for(k=0;k<m;k++){ c[i][j]+=a[i][k]*b[k][j]; } if(j!=0) {printf(" "); } printf("%ld",c[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156128/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156128/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = 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 i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 %c = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %c, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp93 = icmp sgt i32 %0, 0 %.pre126 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp93, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre126, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre126, %for.cond1.preheader.lr.ph ] %indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp291 = icmp sgt i32 %3, 0 br i1 %cmp291, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre126, %entry ], [ %11, %for.inc7 ] %cmp1197 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1197, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv108, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next109, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1495 = icmp sgt i32 %14, 0 br i1 %cmp1495, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre128 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre128, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp28103 = icmp sgt i32 %15, 0 br i1 %cmp28103, label %for.cond30.preheader.preheader, label %for.end65 for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv114, i64 %indvars.iv111 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %16 = load i32, ptr %l, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp14 = icmp slt i64 %indvars.iv.next112, %17 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre127 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %18 = phi i32 [ %.pre127, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %20 = sext i32 %18 to i64 %cmp11 = icmp slt i64 %indvars.iv.next115, %20 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end61 %indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.end61 ], [ 0, %for.cond30.preheader.preheader ] %21 = load i32, ptr %l, align 4, !tbaa !5 %cmp31101 = icmp sgt i32 %21, 0 br i1 %cmp31101, label %for.cond33.preheader, label %for.end61 for.cond33.preheader: ; preds = %for.cond30.preheader, %if.end %indvars.iv120 = phi i64 [ %indvars.iv.next121, %if.end ], [ 0, %for.cond30.preheader ] %22 = load i32, ptr %m, align 4, !tbaa !5 %cmp3499 = icmp sgt i32 %22, 0 br i1 %cmp3499, label %for.body35.lr.ph, label %for.end50 for.body35.lr.ph: ; preds = %for.cond33.preheader %arrayidx47 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv123, i64 %indvars.iv120 %arrayidx47.promoted = load i64, ptr %arrayidx47, align 8, !tbaa !15 %wide.trip.count = zext i32 %22 to i64 %xtraiter = and i64 %wide.trip.count, 1 %23 = icmp eq i32 %22, 1 br i1 %23, label %for.cond33.for.end50_crit_edge.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv117 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next118.1, %for.body35 ] %24 = phi i64 [ %arrayidx47.promoted, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv117 %25 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv117, i64 %indvars.iv120 %26 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %26, %25 %conv = sext i32 %mul to i64 %add = add nsw i64 %24, %conv %indvars.iv.next118 = or i64 %indvars.iv117, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv.next118 %27 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next118, i64 %indvars.iv120 %28 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %28, %27 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 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.cond33.for.end50_crit_edge.unr-lcssa, label %for.body35, !llvm.loop !17 for.cond33.for.end50_crit_edge.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv117.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next118.1, %for.body35 ] %.unr = phi i64 [ %arrayidx47.promoted, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond33.for.end50_crit_edge, label %for.body35.epil for.body35.epil: ; preds = %for.cond33.for.end50_crit_edge.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv117.unr %29 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv117.unr, i64 %indvars.iv120 %30 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %30, %29 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %.unr, %conv.epil br label %for.cond33.for.end50_crit_edge for.cond33.for.end50_crit_edge: ; preds = %for.cond33.for.end50_crit_edge.unr-lcssa, %for.body35.epil %add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond33.for.end50_crit_edge.unr-lcssa ], [ %add.epil, %for.body35.epil ] store i64 %add.lcssa, ptr %arrayidx47, align 8, !tbaa !15 br label %for.end50 for.end50: ; preds = %for.cond33.for.end50_crit_edge, %for.cond33.preheader %cmp51.not = icmp eq i64 %indvars.iv120, 0 br i1 %cmp51.not, label %if.end, label %if.then if.then: ; preds = %for.end50 %putchar90 = call i32 @putchar(i32 32) br label %if.end if.end: ; preds = %if.then, %for.end50 %arrayidx57 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv123, i64 %indvars.iv120 %31 = load i64, ptr %arrayidx57, align 8, !tbaa !15 %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %31) %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %32 = load i32, ptr %l, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp31 = icmp slt i64 %indvars.iv.next121, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.end61, !llvm.loop !18 for.end61: ; preds = %if.end, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %34 = load i32, ptr %n, align 4, !tbaa !5 %35 = sext i32 %34 to i64 %cmp28 = icmp slt i64 %indvars.iv.next124, %35 br i1 %cmp28, label %for.cond30.preheader, label %for.end65, !llvm.loop !19 for.end65: ; preds = %for.end61, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include<stdio.h> int main(){ long n,m,l,i,j,k,sum=0,a[100][100],b[100][100]; scanf("%ld %ld %ld",&n,&m,&l); for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%ld",&a[i][j]); } } for(j=0;j<m;j++){ for(k=0;k<l;k++){ scanf("%ld",&b[j][k]); } } for(i=0;i<n;i++){ for(k=0;k<l;k++){ for(j=0;j<m;j++){ sum+=a[i][j]*b[j][k]; } printf("%ld",sum); sum=0; if(k!=l-1){ printf(" "); }else{ printf("\n"); } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156171/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156171/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [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 %m = alloca i64, align 8 %l = alloca i64, align 8 %a = alloca [100 x [100 x i64]], align 16 %b = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp74 = icmp sgt i64 %0, 0 %.pre90 = load i64, ptr %m, align 8, !tbaa !5 br i1 %cmp74, label %for.cond1.preheader.lr.ph, label %for.cond9.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i64 %.pre90, 0 br i1 %1, label %for.cond1.preheader, label %for.cond27.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc6 %2 = phi i64 [ %9, %for.inc6 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i64 [ %10, %for.inc6 ], [ %.pre90, %for.cond1.preheader.lr.ph ] %i.075 = phi i64 [ %inc7, %for.inc6 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp272 = icmp sgt i64 %3, 0 br i1 %cmp272, label %for.body3, label %for.inc6 for.cond9.preheader: ; preds = %for.inc6, %entry %4 = phi i64 [ %0, %entry ], [ %9, %for.inc6 ] %5 = phi i64 [ %.pre90, %entry ], [ %10, %for.inc6 ] %cmp1078 = icmp sgt i64 %5, 0 %6 = load i64, ptr %l, align 8 %7 = icmp sgt i64 %6, 0 %or.cond = select i1 %cmp1078, i1 %7, i1 false br i1 %or.cond, label %for.cond12.preheader, label %for.cond24.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %j.073 = phi i64 [ %inc, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx4 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %i.075, i64 %j.073 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx4) %inc = add nuw nsw i64 %j.073, 1 %8 = load i64, ptr %m, align 8, !tbaa !5 %cmp2 = icmp slt i64 %inc, %8 br i1 %cmp2, label %for.body3, label %for.inc6.loopexit, !llvm.loop !9 for.inc6.loopexit: ; preds = %for.body3 %.pre = load i64, ptr %n, align 8, !tbaa !5 br label %for.inc6 for.inc6: ; preds = %for.inc6.loopexit, %for.cond1.preheader %9 = phi i64 [ %.pre, %for.inc6.loopexit ], [ %2, %for.cond1.preheader ] %10 = phi i64 [ %8, %for.inc6.loopexit ], [ %3, %for.cond1.preheader ] %inc7 = add nuw nsw i64 %i.075, 1 %cmp = icmp slt i64 %inc7, %9 br i1 %cmp, label %for.cond1.preheader, label %for.cond9.preheader, !llvm.loop !11 for.cond12.preheader: ; preds = %for.cond9.preheader, %for.inc21 %11 = phi i64 [ %18, %for.inc21 ], [ %5, %for.cond9.preheader ] %12 = phi i64 [ %19, %for.inc21 ], [ %6, %for.cond9.preheader ] %j.179 = phi i64 [ %inc22, %for.inc21 ], [ 0, %for.cond9.preheader ] %cmp1376 = icmp sgt i64 %12, 0 br i1 %cmp1376, label %for.body14, label %for.inc21 for.cond24.preheader.loopexit: ; preds = %for.inc21 %.pre92 = load i64, ptr %n, align 8, !tbaa !5 br label %for.cond24.preheader for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %for.cond9.preheader %13 = phi i64 [ %.pre92, %for.cond24.preheader.loopexit ], [ %4, %for.cond9.preheader ] %cmp2585 = icmp sgt i64 %13, 0 br i1 %cmp2585, label %for.cond27.preheader.lr.ph, label %for.end49 for.cond27.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond24.preheader %14 = phi i64 [ %13, %for.cond24.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %15 = load i64, ptr %l, align 8, !tbaa !5 %16 = icmp sgt i64 %15, 0 br i1 %16, label %for.cond27.preheader, label %for.end49 for.body14: ; preds = %for.cond12.preheader, %for.body14 %k.077 = phi i64 [ %inc19, %for.body14 ], [ 0, %for.cond12.preheader ] %arrayidx16 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %j.179, i64 %k.077 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx16) %inc19 = add nuw nsw i64 %k.077, 1 %17 = load i64, ptr %l, align 8, !tbaa !5 %cmp13 = icmp slt i64 %inc19, %17 br i1 %cmp13, label %for.body14, label %for.inc21.loopexit, !llvm.loop !13 for.inc21.loopexit: ; preds = %for.body14 %.pre91 = load i64, ptr %m, align 8, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.inc21.loopexit, %for.cond12.preheader %18 = phi i64 [ %.pre91, %for.inc21.loopexit ], [ %11, %for.cond12.preheader ] %19 = phi i64 [ %17, %for.inc21.loopexit ], [ %12, %for.cond12.preheader ] %inc22 = add nuw nsw i64 %j.179, 1 %cmp10 = icmp slt i64 %inc22, %18 br i1 %cmp10, label %for.cond12.preheader, label %for.cond24.preheader.loopexit, !llvm.loop !14 for.cond27.preheader: ; preds = %for.cond27.preheader.lr.ph, %for.inc47 %20 = phi i64 [ %32, %for.inc47 ], [ %14, %for.cond27.preheader.lr.ph ] %21 = phi i64 [ %33, %for.inc47 ], [ %15, %for.cond27.preheader.lr.ph ] %i.186 = phi i64 [ %inc48, %for.inc47 ], [ 0, %for.cond27.preheader.lr.ph ] %cmp2883 = icmp sgt i64 %21, 0 br i1 %cmp2883, label %for.cond30.preheader, label %for.inc47 for.cond30.preheader: ; preds = %for.cond27.preheader, %for.end39 %k.184 = phi i64 [ %inc45, %for.end39 ], [ 0, %for.cond27.preheader ] %22 = load i64, ptr %m, align 8, !tbaa !5 %cmp3180 = icmp sgt i64 %22, 0 br i1 %cmp3180, label %for.body32.preheader, label %for.end39 for.body32.preheader: ; preds = %for.cond30.preheader %xtraiter = and i64 %22, 1 %23 = icmp eq i64 %22, 1 br i1 %23, label %for.end39.loopexit.unr-lcssa, label %for.body32.preheader.new for.body32.preheader.new: ; preds = %for.body32.preheader %unroll_iter = and i64 %22, -2 br label %for.body32 for.body32: ; preds = %for.body32, %for.body32.preheader.new %sum.282 = phi i64 [ 0, %for.body32.preheader.new ], [ %add.1, %for.body32 ] %j.281 = phi i64 [ 0, %for.body32.preheader.new ], [ %inc38.1, %for.body32 ] %niter = phi i64 [ 0, %for.body32.preheader.new ], [ %niter.next.1, %for.body32 ] %arrayidx34 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %i.186, i64 %j.281 %24 = load i64, ptr %arrayidx34, align 16, !tbaa !5 %arrayidx36 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %j.281, i64 %k.184 %25 = load i64, ptr %arrayidx36, align 8, !tbaa !5 %mul = mul nsw i64 %25, %24 %add = add nsw i64 %mul, %sum.282 %inc38 = or i64 %j.281, 1 %arrayidx34.1 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %i.186, i64 %inc38 %26 = load i64, ptr %arrayidx34.1, align 8, !tbaa !5 %arrayidx36.1 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %inc38, i64 %k.184 %27 = load i64, ptr %arrayidx36.1, align 8, !tbaa !5 %mul.1 = mul nsw i64 %27, %26 %add.1 = add nsw i64 %mul.1, %add %inc38.1 = add nuw nsw i64 %j.281, 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.end39.loopexit.unr-lcssa, label %for.body32, !llvm.loop !15 for.end39.loopexit.unr-lcssa: ; preds = %for.body32, %for.body32.preheader %add.lcssa.ph = phi i64 [ undef, %for.body32.preheader ], [ %add.1, %for.body32 ] %sum.282.unr = phi i64 [ 0, %for.body32.preheader ], [ %add.1, %for.body32 ] %j.281.unr = phi i64 [ 0, %for.body32.preheader ], [ %inc38.1, %for.body32 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end39, label %for.body32.epil for.body32.epil: ; preds = %for.end39.loopexit.unr-lcssa %arrayidx34.epil = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %i.186, i64 %j.281.unr %28 = load i64, ptr %arrayidx34.epil, align 8, !tbaa !5 %arrayidx36.epil = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %j.281.unr, i64 %k.184 %29 = load i64, ptr %arrayidx36.epil, align 8, !tbaa !5 %mul.epil = mul nsw i64 %29, %28 %add.epil = add nsw i64 %mul.epil, %sum.282.unr br label %for.end39 for.end39: ; preds = %for.body32.epil, %for.end39.loopexit.unr-lcssa, %for.cond30.preheader %sum.2.lcssa = phi i64 [ 0, %for.cond30.preheader ], [ %add.lcssa.ph, %for.end39.loopexit.unr-lcssa ], [ %add.epil, %for.body32.epil ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.2.lcssa) %30 = load i64, ptr %l, align 8, !tbaa !5 %sub = add nsw i64 %30, -1 %cmp41.not = icmp eq i64 %k.184, %sub %. = select i1 %cmp41.not, i32 10, i32 32 %putchar71 = call i32 @putchar(i32 %.) %inc45 = add nuw nsw i64 %k.184, 1 %31 = load i64, ptr %l, align 8, !tbaa !5 %cmp28 = icmp slt i64 %inc45, %31 br i1 %cmp28, label %for.cond30.preheader, label %for.inc47.loopexit, !llvm.loop !16 for.inc47.loopexit: ; preds = %for.end39 %.pre93 = load i64, ptr %n, align 8, !tbaa !5 br label %for.inc47 for.inc47: ; preds = %for.inc47.loopexit, %for.cond27.preheader %32 = phi i64 [ %.pre93, %for.inc47.loopexit ], [ %20, %for.cond27.preheader ] %33 = phi i64 [ %31, %for.inc47.loopexit ], [ %21, %for.cond27.preheader ] %inc48 = add nuw nsw i64 %i.186, 1 %cmp25 = icmp slt i64 %inc48, %32 br i1 %cmp25, label %for.cond27.preheader, label %for.end49, !llvm.loop !17 for.end49: ; preds = %for.inc47, %for.cond27.preheader.lr.ph, %for.cond24.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12}
#include<stdio.h> int main(void){ int n, m, l; int A[100][100], B[100][100]; long int C[100][100] = {}; scanf("%d %d %d", &n, &m, &l); for(int i=0; i<n; i++){ for(int j=0; j<m ;j++){ scanf("%d", &A[i][j]); } } for(int i=0; i<m; i++){ for(int j=0; j<l ;j++){ scanf("%d", &B[i][j]); } } for(int i=0; i<n; i++){ for(int j=0; j<l ;j++){ for(int k=0; k<m; k++){ C[i][j] += A[i][k]*B[k][j]; } printf("%ld", C[i][j]); if(j == l-1){ printf("\n"); }else{ printf(" "); } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156258/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\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 %l = alloca i32, align 4 %A = alloca [100 x [100 x i32]], align 16 %B = alloca [100 x [100 x i32]], align 16 %C = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %B) #5 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %C) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %C, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp99 = icmp sgt i32 %0, 0 %.pre133 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp99, label %for.cond1.preheader.lr.ph, label %for.cond12.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre133, 0 br i1 %1, label %for.cond1.preheader, label %for.cond38.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond.cleanup3 %2 = phi i32 [ %8, %for.cond.cleanup3 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %9, %for.cond.cleanup3 ], [ %.pre133, %for.cond1.preheader.lr.ph ] %indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.cond.cleanup3 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp297 = icmp sgt i32 %3, 0 br i1 %cmp297, label %for.body4, label %for.cond.cleanup3 for.cond12.preheader: ; preds = %for.cond.cleanup3, %entry %4 = phi i32 [ %0, %entry ], [ %8, %for.cond.cleanup3 ] %5 = phi i32 [ %.pre133, %entry ], [ %9, %for.cond.cleanup3 ] %cmp13103 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp13103, i1 %7, i1 false br i1 %or.cond, label %for.cond17.preheader, label %for.cond33.preheader for.cond.cleanup3.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup3 for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit, %for.cond1.preheader %8 = phi i32 [ %.pre, %for.cond.cleanup3.loopexit ], [ %2, %for.cond1.preheader ] %9 = phi i32 [ %11, %for.cond.cleanup3.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1 %10 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next116, %10 br i1 %cmp, label %for.cond1.preheader, label %for.cond12.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond1.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond1.preheader ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv115, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = load i32, ptr %m, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp2, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !12 for.cond17.preheader: ; preds = %for.cond12.preheader, %for.cond.cleanup19 %13 = phi i32 [ %19, %for.cond.cleanup19 ], [ %5, %for.cond12.preheader ] %14 = phi i32 [ %20, %for.cond.cleanup19 ], [ %6, %for.cond12.preheader ] %indvars.iv121 = phi i64 [ %indvars.iv.next122, %for.cond.cleanup19 ], [ 0, %for.cond12.preheader ] %cmp18101 = icmp sgt i32 %14, 0 br i1 %cmp18101, label %for.body20, label %for.cond.cleanup19 for.cond33.preheader.loopexit: ; preds = %for.cond.cleanup19 %.pre135 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond33.preheader for.cond33.preheader: ; preds = %for.cond33.preheader.loopexit, %for.cond12.preheader %15 = phi i32 [ %.pre135, %for.cond33.preheader.loopexit ], [ %4, %for.cond12.preheader ] %cmp34109 = icmp sgt i32 %15, 0 br i1 %cmp34109, label %for.cond38.preheader.lr.ph, label %for.cond.cleanup35 for.cond38.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond33.preheader %16 = phi i32 [ %15, %for.cond33.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond38.preheader, label %for.cond.cleanup35 for.cond.cleanup19.loopexit: ; preds = %for.body20 %.pre134 = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond.cleanup19 for.cond.cleanup19: ; preds = %for.cond.cleanup19.loopexit, %for.cond17.preheader %19 = phi i32 [ %.pre134, %for.cond.cleanup19.loopexit ], [ %13, %for.cond17.preheader ] %20 = phi i32 [ %22, %for.cond.cleanup19.loopexit ], [ %14, %for.cond17.preheader ] %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1 %21 = sext i32 %19 to i64 %cmp13 = icmp slt i64 %indvars.iv.next122, %21 br i1 %cmp13, label %for.cond17.preheader, label %for.cond33.preheader.loopexit, !llvm.loop !13 for.body20: ; preds = %for.cond17.preheader, %for.body20 %indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.body20 ], [ 0, %for.cond17.preheader ] %arrayidx24 = getelementptr inbounds [100 x [100 x i32]], ptr %B, i64 0, i64 %indvars.iv121, i64 %indvars.iv118 %call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx24) %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1 %22 = load i32, ptr %l, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp18 = icmp slt i64 %indvars.iv.next119, %23 br i1 %cmp18, label %for.body20, label %for.cond.cleanup19.loopexit, !llvm.loop !14 for.cond38.preheader: ; preds = %for.cond38.preheader.lr.ph, %for.cond.cleanup40 %24 = phi i32 [ %28, %for.cond.cleanup40 ], [ %16, %for.cond38.preheader.lr.ph ] %25 = phi i32 [ %29, %for.cond.cleanup40 ], [ %17, %for.cond38.preheader.lr.ph ] %indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.cond.cleanup40 ], [ 0, %for.cond38.preheader.lr.ph ] %cmp39107 = icmp sgt i32 %25, 0 br i1 %cmp39107, label %for.cond42.preheader, label %for.cond.cleanup40 for.cond.cleanup35: ; preds = %for.cond.cleanup40, %for.cond38.preheader.lr.ph, %for.cond33.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %C) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %B) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 for.cond42.preheader: ; preds = %for.cond38.preheader, %for.cond.cleanup44 %indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.cond.cleanup44 ], [ 0, %for.cond38.preheader ] %26 = load i32, ptr %m, align 4, !tbaa !5 %cmp43105 = icmp sgt i32 %26, 0 %arrayidx57 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv130, i64 %indvars.iv127 %arrayidx57.promoted = load i64, ptr %arrayidx57, align 8, !tbaa !15 br i1 %cmp43105, label %for.body45.lr.ph, label %for.cond.cleanup44 for.body45.lr.ph: ; preds = %for.cond42.preheader %wide.trip.count = zext i32 %26 to i64 %xtraiter = and i64 %wide.trip.count, 1 %27 = icmp eq i32 %26, 1 br i1 %27, label %for.cond42.for.cond.cleanup44_crit_edge.unr-lcssa, label %for.body45.lr.ph.new for.body45.lr.ph.new: ; preds = %for.body45.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body45 for.cond.cleanup40.loopexit: ; preds = %for.cond.cleanup44 %.pre137 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup40 for.cond.cleanup40: ; preds = %for.cond.cleanup40.loopexit, %for.cond38.preheader %28 = phi i32 [ %.pre137, %for.cond.cleanup40.loopexit ], [ %24, %for.cond38.preheader ] %29 = phi i32 [ %36, %for.cond.cleanup40.loopexit ], [ %25, %for.cond38.preheader ] %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1 %30 = sext i32 %28 to i64 %cmp34 = icmp slt i64 %indvars.iv.next131, %30 br i1 %cmp34, label %for.cond38.preheader, label %for.cond.cleanup35, !llvm.loop !17 for.cond42.for.cond.cleanup44_crit_edge.unr-lcssa: ; preds = %for.body45, %for.body45.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body45.lr.ph ], [ %add.1, %for.body45 ] %indvars.iv124.unr = phi i64 [ 0, %for.body45.lr.ph ], [ %indvars.iv.next125.1, %for.body45 ] %.unr = phi i64 [ %arrayidx57.promoted, %for.body45.lr.ph ], [ %add.1, %for.body45 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond42.for.cond.cleanup44_crit_edge, label %for.body45.epil for.body45.epil: ; preds = %for.cond42.for.cond.cleanup44_crit_edge.unr-lcssa %arrayidx49.epil = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv130, i64 %indvars.iv124.unr %31 = load i32, ptr %arrayidx49.epil, align 4, !tbaa !5 %arrayidx53.epil = getelementptr inbounds [100 x [100 x i32]], ptr %B, i64 0, i64 %indvars.iv124.unr, i64 %indvars.iv127 %32 = load i32, ptr %arrayidx53.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %32, %31 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %.unr, %conv.epil br label %for.cond42.for.cond.cleanup44_crit_edge for.cond42.for.cond.cleanup44_crit_edge: ; preds = %for.cond42.for.cond.cleanup44_crit_edge.unr-lcssa, %for.body45.epil %add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond42.for.cond.cleanup44_crit_edge.unr-lcssa ], [ %add.epil, %for.body45.epil ] store i64 %add.lcssa, ptr %arrayidx57, align 8, !tbaa !15 br label %for.cond.cleanup44 for.cond.cleanup44: ; preds = %for.cond42.preheader, %for.cond42.for.cond.cleanup44_crit_edge %33 = phi i64 [ %add.lcssa, %for.cond42.for.cond.cleanup44_crit_edge ], [ %arrayidx57.promoted, %for.cond42.preheader ] %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %33) %34 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %34, -1 %35 = zext i32 %sub to i64 %cmp66 = icmp eq i64 %indvars.iv127, %35 %. = select i1 %cmp66, i32 10, i32 32 %putchar96 = call i32 @putchar(i32 %.) %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1 %36 = load i32, ptr %l, align 4, !tbaa !5 %37 = sext i32 %36 to i64 %cmp39 = icmp slt i64 %indvars.iv.next128, %37 br i1 %cmp39, label %for.cond42.preheader, label %for.cond.cleanup40.loopexit, !llvm.loop !18 for.body45: ; preds = %for.body45, %for.body45.lr.ph.new %indvars.iv124 = phi i64 [ 0, %for.body45.lr.ph.new ], [ %indvars.iv.next125.1, %for.body45 ] %38 = phi i64 [ %arrayidx57.promoted, %for.body45.lr.ph.new ], [ %add.1, %for.body45 ] %niter = phi i64 [ 0, %for.body45.lr.ph.new ], [ %niter.next.1, %for.body45 ] %arrayidx49 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv130, i64 %indvars.iv124 %39 = load i32, ptr %arrayidx49, align 8, !tbaa !5 %arrayidx53 = getelementptr inbounds [100 x [100 x i32]], ptr %B, i64 0, i64 %indvars.iv124, i64 %indvars.iv127 %40 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %mul = mul nsw i32 %40, %39 %conv = sext i32 %mul to i64 %add = add nsw i64 %38, %conv %indvars.iv.next125 = or i64 %indvars.iv124, 1 %arrayidx49.1 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv130, i64 %indvars.iv.next125 %41 = load i32, ptr %arrayidx49.1, align 4, !tbaa !5 %arrayidx53.1 = getelementptr inbounds [100 x [100 x i32]], ptr %B, i64 0, i64 %indvars.iv.next125, i64 %indvars.iv127 %42 = load i32, ptr %arrayidx53.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %42, %41 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next125.1 = add nuw nsw i64 %indvars.iv124, 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.cond42.for.cond.cleanup44_crit_edge.unr-lcssa, label %for.body45, !llvm.loop !19 } ; 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, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.unswitch.partial.disable"} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !11} !14 = distinct !{!14, !10} !15 = !{!16, !16, i64 0} !16 = !{!"long", !7, i64 0} !17 = distinct !{!17, !10, !11} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include<stdio.h> int main(){ char c; int i,j,k; int n,m,l; int table_a[100][100]={0}; int table_b[100][100]={0}; long table_c[100][100]={0}; scanf("%d %d %d",&n,&m,&l); /*テーブルAへ数値セット*/ for(i=0; i<n; i++){ for(j=0; j<m; j++){ scanf("%d%c",&table_a[i][j],&c); if(c == '\n'){ break; } } } /*テーブルBへ数値セット*/ for(i=0; i<m; i++){ for(j=0; j<l; j++){ scanf("%d%c",&table_b[i][j],&c); if(c == '\n'){ break; } } } /*テーブルCへ数値セット*/ for(i=0; i<n; i++){ for(j=0; j<l; j++){ for(k=0; k<m; k++){ table_c[i][j] += table_a[i][k] * table_b[k][j]; } } } /*テーブルCの出力*/ for(i=0; i<n; i++){ for(j=0; j<l; j++){ if(j!=0){ printf(" "); } printf("%ld",table_c[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156300/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 @.str.3 = 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: %c = alloca i8, align 1 %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %table_a = alloca [100 x [100 x i32]], align 16 %table_b = alloca [100 x [100 x i32]], align 16 %table_c = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5 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 %l) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %table_a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %table_a, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %table_b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %table_b, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %table_c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %table_c, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp126 = icmp sgt i32 %0, 0 %.pre184 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp126, label %for.cond1.preheader.lr.ph, label %for.cond12.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre184, 0 br i1 %1, label %for.cond1.preheader, label %for.cond40.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc9 %2 = phi i32 [ %11, %for.inc9 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %12, %for.inc9 ], [ %.pre184, %for.cond1.preheader.lr.ph ] %indvars.iv155 = phi i64 [ %indvars.iv.next156, %for.inc9 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2124 = icmp sgt i32 %3, 0 br i1 %cmp2124, label %for.body3, label %for.inc9 for.cond12.preheader: ; preds = %for.inc9, %entry %4 = phi i32 [ %0, %entry ], [ %11, %for.inc9 ] %5 = phi i32 [ %.pre184, %entry ], [ %12, %for.inc9 ] %cmp13130 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond201 = select i1 %cmp13130, i1 %7, i1 false br i1 %or.cond201, label %for.cond16.preheader, label %for.cond36.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %table_a, i64 0, i64 %indvars.iv155, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %c) %8 = load i8, ptr %c, align 1, !tbaa !9 %cmp7 = icmp ne i8 %8, 10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %m, align 4 %10 = sext i32 %9 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %10 %or.cond = select i1 %cmp7, i1 %cmp2, i1 false br i1 %or.cond, label %for.body3, label %for.inc9.loopexit, !llvm.loop !10 for.inc9.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc9 for.inc9: ; preds = %for.inc9.loopexit, %for.cond1.preheader %11 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %2, %for.cond1.preheader ] %12 = phi i32 [ %9, %for.inc9.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1 %13 = sext i32 %11 to i64 %cmp = icmp slt i64 %indvars.iv.next156, %13 br i1 %cmp, label %for.cond1.preheader, label %for.cond12.preheader, !llvm.loop !12 for.cond16.preheader: ; preds = %for.cond12.preheader, %for.inc33 %14 = phi i32 [ %30, %for.inc33 ], [ %5, %for.cond12.preheader ] %15 = phi i32 [ %31, %for.inc33 ], [ %6, %for.cond12.preheader ] %indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.inc33 ], [ 0, %for.cond12.preheader ] %cmp17128 = icmp sgt i32 %15, 0 br i1 %cmp17128, label %for.body19, label %for.inc33 for.cond36.preheader.loopexit: ; preds = %for.inc33 %.pre186 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond36.preheader for.cond36.preheader: ; preds = %for.cond36.preheader.loopexit, %for.cond12.preheader %16 = phi i32 [ %4, %for.cond12.preheader ], [ %.pre186, %for.cond36.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond12.preheader ], [ %30, %for.cond36.preheader.loopexit ] %cmp37136 = icmp sgt i32 %16, 0 br i1 %cmp37136, label %for.cond40.preheader.lr.ph, label %for.end94 for.cond40.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond36.preheader %.lcssa190 = phi i32 [ %.lcssa, %for.cond36.preheader ], [ %.pre184, %for.cond1.preheader.lr.ph ] %17 = phi i32 [ %16, %for.cond36.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %18 = load i32, ptr %l, align 4, !tbaa !5 %cmp41134 = icmp sgt i32 %18, 0 %cmp45132 = icmp sgt i32 %.lcssa190, 0 %or.cond199 = select i1 %cmp41134, i1 %cmp45132, i1 false br i1 %or.cond199, label %for.cond40.preheader.us.us.preheader, label %for.cond74.preheader.preheader for.cond74.preheader.preheader: ; preds = %for.cond40.for.inc67_crit_edge.split.us.us.us, %for.cond40.preheader.lr.ph br label %for.cond74.preheader for.cond40.preheader.us.us.preheader: ; preds = %for.cond40.preheader.lr.ph %wide.trip.count175 = zext i32 %17 to i64 %wide.trip.count170 = zext i32 %18 to i64 %wide.trip.count = zext i32 %.lcssa190 to i64 %xtraiter = and i64 %wide.trip.count, 1 %19 = icmp eq i32 %.lcssa190, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond40.preheader.us.us for.cond40.preheader.us.us: ; preds = %for.cond40.preheader.us.us.preheader, %for.cond40.for.inc67_crit_edge.split.us.us.us %indvars.iv172 = phi i64 [ 0, %for.cond40.preheader.us.us.preheader ], [ %indvars.iv.next173, %for.cond40.for.inc67_crit_edge.split.us.us.us ] br label %for.cond44.preheader.us.us.us for.cond44.preheader.us.us.us: ; preds = %for.cond44.for.inc64_crit_edge.us.us.us, %for.cond40.preheader.us.us %indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.cond44.for.inc64_crit_edge.us.us.us ], [ 0, %for.cond40.preheader.us.us ] %arrayidx60.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %table_c, i64 0, i64 %indvars.iv172, i64 %indvars.iv167 %arrayidx60.promoted.us.us.us = load i64, ptr %arrayidx60.us.us.us, align 8, !tbaa !14 br i1 %19, label %for.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa, label %for.body47.us.us.us for.body47.us.us.us: ; preds = %for.cond44.preheader.us.us.us, %for.body47.us.us.us %indvars.iv164 = phi i64 [ %indvars.iv.next165.1, %for.body47.us.us.us ], [ 0, %for.cond44.preheader.us.us.us ] %20 = phi i64 [ %add.us.us.us.1, %for.body47.us.us.us ], [ %arrayidx60.promoted.us.us.us, %for.cond44.preheader.us.us.us ] %niter = phi i64 [ %niter.next.1, %for.body47.us.us.us ], [ 0, %for.cond44.preheader.us.us.us ] %arrayidx51.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %table_a, i64 0, i64 %indvars.iv172, i64 %indvars.iv164 %21 = load i32, ptr %arrayidx51.us.us.us, align 8, !tbaa !5 %arrayidx55.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %table_b, i64 0, i64 %indvars.iv164, i64 %indvars.iv167 %22 = load i32, ptr %arrayidx55.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %22, %21 %conv56.us.us.us = sext i32 %mul.us.us.us to i64 %add.us.us.us = add nsw i64 %20, %conv56.us.us.us %indvars.iv.next165 = or i64 %indvars.iv164, 1 %arrayidx51.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %table_a, i64 0, i64 %indvars.iv172, i64 %indvars.iv.next165 %23 = load i32, ptr %arrayidx51.us.us.us.1, align 4, !tbaa !5 %arrayidx55.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %table_b, i64 0, i64 %indvars.iv.next165, i64 %indvars.iv167 %24 = load i32, ptr %arrayidx55.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.1 = mul nsw i32 %24, %23 %conv56.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv56.us.us.us.1 %indvars.iv.next165.1 = add nuw nsw i64 %indvars.iv164, 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.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa, label %for.body47.us.us.us, !llvm.loop !16 for.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body47.us.us.us, %for.cond44.preheader.us.us.us %add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond44.preheader.us.us.us ], [ %add.us.us.us.1, %for.body47.us.us.us ] %indvars.iv164.unr = phi i64 [ 0, %for.cond44.preheader.us.us.us ], [ %indvars.iv.next165.1, %for.body47.us.us.us ] %.unr = phi i64 [ %arrayidx60.promoted.us.us.us, %for.cond44.preheader.us.us.us ], [ %add.us.us.us.1, %for.body47.us.us.us ] br i1 %lcmp.mod.not, label %for.cond44.for.inc64_crit_edge.us.us.us, label %for.body47.us.us.us.epil for.body47.us.us.us.epil: ; preds = %for.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa %arrayidx51.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %table_a, i64 0, i64 %indvars.iv172, i64 %indvars.iv164.unr %25 = load i32, ptr %arrayidx51.us.us.us.epil, align 4, !tbaa !5 %arrayidx55.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %table_b, i64 0, i64 %indvars.iv164.unr, i64 %indvars.iv167 %26 = load i32, ptr %arrayidx55.us.us.us.epil, align 4, !tbaa !5 %mul.us.us.us.epil = mul nsw i32 %26, %25 %conv56.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64 %add.us.us.us.epil = add nsw i64 %.unr, %conv56.us.us.us.epil br label %for.cond44.for.inc64_crit_edge.us.us.us for.cond44.for.inc64_crit_edge.us.us.us: ; preds = %for.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa, %for.body47.us.us.us.epil %add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond44.for.inc64_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body47.us.us.us.epil ] store i64 %add.us.us.us.lcssa, ptr %arrayidx60.us.us.us, align 8, !tbaa !14 %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1 %exitcond171.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count170 br i1 %exitcond171.not, label %for.cond40.for.inc67_crit_edge.split.us.us.us, label %for.cond44.preheader.us.us.us, !llvm.loop !17 for.cond40.for.inc67_crit_edge.split.us.us.us: ; preds = %for.cond44.for.inc64_crit_edge.us.us.us %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1 %exitcond176.not = icmp eq i64 %indvars.iv.next173, %wide.trip.count175 br i1 %exitcond176.not, label %for.cond74.preheader.preheader, label %for.cond40.preheader.us.us, !llvm.loop !18 for.body19: ; preds = %for.cond16.preheader, %for.body19 %indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.body19 ], [ 0, %for.cond16.preheader ] %arrayidx23 = getelementptr inbounds [100 x [100 x i32]], ptr %table_b, i64 0, i64 %indvars.iv161, i64 %indvars.iv158 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx23, ptr noundef nonnull %c) %27 = load i8, ptr %c, align 1, !tbaa !9 %cmp26 = icmp ne i8 %27, 10 %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %28 = load i32, ptr %l, align 4 %29 = sext i32 %28 to i64 %cmp17 = icmp slt i64 %indvars.iv.next159, %29 %or.cond148 = select i1 %cmp26, i1 %cmp17, i1 false br i1 %or.cond148, label %for.body19, label %for.inc33.loopexit, !llvm.loop !19 for.inc33.loopexit: ; preds = %for.body19 %.pre185 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc33 for.inc33: ; preds = %for.inc33.loopexit, %for.cond16.preheader %30 = phi i32 [ %.pre185, %for.inc33.loopexit ], [ %14, %for.cond16.preheader ] %31 = phi i32 [ %28, %for.inc33.loopexit ], [ %15, %for.cond16.preheader ] %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %32 = sext i32 %30 to i64 %cmp13 = icmp slt i64 %indvars.iv.next162, %32 br i1 %cmp13, label %for.cond16.preheader, label %for.cond36.preheader.loopexit, !llvm.loop !20 for.cond74.preheader: ; preds = %for.cond74.preheader.preheader, %for.end90 %indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.end90 ], [ 0, %for.cond74.preheader.preheader ] %33 = load i32, ptr %l, align 4, !tbaa !5 %cmp75144 = icmp sgt i32 %33, 0 br i1 %cmp75144, label %if.end82.peel, label %for.end90 if.end82.peel: ; preds = %for.cond74.preheader %arrayidx86.peel = getelementptr inbounds [100 x [100 x i64]], ptr %table_c, i64 0, i64 %indvars.iv181, i64 0 %34 = load i64, ptr %arrayidx86.peel, align 16, !tbaa !14 %call87.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %34) %35 = load i32, ptr %l, align 4, !tbaa !5 %cmp75.peel = icmp sgt i32 %35, 1 br i1 %cmp75.peel, label %if.end82, label %for.end90 if.end82: ; preds = %if.end82.peel, %if.end82 %indvars.iv177 = phi i64 [ %indvars.iv.next178, %if.end82 ], [ 1, %if.end82.peel ] %putchar123 = call i32 @putchar(i32 32) %arrayidx86 = getelementptr inbounds [100 x [100 x i64]], ptr %table_c, i64 0, i64 %indvars.iv181, i64 %indvars.iv177 %36 = load i64, ptr %arrayidx86, align 8, !tbaa !14 %call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %36) %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1 %37 = load i32, ptr %l, align 4, !tbaa !5 %38 = sext i32 %37 to i64 %cmp75 = icmp slt i64 %indvars.iv.next178, %38 br i1 %cmp75, label %if.end82, label %for.end90, !llvm.loop !21 for.end90: ; preds = %if.end82, %if.end82.peel, %for.cond74.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1 %39 = load i32, ptr %n, align 4, !tbaa !5 %40 = sext i32 %39 to i64 %cmp71 = icmp slt i64 %indvars.iv.next182, %40 br i1 %cmp71, label %for.cond74.preheader, label %for.end94, !llvm.loop !23 for.end94: ; preds = %for.end90, %for.cond36.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %table_c) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %table_b) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %table_a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"} !14 = !{!15, !15, i64 0} !15 = !{!"long", !7, i64 0} !16 = distinct !{!16, !11} !17 = distinct !{!17, !11} !18 = distinct !{!18, !11} !19 = distinct !{!19, !11} !20 = distinct !{!20, !11, !13} !21 = distinct !{!21, !11, !22} !22 = !{!"llvm.loop.peeled.count", i32 1} !23 = distinct !{!23, !11}
#include<stdio.h> int main(void) { int a[100][100] = {0}; int b[100][100] = {0}; int i,l,j,n,m,k; long c; scanf("%d %d %d",&n,&m,&l); for(i=0;i < n;i++){ for(j = 0;j < m;j++){ scanf("%d",&a[i][j]); } } for(i=0;i < m;i++){ for(j = 0;j < l;j++){ scanf("%d",&b[i][j]); } } for(i=0;i < n;i++){ for(j = 0;j < l;j++){ c = 0; for(k = 0;k < m;k++){ c+= a[i][k] * b[k][j]; } printf("%ld",c); if(j < l-1){ putchar(' '); } else{ putchar('\n'); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156344/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 %l = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %a, i8 0, i64 40000, i1 false) 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) %b, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #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 %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre117, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre117, %for.cond1.preheader.lr.ph ] %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp280 = icmp sgt i32 %3, 0 br i1 %cmp280, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre117, %entry ], [ %11, %for.inc7 ] %cmp1186 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1186, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv99, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next100, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1484 = icmp sgt i32 %14, 0 br i1 %cmp1484, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre119 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre119, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2893 = icmp sgt i32 %15, 0 br i1 %cmp2893, label %for.cond30.preheader.lr.ph, label %for.end57 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond30.preheader, label %for.end57 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv105, i64 %indvars.iv102 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %19 = load i32, ptr %l, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next103, %20 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre118 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %21 = phi i32 [ %.pre118, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %23 = sext i32 %21 to i64 %cmp11 = icmp slt i64 %indvars.iv.next106, %23 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc55 %24 = phi i32 [ %39, %for.inc55 ], [ %16, %for.cond30.preheader.lr.ph ] %25 = phi i32 [ %40, %for.inc55 ], [ %17, %for.cond30.preheader.lr.ph ] %indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc55 ], [ 0, %for.cond30.preheader.lr.ph ] %cmp3191 = icmp sgt i32 %25, 0 br i1 %cmp3191, label %for.cond33.preheader, label %for.inc55 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.end46 ], [ 0, %for.cond30.preheader ] %26 = load i32, ptr %m, align 4, !tbaa !5 %cmp3488 = icmp sgt i32 %26, 0 br i1 %cmp3488, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %26 to i64 %xtraiter = and i64 %wide.trip.count, 1 %27 = icmp eq i32 %26, 1 br i1 %27, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv108 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next109.1, %for.body35 ] %c.090 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv108 %28 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv108, i64 %indvars.iv111 %29 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %29, %28 %conv = sext i32 %mul to i64 %add = add nsw i64 %c.090, %conv %indvars.iv.next109 = or i64 %indvars.iv108, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv.next109 %30 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next109, i64 %indvars.iv111 %31 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %31, %30 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv108.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next109.1, %for.body35 ] %c.090.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv108.unr %32 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv108.unr, i64 %indvars.iv111 %33 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %33, %32 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %c.090.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %c.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %c.0.lcssa) %34 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %34, -1 %35 = sext i32 %sub to i64 %cmp48 = icmp slt i64 %indvars.iv111, %35 %36 = load ptr, ptr @stdout, align 8, !tbaa !16 %. = select i1 %cmp48, i32 32, i32 10 %call.i = call i32 @putc(i32 noundef %., ptr noundef %36) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %37 = load i32, ptr %l, align 4, !tbaa !5 %38 = sext i32 %37 to i64 %cmp31 = icmp slt i64 %indvars.iv.next112, %38 br i1 %cmp31, label %for.cond33.preheader, label %for.inc55.loopexit, !llvm.loop !18 for.inc55.loopexit: ; preds = %for.end46 %.pre120 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc55 for.inc55: ; preds = %for.inc55.loopexit, %for.cond30.preheader %39 = phi i32 [ %.pre120, %for.inc55.loopexit ], [ %24, %for.cond30.preheader ] %40 = phi i32 [ %37, %for.inc55.loopexit ], [ %25, %for.cond30.preheader ] %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %41 = sext i32 %39 to i64 %cmp28 = icmp slt i64 %indvars.iv.next115, %41 br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !19 for.end57: ; preds = %for.inc55, %for.cond30.preheader.lr.ph, %for.cond27.preheader 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 %l) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture 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 = { 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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = !{!17, !17, i64 0} !17 = !{!"any pointer", !7, i64 0} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !12}
#include <stdio.h> int main(void) { int n, m, l; long a[100][100] = {0}; long b[100][100] = {0}; long c[100][100] = {0}; int i, j, k; scanf("%d %d %d", &n, &m, &l); for(i = 0; i < n; i++) for (j = 0; j < m; j++) scanf("%ld", &a[i][j]); for(i = 0; i < m; i++) for (j = 0; j < l; j++) scanf("%ld", &b[i][j]); for(i = 0; i < n; i++) { for(j = 0; j < l; j++) { for (k = 0; k < m; k++) { c[i][j] += a[i][k] * b[k][j]; } } } for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { printf("%ld", c[i][j]); if (j != l - 1) printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156388/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156388/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\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 %l = alloca i32, align 4 %a = alloca [100 x [100 x i64]], align 16 %b = alloca [100 x [100 x i64]], align 16 %c = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %a, i8 0, i64 80000, i1 false) call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %b, i8 0, i64 80000, i1 false) call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %c, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp108 = icmp sgt i32 %0, 0 %.pre164 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp108, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre164, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre164, %for.cond1.preheader.lr.ph ] %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2106 = icmp sgt i32 %3, 0 br i1 %cmp2106, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre164, %entry ], [ %11, %for.inc7 ] %cmp11112 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond181 = select i1 %cmp11112, i1 %7, i1 false br i1 %or.cond181, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv136, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next137, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %28, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %29, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14110 = icmp sgt i32 %14, 0 br i1 %cmp14110, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre166 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre166, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %28, %for.cond27.preheader.loopexit ] %cmp28118 = icmp sgt i32 %15, 0 br i1 %cmp28118, label %for.cond30.preheader.lr.ph, label %for.end76 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %.lcssa171 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre164, %for.cond1.preheader.lr.ph ] %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %cmp31116 = icmp sgt i32 %17, 0 %cmp34114 = icmp sgt i32 %.lcssa171, 0 %or.cond = select i1 %cmp31116, i1 %cmp34114, i1 false br i1 %or.cond, label %for.cond30.preheader.us.us.preheader, label %for.cond60.preheader.preheader for.cond60.preheader.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph br label %for.cond60.preheader for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph %wide.trip.count156 = zext i32 %16 to i64 %wide.trip.count151 = zext i32 %17 to i64 %wide.trip.count = zext i32 %.lcssa171 to i64 %xtraiter = and i64 %wide.trip.count, 1 %18 = icmp eq i32 %.lcssa171, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv153 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next154, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx47.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv153, i64 %indvars.iv148 %arrayidx47.promoted.us.us.us = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 br i1 %18, label %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.cond33.preheader.us.us.us, %for.body35.us.us.us %indvars.iv145 = phi i64 [ %indvars.iv.next146.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ] %19 = phi i64 [ %add.us.us.us.1, %for.body35.us.us.us ], [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ] %niter = phi i64 [ %niter.next.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv145 %20 = load i64, ptr %arrayidx39.us.us.us, align 16, !tbaa !13 %arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv145, i64 %indvars.iv148 %21 = load i64, ptr %arrayidx43.us.us.us, align 8, !tbaa !13 %mul.us.us.us = mul nsw i64 %21, %20 %add.us.us.us = add nsw i64 %19, %mul.us.us.us %indvars.iv.next146 = or i64 %indvars.iv145, 1 %arrayidx39.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv.next146 %22 = load i64, ptr %arrayidx39.us.us.us.1, align 8, !tbaa !13 %arrayidx43.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv.next146, i64 %indvars.iv148 %23 = load i64, ptr %arrayidx43.us.us.us.1, align 8, !tbaa !13 %mul.us.us.us.1 = mul nsw i64 %23, %22 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %mul.us.us.us.1 %indvars.iv.next146.1 = add nuw nsw i64 %indvars.iv145, 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.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us, !llvm.loop !15 for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body35.us.us.us, %for.cond33.preheader.us.us.us %add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ] %indvars.iv145.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next146.1, %for.body35.us.us.us ] %.unr = phi i64 [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ] br i1 %lcmp.mod.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.epil for.body35.us.us.us.epil: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa %arrayidx39.us.us.us.epil = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv153, i64 %indvars.iv145.unr %24 = load i64, ptr %arrayidx39.us.us.us.epil, align 8, !tbaa !13 %arrayidx43.us.us.us.epil = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv145.unr, i64 %indvars.iv148 %25 = load i64, ptr %arrayidx43.us.us.us.epil, align 8, !tbaa !13 %mul.us.us.us.epil = mul nsw i64 %25, %24 %add.us.us.us.epil = add nsw i64 %.unr, %mul.us.us.us.epil br label %for.cond33.for.inc51_crit_edge.us.us.us for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, %for.body35.us.us.us.epil %add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body35.us.us.us.epil ] store i64 %add.us.us.us.lcssa, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151 br i1 %exitcond152.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !16 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.cond60.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !17 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv139 = phi i64 [ %indvars.iv.next140, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv142, i64 %indvars.iv139 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1 %26 = load i32, ptr %l, align 4, !tbaa !5 %27 = sext i32 %26 to i64 %cmp14 = icmp slt i64 %indvars.iv.next140, %27 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18 for.inc24.loopexit: ; preds = %for.body15 %.pre165 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %28 = phi i32 [ %.pre165, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %29 = phi i32 [ %26, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %30 = sext i32 %28 to i64 %cmp11 = icmp slt i64 %indvars.iv.next143, %30 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !19 for.cond60.preheader: ; preds = %for.cond60.preheader.preheader, %for.end72 %indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.end72 ], [ 0, %for.cond60.preheader.preheader ] %31 = load i32, ptr %l, align 4, !tbaa !5 %cmp61126 = icmp sgt i32 %31, 0 br i1 %cmp61126, label %for.body62, label %for.end72 for.body62: ; preds = %for.cond60.preheader, %for.inc70 %indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.inc70 ], [ 0, %for.cond60.preheader ] %arrayidx66 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv161, i64 %indvars.iv158 %32 = load i64, ptr %arrayidx66, align 8, !tbaa !13 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %32) %33 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %33, -1 %34 = zext i32 %sub to i64 %cmp68.not = icmp eq i64 %indvars.iv158, %34 br i1 %cmp68.not, label %for.inc70, label %if.then if.then: ; preds = %for.body62 %putchar105 = call i32 @putchar(i32 32) %.pre167 = load i32, ptr %l, align 4, !tbaa !5 br label %for.inc70 for.inc70: ; preds = %for.body62, %if.then %35 = phi i32 [ %33, %for.body62 ], [ %.pre167, %if.then ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %36 = sext i32 %35 to i64 %cmp61 = icmp slt i64 %indvars.iv.next159, %36 br i1 %cmp61, label %for.body62, label %for.end72, !llvm.loop !20 for.end72: ; preds = %for.inc70, %for.cond60.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %37 = load i32, ptr %n, align 4, !tbaa !5 %38 = sext i32 %37 to i64 %cmp58 = icmp slt i64 %indvars.iv.next162, %38 br i1 %cmp58, label %for.cond60.preheader, label %for.end76, !llvm.loop !21 for.end76: ; preds = %for.end72, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long", !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !12} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10}
#include <stdio.h> int main() { int n,m,l; int i,j,k; int box1[100][100]={{0}}; int box2[100][100]={{0}}; long box3[100][100]={{0}}; scanf("%d%d%d",&n,&m,&l); for(i=0; i<n; i++) { for(j=0; j<m; j++) { scanf("%d",&box1[i][j]); } } for(i=0; i<m; i++) { for(j=0; j<l; j++) { scanf("%d",&box2[i][j]); } } for(i=0; i<n; i++) { for(j=0; j<l; j++) { for(k=0; k<m; k++) { box3[i][j] += box1[i][k]*box2[k][j]; } } } for(i=0; i<n; i++) { for(j=0; j<l; j++) { printf("%ld",box3[i][j]); if(j == l-1) printf("\n"); else printf(" "); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156430/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156430/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\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 %l = alloca i32, align 4 %box1 = alloca [100 x [100 x i32]], align 16 %box2 = alloca [100 x [100 x i32]], align 16 %box3 = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %box1) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %box1, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %box2) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %box2, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %box3) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %box3, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp111 = icmp sgt i32 %0, 0 %.pre168 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp111, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre168, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre168, %for.cond1.preheader.lr.ph ] %indvars.iv140 = phi i64 [ %indvars.iv.next141, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2109 = icmp sgt i32 %3, 0 br i1 %cmp2109, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre168, %entry ], [ %11, %for.inc7 ] %cmp11115 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond186 = select i1 %cmp11115, i1 %7, i1 false br i1 %or.cond186, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %box1, i64 0, i64 %indvars.iv140, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next141, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %28, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %29, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv146 = phi i64 [ %indvars.iv.next147, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14113 = icmp sgt i32 %14, 0 br i1 %cmp14113, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre170 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre170, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %28, %for.cond27.preheader.loopexit ] %cmp28121 = icmp sgt i32 %15, 0 br i1 %cmp28121, label %for.cond30.preheader.lr.ph, label %for.end79 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %.lcssa175 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre168, %for.cond1.preheader.lr.ph ] %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %cmp31119 = icmp sgt i32 %17, 0 %cmp34117 = icmp sgt i32 %.lcssa175, 0 %or.cond = select i1 %cmp31119, i1 %cmp34117, i1 false br i1 %or.cond, label %for.cond30.preheader.us.us.preheader, label %for.cond57.preheader for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph %wide.trip.count160 = zext i32 %16 to i64 %wide.trip.count155 = zext i32 %17 to i64 %wide.trip.count = zext i32 %.lcssa175 to i64 %xtraiter = and i64 %wide.trip.count, 1 %18 = icmp eq i32 %.lcssa175, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv157 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next158, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx47.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %box3, i64 0, i64 %indvars.iv157, i64 %indvars.iv152 %arrayidx47.promoted.us.us.us = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 br i1 %18, label %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.cond33.preheader.us.us.us, %for.body35.us.us.us %indvars.iv149 = phi i64 [ %indvars.iv.next150.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ] %19 = phi i64 [ %add.us.us.us.1, %for.body35.us.us.us ], [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ] %niter = phi i64 [ %niter.next.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %box1, i64 0, i64 %indvars.iv157, i64 %indvars.iv149 %20 = load i32, ptr %arrayidx39.us.us.us, align 8, !tbaa !5 %arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %box2, i64 0, i64 %indvars.iv149, i64 %indvars.iv152 %21 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %21, %20 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %add.us.us.us = add nsw i64 %19, %conv.us.us.us %indvars.iv.next150 = or i64 %indvars.iv149, 1 %arrayidx39.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %box1, i64 0, i64 %indvars.iv157, i64 %indvars.iv.next150 %22 = load i32, ptr %arrayidx39.us.us.us.1, align 4, !tbaa !5 %arrayidx43.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %box2, i64 0, i64 %indvars.iv.next150, i64 %indvars.iv152 %23 = load i32, ptr %arrayidx43.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.1 = mul nsw i32 %23, %22 %conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1 %indvars.iv.next150.1 = add nuw nsw i64 %indvars.iv149, 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.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us, !llvm.loop !15 for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body35.us.us.us, %for.cond33.preheader.us.us.us %add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ] %indvars.iv149.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next150.1, %for.body35.us.us.us ] %.unr = phi i64 [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ] br i1 %lcmp.mod.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.epil for.body35.us.us.us.epil: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa %arrayidx39.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %box1, i64 0, i64 %indvars.iv157, i64 %indvars.iv149.unr %24 = load i32, ptr %arrayidx39.us.us.us.epil, align 4, !tbaa !5 %arrayidx43.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %box2, i64 0, i64 %indvars.iv149.unr, i64 %indvars.iv152 %25 = load i32, ptr %arrayidx43.us.us.us.epil, align 4, !tbaa !5 %mul.us.us.us.epil = mul nsw i32 %25, %24 %conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64 %add.us.us.us.epil = add nsw i64 %.unr, %conv.us.us.us.epil br label %for.cond33.for.inc51_crit_edge.us.us.us for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, %for.body35.us.us.us.epil %add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body35.us.us.us.epil ] store i64 %add.us.us.us.lcssa, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond156.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count155 br i1 %exitcond156.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !16 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1 %exitcond161.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count160 br i1 %exitcond161.not, label %for.cond57.preheader, label %for.cond30.preheader.us.us, !llvm.loop !17 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv143 = phi i64 [ %indvars.iv.next144, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %box2, i64 0, i64 %indvars.iv146, i64 %indvars.iv143 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1 %26 = load i32, ptr %l, align 4, !tbaa !5 %27 = sext i32 %26 to i64 %cmp14 = icmp slt i64 %indvars.iv.next144, %27 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18 for.inc24.loopexit: ; preds = %for.body15 %.pre169 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %28 = phi i32 [ %.pre169, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %29 = phi i32 [ %26, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1 %30 = sext i32 %28 to i64 %cmp11 = icmp slt i64 %indvars.iv.next147, %30 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !19 for.cond57.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph %31 = load i32, ptr %l, align 4 %32 = icmp sgt i32 %31, 0 br i1 %32, label %for.cond61.preheader, label %for.end79 for.cond61.preheader: ; preds = %for.cond57.preheader, %for.inc77 %33 = phi i32 [ %40, %for.inc77 ], [ %16, %for.cond57.preheader ] %34 = phi i32 [ %41, %for.inc77 ], [ %31, %for.cond57.preheader ] %indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.inc77 ], [ 0, %for.cond57.preheader ] %cmp62129 = icmp sgt i32 %34, 0 br i1 %cmp62129, label %for.body64, label %for.inc77 for.body64: ; preds = %for.cond61.preheader, %for.body64 %indvars.iv162 = phi i64 [ %indvars.iv.next163, %for.body64 ], [ 0, %for.cond61.preheader ] %arrayidx68 = getelementptr inbounds [100 x [100 x i64]], ptr %box3, i64 0, i64 %indvars.iv165, i64 %indvars.iv162 %35 = load i64, ptr %arrayidx68, align 8, !tbaa !13 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %35) %36 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %36, -1 %37 = zext i32 %sub to i64 %cmp70 = icmp eq i64 %indvars.iv162, %37 %. = select i1 %cmp70, i32 10, i32 32 %putchar108 = call i32 @putchar(i32 %.) %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1 %38 = load i32, ptr %l, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp62 = icmp slt i64 %indvars.iv.next163, %39 br i1 %cmp62, label %for.body64, label %for.inc77.loopexit, !llvm.loop !20 for.inc77.loopexit: ; preds = %for.body64 %.pre171 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc77 for.inc77: ; preds = %for.inc77.loopexit, %for.cond61.preheader %40 = phi i32 [ %.pre171, %for.inc77.loopexit ], [ %33, %for.cond61.preheader ] %41 = phi i32 [ %38, %for.inc77.loopexit ], [ %34, %for.cond61.preheader ] %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %42 = sext i32 %40 to i64 %cmp58 = icmp slt i64 %indvars.iv.next166, %42 br i1 %cmp58, label %for.cond61.preheader, label %for.end79, !llvm.loop !21 for.end79: ; preds = %for.inc77, %for.cond27.preheader, %for.cond57.preheader call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %box3) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %box2) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %box1) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long", !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !12} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !12}
#include<stdio.h> int main(){ int n,i; long long a,b; scanf("%d%lld%lld",&n,&a,&b); long long x[n+1]; for(i=0;i<n;i++) scanf("%lld",&x[i]); long long count=0; for(i=1;i<n;i++){ if((x[i]-x[i-1])*a>b) count+=b; else count+=a*(x[i]-x[i-1]); } printf("%lld\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156481/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156481/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%d%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp34 = icmp sgt i32 %3, 0 br i1 %cmp34, label %for.body, label %for.end22 for.cond2.preheader: ; preds = %for.body %cmp336 = icmp sgt i32 %8, 1 br i1 %cmp336, label %for.body4.lr.ph, label %for.end22 for.body4.lr.ph: ; preds = %for.cond2.preheader %4 = load i64, ptr %a, align 8, !tbaa !9 %5 = load i64, ptr %b, align 8, !tbaa !9 %wide.trip.count = zext i32 %8 to i64 %.pre = load i64, ptr %vla, align 16, !tbaa !9 %6 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %6, 1 %7 = icmp eq i32 %8, 2 br i1 %7, label %for.end22.loopexit.unr-lcssa, label %for.body4.lr.ph.new for.body4.lr.ph.new: ; preds = %for.body4.lr.ph %unroll_iter = and i64 %6, -2 %invariant.gep = getelementptr i64, ptr %vla, i64 1 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11 for.body4: ; preds = %for.body4, %for.body4.lr.ph.new %10 = phi i64 [ %.pre, %for.body4.lr.ph.new ], [ %12, %for.body4 ] %indvars.iv42 = phi i64 [ 1, %for.body4.lr.ph.new ], [ %indvars.iv.next43.1, %for.body4 ] %count.038 = phi i64 [ 0, %for.body4.lr.ph.new ], [ %count.1.1, %for.body4 ] %niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.1, %for.body4 ] %arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv42 %11 = load i64, ptr %arrayidx6, align 8, !tbaa !9 %sub9 = sub nsw i64 %11, %10 %mul = mul nsw i64 %sub9, %4 %.mul = call i64 @llvm.smin.i64(i64 %mul, i64 %5) %count.1 = add nsw i64 %.mul, %count.038 %gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv42 %12 = load i64, ptr %gep, align 8, !tbaa !9 %sub9.1 = sub nsw i64 %12, %11 %mul.1 = mul nsw i64 %sub9.1, %4 %.mul.1 = call i64 @llvm.smin.i64(i64 %mul.1, i64 %5) %count.1.1 = add nsw i64 %.mul.1, %count.1 %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 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.end22.loopexit.unr-lcssa, label %for.body4, !llvm.loop !13 for.end22.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.lr.ph %count.1.lcssa.ph = phi i64 [ undef, %for.body4.lr.ph ], [ %count.1.1, %for.body4 ] %.unr = phi i64 [ %.pre, %for.body4.lr.ph ], [ %12, %for.body4 ] %indvars.iv42.unr = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next43.1, %for.body4 ] %count.038.unr = phi i64 [ 0, %for.body4.lr.ph ], [ %count.1.1, %for.body4 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end22, label %for.body4.epil for.body4.epil: ; preds = %for.end22.loopexit.unr-lcssa %arrayidx6.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv42.unr %13 = load i64, ptr %arrayidx6.epil, align 8, !tbaa !9 %sub9.epil = sub nsw i64 %13, %.unr %mul.epil = mul nsw i64 %sub9.epil, %4 %.mul.epil = call i64 @llvm.smin.i64(i64 %mul.epil, i64 %5) %count.1.epil = add nsw i64 %.mul.epil, %count.038.unr br label %for.end22 for.end22: ; preds = %for.body4.epil, %for.end22.loopexit.unr-lcssa, %entry, %for.cond2.preheader %count.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %count.1.epil, %for.body4.epil ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
//Twelvefold way[syazou 12-sou] //https://onlinejudge.u-aizu.ac.jp/problems/DPL_5_A //https://qiita.com/drken/items/f2ea4b58b0d21621bd51 //https://mathtrain.jp/twelveway #include<stdio.h> #define mod 1000000007 #define faclim 1048576 #define partition_nlim 1024 #define partition_klim 1024 long long power(long long a,long long b){ long long x=1,y=a; while(b>0){ if(b&1ll){ x=(x*y)%mod; } y=(y*y)%mod; b>>=1; } return x%mod; } long long modular_inverse(long long n){ return power(n,mod-2); } long long factorial[faclim]; long long invfact[faclim]; long long bce[faclim]; void cfact(){ long long i; factorial[0]=1; factorial[1]=1; for(i=2;i<faclim;i++){ factorial[i]=factorial[i-1]*i; factorial[i]%=mod; } invfact[faclim-1]=modular_inverse(factorial[faclim-1]); for(i=faclim-2;i>=0;i--){ invfact[i]=invfact[i+1]*(i+1); invfact[i]%=mod; } for(i=0;i<faclim;i++){ if(i%2==1){bce[i]=mod-1;} else{bce[i]=1;} bce[i]*=invfact[i]; bce[i]%=mod; if(i!=0){ bce[i]+=bce[i-1]; if(bce[i]>=mod){bce[i]-=mod;} } } } long long calcnCr(long long n,long long k){ if(k<0 || n<k){return 0;} return (factorial[n]*((invfact[k]*invfact[n-k])%mod))%mod; } long long partition[partition_nlim][partition_klim]; long long partition_isinit=0; void partition_init(){ if(partition_isinit==1){return;} partition_isinit=1; long long i,j; for(i=0;i<partition_nlim;i++){ for(j=0;j<partition_klim;j++){ partition[i][j]=-1; } } } long long partition_rep(long long n,long long k){ if(n<0 || k<0){return 0;} if(n==0){return 1;} if(k==0){ if(n==0){return 1;} else{return 0;} } if(partition[n][k]!=-1){return partition[n][k];} partition[n][k]=(partition_rep(n,k-1)+partition_rep(n-k,k))%mod; return partition[n][k]; } // packing n balls using k boxes // | distinguish | each boxes contains the balls limited | // | balls | boxes | no limits | at most 1 | at least 1 | // | can | can | 1 | 2 | 3 | // | can't | can | 4 | 5 | 6 | // | can | can't | 7 | 8 | 9 | // | can't | can't | 10 | 11 | 12 | long long twelvefold_way(long long n,long long k,long long type){ long long i,r=0,dt; switch(type){ case 1: return power(k,n); break; case 2: if(k<n){return 0;} return (factorial[k]*invfact[k-n])%mod; break; case 3: if(n<k){return 0;} for(i=0;i<=k;i++){ dt=(calcnCr(k,i)*power(i,n))%mod; if((k-i)%2==1){r+=(mod-dt);} else{r+=dt;} if(r>=mod){r-=mod;} } return r; break; case 4: return calcnCr(n+k-1,n); break; case 5: if(k<n){return 0;} return calcnCr(k,n); break; case 6: if(n<k){return 0;} return calcnCr(n-1,k-1); break; case 7: for(i=0;i<=k;i++){ dt=(power(i,n)*invfact[i])%mod; r+=dt*bce[k-i]; r%=mod; } return r; case 8: if(k<n){return 0;} return 1; break; case 9: if(n<k){return 0;} for(i=0;i<=k;i++){ dt=(calcnCr(k,i)*power(i,n))%mod; if((k-i)%2==1){r+=(mod-dt);} else{r+=dt;} if(r>=mod){r-=mod;} } r*=invfact[k];r%=mod; return r; break; case 10: partition_init(); return partition_rep(n,k); break; case 11: if(k<n){return 0;} return 1; break; case 12: if(n<k){return 0;} partition_init(); return partition_rep(n-k,k); break; } } int main(){ cfact(); long long n,k; scanf("%lld%lld",&n,&k); printf("%lld\n",twelvefold_way(n,k,1)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156524/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @factorial = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 @invfact = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 @bce = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 @partition_isinit = dso_local local_unnamed_addr global i64 0, align 8 @partition = dso_local local_unnamed_addr global [1024 x [1024 x i64]] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @power(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp9 = icmp sgt i64 %b, 0 br i1 %cmp9, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %y.012 = phi i64 [ %rem2, %if.end ], [ %a, %entry ] %x.011 = phi i64 [ %x.1, %if.end ], [ 1, %entry ] %b.addr.010 = phi i64 [ %shr, %if.end ], [ %b, %entry ] %and = and i64 %b.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 %y.012, %x.011 %rem = srem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %x.1 = phi i64 [ %rem, %if.then ], [ %x.011, %while.body ] %mul1 = mul nsw i64 %y.012, %y.012 %rem2 = urem i64 %mul1, 1000000007 %shr = lshr i64 %b.addr.010, 1 %cmp.not = icmp ult i64 %b.addr.010, 2 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !5 while.end.loopexit: ; preds = %if.end %0 = srem i64 %x.1, 1000000007 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %x.0.lcssa = phi i64 [ 1, %entry ], [ %0, %while.end.loopexit ] ret i64 %x.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 i64 @modular_inverse(i64 noundef %n) local_unnamed_addr #0 { entry: br label %while.body.i while.body.i: ; preds = %if.end.i, %entry %y.012.i = phi i64 [ %rem2.i, %if.end.i ], [ %n, %entry ] %x.011.i = phi i64 [ %x.1.i, %if.end.i ], [ 1, %entry ] %b.addr.010.i = phi i64 [ %shr.i, %if.end.i ], [ 1000000005, %entry ] %and.i = and i64 %b.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 %x.011.i, %y.012.i %rem.i = srem i64 %mul.i, 1000000007 br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %x.1.i = phi i64 [ %rem.i, %if.then.i ], [ %x.011.i, %while.body.i ] %mul1.i = mul nsw i64 %y.012.i, %y.012.i %rem2.i = urem i64 %mul1.i, 1000000007 %shr.i = lshr i64 %b.addr.010.i, 1 %cmp.not.i = icmp ult i64 %b.addr.010.i, 2 br i1 %cmp.not.i, label %power.exit, label %while.body.i, !llvm.loop !5 power.exit: ; preds = %if.end.i %0 = srem i64 %x.1.i, 1000000007 ret i64 %0 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @cfact() local_unnamed_addr #2 { entry: store i64 1, ptr @factorial, align 16, !tbaa !7 store i64 1, ptr getelementptr inbounds ([1048576 x i64], ptr @factorial, i64 0, i64 1), align 8, !tbaa !7 br label %for.body for.body: ; preds = %for.body, %entry %0 = phi i64 [ 1, %entry ], [ %rem.1, %for.body ] %i.066 = phi i64 [ 2, %entry ], [ %inc.1, %for.body ] %mul = mul nsw i64 %0, %i.066 %arrayidx1 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %i.066 %rem = srem i64 %mul, 1000000007 store i64 %rem, ptr %arrayidx1, align 16, !tbaa !7 %inc = or i64 %i.066, 1 %mul.1 = mul nsw i64 %rem, %inc %arrayidx1.1 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %inc %rem.1 = srem i64 %mul.1, 1000000007 store i64 %rem.1, ptr %arrayidx1.1, align 8, !tbaa !7 %inc.1 = add nuw nsw i64 %i.066, 2 %exitcond.not.1 = icmp eq i64 %inc.1, 1048576 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body %1 = load i64, ptr getelementptr inbounds ([1048576 x i64], ptr @factorial, i64 0, i64 1048575), align 8, !tbaa !7 br label %while.body.i.i while.body.i.i: ; preds = %if.end.i.i, %for.end %y.012.i.i = phi i64 [ %rem2.i.i, %if.end.i.i ], [ %1, %for.end ] %x.011.i.i = phi i64 [ %x.1.i.i, %if.end.i.i ], [ 1, %for.end ] %b.addr.010.i.i = phi i64 [ %shr.i.i, %if.end.i.i ], [ 1000000005, %for.end ] %and.i.i = and i64 %b.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 %x.011.i.i, %y.012.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 %x.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %x.011.i.i, %while.body.i.i ] %mul1.i.i = mul nsw i64 %y.012.i.i, %y.012.i.i %rem2.i.i = urem i64 %mul1.i.i, 1000000007 %shr.i.i = lshr i64 %b.addr.010.i.i, 1 %cmp.not.i.i = icmp ult i64 %b.addr.010.i.i, 2 br i1 %cmp.not.i.i, label %modular_inverse.exit, label %while.body.i.i, !llvm.loop !5 modular_inverse.exit: ; preds = %if.end.i.i %2 = srem i64 %x.1.i.i, 1000000007 store i64 %2, ptr getelementptr inbounds ([1048576 x i64], ptr @invfact, i64 0, i64 1048575), align 8, !tbaa !7 br label %for.body5 for.body5: ; preds = %for.body5.1, %modular_inverse.exit %3 = phi i64 [ %2, %modular_inverse.exit ], [ %rem11.1, %for.body5.1 ] %i.167 = phi i64 [ 1048574, %modular_inverse.exit ], [ %dec.1, %for.body5.1 ] %add = or i64 %i.167, 1 %mul8 = mul nsw i64 %3, %add %arrayidx9 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.167 %rem11 = srem i64 %mul8, 1000000007 store i64 %rem11, ptr %arrayidx9, align 16, !tbaa !7 %cmp4.not = icmp eq i64 %i.167, 0 br i1 %cmp4.not, label %for.body16.peel.next, label %for.body5.1, !llvm.loop !12 for.body5.1: ; preds = %for.body5 %dec = add nsw i64 %i.167, -1 %mul8.1 = mul nsw i64 %rem11, %i.167 %arrayidx9.1 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %dec %rem11.1 = srem i64 %mul8.1, 1000000007 store i64 %rem11.1, ptr %arrayidx9.1, align 8, !tbaa !7 %dec.1 = add nsw i64 %i.167, -2 br label %for.body5 for.body16.peel.next: ; preds = %for.body5 %4 = load i64, ptr @invfact, align 16, !tbaa !7 %rem25.peel = srem i64 %4, 1000000007 store i64 %rem25.peel, ptr @bce, align 16, !tbaa !7 br label %for.body16 for.body16: ; preds = %for.body16.peel.next, %for.body16 %5 = phi i64 [ %8, %for.body16 ], [ %rem25.peel, %for.body16.peel.next ] %i.268 = phi i64 [ %inc40, %for.body16 ], [ 1, %for.body16.peel.next ] %rem17 = and i64 %i.268, 1 %cmp18.not = icmp eq i64 %rem17, 0 %spec.select = select i1 %cmp18.not, i64 1, i64 1000000006 %6 = getelementptr inbounds [1048576 x i64], ptr @bce, i64 0, i64 %i.268 %arrayidx21 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.268 %7 = load i64, ptr %arrayidx21, align 8, !tbaa !7 %mul23 = mul nsw i64 %spec.select, %7 %rem25 = srem i64 %mul23, 1000000007 %add31 = add nsw i64 %5, %rem25 %cmp33 = icmp sgt i64 %add31, 1000000006 %sub36 = add nsw i64 %add31, -1000000007 %8 = select i1 %cmp33, i64 %sub36, i64 %add31 store i64 %8, ptr %6, align 8, !tbaa !7 %inc40 = add nuw nsw i64 %i.268, 1 %exitcond69.not = icmp eq i64 %inc40, 1048576 br i1 %exitcond69.not, label %for.end41, label %for.body16, !llvm.loop !13 for.end41: ; preds = %for.body16 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @calcnCr(i64 noundef %n, i64 noundef %k) local_unnamed_addr #3 { entry: %cmp = icmp slt i64 %k, 0 %cmp1 = icmp slt i64 %n, %k %or.cond = or i1 %cmp, %cmp1 br i1 %or.cond, label %return, label %if.end if.end: ; preds = %entry %arrayidx = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %n %0 = load i64, ptr %arrayidx, align 8, !tbaa !7 %arrayidx2 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %k %1 = load i64, ptr %arrayidx2, align 8, !tbaa !7 %sub = sub nsw i64 %n, %k %arrayidx3 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub %2 = load i64, ptr %arrayidx3, align 8, !tbaa !7 %mul = mul nsw i64 %2, %1 %rem = srem i64 %mul, 1000000007 %mul4 = mul nsw i64 %rem, %0 %rem5 = srem i64 %mul4, 1000000007 br label %return return: ; preds = %entry, %if.end %retval.0 = phi i64 [ %rem5, %if.end ], [ 0, %entry ] ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @partition_init() local_unnamed_addr #4 { entry: %0 = load i64, ptr @partition_isinit, align 8, !tbaa !7 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry store i64 1, ptr @partition_isinit, align 8, !tbaa !7 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8388608) @partition, i8 -1, i64 8388608, i1 false), !tbaa !7 br label %return return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @partition_rep(i64 noundef %n, i64 noundef %k) local_unnamed_addr #5 { entry: %0 = or i64 %k, %n %or.cond.not = icmp sgt i64 %0, -1 br i1 %or.cond.not, label %if.end, label %common.ret38 if.end: ; preds = %entry %cmp2 = icmp eq i64 %n, 0 br i1 %cmp2, label %common.ret38, label %if.end4 if.end4: ; preds = %if.end %cmp5 = icmp eq i64 %k, 0 br i1 %cmp5, label %common.ret38, label %if.end9 if.end9: ; preds = %if.end4 %arrayidx10 = getelementptr inbounds [1024 x [1024 x i64]], ptr @partition, i64 0, i64 %n, i64 %k %1 = load i64, ptr %arrayidx10, align 8, !tbaa !7 %cmp11.not = icmp eq i64 %1, -1 br i1 %cmp11.not, label %if.end15, label %common.ret38 common.ret38: ; preds = %if.end9, %if.end4, %if.end, %entry, %if.end15 %common.ret38.op = phi i64 [ %rem, %if.end15 ], [ 0, %entry ], [ 1, %if.end ], [ 0, %if.end4 ], [ %1, %if.end9 ] ret i64 %common.ret38.op if.end15: ; preds = %if.end9 %sub = add nsw i64 %k, -1 %call = tail call i64 @partition_rep(i64 noundef %n, i64 noundef %sub) %sub16 = sub nsw i64 %n, %k %call17 = tail call i64 @partition_rep(i64 noundef %sub16, i64 noundef %k) %add = add nsw i64 %call17, %call %rem = srem i64 %add, 1000000007 store i64 %rem, ptr %arrayidx10, align 8, !tbaa !7 br label %common.ret38 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @twelvefold_way(i64 noundef %n, i64 noundef %k, i64 noundef %type) local_unnamed_addr #6 { entry: switch i64 %type, label %cleanup [ i64 1, label %sw.bb i64 2, label %sw.bb1 i64 3, label %sw.bb3 i64 4, label %sw.bb23 i64 5, label %sw.bb27 i64 6, label %sw.bb32 i64 7, label %for.cond40.preheader i64 8, label %sw.bb55 i64 9, label %sw.bb59 i64 10, label %sw.bb89 i64 11, label %sw.bb91 i64 12, label %sw.bb95 ] for.cond40.preheader: ; preds = %entry %cmp41.not302 = icmp slt i64 %k, 0 br i1 %cmp41.not302, label %cleanup, label %for.body42.lr.ph for.body42.lr.ph: ; preds = %for.cond40.preheader %cmp9.i242 = icmp sgt i64 %n, 0 br i1 %cmp9.i242, label %for.body42.us, label %for.body42 for.body42.us: ; preds = %for.body42.lr.ph, %while.end.loopexit.i259.us %r.3304.us = phi i64 [ %rem51.us, %while.end.loopexit.i259.us ], [ 0, %for.body42.lr.ph ] %i.1303.us = phi i64 [ %inc53.us, %while.end.loopexit.i259.us ], [ 0, %for.body42.lr.ph ] br label %while.body.i244.us while.body.i244.us: ; preds = %for.body42.us, %if.end.i253.us %y.012.i245.us = phi i64 [ %rem2.i256.us, %if.end.i253.us ], [ %i.1303.us, %for.body42.us ] %x.011.i246.us = phi i64 [ %x.1.i254.us, %if.end.i253.us ], [ 1, %for.body42.us ] %b.addr.010.i247.us = phi i64 [ %shr.i257.us, %if.end.i253.us ], [ %n, %for.body42.us ] %and.i248.us = and i64 %b.addr.010.i247.us, 1 %tobool.not.i249.us = icmp eq i64 %and.i248.us, 0 br i1 %tobool.not.i249.us, label %if.end.i253.us, label %if.then.i250.us if.then.i250.us: ; preds = %while.body.i244.us %mul.i251.us = mul nsw i64 %x.011.i246.us, %y.012.i245.us %rem.i252.us = srem i64 %mul.i251.us, 1000000007 br label %if.end.i253.us if.end.i253.us: ; preds = %if.then.i250.us, %while.body.i244.us %x.1.i254.us = phi i64 [ %rem.i252.us, %if.then.i250.us ], [ %x.011.i246.us, %while.body.i244.us ] %mul1.i255.us = mul nsw i64 %y.012.i245.us, %y.012.i245.us %rem2.i256.us = urem i64 %mul1.i255.us, 1000000007 %shr.i257.us = lshr i64 %b.addr.010.i247.us, 1 %cmp.not.i258.us = icmp ult i64 %b.addr.010.i247.us, 2 br i1 %cmp.not.i258.us, label %while.end.loopexit.i259.us, label %while.body.i244.us, !llvm.loop !5 while.end.loopexit.i259.us: ; preds = %if.end.i253.us %0 = srem i64 %x.1.i254.us, 1000000007 %arrayidx44.us = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.1303.us %1 = load i64, ptr %arrayidx44.us, align 8, !tbaa !7 %mul45.us = mul nsw i64 %1, %0 %rem46.us = srem i64 %mul45.us, 1000000007 %sub47.us = sub nsw i64 %k, %i.1303.us %arrayidx48.us = getelementptr inbounds [1048576 x i64], ptr @bce, i64 0, i64 %sub47.us %2 = load i64, ptr %arrayidx48.us, align 8, !tbaa !7 %mul49.us = mul nsw i64 %rem46.us, %2 %add50.us = add nsw i64 %mul49.us, %r.3304.us %rem51.us = srem i64 %add50.us, 1000000007 %inc53.us = add nuw i64 %i.1303.us, 1 %exitcond314.not = icmp eq i64 %i.1303.us, %k br i1 %exitcond314.not, label %cleanup, label %for.body42.us, !llvm.loop !15 sw.bb: ; preds = %entry %cmp9.i = icmp sgt i64 %n, 0 br i1 %cmp9.i, label %while.body.i, label %cleanup while.body.i: ; preds = %sw.bb, %if.end.i %y.012.i = phi i64 [ %rem2.i, %if.end.i ], [ %k, %sw.bb ] %x.011.i = phi i64 [ %x.1.i, %if.end.i ], [ 1, %sw.bb ] %b.addr.010.i = phi i64 [ %shr.i, %if.end.i ], [ %n, %sw.bb ] %and.i = and i64 %b.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 %x.011.i, %y.012.i %rem.i = srem i64 %mul.i, 1000000007 br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %x.1.i = phi i64 [ %rem.i, %if.then.i ], [ %x.011.i, %while.body.i ] %mul1.i = mul nsw i64 %y.012.i, %y.012.i %rem2.i = urem i64 %mul1.i, 1000000007 %shr.i = lshr i64 %b.addr.010.i, 1 %cmp.not.i = icmp ult i64 %b.addr.010.i, 2 br i1 %cmp.not.i, label %while.end.loopexit.i, label %while.body.i, !llvm.loop !5 while.end.loopexit.i: ; preds = %if.end.i %3 = srem i64 %x.1.i, 1000000007 br label %cleanup sw.bb1: ; preds = %entry %cmp = icmp slt i64 %k, %n br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %sw.bb1 %arrayidx = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %k %4 = load i64, ptr %arrayidx, align 8, !tbaa !7 %sub = sub nsw i64 %k, %n %arrayidx2 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub %5 = load i64, ptr %arrayidx2, align 8, !tbaa !7 %mul = mul nsw i64 %5, %4 %rem = srem i64 %mul, 1000000007 br label %cleanup sw.bb3: ; preds = %entry %cmp4 = icmp slt i64 %n, %k %cmp7.not306 = icmp slt i64 %k, 0 %or.cond310 = or i1 %cmp4, %cmp7.not306 br i1 %or.cond310, label %cleanup, label %calcnCr.exit.lr.ph calcnCr.exit.lr.ph: ; preds = %sw.bb3 %arrayidx.i = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %k %6 = load i64, ptr %arrayidx.i, align 8, !tbaa !7 %cmp9.i183 = icmp sgt i64 %n, 0 br label %calcnCr.exit calcnCr.exit: ; preds = %calcnCr.exit.lr.ph, %power.exit201 %r.0308 = phi i64 [ 0, %calcnCr.exit.lr.ph ], [ %r.2, %power.exit201 ] %i.0307 = phi i64 [ 0, %calcnCr.exit.lr.ph ], [ %inc, %power.exit201 ] %arrayidx2.i = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.0307 %7 = load i64, ptr %arrayidx2.i, align 8, !tbaa !7 %sub.i = sub nsw i64 %k, %i.0307 %arrayidx3.i = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub.i %8 = load i64, ptr %arrayidx3.i, align 8, !tbaa !7 %mul.i181 = mul nsw i64 %8, %7 %rem.i182 = srem i64 %mul.i181, 1000000007 %mul4.i = mul nsw i64 %rem.i182, %6 %rem5.i = srem i64 %mul4.i, 1000000007 br i1 %cmp9.i183, label %while.body.i185, label %power.exit201 while.body.i185: ; preds = %calcnCr.exit, %if.end.i194 %y.012.i186 = phi i64 [ %rem2.i197, %if.end.i194 ], [ %i.0307, %calcnCr.exit ] %x.011.i187 = phi i64 [ %x.1.i195, %if.end.i194 ], [ 1, %calcnCr.exit ] %b.addr.010.i188 = phi i64 [ %shr.i198, %if.end.i194 ], [ %n, %calcnCr.exit ] %and.i189 = and i64 %b.addr.010.i188, 1 %tobool.not.i190 = icmp eq i64 %and.i189, 0 br i1 %tobool.not.i190, label %if.end.i194, label %if.then.i191 if.then.i191: ; preds = %while.body.i185 %mul.i192 = mul nsw i64 %x.011.i187, %y.012.i186 %rem.i193 = srem i64 %mul.i192, 1000000007 br label %if.end.i194 if.end.i194: ; preds = %if.then.i191, %while.body.i185 %x.1.i195 = phi i64 [ %rem.i193, %if.then.i191 ], [ %x.011.i187, %while.body.i185 ] %mul1.i196 = mul nsw i64 %y.012.i186, %y.012.i186 %rem2.i197 = urem i64 %mul1.i196, 1000000007 %shr.i198 = lshr i64 %b.addr.010.i188, 1 %cmp.not.i199 = icmp ult i64 %b.addr.010.i188, 2 br i1 %cmp.not.i199, label %while.end.loopexit.i200, label %while.body.i185, !llvm.loop !5 while.end.loopexit.i200: ; preds = %if.end.i194 %9 = srem i64 %x.1.i195, 1000000007 br label %power.exit201 power.exit201: ; preds = %calcnCr.exit, %while.end.loopexit.i200 %x.0.lcssa.i184 = phi i64 [ 1, %calcnCr.exit ], [ %9, %while.end.loopexit.i200 ] %mul10 = mul nsw i64 %x.0.lcssa.i184, %rem5.i %rem11 = srem i64 %mul10, 1000000007 %10 = and i64 %sub.i, -9223372036854775807 %cmp14 = icmp eq i64 %10, 1 %reass.sub178 = add i64 %r.0308, 1000000007 %add = sub i64 %reass.sub178, %rem11 %add17 = add nsw i64 %rem11, %r.0308 %r.1 = select i1 %cmp14, i64 %add, i64 %add17 %cmp19 = icmp sgt i64 %r.1, 1000000006 %sub21 = add nsw i64 %r.1, -1000000007 %r.2 = select i1 %cmp19, i64 %sub21, i64 %r.1 %inc = add nuw i64 %i.0307, 1 %exitcond315.not = icmp eq i64 %i.0307, %k br i1 %exitcond315.not, label %cleanup, label %calcnCr.exit, !llvm.loop !16 sw.bb23: ; preds = %entry %cmp.i = icmp slt i64 %n, 0 %cmp1.i202 = icmp slt i64 %k, 1 %or.cond.i = or i1 %cmp.i, %cmp1.i202 br i1 %or.cond.i, label %cleanup, label %if.end.i203 if.end.i203: ; preds = %sw.bb23 %add24 = add nsw i64 %n, -1 %sub25 = add i64 %add24, %k %arrayidx.i204 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %sub25 %11 = load i64, ptr %arrayidx.i204, align 8, !tbaa !7 %arrayidx2.i205 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %n %12 = load i64, ptr %arrayidx2.i205, align 8, !tbaa !7 %sub.i206 = sub nsw i64 %sub25, %n %arrayidx3.i207 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub.i206 %13 = load i64, ptr %arrayidx3.i207, align 8, !tbaa !7 %mul.i208 = mul nsw i64 %13, %12 %rem.i209 = srem i64 %mul.i208, 1000000007 %mul4.i210 = mul nsw i64 %rem.i209, %11 %rem5.i211 = srem i64 %mul4.i210, 1000000007 br label %cleanup sw.bb27: ; preds = %entry %cmp28 = icmp slt i64 %k, %n %cmp.i214 = icmp slt i64 %n, 0 %or.cond = or i1 %cmp.i214, %cmp28 br i1 %or.cond, label %cleanup, label %if.end.i217 if.end.i217: ; preds = %sw.bb27 %arrayidx.i218 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %k %14 = load i64, ptr %arrayidx.i218, align 8, !tbaa !7 %arrayidx2.i219 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %n %15 = load i64, ptr %arrayidx2.i219, align 8, !tbaa !7 %sub.i220 = sub nsw i64 %k, %n %arrayidx3.i221 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub.i220 %16 = load i64, ptr %arrayidx3.i221, align 8, !tbaa !7 %mul.i222 = mul nsw i64 %16, %15 %rem.i223 = srem i64 %mul.i222, 1000000007 %mul4.i224 = mul nsw i64 %rem.i223, %14 %rem5.i225 = srem i64 %mul4.i224, 1000000007 br label %cleanup sw.bb32: ; preds = %entry %cmp33 = icmp slt i64 %n, %k %cmp.i228 = icmp slt i64 %k, 1 %or.cond297 = or i1 %cmp33, %cmp.i228 br i1 %or.cond297, label %cleanup, label %if.end.i231 if.end.i231: ; preds = %sw.bb32 %sub37 = add nsw i64 %k, -1 %sub36 = add nsw i64 %n, -1 %arrayidx.i232 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %sub36 %17 = load i64, ptr %arrayidx.i232, align 8, !tbaa !7 %arrayidx2.i233 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub37 %18 = load i64, ptr %arrayidx2.i233, align 8, !tbaa !7 %sub.i234 = sub nsw i64 %sub36, %sub37 %arrayidx3.i235 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub.i234 %19 = load i64, ptr %arrayidx3.i235, align 8, !tbaa !7 %mul.i236 = mul nsw i64 %19, %18 %rem.i237 = srem i64 %mul.i236, 1000000007 %mul4.i238 = mul nsw i64 %rem.i237, %17 %rem5.i239 = srem i64 %mul4.i238, 1000000007 br label %cleanup for.body42: ; preds = %for.body42.lr.ph, %for.body42 %r.3304 = phi i64 [ %rem51, %for.body42 ], [ 0, %for.body42.lr.ph ] %i.1303 = phi i64 [ %inc53, %for.body42 ], [ 0, %for.body42.lr.ph ] %arrayidx44 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.1303 %20 = load i64, ptr %arrayidx44, align 8, !tbaa !7 %rem46 = srem i64 %20, 1000000007 %sub47 = sub nsw i64 %k, %i.1303 %arrayidx48 = getelementptr inbounds [1048576 x i64], ptr @bce, i64 0, i64 %sub47 %21 = load i64, ptr %arrayidx48, align 8, !tbaa !7 %mul49 = mul nsw i64 %rem46, %21 %add50 = add nsw i64 %mul49, %r.3304 %rem51 = srem i64 %add50, 1000000007 %inc53 = add nuw i64 %i.1303, 1 %exitcond313.not = icmp eq i64 %i.1303, %k br i1 %exitcond313.not, label %cleanup, label %for.body42, !llvm.loop !15 sw.bb55: ; preds = %entry %cmp56 = icmp sge i64 %k, %n %. = zext i1 %cmp56 to i64 br label %cleanup sw.bb59: ; preds = %entry %cmp60 = icmp slt i64 %n, %k br i1 %cmp60, label %cleanup, label %for.cond63.preheader for.cond63.preheader: ; preds = %sw.bb59 %cmp64.not299 = icmp slt i64 %k, 0 br i1 %cmp64.not299, label %for.end85, label %calcnCr.exit272.lr.ph calcnCr.exit272.lr.ph: ; preds = %for.cond63.preheader %arrayidx.i263 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %k %22 = load i64, ptr %arrayidx.i263, align 8, !tbaa !7 %cmp9.i273 = icmp sgt i64 %n, 0 br label %calcnCr.exit272 calcnCr.exit272: ; preds = %calcnCr.exit272.lr.ph, %power.exit291 %r.4301 = phi i64 [ 0, %calcnCr.exit272.lr.ph ], [ %r.6, %power.exit291 ] %i.2300 = phi i64 [ 0, %calcnCr.exit272.lr.ph ], [ %inc84, %power.exit291 ] %arrayidx2.i264 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.2300 %23 = load i64, ptr %arrayidx2.i264, align 8, !tbaa !7 %sub.i265 = sub nsw i64 %k, %i.2300 %arrayidx3.i266 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %sub.i265 %24 = load i64, ptr %arrayidx3.i266, align 8, !tbaa !7 %mul.i267 = mul nsw i64 %24, %23 %rem.i268 = srem i64 %mul.i267, 1000000007 %mul4.i269 = mul nsw i64 %rem.i268, %22 %rem5.i270 = srem i64 %mul4.i269, 1000000007 br i1 %cmp9.i273, label %while.body.i275, label %power.exit291 while.body.i275: ; preds = %calcnCr.exit272, %if.end.i284 %y.012.i276 = phi i64 [ %rem2.i287, %if.end.i284 ], [ %i.2300, %calcnCr.exit272 ] %x.011.i277 = phi i64 [ %x.1.i285, %if.end.i284 ], [ 1, %calcnCr.exit272 ] %b.addr.010.i278 = phi i64 [ %shr.i288, %if.end.i284 ], [ %n, %calcnCr.exit272 ] %and.i279 = and i64 %b.addr.010.i278, 1 %tobool.not.i280 = icmp eq i64 %and.i279, 0 br i1 %tobool.not.i280, label %if.end.i284, label %if.then.i281 if.then.i281: ; preds = %while.body.i275 %mul.i282 = mul nsw i64 %x.011.i277, %y.012.i276 %rem.i283 = srem i64 %mul.i282, 1000000007 br label %if.end.i284 if.end.i284: ; preds = %if.then.i281, %while.body.i275 %x.1.i285 = phi i64 [ %rem.i283, %if.then.i281 ], [ %x.011.i277, %while.body.i275 ] %mul1.i286 = mul nsw i64 %y.012.i276, %y.012.i276 %rem2.i287 = urem i64 %mul1.i286, 1000000007 %shr.i288 = lshr i64 %b.addr.010.i278, 1 %cmp.not.i289 = icmp ult i64 %b.addr.010.i278, 2 br i1 %cmp.not.i289, label %while.end.loopexit.i290, label %while.body.i275, !llvm.loop !5 while.end.loopexit.i290: ; preds = %if.end.i284 %25 = srem i64 %x.1.i285, 1000000007 br label %power.exit291 power.exit291: ; preds = %calcnCr.exit272, %while.end.loopexit.i290 %x.0.lcssa.i274 = phi i64 [ 1, %calcnCr.exit272 ], [ %25, %while.end.loopexit.i290 ] %mul68 = mul nsw i64 %x.0.lcssa.i274, %rem5.i270 %rem69 = srem i64 %mul68, 1000000007 %26 = and i64 %sub.i265, -9223372036854775807 %cmp72 = icmp eq i64 %26, 1 %reass.sub = add i64 %r.4301, 1000000007 %add75 = sub i64 %reass.sub, %rem69 %add77 = add nsw i64 %rem69, %r.4301 %r.5 = select i1 %cmp72, i64 %add75, i64 %add77 %cmp79 = icmp sgt i64 %r.5, 1000000006 %sub81 = add nsw i64 %r.5, -1000000007 %r.6 = select i1 %cmp79, i64 %sub81, i64 %r.5 %inc84 = add nuw i64 %i.2300, 1 %exitcond.not = icmp eq i64 %i.2300, %k br i1 %exitcond.not, label %for.end85, label %calcnCr.exit272, !llvm.loop !17 for.end85: ; preds = %power.exit291, %for.cond63.preheader %r.4.lcssa = phi i64 [ 0, %for.cond63.preheader ], [ %r.6, %power.exit291 ] %arrayidx86 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %k %27 = load i64, ptr %arrayidx86, align 8, !tbaa !7 %mul87 = mul nsw i64 %27, %r.4.lcssa %rem88 = srem i64 %mul87, 1000000007 br label %cleanup sw.bb89: ; preds = %entry %28 = load i64, ptr @partition_isinit, align 8, !tbaa !7 %cmp.i292 = icmp eq i64 %28, 1 br i1 %cmp.i292, label %partition_init.exit, label %if.end.i293 if.end.i293: ; preds = %sw.bb89 store i64 1, ptr @partition_isinit, align 8, !tbaa !7 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8388608) @partition, i8 -1, i64 8388608, i1 false), !tbaa !7 br label %partition_init.exit partition_init.exit: ; preds = %sw.bb89, %if.end.i293 %call90 = tail call i64 @partition_rep(i64 noundef %n, i64 noundef %k) br label %cleanup sw.bb91: ; preds = %entry %cmp92 = icmp sge i64 %k, %n %.179 = zext i1 %cmp92 to i64 br label %cleanup sw.bb95: ; preds = %entry %cmp96 = icmp slt i64 %n, %k br i1 %cmp96, label %cleanup, label %if.end98 if.end98: ; preds = %sw.bb95 %29 = load i64, ptr @partition_isinit, align 8, !tbaa !7 %cmp.i294 = icmp eq i64 %29, 1 br i1 %cmp.i294, label %partition_init.exit296, label %if.end.i295 if.end.i295: ; preds = %if.end98 store i64 1, ptr @partition_isinit, align 8, !tbaa !7 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8388608) @partition, i8 -1, i64 8388608, i1 false), !tbaa !7 br label %partition_init.exit296 partition_init.exit296: ; preds = %if.end98, %if.end.i295 %sub99 = sub nsw i64 %n, %k %call100 = tail call i64 @partition_rep(i64 noundef %sub99, i64 noundef %k) br label %cleanup cleanup: ; preds = %for.body42, %while.end.loopexit.i259.us, %power.exit201, %for.cond40.preheader, %if.end.i231, %if.end.i217, %if.end.i203, %sw.bb23, %while.end.loopexit.i, %sw.bb, %entry, %sw.bb95, %sw.bb91, %sw.bb59, %sw.bb55, %sw.bb32, %sw.bb27, %sw.bb3, %sw.bb1, %partition_init.exit296, %partition_init.exit, %for.end85, %if.end %retval.0 = phi i64 [ %call100, %partition_init.exit296 ], [ %call90, %partition_init.exit ], [ %rem88, %for.end85 ], [ %rem, %if.end ], [ 0, %sw.bb1 ], [ 0, %sw.bb3 ], [ 0, %sw.bb27 ], [ 0, %sw.bb32 ], [ %., %sw.bb55 ], [ 0, %sw.bb59 ], [ %.179, %sw.bb91 ], [ 0, %sw.bb95 ], [ undef, %entry ], [ 1, %sw.bb ], [ %3, %while.end.loopexit.i ], [ %rem5.i211, %if.end.i203 ], [ 0, %sw.bb23 ], [ %rem5.i225, %if.end.i217 ], [ %rem5.i239, %if.end.i231 ], [ 0, %for.cond40.preheader ], [ %r.2, %power.exit201 ], [ %rem51.us, %while.end.loopexit.i259.us ], [ %rem51, %for.body42 ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i64, align 8 %k = alloca i64, align 8 store i64 1, ptr @factorial, align 16, !tbaa !7 store i64 1, ptr getelementptr inbounds ([1048576 x i64], ptr @factorial, i64 0, i64 1), align 8, !tbaa !7 br label %for.body.i for.body.i: ; preds = %for.body.i, %entry %0 = phi i64 [ 1, %entry ], [ %rem.i.1, %for.body.i ] %i.066.i = phi i64 [ 2, %entry ], [ %inc.i.1, %for.body.i ] %mul.i = mul nsw i64 %i.066.i, %0 %arrayidx1.i = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %i.066.i %rem.i = srem i64 %mul.i, 1000000007 store i64 %rem.i, ptr %arrayidx1.i, align 16, !tbaa !7 %inc.i = or i64 %i.066.i, 1 %mul.i.1 = mul nsw i64 %inc.i, %rem.i %arrayidx1.i.1 = getelementptr inbounds [1048576 x i64], ptr @factorial, i64 0, i64 %inc.i %rem.i.1 = srem i64 %mul.i.1, 1000000007 store i64 %rem.i.1, ptr %arrayidx1.i.1, align 8, !tbaa !7 %inc.i.1 = add nuw nsw i64 %i.066.i, 2 %exitcond.not.i.1 = icmp eq i64 %inc.i.1, 1048576 br i1 %exitcond.not.i.1, label %for.end.i, label %for.body.i, !llvm.loop !11 for.end.i: ; preds = %for.body.i %1 = load i64, ptr getelementptr inbounds ([1048576 x i64], ptr @factorial, i64 0, i64 1048575), align 8, !tbaa !7 br label %while.body.i.i.i while.body.i.i.i: ; preds = %if.end.i.i.i, %for.end.i %y.012.i.i.i = phi i64 [ %rem2.i.i.i, %if.end.i.i.i ], [ %1, %for.end.i ] %x.011.i.i.i = phi i64 [ %x.1.i.i.i, %if.end.i.i.i ], [ 1, %for.end.i ] %b.addr.010.i.i.i = phi i64 [ %shr.i.i.i, %if.end.i.i.i ], [ 1000000005, %for.end.i ] %and.i.i.i = and i64 %b.addr.010.i.i.i, 1 %tobool.not.i.i.i = icmp eq i64 %and.i.i.i, 0 br i1 %tobool.not.i.i.i, label %if.end.i.i.i, label %if.then.i.i.i if.then.i.i.i: ; preds = %while.body.i.i.i %mul.i.i.i = mul nsw i64 %x.011.i.i.i, %y.012.i.i.i %rem.i.i.i = srem i64 %mul.i.i.i, 1000000007 br label %if.end.i.i.i if.end.i.i.i: ; preds = %if.then.i.i.i, %while.body.i.i.i %x.1.i.i.i = phi i64 [ %rem.i.i.i, %if.then.i.i.i ], [ %x.011.i.i.i, %while.body.i.i.i ] %mul1.i.i.i = mul nsw i64 %y.012.i.i.i, %y.012.i.i.i %rem2.i.i.i = urem i64 %mul1.i.i.i, 1000000007 %shr.i.i.i = lshr i64 %b.addr.010.i.i.i, 1 %cmp.not.i.i.i = icmp ult i64 %b.addr.010.i.i.i, 2 br i1 %cmp.not.i.i.i, label %modular_inverse.exit.i, label %while.body.i.i.i, !llvm.loop !5 modular_inverse.exit.i: ; preds = %if.end.i.i.i %2 = srem i64 %x.1.i.i.i, 1000000007 store i64 %2, ptr getelementptr inbounds ([1048576 x i64], ptr @invfact, i64 0, i64 1048575), align 8, !tbaa !7 br label %for.body5.i for.body5.i: ; preds = %for.body5.i.1, %modular_inverse.exit.i %3 = phi i64 [ %2, %modular_inverse.exit.i ], [ %rem11.i.1, %for.body5.i.1 ] %i.167.i = phi i64 [ 1048574, %modular_inverse.exit.i ], [ %dec.i.1, %for.body5.i.1 ] %add.i = or i64 %i.167.i, 1 %mul8.i = mul nsw i64 %add.i, %3 %arrayidx9.i = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.167.i %rem11.i = srem i64 %mul8.i, 1000000007 store i64 %rem11.i, ptr %arrayidx9.i, align 16, !tbaa !7 %cmp4.not.i = icmp eq i64 %i.167.i, 0 br i1 %cmp4.not.i, label %for.body16.peel.next.i, label %for.body5.i.1, !llvm.loop !12 for.body5.i.1: ; preds = %for.body5.i %dec.i = add nsw i64 %i.167.i, -1 %mul8.i.1 = mul nsw i64 %i.167.i, %rem11.i %arrayidx9.i.1 = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %dec.i %rem11.i.1 = srem i64 %mul8.i.1, 1000000007 store i64 %rem11.i.1, ptr %arrayidx9.i.1, align 8, !tbaa !7 %dec.i.1 = add nsw i64 %i.167.i, -2 br label %for.body5.i for.body16.peel.next.i: ; preds = %for.body5.i %4 = load i64, ptr @invfact, align 16, !tbaa !7 %rem25.peel.i = srem i64 %4, 1000000007 store i64 %rem25.peel.i, ptr @bce, align 16, !tbaa !7 br label %for.body16.i for.body16.i: ; preds = %for.body16.i, %for.body16.peel.next.i %5 = phi i64 [ %8, %for.body16.i ], [ %rem25.peel.i, %for.body16.peel.next.i ] %i.268.i = phi i64 [ %inc40.i, %for.body16.i ], [ 1, %for.body16.peel.next.i ] %rem17.i = and i64 %i.268.i, 1 %cmp18.not.i = icmp eq i64 %rem17.i, 0 %spec.select.i = select i1 %cmp18.not.i, i64 1, i64 1000000006 %6 = getelementptr inbounds [1048576 x i64], ptr @bce, i64 0, i64 %i.268.i %arrayidx21.i = getelementptr inbounds [1048576 x i64], ptr @invfact, i64 0, i64 %i.268.i %7 = load i64, ptr %arrayidx21.i, align 8, !tbaa !7 %mul23.i = mul nsw i64 %spec.select.i, %7 %rem25.i = srem i64 %mul23.i, 1000000007 %add31.i = add nsw i64 %rem25.i, %5 %cmp33.i = icmp sgt i64 %add31.i, 1000000006 %sub36.i = add nsw i64 %add31.i, -1000000007 %8 = select i1 %cmp33.i, i64 %sub36.i, i64 %add31.i store i64 %8, ptr %6, align 8, !tbaa !7 %inc40.i = add nuw nsw i64 %i.268.i, 1 %exitcond69.not.i = icmp eq i64 %inc40.i, 1048576 br i1 %exitcond69.not.i, label %cfact.exit, label %for.body16.i, !llvm.loop !13 cfact.exit: ; preds = %for.body16.i call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %9 = load i64, ptr %n, align 8, !tbaa !7 %cmp9.i.i = icmp sgt i64 %9, 0 br i1 %cmp9.i.i, label %while.body.i.i.preheader, label %twelvefold_way.exit while.body.i.i.preheader: ; preds = %cfact.exit %10 = load i64, ptr %k, align 8, !tbaa !7 br label %while.body.i.i while.body.i.i: ; preds = %while.body.i.i.preheader, %if.end.i.i %y.012.i.i = phi i64 [ %rem2.i.i, %if.end.i.i ], [ %10, %while.body.i.i.preheader ] %x.011.i.i = phi i64 [ %x.1.i.i, %if.end.i.i ], [ 1, %while.body.i.i.preheader ] %b.addr.010.i.i = phi i64 [ %shr.i.i, %if.end.i.i ], [ %9, %while.body.i.i.preheader ] %and.i.i = and i64 %b.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 %x.011.i.i, %y.012.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 %x.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %x.011.i.i, %while.body.i.i ] %mul1.i.i = mul nsw i64 %y.012.i.i, %y.012.i.i %rem2.i.i = urem i64 %mul1.i.i, 1000000007 %shr.i.i = lshr i64 %b.addr.010.i.i, 1 %cmp.not.i.i = icmp ult i64 %b.addr.010.i.i, 2 br i1 %cmp.not.i.i, label %while.end.loopexit.i.i, label %while.body.i.i, !llvm.loop !5 while.end.loopexit.i.i: ; preds = %if.end.i.i %11 = srem i64 %x.1.i.i, 1000000007 br label %twelvefold_way.exit twelvefold_way.exit: ; preds = %cfact.exit, %while.end.loopexit.i.i %retval.0.i = phi i64 [ 1, %cfact.exit ], [ %11, %while.end.loopexit.i.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %retval.0.i) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9 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 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 #3 = { 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6, !14} !14 = !{!"llvm.loop.peeled.count", i32 1} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6}
#include <stdio.h> #include <math.h> int main() { int d, n; scanf("%d%d", &d, &n); n = n == 100 ? n + 1 : n; for (int i = 0; i < d; i++) { n *= 100; } printf("%d\n", n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156568/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156568/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %d = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4 %cmp = icmp eq i32 %0, 100 %cond = select i1 %cmp, i32 101, i32 %0 store i32 %cond, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %d, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %1, 0 br i1 %cmp15, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %1, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %1, -8 %2 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %cond, i64 0 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> [ %2, %vector.ph ], [ %3, %vector.body ] %vec.phi8 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %4, %vector.body ] %3 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100> %4 = mul <4 x i32> %vec.phi8, <i32 100, i32 100, i32 100, i32 100> %index.next = add nuw i32 %index, 8 %5 = icmp eq i32 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %4, %3 %6 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %1, %n.vec br i1 %cmp.n, label %for.cond.for.cond.cleanup_crit_edge, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %mul46.ph = phi i32 [ %cond, %for.body.preheader ], [ %6, %middle.block ] br label %for.body for.cond.for.cond.cleanup_crit_edge: ; preds = %for.body, %middle.block %mul.lcssa = phi i32 [ %6, %middle.block ], [ %mul, %for.body ] store i32 %mul.lcssa, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.for.cond.cleanup_crit_edge, %entry %7 = phi i32 [ %mul.lcssa, %for.cond.for.cond.cleanup_crit_edge ], [ %cond, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 for.body: ; preds = %for.body.preheader9, %for.body %i.07 = phi i32 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ] %mul46 = phi i32 [ %mul, %for.body ], [ %mul46.ph, %for.body.preheader9 ] %mul = mul nsw i32 %mul46, 100 %inc = add nuw nsw i32 %i.07, 1 %exitcond.not = icmp eq i32 %inc, %1 br i1 %exitcond.not, label %for.cond.for.cond.cleanup_crit_edge, 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.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, !12, !11}
#include<stdio.h> #include<math.h> int main(){ int D, N; int ans; scanf("%d %d", &D, &N); if(N==100){ N=101; } ans = pow(100, D) *N; printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156610/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156610/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %D = alloca i32, align 4 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 100 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 101, ptr %N, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = load i32, ptr %D, align 4, !tbaa !5 %conv = sitofp i32 %1 to double %call1 = call double @pow(double noundef 1.000000e+02, double noundef %conv) #4 %2 = load i32, ptr %N, align 4, !tbaa !5 %conv2 = sitofp i32 %2 to double %mul = fmul double %call1, %conv2 %conv3 = fptosi double %mul to i32 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
//set many funcs template //Ver.20181228 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} int sankaku(int x){return ((1+x)*x)/2;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} void shuffledget(int x[],int n){ srand(time(0)); int i,b[524288],p,c; for(i=0;i<n;i++){ b[i]=i; } for(i=n;i>=1;i--){ p=rand()%i; c=b[i-1];b[i-1]=b[p];b[p]=c; } for(i=0;i<n;i++){ scanf("%d",&x[b[i]]); } } int dx4[4]={1,-1,0,0}; int dy4[4]={0,0,1,-1}; int dx8[8]={-1,-1,-1,0,0,1,1,1}; int dy8[8]={-1,0,1,-1,1,-1,0,1}; int search(int x,int a[],int n){ int st=0,fi=n-1,te; while(st<=fi){ te=(st+fi)/2; if(a[te]<x){st=te+1;}else{fi=te-1;} } return st; } void prarr(int arr[],int n){ int i; for(i=0;i<n;i++){ if(i){printf(" ");} printf("%d",arr[i]); } printf("\n"); return; } typedef struct{ int val; int node; }sd; int sdsortfnc(const void *a,const void *b){ if(((sd*)a)->val < ((sd*)b)->val){return -1;} if(((sd*)a)->val > ((sd*)b)->val){return 1;} return 0; } int main(void){ int i,j,n,m,k,a,b,c,h,w,r=0,l,t; scanf("%d%d",&k,&n); if(n==100){ n++; } if(k==0){k=1;} else if(k==1){k=100;} else{k=10000;} printf("%d\n",n*k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156654/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156654/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16 @dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16 @dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16 @.str.3 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.4 = 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: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.05, 10 %add = add nsw i32 %r.06, %rem %div = sdiv i32 %x.addr.05, 10 %x.addr.05.off = add i32 %x.addr.05, 9 %tobool.not = icmp ult i32 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i32 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.06, %b %add = add nsw i32 %rem, %r.07 %div = sdiv i32 %x.addr.06, %b %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i32 %x, 1 %mul = mul nsw i32 %add, %x %div = sdiv i32 %mul, 2 ret i32 %div } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !19 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !22 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.05, 10 %add = add nsw i64 %r.06, %rem %div = sdiv i64 %x.addr.05, 10 %x.addr.05.off = add i64 %x.addr.05, 9 %tobool.not = icmp ult i64 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.06, %b %add = add nsw i64 %rem, %r.07 %div = sdiv i64 %x.addr.06, %b %tobool.not = icmp eq i64 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i64 %x, 1 %mul = mul nsw i64 %add, %x %div = sdiv i64 %mul, 2 ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #14 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #14 ret i32 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp sgt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 { entry: %b = alloca [524288 x i32], align 16 %call = tail call i64 @time(ptr noundef null) #15 %conv = trunc i64 %call to i32 tail call void @srand(i32 noundef %conv) #15 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #15 %cmp44 = icmp sgt i32 %n, 0 br i1 %cmp44, label %for.body.preheader, label %for.end29 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61 for.body.preheader61: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond2.preheader: ; preds = %for.body, %middle.block br i1 %cmp44, label %for.body5.preheader, label %for.end29 for.body5.preheader: ; preds = %for.cond2.preheader %3 = zext i32 %n to i64 br label %for.body5 for.body: ; preds = %for.body.preheader61, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !25 %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.cond2.preheader, label %for.body, !llvm.loop !35 for.cond18.preheader: ; preds = %for.body5 br i1 %cmp44, label %for.body21.preheader, label %for.end29 for.body21.preheader: ; preds = %for.cond18.preheader %wide.trip.count58 = zext i32 %n to i64 br label %for.body21 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ] %call6 = tail call i32 @rand() #15 %5 = trunc i64 %indvars.iv51 to i32 %rem = srem i32 %call6, %5 %indvars.iv.next52 = add nsw i64 %indvars.iv51, -1 %idxprom7 = and i64 %indvars.iv.next52, 4294967295 %arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !25 %idxprom9 = sext i32 %rem to i64 %arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !25 store i32 %7, ptr %arrayidx8, align 4, !tbaa !25 store i32 %6, ptr %arrayidx10, align 4, !tbaa !25 %cmp3 = icmp ugt i64 %indvars.iv51, 1 br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !36 for.body21: ; preds = %for.body21.preheader, %for.body21 %indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ] %arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54 %8 = load i32, ptr %arrayidx23, align 4, !tbaa !25 %idxprom24 = sext i32 %8 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24 %call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25) %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58 br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !37 for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #15 ret void } ; Function Attrs: nounwind declare void @srand(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i64 @time(ptr noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 { entry: %cmp.not9 = icmp slt i32 %n, 1 br i1 %cmp.not9, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ] %fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ] %add = add nsw i32 %st.011, %fi.010 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !25 %cmp1 = icmp slt i32 %0, %x %add2 = add nsw i32 %div, 1 %sub3 = add nsw i32 %div, -1 %fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3 %st.1 = select i1 %cmp1, i32 %add2, i32 %st.011 %cmp.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #11 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %.pre = load i32, ptr %arr, align 4, !tbaa !25 %call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %n, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar6 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !25 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !41 %1 = load i32, ptr %b, align 4, !tbaa !41 %cmp = icmp slt i32 %0, %1 %cmp4 = icmp sgt i32 %0, %1 %. = zext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #11 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #15 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #15 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %k, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !25 %cmp = icmp eq i32 %0, 100 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 101, ptr %n, align 4, !tbaa !25 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 101, %if.then ], [ %0, %entry ] %2 = load i32, ptr %k, align 4, !tbaa !25 switch i32 %2, label %if.else5 [ i32 0, label %if.then2 i32 1, label %if.then4 ] if.then2: ; preds = %if.end store i32 1, ptr %k, align 4, !tbaa !25 br label %if.end7 if.then4: ; preds = %if.end store i32 100, ptr %k, align 4, !tbaa !25 br label %if.end7 if.else5: ; preds = %if.end store i32 10000, ptr %k, align 4, !tbaa !25 br label %if.end7 if.end7: ; preds = %if.then4, %if.else5, %if.then2 %3 = phi i32 [ 100, %if.then4 ], [ 10000, %if.else5 ], [ 1, %if.then2 ] %mul = mul nsw i32 %3, %1 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #15 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #13 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #13 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #14 = { nounwind willreturn memory(read) } attributes #15 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !6} !22 = distinct !{!22, !20} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = !{!26, !26, i64 0} !26 = !{!"int", !27, i64 0} !27 = !{!"omnipotent char", !28, i64 0} !28 = !{!"Simple C/C++ TBAA"} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !27, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !27, i64 0} !33 = !{!27, !27, i64 0} !34 = distinct !{!34, !6, !9, !10} !35 = distinct !{!35, !6, !10, !9} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = distinct !{!38, !6} !39 = distinct !{!39, !6, !40} !40 = !{!"llvm.loop.peeled.count", i32 1} !41 = !{!42, !26, i64 0} !42 = !{!"", !26, i64 0, !26, i64 4}
#include<stdio.h> int main(){ int D; int N; scanf("%d %d",&D,&N); int A=1; for(int i=0;i<D;i++)A*=100; if(N<=99){printf("%d",A*N); }else{printf("%d",A*101);} }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156698/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156698/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %D = alloca i32, align 4 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N) %0 = load i32, ptr %D, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader13, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %0, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.phi12 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ] %1 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100> %2 = mul <4 x i32> %vec.phi12, <i32 100, i32 100, i32 100, i32 100> %index.next = add nuw i32 %index, 8 %3 = icmp eq i32 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %2, %1 %4 = 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 %for.cond.cleanup, label %for.body.preheader13 for.body.preheader13: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %A.010.ph = phi i32 [ 1, %for.body.preheader ], [ %4, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %A.0.lcssa = phi i32 [ 1, %entry ], [ %4, %middle.block ], [ %mul, %for.body ] %5 = load i32, ptr %N, align 4, !tbaa !5 %cmp1 = icmp slt i32 %5, 100 %mul4.sink.v = select i1 %cmp1, i32 %5, i32 101 %mul4.sink = mul nsw i32 %mul4.sink.v, %A.0.lcssa %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 ret i32 0 for.body: ; preds = %for.body.preheader13, %for.body %i.011 = phi i32 [ %inc, %for.body ], [ %i.011.ph, %for.body.preheader13 ] %A.010 = phi i32 [ %mul, %for.body ], [ %A.010.ph, %for.body.preheader13 ] %mul = mul nsw i32 %A.010, 100 %inc = add nuw nsw i32 %i.011, 1 %exitcond.not = icmp eq i32 %inc, %0 br i1 %exitcond.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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.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, !12, !11}
#include <stdio.h> #include <math.h> int main( void ) { int D , N , a , ans , i; scanf( "%d %d" , &D , &N ); a = pow( 100 , D ); ans = 0; for( i=1; i<=N ; i++) ans += a; if( N==100) ans +=a; printf( "%d" , ans ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156740/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156740/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %D = alloca i32, align 4 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N) %0 = load i32, ptr %D, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %call1 = call double @pow(double noundef 1.000000e+02, double noundef %conv) #4 %conv2 = fptosi double %call1 to i32 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = mul i32 %1, %conv2 %cmp.not12.inv = icmp sgt i32 %1, 0 %spec.select16 = select i1 %cmp.not12.inv, i32 %2, i32 0 %cmp4 = icmp eq i32 %1, 100 %add6 = select i1 %cmp4, i32 %conv2, i32 0 %spec.select = add nsw i32 %add6, %spec.select16 %call7 = 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 %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int d, n, result; scanf("%d %d", &d, &n); switch (d) { case 0: result = n + (n / 100); break; case 1: result = 100 * n + (n / 100 * 100); break; case 2: result = 100 * 100 * n + (n / 100 * 100 * 100); break; } printf("%d\n", result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156791/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156791/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %d = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #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 %d, ptr noundef nonnull %n) %0 = load i32, ptr %d, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %.fr = freeze i32 %1 switch i32 %0, label %unreachable [ i32 0, label %sw.bb i32 1, label %sw.bb1 i32 2, label %sw.bb5 ] sw.bb: ; preds = %entry %div = sdiv i32 %.fr, 100 %add = add nsw i32 %div, %.fr br label %sw.epilog sw.bb1: ; preds = %entry %mul = mul nsw i32 %.fr, 100 %2 = srem i32 %.fr, 100 %mul3 = sub nsw i32 %.fr, %2 %add4 = add nsw i32 %mul3, %mul br label %sw.epilog sw.bb5: ; preds = %entry %mul6 = mul nsw i32 %.fr, 10000 %3 = srem i32 %.fr, 100 %mul8 = sub nsw i32 %.fr, %3 %mul9 = mul nsw i32 %mul8, 100 %add10 = add nsw i32 %mul9, %mul6 br label %sw.epilog unreachable: ; preds = %entry unreachable sw.epilog: ; preds = %sw.bb5, %sw.bb1, %sw.bb %result.0 = phi i32 [ %add10, %sw.bb5 ], [ %add4, %sw.bb1 ], [ %add, %sw.bb ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define MAX_N 1000 #define MAX_DEPTH MAX_N #define MAX_LINE_LEN 50 typedef char line_t[MAX_DEPTH + MAX_LINE_LEN + 1]; void convert(int n, line_t line[]) { int i, j, p; for (i = 0; i < n; i++) { for (p = 0; line[i][p] == '.'; p++) { } if (p > 0) { line[i][p - 1] = '+'; for (j = i - 1; j >= 0; j--) { if (line[j][p - 1] != '.') break; line[j][p - 1] = '|'; } } } for (i = 0; i < n; i++) { for (p = 0; line[i][p] != '\0'; p++) { if (line[i][p] == '.') line[i][p] = ' '; } } } int main() { static line_t line[MAX_N]; int n, i; for (;;) { scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { scanf("%s", line[i]); } convert(n, line); for (i = 0; i < n; i++) { printf("%s\n", line[i]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156834/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156834/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.line = internal global [1000 x [1051 x i8]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @convert(i32 noundef %n, ptr nocapture noundef %line) local_unnamed_addr #0 { entry: %cmp101 = icmp sgt i32 %n, 0 br i1 %cmp101, label %for.cond1.preheader.preheader, label %for.end69 for.cond1.preheader.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc35 %indvars.iv106 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvars.iv.next107, %for.inc35 ] br label %for.cond1 for.cond38.preheader: ; preds = %for.inc35 br i1 %cmp101, label %for.cond42.preheader.preheader, label %for.end69 for.cond42.preheader.preheader: ; preds = %for.cond38.preheader %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %n, 1 br i1 %0, label %for.end69.loopexit.unr-lcssa, label %for.cond42.preheader.preheader.new for.cond42.preheader.preheader.new: ; preds = %for.cond42.preheader.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.cond42.preheader for.cond1: ; preds = %for.cond1, %for.cond1.preheader %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1 ], [ 0, %for.cond1.preheader ] %arrayidx3 = getelementptr inbounds [1051 x i8], ptr %line, i64 %indvars.iv106, i64 %indvars.iv %1 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %cmp4 = icmp eq i8 %1, 46 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp4, label %for.cond1, label %for.end, !llvm.loop !8 for.end: ; preds = %for.cond1 %2 = and i64 %indvars.iv, 4294967295 %cmp7.not = icmp eq i64 %2, 0 br i1 %cmp7.not, label %for.inc35, label %if.then if.then: ; preds = %for.end %sub = add i64 %indvars.iv, 4294967295 %idxprom11 = and i64 %sub, 4294967295 %arrayidx12 = getelementptr inbounds [1051 x i8], ptr %line, i64 %indvars.iv106, i64 %idxprom11 store i8 43, ptr %arrayidx12, align 1, !tbaa !5 %cmp1599.not = icmp eq i64 %indvars.iv106, 0 br i1 %cmp1599.not, label %for.inc35, label %for.body17 for.body17: ; preds = %if.then, %if.end %indvars.iv108 = phi i64 [ %indvars.iv.next109, %if.end ], [ %indvars.iv106, %if.then ] %indvars.iv.next109 = add nsw i64 %indvars.iv108, -1 %idxprom18 = and i64 %indvars.iv.next109, 4294967295 %arrayidx22 = getelementptr inbounds [1051 x i8], ptr %line, i64 %idxprom18, i64 %idxprom11 %3 = load i8, ptr %arrayidx22, align 1, !tbaa !5 %cmp24.not = icmp eq i8 %3, 46 br i1 %cmp24.not, label %if.end, label %for.inc35 if.end: ; preds = %for.body17 store i8 124, ptr %arrayidx22, align 1, !tbaa !5 %4 = icmp sgt i64 %indvars.iv108, 1 br i1 %4, label %for.body17, label %for.inc35, !llvm.loop !10 for.inc35: ; preds = %if.end, %for.body17, %if.then, %for.end %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1 %exitcond.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count br i1 %exitcond.not, label %for.cond38.preheader, label %for.cond1.preheader, !llvm.loop !11 for.cond42.preheader: ; preds = %for.inc67.1, %for.cond42.preheader.preheader.new %indvars.iv117 = phi i64 [ 0, %for.cond42.preheader.preheader.new ], [ %indvars.iv.next118.1, %for.inc67.1 ] %niter = phi i64 [ 0, %for.cond42.preheader.preheader.new ], [ %niter.next.1, %for.inc67.1 ] br label %for.cond42 for.cond42: ; preds = %for.cond42.preheader, %for.inc64 %indvars.iv113 = phi i64 [ 0, %for.cond42.preheader ], [ %indvars.iv.next114, %for.inc64 ] %arrayidx46 = getelementptr inbounds [1051 x i8], ptr %line, i64 %indvars.iv117, i64 %indvars.iv113 %5 = load i8, ptr %arrayidx46, align 1, !tbaa !5 switch i8 %5, label %for.inc64 [ i8 0, label %for.inc67 i8 46, label %if.then58 ] if.then58: ; preds = %for.cond42 store i8 32, ptr %arrayidx46, align 1, !tbaa !5 br label %for.inc64 for.inc64: ; preds = %for.cond42, %if.then58 %indvars.iv.next114 = add nuw i64 %indvars.iv113, 1 br label %for.cond42, !llvm.loop !12 for.inc67: ; preds = %for.cond42 %indvars.iv.next118 = or i64 %indvars.iv117, 1 br label %for.cond42.1 for.cond42.1: ; preds = %for.inc64.1, %for.inc67 %indvars.iv113.1 = phi i64 [ 0, %for.inc67 ], [ %indvars.iv.next114.1, %for.inc64.1 ] %arrayidx46.1 = getelementptr inbounds [1051 x i8], ptr %line, i64 %indvars.iv.next118, i64 %indvars.iv113.1 %6 = load i8, ptr %arrayidx46.1, align 1, !tbaa !5 switch i8 %6, label %for.inc64.1 [ i8 0, label %for.inc67.1 i8 46, label %if.then58.1 ] if.then58.1: ; preds = %for.cond42.1 store i8 32, ptr %arrayidx46.1, align 1, !tbaa !5 br label %for.inc64.1 for.inc67.1: ; preds = %for.cond42.1 %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 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.end69.loopexit.unr-lcssa, label %for.cond42.preheader, !llvm.loop !13 for.inc64.1: ; preds = %if.then58.1, %for.cond42.1 %indvars.iv.next114.1 = add nuw i64 %indvars.iv113.1, 1 br label %for.cond42.1, !llvm.loop !12 for.end69.loopexit.unr-lcssa: ; preds = %for.inc67.1, %for.cond42.preheader.preheader %indvars.iv117.unr = phi i64 [ 0, %for.cond42.preheader.preheader ], [ %indvars.iv.next118.1, %for.inc67.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end69, label %for.cond42.epil for.cond42.epil: ; preds = %for.end69.loopexit.unr-lcssa, %for.inc64.epil %indvars.iv113.epil = phi i64 [ %indvars.iv.next114.epil, %for.inc64.epil ], [ 0, %for.end69.loopexit.unr-lcssa ] %arrayidx46.epil = getelementptr inbounds [1051 x i8], ptr %line, i64 %indvars.iv117.unr, i64 %indvars.iv113.epil %7 = load i8, ptr %arrayidx46.epil, align 1, !tbaa !5 switch i8 %7, label %for.inc64.epil [ i8 0, label %for.end69 i8 46, label %if.then58.epil ] if.then58.epil: ; preds = %for.cond42.epil store i8 32, ptr %arrayidx46.epil, align 1, !tbaa !5 br label %for.inc64.epil for.inc64.epil: ; preds = %if.then58.epil, %for.cond42.epil %indvars.iv.next114.epil = add nuw i64 %indvars.iv113.epil, 1 br label %for.cond42.epil, !llvm.loop !12 for.end69: ; preds = %for.end69.loopexit.unr-lcssa, %for.cond42.epil, %entry, %for.cond38.preheader ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !14 %cmp25 = icmp eq i32 %0, 0 br i1 %cmp25, label %for.end14, label %for.cond1.preheader for.cond.loopexit: ; preds = %for.body6, %for.cond1.preheader, %for.end, %convert.exit %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !14 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond.loopexit %2 = phi i32 [ %1, %for.cond.loopexit ], [ %0, %entry ] %cmp220 = icmp sgt i32 %2, 0 br i1 %cmp220, label %for.body, label %for.cond.loopexit for.body: ; preds = %for.cond1.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond1.preheader ] %arrayidx = getelementptr inbounds [1000 x [1051 x i8]], ptr @main.line, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %n, align 4, !tbaa !14 %3 = sext i32 %.pr to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !16 for.end: ; preds = %for.body %cmp101.i = icmp sgt i32 %.pr, 0 br i1 %cmp101.i, label %for.cond1.preheader.preheader.i, label %for.cond.loopexit for.cond1.preheader.preheader.i: ; preds = %for.end %wide.trip.count.i = zext i32 %.pr to i64 br label %for.cond1.preheader.i for.cond1.preheader.i: ; preds = %for.inc35.i, %for.cond1.preheader.preheader.i %indvars.iv106.i = phi i64 [ 0, %for.cond1.preheader.preheader.i ], [ %indvars.iv.next107.i, %for.inc35.i ] br label %for.cond1.i for.cond1.i: ; preds = %for.cond1.i, %for.cond1.preheader.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond1.i ], [ 0, %for.cond1.preheader.i ] %arrayidx3.i = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %indvars.iv106.i, i64 %indvars.iv.i %4 = load i8, ptr %arrayidx3.i, align 1, !tbaa !5 %cmp4.i = icmp eq i8 %4, 46 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp4.i, label %for.cond1.i, label %for.end.i, !llvm.loop !8 for.end.i: ; preds = %for.cond1.i %5 = and i64 %indvars.iv.i, 4294967295 %cmp7.not.i = icmp eq i64 %5, 0 br i1 %cmp7.not.i, label %for.inc35.i, label %if.then.i if.then.i: ; preds = %for.end.i %sub.i = add i64 %indvars.iv.i, 4294967295 %idxprom11.i = and i64 %sub.i, 4294967295 %arrayidx12.i = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %indvars.iv106.i, i64 %idxprom11.i store i8 43, ptr %arrayidx12.i, align 1, !tbaa !5 %cmp1599.not.i = icmp eq i64 %indvars.iv106.i, 0 br i1 %cmp1599.not.i, label %for.inc35.i, label %for.body17.i for.body17.i: ; preds = %if.then.i, %if.end.i %indvars.iv108.i = phi i64 [ %indvars.iv.next109.i, %if.end.i ], [ %indvars.iv106.i, %if.then.i ] %indvars.iv.next109.i = add nsw i64 %indvars.iv108.i, -1 %idxprom18.i = and i64 %indvars.iv.next109.i, 4294967295 %arrayidx22.i = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %idxprom18.i, i64 %idxprom11.i %6 = load i8, ptr %arrayidx22.i, align 1, !tbaa !5 %cmp24.not.i = icmp eq i8 %6, 46 br i1 %cmp24.not.i, label %if.end.i, label %for.inc35.i if.end.i: ; preds = %for.body17.i store i8 124, ptr %arrayidx22.i, align 1, !tbaa !5 %7 = icmp sgt i64 %indvars.iv108.i, 1 br i1 %7, label %for.body17.i, label %for.inc35.i, !llvm.loop !10 for.inc35.i: ; preds = %if.end.i, %for.body17.i, %if.then.i, %for.end.i %indvars.iv.next107.i = add nuw nsw i64 %indvars.iv106.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next107.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.cond42.preheader.i.preheader, label %for.cond1.preheader.i, !llvm.loop !11 for.cond42.preheader.i.preheader: ; preds = %for.inc35.i %xtraiter = and i64 %wide.trip.count.i, 1 %8 = icmp eq i32 %.pr, 1 br i1 %8, label %convert.exit.unr-lcssa, label %for.cond42.preheader.i.preheader.new for.cond42.preheader.i.preheader.new: ; preds = %for.cond42.preheader.i.preheader %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.cond42.preheader.i for.cond42.preheader.i: ; preds = %for.inc67.i.1, %for.cond42.preheader.i.preheader.new %indvars.iv117.i = phi i64 [ 0, %for.cond42.preheader.i.preheader.new ], [ %indvars.iv.next118.i.1, %for.inc67.i.1 ] %niter = phi i64 [ 0, %for.cond42.preheader.i.preheader.new ], [ %niter.next.1, %for.inc67.i.1 ] br label %for.cond42.i for.cond42.i: ; preds = %for.inc64.i, %for.cond42.preheader.i %indvars.iv113.i = phi i64 [ 0, %for.cond42.preheader.i ], [ %indvars.iv.next114.i, %for.inc64.i ] %arrayidx46.i = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %indvars.iv117.i, i64 %indvars.iv113.i %9 = load i8, ptr %arrayidx46.i, align 1, !tbaa !5 switch i8 %9, label %for.inc64.i [ i8 0, label %for.inc67.i i8 46, label %if.then58.i ] if.then58.i: ; preds = %for.cond42.i store i8 32, ptr %arrayidx46.i, align 1, !tbaa !5 br label %for.inc64.i for.inc64.i: ; preds = %if.then58.i, %for.cond42.i %indvars.iv.next114.i = add nuw i64 %indvars.iv113.i, 1 br label %for.cond42.i, !llvm.loop !12 for.inc67.i: ; preds = %for.cond42.i %indvars.iv.next118.i = or i64 %indvars.iv117.i, 1 br label %for.cond42.i.1 for.cond42.i.1: ; preds = %for.inc64.i.1, %for.inc67.i %indvars.iv113.i.1 = phi i64 [ 0, %for.inc67.i ], [ %indvars.iv.next114.i.1, %for.inc64.i.1 ] %arrayidx46.i.1 = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %indvars.iv.next118.i, i64 %indvars.iv113.i.1 %10 = load i8, ptr %arrayidx46.i.1, align 1, !tbaa !5 switch i8 %10, label %for.inc64.i.1 [ i8 0, label %for.inc67.i.1 i8 46, label %if.then58.i.1 ] if.then58.i.1: ; preds = %for.cond42.i.1 store i8 32, ptr %arrayidx46.i.1, align 1, !tbaa !5 br label %for.inc64.i.1 for.inc67.i.1: ; preds = %for.cond42.i.1 %indvars.iv.next118.i.1 = add nuw nsw i64 %indvars.iv117.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %convert.exit.unr-lcssa, label %for.cond42.preheader.i, !llvm.loop !13 for.inc64.i.1: ; preds = %if.then58.i.1, %for.cond42.i.1 %indvars.iv.next114.i.1 = add nuw i64 %indvars.iv113.i.1, 1 br label %for.cond42.i.1, !llvm.loop !12 convert.exit.unr-lcssa: ; preds = %for.inc67.i.1, %for.cond42.preheader.i.preheader %indvars.iv117.i.unr = phi i64 [ 0, %for.cond42.preheader.i.preheader ], [ %indvars.iv.next118.i.1, %for.inc67.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %convert.exit, label %for.cond42.i.epil for.cond42.i.epil: ; preds = %convert.exit.unr-lcssa, %for.inc64.i.epil %indvars.iv113.i.epil = phi i64 [ %indvars.iv.next114.i.epil, %for.inc64.i.epil ], [ 0, %convert.exit.unr-lcssa ] %arrayidx46.i.epil = getelementptr inbounds [1051 x i8], ptr @main.line, i64 %indvars.iv117.i.unr, i64 %indvars.iv113.i.epil %11 = load i8, ptr %arrayidx46.i.epil, align 1, !tbaa !5 switch i8 %11, label %for.inc64.i.epil [ i8 0, label %convert.exit i8 46, label %if.then58.i.epil ] if.then58.i.epil: ; preds = %for.cond42.i.epil store i8 32, ptr %arrayidx46.i.epil, align 1, !tbaa !5 br label %for.inc64.i.epil for.inc64.i.epil: ; preds = %if.then58.i.epil, %for.cond42.i.epil %indvars.iv.next114.i.epil = add nuw i64 %indvars.iv113.i.epil, 1 br label %for.cond42.i.epil, !llvm.loop !12 convert.exit: ; preds = %for.cond42.i.epil, %convert.exit.unr-lcssa br i1 %cmp101.i, label %for.body6, label %for.cond.loopexit for.body6: ; preds = %convert.exit, %for.body6 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body6 ], [ 0, %convert.exit ] %arrayidx8 = getelementptr inbounds [1000 x [1051 x i8]], ptr @main.line, i64 0, i64 %indvars.iv27 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx8) %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1 %12 = load i32, ptr %n, align 4, !tbaa !14 %13 = sext i32 %12 to i64 %cmp5 = icmp slt i64 %indvars.iv.next28, %13 br i1 %cmp5, label %for.body6, label %for.cond.loopexit, !llvm.loop !17 for.end14: ; preds = %for.cond.loopexit, %entry 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 #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9} !14 = !{!15, !15, i64 0} !15 = !{!"int", !6, i64 0} !16 = distinct !{!16, !9} !17 = distinct !{!17, !9}
#include <stdio.h> int main(void) { int a, b, c, t; char c1, c2, ct; a = 1; b = c = t =0; while (scanf("%c,%c", &c1, &c2) != EOF){ if (c1 > c2){ ct = c1; c1 = c2; c2 = ct; } if (c1 == 'A' && c2 == 'B'){ t = a; a = b; b = t; } else if (c1 == 'A' && c2 == 'C'){ t = a; a = c; c = t; } else if (c1 == 'B' && c2 == 'C'){ t = b; b = c; c = t; } } b *= 10; c *= 100; t = a + b + c; switch (t){ case 1: printf("A\n"); break; case 10: printf("B\n"); break; case 100: printf("C\n"); break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156878/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156878/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c,%c\00", align 1 @str = private unnamed_addr constant [2 x i8] c"C\00", align 1 @str.4 = private unnamed_addr constant [2 x i8] c"B\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c1 = alloca i8, align 1 %c2 = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c1) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c2) #4 %call54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c1, ptr noundef nonnull %c2) %cmp.not55 = icmp eq i32 %call54, -1 br i1 %cmp.not55, label %sw.epilog.sink.split, label %while.body while.body: ; preds = %entry, %if.end30 %a.058 = phi i32 [ %a.1, %if.end30 ], [ 1, %entry ] %c.057 = phi i32 [ %c.1, %if.end30 ], [ 0, %entry ] %b.056 = phi i32 [ %b.1, %if.end30 ], [ 0, %entry ] %0 = load i8, ptr %c1, align 1, !tbaa !5 %1 = load i8, ptr %c2, align 1 %cmp2 = icmp sgt i8 %0, %1 br i1 %cmp2, label %if.then, label %if.end if.then: ; preds = %while.body store i8 %1, ptr %c1, align 1, !tbaa !5 store i8 %0, ptr %c2, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i8 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i8 [ %1, %if.then ], [ %0, %while.body ] %cmp5 = icmp eq i8 %3, 65 %cmp8 = icmp eq i8 %2, 66 %or.cond = and i1 %cmp5, %cmp8 br i1 %or.cond, label %if.end30, label %if.else if.else: ; preds = %if.end %cmp16 = icmp eq i8 %2, 67 %or.cond38 = and i1 %cmp5, %cmp16 br i1 %or.cond38, label %if.end30, label %if.else19 if.else19: ; preds = %if.else %cmp21 = icmp eq i8 %3, 66 %or.cond39 = and i1 %cmp21, %cmp16 %spec.select = select i1 %or.cond39, i32 %c.057, i32 %b.056 %spec.select53 = select i1 %or.cond39, i32 %b.056, i32 %c.057 br label %if.end30 if.end30: ; preds = %if.else19, %if.else, %if.end %b.1 = phi i32 [ %a.058, %if.end ], [ %b.056, %if.else ], [ %spec.select, %if.else19 ] %c.1 = phi i32 [ %c.057, %if.end ], [ %a.058, %if.else ], [ %spec.select53, %if.else19 ] %a.1 = phi i32 [ %b.056, %if.end ], [ %c.057, %if.else ], [ %a.058, %if.else19 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c1, ptr noundef nonnull %c2) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %if.end30 %4 = mul nuw nsw i32 %b.1, 10 %5 = mul nuw nsw i32 %c.1, 100 %6 = add nuw nsw i32 %a.1, %4 %7 = add nuw nsw i32 %6, %5 switch i32 %7, label %sw.epilog [ i32 1, label %sw.epilog.sink.split i32 10, label %sw.bb34 i32 100, label %sw.bb36 ] sw.bb34: ; preds = %while.end br label %sw.epilog.sink.split sw.bb36: ; preds = %while.end br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %while.end, %entry, %sw.bb34, %sw.bb36 %str.sink = phi ptr [ @str, %sw.bb36 ], [ @str.4, %sw.bb34 ], [ @str.5, %entry ], [ @str.5, %while.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %while.end call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c2) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c1) #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> int main(void){ char s[10], o[10]; int S[10], C[10]; C[1] = 1; C[2] = 0; C[3] = 0; while ( scanf("%4s", s) != EOF ) { /*printf("%c\n", s[0], s[2]);*/ if ( s[0] == 'A' ) {S[0] = 1;/*printf("keya\n");*/} else if ( s[0] == 'B' ) S[0] = 2; else if ( s[0] == 'C' ) S[0] = 3; if ( s[2] == 'A' ) S[1] = 1; else if ( s[2] == 'B' ) {S[1] = 2;/*printf("keya\n");*/} else if ( s[2] == 'C' ) {S[1] = 3;/*printf("keyb;\n");*/} if ( C [S[0]] == 1 ) { C[S[0]] = 0; C[S[1]] = 1; } else if ( C[S[1]] == 1 ) { C[S[0]] = 1; C[S[1]] = 0; } /*printf("key\n"); printf("S[0]:%d S[1]:%d\n", S[0], S[1]);*/ /*printf("A:%d B:%d C:%d\n", C[1], C[2], C[3]); if ( C[1] == 1 ) printf("A\n"); else if ( C[2] == 1 ) printf("B\n"); else if ( C[3] == 1 ) printf("C\n");*/ /*printf("end\n");*/ } if ( C[1] == 1 ) printf("A\n"); else if ( C[2] == 1 ) printf("B\n"); else if ( C[3] == 1 ) printf("C\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156920/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156920/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%4s\00", align 1 @str = private unnamed_addr constant [2 x i8] c"C\00", align 1 @str.4 = private unnamed_addr constant [2 x i8] c"B\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 %C = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %C) #4 %arrayidx = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 1 store i32 1, ptr %arrayidx, align 4, !tbaa !5 %arrayidx1 = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 2 store i32 0, ptr %arrayidx1, align 8, !tbaa !5 %arrayidx2 = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 3 store i32 0, ptr %arrayidx2, align 4, !tbaa !5 %call97 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not98 = icmp eq i32 %call97, -1 br i1 %cmp.not98, label %if.end90.sink.split, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %arrayidx22 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 2 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end70 %S.sroa.0.0100 = phi i32 [ undef, %while.body.lr.ph ], [ %S.sroa.0.1, %if.end70 ] %S.sroa.8.099 = phi i32 [ undef, %while.body.lr.ph ], [ %S.sroa.8.1, %if.end70 ] %0 = load i8, ptr %s, align 1, !tbaa !9 %switch.tableidx = add i8 %0, -65 %1 = icmp ult i8 %switch.tableidx, 3 %switch.idx.cast = zext i8 %switch.tableidx to i32 %switch.offset = add nuw nsw i32 %switch.idx.cast, 1 %S.sroa.0.1 = select i1 %1, i32 %switch.offset, i32 %S.sroa.0.0100 %2 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %switch.tableidx102 = add i8 %2, -65 %3 = icmp ult i8 %switch.tableidx102, 3 %switch.idx.cast103 = zext i8 %switch.tableidx102 to i32 %switch.offset104 = add nuw nsw i32 %switch.idx.cast103, 1 %S.sroa.8.1 = select i1 %3, i32 %switch.offset104, i32 %S.sroa.8.099 %idxprom = sext i32 %S.sroa.0.1 to i64 %arrayidx46 = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 %idxprom %4 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %cmp47 = icmp eq i32 %4, 1 br i1 %cmp47, label %if.then49, label %if.else56 if.then49: ; preds = %while.body store i32 0, ptr %arrayidx46, align 4, !tbaa !5 %idxprom54 = sext i32 %S.sroa.8.1 to i64 %arrayidx55 = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 %idxprom54 store i32 1, ptr %arrayidx55, align 4, !tbaa !5 br label %if.end70 if.else56: ; preds = %while.body %idxprom58 = sext i32 %S.sroa.8.1 to i64 %arrayidx59 = getelementptr inbounds [10 x i32], ptr %C, i64 0, i64 %idxprom58 %5 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %cmp60 = icmp eq i32 %5, 1 br i1 %cmp60, label %if.then62, label %if.end70 if.then62: ; preds = %if.else56 store i32 1, ptr %arrayidx46, align 4, !tbaa !5 store i32 0, ptr %arrayidx59, align 4, !tbaa !5 br label %if.end70 if.end70: ; preds = %if.else56, %if.then62, %if.then49 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %if.end70 %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 %6 = icmp eq i32 %.pre, 1 br i1 %6, label %if.end90.sink.split, label %if.else76 if.else76: ; preds = %while.end %7 = load i32, ptr %arrayidx1, align 8, !tbaa !5 %cmp78 = icmp eq i32 %7, 1 br i1 %cmp78, label %if.end90.sink.split, label %if.else82 if.else82: ; preds = %if.else76 %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp84 = icmp eq i32 %8, 1 br i1 %cmp84, label %if.end90.sink.split, label %if.end90 if.end90.sink.split: ; preds = %if.else82, %if.else76, %while.end, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %while.end ], [ @str.4, %if.else76 ], [ @str, %if.else82 ] %puts95 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end90 if.end90: ; preds = %if.end90.sink.split, %if.else82 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 10, 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int matchx(int x){ int to; switch (x) { case 'A': to=0; break; case 'B': to=1; break; case 'C': to=2; break; } return to; } int matchy(int y){ int go; switch (y) { case 'A':go=0; break; case 'B':go=1; break; case 'C':go=2; break; } return go; } int main ( void ) { int a[3]={0},work,to,go; char x[2],y[2]; a[0]=1; while(scanf("%1s,%1s",x,y)!=EOF){ to=matchx(x[0]); go=matchy(y[0]); work=a[to]; a[to]=a[go]; a[go]=work; } if(a[0]==1){ puts("A"); }else if(a[1]==1){ puts("B"); }else puts("C"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156993/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156993/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%1s,%1s\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"B\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"C\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @matchx(i32 noundef %x) local_unnamed_addr #0 { entry: %switch.selectcmp = icmp eq i32 %x, 66 %switch.select = zext i1 %switch.selectcmp to i32 %switch.selectcmp3 = icmp eq i32 %x, 67 %switch.select4 = select i1 %switch.selectcmp3, i32 2, i32 %switch.select ret i32 %switch.select4 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @matchy(i32 noundef %y) local_unnamed_addr #0 { entry: %switch.selectcmp = icmp eq i32 %y, 66 %switch.select = zext i1 %switch.selectcmp to i32 %switch.selectcmp3 = icmp eq i32 %y, 67 %switch.select4 = select i1 %switch.selectcmp3, i32 2, i32 %switch.select ret i32 %switch.select4 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca [3 x i32], align 4 %x = alloca [2 x i8], align 1 %y = alloca [2 x i8], align 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4 %0 = getelementptr inbounds i8, ptr %a, i64 4 store i64 0, ptr %0, align 4 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %y) #4 store i32 1, ptr %a, align 4, !tbaa !5 %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not33 = icmp eq i32 %call32, -1 br i1 %cmp.not33, label %if.end25, label %while.body while.body: ; preds = %entry, %while.body %1 = load i8, ptr %x, align 1, !tbaa !9 %switch.selectcmp.i = icmp eq i8 %1, 66 %switch.selectcmp3.i = icmp eq i8 %1, 67 %2 = zext i1 %switch.selectcmp.i to i64 %3 = load i8, ptr %y, align 1, !tbaa !9 %switch.selectcmp.i28 = icmp eq i8 %3, 66 %switch.selectcmp3.i30 = icmp eq i8 %3, 67 %4 = zext i1 %switch.selectcmp.i28 to i64 %idxprom = select i1 %switch.selectcmp3.i, i64 2, i64 %2 %arrayidx7 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %idxprom %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %idxprom8 = select i1 %switch.selectcmp3.i30, i64 2, i64 %4 %arrayidx9 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %idxprom8 %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 store i32 %6, ptr %arrayidx7, align 4, !tbaa !5 store i32 %5, ptr %arrayidx9, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.body %.pre = load i32, ptr %a, align 4, !tbaa !5 %7 = icmp eq i32 %.pre, 1 br i1 %7, label %if.end25, label %if.else if.else: ; preds = %while.end %arrayidx18 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %8, 1 %.str.2..str.3 = select i1 %cmp19, ptr @.str.2, ptr @.str.3 br label %if.end25 if.end25: ; preds = %if.else, %while.end, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %while.end ], [ %.str.2..str.3, %if.else ] %call22 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define swap(a, b) {char tmp = a; a = b; b = tmp;} int main(void) { char s[4]; char ball[3] = {1}; int i; while (scanf("%s",s) != EOF){ swap(ball[s[0] - 'A'], ball[s[2] - 'A']); } for (i = 0; i < 3; i++){ if (ball[i] == 1){ printf("%c\n", 'A' + i); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157064/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157064/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.ball = private unnamed_addr constant [3 x i8] c"\01\00\00", align 1 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 %ball = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %ball) #4 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ball, ptr noundef nonnull align 1 dereferenceable(3) @__const.main.ball, i64 3, i1 false) %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not29 = icmp eq i32 %call28, -1 br i1 %cmp.not29, label %if.then, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %arrayidx2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 br label %while.body for.cond.preheader: ; preds = %while.body %.pre = load i8, ptr %ball, align 1, !tbaa !5 %0 = icmp eq i8 %.pre, 1 br i1 %0, label %if.then, label %for.inc while.body: ; preds = %while.body.lr.ph, %while.body %1 = load i8, ptr %s, align 1, !tbaa !5 %conv = sext i8 %1 to i64 %sub = add nsw i64 %conv, -65 %arrayidx1 = getelementptr inbounds [3 x i8], ptr %ball, i64 0, i64 %sub %2 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %conv3 = sext i8 %3 to i64 %sub4 = add nsw i64 %conv3, -65 %arrayidx6 = getelementptr inbounds [3 x i8], ptr %ball, i64 0, i64 %sub4 %4 = load i8, ptr %arrayidx6, align 1, !tbaa !5 store i8 %4, ptr %arrayidx1, align 1, !tbaa !5 store i8 %2, ptr %arrayidx6, align 1, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !8 if.then: ; preds = %entry, %for.cond.preheader %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 65) br label %for.inc for.inc: ; preds = %for.cond.preheader, %if.then %arrayidx20.1 = getelementptr inbounds [3 x i8], ptr %ball, i64 0, i64 1 %5 = load i8, ptr %arrayidx20.1, align 1, !tbaa !5 %cmp22.1 = icmp eq i8 %5, 1 br i1 %cmp22.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %call24.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 66) br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx20.2 = getelementptr inbounds [3 x i8], ptr %ball, i64 0, i64 2 %6 = load i8, ptr %arrayidx20.2, align 1, !tbaa !5 %cmp22.2 = icmp eq i8 %6, 1 br i1 %cmp22.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %call24.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 67) br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %ball) #4 call void @llvm.lifetime.end.p0(i64 4, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int r[502]; double WID[502]; double width(int r1, int r2) { if (r1 == 10001 && r2 == 10001) { return 0.0; } else if (r1 == 10001) { return (double)r2; } else if (r2 == 10001){ return (double)r1; } else return 2 * sqrt((double)(r1 * r2)); } int main(void) { int N,i,j,k; double add; scanf("%d",&N); for (i = 1; i <= N; i++) { scanf("%d", &r[i]); } r[0] = r[N + 1] = 10001; WID[0] = 0; for (i = 1; i <= N + 1; i++) { WID[i] = WID[i - 1] + width(r[i - 1],r[i]); } for (i = 2; i <= N; i++) { for (j = 0; j + i <= N + 1; j++) { if ((add = width(r[j], r[j + i]) - (WID[j + i] - WID[j])) > 0.0) { for (k = j + i; k <= N + 1; k++) { WID[k] += add; } } } } printf("%.5lf\n",WID[N + 1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157107/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157107/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @r = dso_local global [502 x i32] zeroinitializer, align 16 @WID = dso_local local_unnamed_addr global [502 x double] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%.5lf\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable define dso_local double @width(i32 noundef %r1, i32 noundef %r2) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %r1, 10001 %cmp1 = icmp eq i32 %r2, 10001 %or.cond = and i1 %cmp, %cmp1 br i1 %or.cond, label %return, label %if.else if.else: ; preds = %entry br i1 %cmp, label %if.then3, label %if.else4 if.then3: ; preds = %if.else %conv = sitofp i32 %r2 to double br label %return if.else4: ; preds = %if.else br i1 %cmp1, label %if.then7, label %if.else9 if.then7: ; preds = %if.else4 %conv8 = sitofp i32 %r1 to double br label %return if.else9: ; preds = %if.else4 %mul = mul nsw i32 %r2, %r1 %conv10 = sitofp i32 %mul to double %call = tail call double @sqrt(double noundef %conv10) #5 %mul11 = fmul double %call, 2.000000e+00 br label %return return: ; preds = %entry, %if.else9, %if.then7, %if.then3 %retval.0 = phi double [ %conv, %if.then3 ], [ %conv8, %if.then7 ], [ %mul11, %if.else9 ], [ 0.000000e+00, %entry ] ret double %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not106 = icmp slt i32 %0, 1 br i1 %cmp.not106, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %3 = phi i32 [ %0, %entry ], [ %1, %for.body ] %add2 = add nsw i32 %3, 1 %idxprom3 = sext i32 %add2 to i64 %arrayidx4 = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %idxprom3 store i32 10001, ptr %arrayidx4, align 4, !tbaa !5 store i32 10001, ptr @r, align 16, !tbaa !5 store double 0.000000e+00, ptr @WID, align 16, !tbaa !11 %cmp7.not109 = icmp slt i32 %3, 0 br i1 %cmp7.not109, label %for.end61, label %for.body8 for.cond23.preheader: ; preds = %width.exit %cmp24.not117 = icmp slt i32 %9, 2 br i1 %cmp24.not117, label %for.end61, label %for.cond26.preheader for.body8: ; preds = %for.end, %width.exit %4 = phi i32 [ %9, %width.exit ], [ %3, %for.end ] %5 = phi double [ %add17, %width.exit ], [ 0.000000e+00, %for.end ] %indvars.iv123 = phi i64 [ %indvars.iv.next124, %width.exit ], [ 1, %for.end ] %6 = add nsw i64 %indvars.iv123, -1 %arrayidx13 = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %6 %7 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %indvars.iv123 %8 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp.i = icmp eq i32 %7, 10001 %cmp1.i = icmp eq i32 %8, 10001 %or.cond.i = and i1 %cmp.i, %cmp1.i br i1 %or.cond.i, label %width.exit, label %if.else.i if.else.i: ; preds = %for.body8 br i1 %cmp.i, label %if.then3.i, label %if.else4.i if.then3.i: ; preds = %if.else.i %conv.i = sitofp i32 %8 to double br label %width.exit if.else4.i: ; preds = %if.else.i br i1 %cmp1.i, label %if.then7.i, label %if.else9.i if.then7.i: ; preds = %if.else4.i %conv8.i = sitofp i32 %7 to double br label %width.exit if.else9.i: ; preds = %if.else4.i %mul.i = mul nsw i32 %8, %7 %conv10.i = sitofp i32 %mul.i to double %call.i = call double @sqrt(double noundef %conv10.i) #5 %mul11.i = fmul double %call.i, 2.000000e+00 %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %width.exit width.exit: ; preds = %for.body8, %if.then3.i, %if.then7.i, %if.else9.i %9 = phi i32 [ %4, %if.then3.i ], [ %4, %if.then7.i ], [ %.pre, %if.else9.i ], [ %4, %for.body8 ] %retval.0.i = phi double [ %conv.i, %if.then3.i ], [ %conv8.i, %if.then7.i ], [ %mul11.i, %if.else9.i ], [ 0.000000e+00, %for.body8 ] %add17 = fadd double %5, %retval.0.i %arrayidx19 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %indvars.iv123 store double %add17, ptr %arrayidx19, align 8, !tbaa !11 %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %10 = sext i32 %9 to i64 %cmp7.not = icmp sgt i64 %indvars.iv123, %10 br i1 %cmp7.not, label %for.cond23.preheader, label %for.body8, !llvm.loop !13 for.cond26.preheader: ; preds = %for.cond23.preheader, %for.inc59 %indvar = phi i64 [ %indvar.next, %for.inc59 ], [ 0, %for.cond23.preheader ] %.pre139141 = phi i32 [ %.pre139142, %for.inc59 ], [ %9, %for.cond23.preheader ] %11 = phi i32 [ %34, %for.inc59 ], [ %9, %for.cond23.preheader ] %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.inc59 ], [ 2, %for.cond23.preheader ] %add28113 = add nsw i32 %11, 1 %12 = sext i32 %add28113 to i64 %cmp29.not114 = icmp sgt i64 %indvars.iv136, %12 br i1 %cmp29.not114, label %for.inc59, label %for.body30.preheader for.body30.preheader: ; preds = %for.cond26.preheader %13 = trunc i64 %indvars.iv136 to i32 br label %for.body30 for.body30: ; preds = %for.body30.preheader, %for.inc56 %.pre139140 = phi i32 [ %.pre139141, %for.body30.preheader ], [ %.pre139, %for.inc56 ] %indvars.iv132 = phi i64 [ 0, %for.body30.preheader ], [ %indvars.iv.next133, %for.inc56 ] %indvars.iv127 = phi i32 [ %13, %for.body30.preheader ], [ %indvars.iv.next128, %for.inc56 ] %14 = add i64 %indvar, %indvars.iv132 %15 = trunc i64 %14 to i32 %16 = xor i32 %15, -1 %17 = zext i32 %indvars.iv127 to i64 %arrayidx32 = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %indvars.iv132 %18 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %arrayidx35 = getelementptr inbounds [502 x i32], ptr @r, i64 0, i64 %17 %19 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %cmp.i89 = icmp eq i32 %18, 10001 %cmp1.i90 = icmp eq i32 %19, 10001 %or.cond.i91 = and i1 %cmp.i89, %cmp1.i90 br i1 %or.cond.i91, label %width.exit104, label %if.else.i92 if.else.i92: ; preds = %for.body30 br i1 %cmp.i89, label %if.then3.i102, label %if.else4.i93 if.then3.i102: ; preds = %if.else.i92 %conv.i103 = sitofp i32 %19 to double br label %width.exit104 if.else4.i93: ; preds = %if.else.i92 br i1 %cmp1.i90, label %if.then7.i100, label %if.else9.i94 if.then7.i100: ; preds = %if.else4.i93 %conv8.i101 = sitofp i32 %18 to double br label %width.exit104 if.else9.i94: ; preds = %if.else4.i93 %mul.i95 = mul nsw i32 %19, %18 %conv10.i96 = sitofp i32 %mul.i95 to double %call.i97 = call double @sqrt(double noundef %conv10.i96) #5 %mul11.i98 = fmul double %call.i97, 2.000000e+00 %.pre139.pre = load i32, ptr %N, align 4, !tbaa !5 br label %width.exit104 width.exit104: ; preds = %for.body30, %if.then3.i102, %if.then7.i100, %if.else9.i94 %.pre139 = phi i32 [ %.pre139140, %if.then3.i102 ], [ %.pre139140, %if.then7.i100 ], [ %.pre139.pre, %if.else9.i94 ], [ %.pre139140, %for.body30 ] %retval.0.i99 = phi double [ %conv.i103, %if.then3.i102 ], [ %conv8.i101, %if.then7.i100 ], [ %mul11.i98, %if.else9.i94 ], [ 0.000000e+00, %for.body30 ] %arrayidx39 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %17 %20 = load double, ptr %arrayidx39, align 8, !tbaa !11 %arrayidx41 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %indvars.iv132 %21 = load double, ptr %arrayidx41, align 8, !tbaa !11 %sub42 = fsub double %20, %21 %sub43 = fsub double %retval.0.i99, %sub42 %cmp44 = fcmp ule double %sub43, 0.000000e+00 %add47 = add nsw i32 %.pre139, 1 %cmp48.not111 = icmp sgt i32 %indvars.iv127, %add47 %or.cond = select i1 %cmp44, i1 true, i1 %cmp48.not111 br i1 %or.cond, label %for.inc56, label %for.body49.preheader for.body49.preheader: ; preds = %width.exit104 %22 = add i32 %.pre139, %16 %23 = zext i32 %22 to i64 %24 = add nuw nsw i64 %23, 1 %min.iters.check = icmp ult i32 %22, 3 br i1 %min.iters.check, label %for.body49.preheader153, label %vector.ph vector.ph: ; preds = %for.body49.preheader %n.vec = and i64 %24, 8589934588 %ind.end = add nuw nsw i64 %n.vec, %17 %broadcast.splatinsert = insertelement <2 x double> poison, double %sub43, i64 0 %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %17 %25 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %offset.idx %wide.load = load <2 x double>, ptr %25, align 8, !tbaa !11 %26 = getelementptr inbounds double, ptr %25, i64 2 %wide.load152 = load <2 x double>, ptr %26, align 8, !tbaa !11 %27 = fadd <2 x double> %broadcast.splat, %wide.load %28 = fadd <2 x double> %broadcast.splat, %wide.load152 store <2 x double> %27, ptr %25, align 8, !tbaa !11 store <2 x double> %28, ptr %26, align 8, !tbaa !11 %index.next = add nuw i64 %index, 4 %29 = icmp eq i64 %index.next, %n.vec br i1 %29, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %24, %n.vec br i1 %cmp.n, label %for.inc56, label %for.body49.preheader153 for.body49.preheader153: ; preds = %for.body49.preheader, %middle.block %indvars.iv129.ph = phi i64 [ %17, %for.body49.preheader ], [ %ind.end, %middle.block ] br label %for.body49 for.body49: ; preds = %for.body49.preheader153, %for.body49 %indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.body49 ], [ %indvars.iv129.ph, %for.body49.preheader153 ] %arrayidx51 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %indvars.iv129 %30 = load double, ptr %arrayidx51, align 8, !tbaa !11 %add52 = fadd double %sub43, %30 store double %add52, ptr %arrayidx51, align 8, !tbaa !11 %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 %31 = trunc i64 %indvars.iv129 to i32 %cmp48.not = icmp slt i32 %.pre139, %31 br i1 %cmp48.not, label %for.inc56, label %for.body49, !llvm.loop !17 for.inc56: ; preds = %for.body49, %middle.block, %width.exit104 %indvars.iv.next133 = add nuw i64 %indvars.iv132, 1 %32 = add nuw nsw i64 %indvars.iv.next133, %indvars.iv136 %33 = trunc i64 %32 to i32 %cmp29.not = icmp slt i32 %add47, %33 %indvars.iv.next128 = add i32 %indvars.iv127, 1 br i1 %cmp29.not, label %for.inc59, label %for.body30, !llvm.loop !18 for.inc59: ; preds = %for.inc56, %for.cond26.preheader %.pre139142 = phi i32 [ %.pre139141, %for.cond26.preheader ], [ %.pre139, %for.inc56 ] %34 = phi i32 [ %11, %for.cond26.preheader ], [ %.pre139, %for.inc56 ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %35 = sext i32 %34 to i64 %cmp24.not.not = icmp slt i64 %indvars.iv136, %35 %indvar.next = add i64 %indvar, 1 br i1 %cmp24.not.not, label %for.cond26.preheader, label %for.end61, !llvm.loop !19 for.end61: ; preds = %for.inc59, %for.end, %for.cond23.preheader %.lcssa = phi i32 [ %9, %for.cond23.preheader ], [ %3, %for.end ], [ %34, %for.inc59 ] %add62 = add nsw i32 %.lcssa, 1 %idxprom63 = sext i32 %add62 to i64 %arrayidx64 = getelementptr inbounds [502 x double], ptr @WID, i64 0, i64 %idxprom63 %36 = load double, ptr %arrayidx64, align 8, !tbaa !11 %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %36) 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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 attributes #0 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"double", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !10, !16, !15} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> int main(void) { char b; scanf("%c", &b); if (b == 'A') { puts("T"); } else if (b == 'C') { puts("G"); } else if (b == 'G') { puts("C"); } else { puts("A"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157150/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157150/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"T\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"G\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"C\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i8, ptr %b, align 1, !tbaa !5 %switch.tableidx = add i8 %0, -65 %1 = icmp ult i8 %switch.tableidx, 7 br i1 %1, label %switch.lookup, label %if.end17 switch.lookup: ; preds = %entry %2 = sext i8 %switch.tableidx to i64 %reltable.shift = shl i64 %2, 2 %reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift) br label %if.end17 if.end17: ; preds = %entry, %switch.lookup %.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.4, %entry ] %call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read) declare ptr @llvm.load.relative.i64(ptr, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}