Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#if 0 cat <<EOF >mistaken-paste #endif // thx Ebi-chan! // #pragma GCC optimize("unroll-loops") // #pragma GCC optimize("O3") #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 2000000007LL #define VERYBIG 2000000000000000007LL #define ULTRABIG 300000000000000000000LL #define MOD 1000000007LL #define FOD 998244353LL #define HOD 1000000009LL #define IOD 100000007LL typedef uint64_t ull; typedef int64_t sll; #define N_MAX 1048576 #ifdef __cplusplus #include <queue> #include <stack> // #include <tuple> #include <set> #include <map> #include <string> #include <algorithm> // #include <functional> // #include <array> using std::queue; using std::priority_queue; using std::stack; // using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; using std::string; // using std::get; // using std::function; // using std::array; template <typename T, typename U> pair<T, U> operator+(pair<T, U> l, pair<T, U> r) { return pair<T, U>(l.first + r.first, l.second + r.second); } #endif #ifndef M_PI #define M_PI 3.14159265358979323846264338327950 #endif typedef struct { sll a; sll b; } hwll; typedef struct { sll a; sll b; sll c; } hwllc; typedef struct { hwll a; hwll b; } linell; typedef struct { double a; double b; } hwreal; sll n, m; sll h, w; sll k; sll q; sll va, vb, vc, vd, ve, vf; ull ua, ub, uc, ud, ue, uf; long double vra, vrb, vrc; double vda, vdb, vdc; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } double dmin (double x, double y) { return (x < y) ? x : y; } double dmax (double x, double y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #define BEGCMP(NAME) int32_t NAME (const void *left, const void *right) #define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right #define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1 // int32_t pullcomp (const void *left, const void *right) { // ull l = *(ull*)left; // ull r = *(ull*)right; // if (l < r) { // return -1; // } // if (l > r) { // return +1; // } // return 0; // } BEGCMP(pullcomp){ DEFLR(ull); CMPRET(l, r); return 0; } BEGCMP(prevcomp){ DEFLR(sll); CMPRET(r, l); return 0; } BEGCMP(psllcomp){ DEFLR(sll); CMPRET(l, r); return 0; } BEGCMP(pcharcomp){ DEFLR(char); CMPRET(l, r); return 0; } BEGCMP(pdoublecomp){ DEFLR(double); CMPRET(l, r); return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } BEGCMP(phwllABcomp){ DEFLR(hwll); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } BEGCMP(phwllREVcomp){ DEFLR(hwll); CMPRET(l.b, r.b); CMPRET(l.a, r.a); return 0; } BEGCMP(ptriplecomp){ DEFLR(hwllc); CMPRET(l.a, r.a); CMPRET(l.b, r.b); CMPRET(l.c, r.c); return 0; } BEGCMP(ptripleREVcomp){ DEFLR(hwllc); CMPRET(l.b, r.b); CMPRET(l.a, r.a); CMPRET(l.c, r.c); return 0; } BEGCMP(ptripleCABcomp){ DEFLR(hwllc); CMPRET(l.c, r.c); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } BEGCMP(phwrealcomp){ DEFLR(hwreal); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } int32_t pquadcomp (const void *left, const void *right) { linell l = *(linell*)left; linell r = *(linell*)right; sll ac = phwllABcomp(&(l.a), &(r.a)); if (ac) return ac; sll bc = phwllABcomp(&(l.b), &(r.b)); if (bc) return bc; return 0; } int32_t pfracomp (const void *left, const void *right) { hwll l = *(hwll*)left; hwll r = *(hwll*)right; CMPRET(l.a * r.b, l.b * r.a); return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } bool isinrange_soft (sll left, sll x, sll right) { return (left <= x && x <= right) || (left >= x && x >= right); } void sw (sll *l, sll *r) { if (*l == *r) return; sll t = *l; *l = *r; *r = t; } void uw (ull *l, ull *r) { if (*l == *r) return; ull t = *l; *l = *r; *r = t; } ull frac[N_MAX * 10], invf[N_MAX * 10]; void f_init (sll n, sll m) { frac[0] = 1; for (sll i = 1; i <= n; i++) { frac[i] = frac[i - 1] * i % m; } invf[n] = divide(1, frac[n], m); for (sll i = n - 1; i >= 0; i--) { invf[i] = invf[i + 1] * (i + 1) % m; } } ull ncr (sll n, sll r, ull m) { if (n < 0 || r < 0 || n < r) return 0; return frac[n] * (invf[r] * invf[n - r] % m) % m; } sll a[N_MAX * 5]; // ull a[N_MAX + 5]; // sll a[3001][3001]; sll b[N_MAX * 5]; // ull b[N_MAX + 5]; // sll b[3001][3001]; sll c[N_MAX * 5]; sll d[N_MAX * 5]; sll e[N_MAX * 4]; char s[N_MAX + 1]; // char s[3010][3010]; char t[N_MAX + 1]; // char t[3010][3010]; char u[N_MAX + 1]; hwll xy[N_MAX * 4]; hwllc tup[N_MAX * 4]; // sll table[3005][3005]; sll table[2005][2005]; ull gin[N_MAX]; // here we go void make (sll i, sll c) { if (i == n) { puts(s); return; } for (sll j = 0; j <= c; j++) { s[i] = 'a' + j; make(i + 1, smax(j + 1, c)); } } char extra[N_MAX]; // bool nogood[8054][8054]; bool nog1[88054]; bool nog2[88054]; bool nog3[88054]; 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; sll *dpcell; sll ns = strlen(s), nt = strlen(t), nu = strlen(u); for (i = 0; s[i]; i++) if (s[i] == '?') s[i] = 0; for (i = 0; t[i]; i++) if (t[i] == '?') t[i] = 0; for (i = 0; u[i]; i++) if (u[i] == '?') u[i] = 0; sll fix = 4020; for (i = 0; i < fix * 2; i++) { bool isng = false; for (j = 0; j < fix * 4; j++) { char ch = 0, dh = 0; if (isinrange(fix, j, fix + ns - 1)) { ch = s[j - fix]; } if (isinrange(i, j, i + nt - 1)) { dh = t[j - i]; } if (ch && dh && ch != dh) { isng = true; } } if (isng) { nog1[i] = true; } } for (i = 0; i < fix * 2; i++) { bool isng = false; for (j = 0; j < fix * 4; j++) { char ch = 0, dh = 0; if (isinrange(fix, j, fix + ns - 1)) { ch = s[j - fix]; } if (isinrange(i, j, i + nu - 1)) { dh = u[j - i]; } if (ch && dh && ch != dh) { isng = true; } } if (isng) { nog2[i] = true; } } for (i = 0; i < fix * 4; i++) { bool isng = false; for (j = 0; j < fix * 8; j++) { char ch = 0, dh = 0; if (isinrange(fix, j, fix + nt - 1)) { ch = t[j - fix]; } if (isinrange(i, j, i + nu - 1)) { dh = u[j - i]; } if (ch && dh && ch != dh) { isng = true; } } if (isng) { nog3[i] = true; } } result = VERYBIG; for (i = 0; i < fix * 2; i++) { for (j = 0; j < fix * 2; j++) { if (nog1[i]) continue; if (nog2[j]) continue; if (nog3[j - i + fix]) continue; sll l = smin(smin(i, j), fix); sll r = smax(smax(i + nt, j + nu), fix + ns); result = smin(result, r - l); } } printf("%lld\n", result); // printf("%.15f\n", dresult); // puts(s); return 0; success: // puts("YES"); puts("Yes"); // printf("%llu\n", result); // puts("0"); // puts("First"); return 0; fail: // puts("NO"); puts("No"); // puts("0"); // puts("-1"); // puts("-1 -1 -1"); // puts("Second"); return 1; } int32_t main (int argc, char *argv[]) { int32_t i, j; n = 3; m = 0; h = 5; // scanf("%llu", &m); // scanf("%lld", &w); // scanf("%lld%lld", &h, &w); // scanf("%lld", &n, &m); // scanf("%lld", &k, &n, &m); // scanf("%llu", &h, &w); // scanf("%lld", &q); // scanf("%lld%lld", &va, &vb, &vc, &vd); // va--; // vb--; // scanf("%llu%llu%llu%llu", &ua, &ub, &uc, &ud, &ue); scanf("%s", s); scanf("%s", t); scanf("%s", u); // scanf("%lld", &k); // scanf("%lld", &m); // scanf("%lld", &n); // for (i = 0; i < n; i++) { // // scanf("%s", s[i]); // scanf("%lld", &c[i]); // } // scanf(" %c", &ch); // scanf("%llu", &q); for (i = 0; i < 0; i++) { // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c); // scanf("%lld", &c[i]); scanf("%lld", &a[i]); // scanf("%lld", &b[i]); // scanf("%lld", &c[i]); // scanf("%lld", &d[i]); // scanf("%lld", &e[i]); // a[i]--; // b[i]--; // c[i]--; // d[i]--; // xy[i].a--; // xy[i].b--; // tup[i].a--; // tup[i].b--; } // scanf("%lld%lld", &va, &vb); // scanf("%llu", &m); // scanf("%llu", &q); // scanf("%s", t); // for (i = 0; i < m; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // // xy[i].a--; // // xy[i].b--; // // scanf("%lld", &a[i], &b[i]); // scanf("%lld", &b[i]); // // a[i]--; // // b[i]--; // // scanf("%lld", &c[i]); // // scanf("%lld", &d[i]); // // scanf("%lld", &e[i]); // // c[i]--; // // d[i]--; // } // for (i = 0; i < q; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld", &c[i]); // // xy[i].a--; // // xy[i].b--; // } // for (i = 0; i < h; i++) { // for (j = 0; j < w; j++) { // scanf("%lld", &table[i][j]); // // table[i][j]--; // } // } // for (i = 0; i < n; i++) { // scanf("%s", s[i]); // } // for (i = 0; i < n; i++) { // scanf("%s", t[i]); // } // scanf("%llu", &q); // for (i = 0; i < q; i++) { // scanf("%lld%lld%lld", &e[i], &c[i], &d[i]); // c[i]--; // } solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234255/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234255/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.hwll = type { i64, i64 } %struct.hwllc = type { i64, i64, i64 } @frac = dso_local local_unnamed_addr global [10485760 x i64] zeroinitializer, align 16 @invf = dso_local local_unnamed_addr global [10485760 x i64] zeroinitializer, align 16 @n = dso_local local_unnamed_addr global i64 0, align 8 @s = dso_local global [1048577 x i8] zeroinitializer, align 16 @t = dso_local global [1048577 x i8] zeroinitializer, align 16 @u = dso_local global [1048577 x i8] zeroinitializer, align 16 @nog1 = dso_local local_unnamed_addr global [88054 x i8] zeroinitializer, align 16 @nog2 = dso_local local_unnamed_addr global [88054 x i8] zeroinitializer, align 16 @nog3 = dso_local local_unnamed_addr global [88054 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @m = dso_local local_unnamed_addr global i64 0, align 8 @h = dso_local local_unnamed_addr global i64 0, align 8 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @a = dso_local local_unnamed_addr global [5242880 x i64] zeroinitializer, align 16 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @q = dso_local local_unnamed_addr global i64 0, align 8 @va = dso_local local_unnamed_addr global i64 0, align 8 @vb = dso_local local_unnamed_addr global i64 0, align 8 @vc = dso_local local_unnamed_addr global i64 0, align 8 @vd = dso_local local_unnamed_addr global i64 0, align 8 @ve = dso_local local_unnamed_addr global i64 0, align 8 @vf = dso_local local_unnamed_addr global i64 0, align 8 @ua = dso_local local_unnamed_addr global i64 0, align 8 @ub = dso_local local_unnamed_addr global i64 0, align 8 @uc = dso_local local_unnamed_addr global i64 0, align 8 @ud = dso_local local_unnamed_addr global i64 0, align 8 @ue = dso_local local_unnamed_addr global i64 0, align 8 @uf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @b = dso_local local_unnamed_addr global [5242880 x i64] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [5242880 x i64] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [5242880 x i64] zeroinitializer, align 16 @e = dso_local local_unnamed_addr global [4194304 x i64] zeroinitializer, align 16 @xy = dso_local local_unnamed_addr global [4194304 x %struct.hwll] zeroinitializer, align 16 @tup = dso_local local_unnamed_addr global [4194304 x %struct.hwllc] zeroinitializer, align 16 @table = dso_local local_unnamed_addr global [2005 x [2005 x i64]] zeroinitializer, align 16 @gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 @extra = dso_local local_unnamed_addr global [1048576 x i8] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dmin(double noundef %x, double noundef %y) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %x, %y %cond = select i1 %cmp, double %x, double %y ret double %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dmax(double noundef %x, double noundef %y) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %x, %y %cond = select i1 %cmp, double %x, double %y ret double %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %cmp4 = icmp eq i64 %y, 0 br i1 %cmp4, label %return, label %if.else if.else: ; preds = %entry, %if.else %y.tr6 = phi i64 [ %rem, %if.else ], [ %y, %entry ] %x.tr5 = phi i64 [ %y.tr6, %if.else ], [ %x, %entry ] %rem = urem i64 %x.tr5, %y.tr6 %cmp = icmp eq i64 %rem, 0 br i1 %cmp, label %return, label %if.else return: ; preds = %if.else, %entry %x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.else ] ret i64 %x.tr.lcssa } ; 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 #2 { 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 #2 { 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 #1 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #2 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %1, %0 %cmp1 = icmp sgt i64 %1, %0 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i8, ptr %left, align 1, !tbaa !12 %1 = load i8, ptr %right, align 1, !tbaa !12 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load double, ptr %left, align 8, !tbaa !13 %1 = load double, ptr %right, align 8, !tbaa !13 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp ogt double %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !15 %1 = load ptr, ptr %right, align 8, !tbaa !15 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #12 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptripleCABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = fcmp ogt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22 %l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19 %l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17 %l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24 %l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22 %r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19 %r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17 %r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24 %r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18 %cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp.i, label %cleanup10, label %if.end.i if.end.i: ; preds = %entry %cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4.i, label %cleanup10, label %if.end6.i if.end6.i: ; preds = %if.end.i %cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit phwllABcomp.exit: ; preds = %if.end6.i %cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp13.i.not, label %cleanup10, label %if.end if.end: ; preds = %phwllABcomp.exit %cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp.i21, label %cleanup10, label %if.end.i22 if.end.i22: ; preds = %if.end %cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24 if.end6.i24: ; preds = %if.end.i22 %cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26 if.end10.i26: ; preds = %if.end6.i24 %cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload %..i28 = zext i1 %cmp13.i27 to i32 br label %cleanup10 cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit %retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ] ret i32 %retval.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pfracomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %mul = mul nsw i64 %r.sroa.5.0.copyload, %l.sroa.0.0.copyload %mul3 = mul nsw i64 %r.sroa.0.0.copyload, %l.sroa.5.0.copyload %cmp = icmp slt i64 %mul, %mul3 %cmp10 = icmp sgt i64 %mul, %mul3 %. = zext i1 %cmp10 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. 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 #1 { entry: %cmp = icmp sle i64 %left, %x %cmp1 = icmp sle i64 %x, %right %0 = and i1 %cmp, %cmp1 ret i1 %0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #1 { entry: %cmp.not = icmp sgt i64 %left, %x %cmp1.not = icmp sgt i64 %x, %right %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %lor.rhs, label %lor.end lor.rhs: ; preds = %entry %cmp2 = icmp sge i64 %left, %x %cmp3 = icmp sge i64 %x, %right %0 = and i1 %cmp2, %cmp3 br label %lor.end lor.end: ; preds = %entry, %lor.rhs %1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ] ret i1 %1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @sw(ptr nocapture noundef %l, ptr nocapture noundef %r) local_unnamed_addr #6 { entry: %0 = load i64, ptr %l, align 8, !tbaa !8 %1 = load i64, ptr %r, align 8, !tbaa !8 %cmp = icmp eq i64 %0, %1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry store i64 %1, ptr %l, align 8, !tbaa !8 store i64 %0, ptr %r, align 8, !tbaa !8 br label %return return: ; preds = %entry, %if.end ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @uw(ptr nocapture noundef %l, ptr nocapture noundef %r) local_unnamed_addr #6 { entry: %0 = load i64, ptr %l, align 8, !tbaa !8 %1 = load i64, ptr %r, align 8, !tbaa !8 %cmp = icmp eq i64 %0, %1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry store i64 %1, ptr %l, align 8, !tbaa !8 store i64 %0, ptr %r, align 8, !tbaa !8 br label %return return: ; preds = %entry, %if.end ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @f_init(i64 noundef %n, i64 noundef %m) local_unnamed_addr #7 { entry: store i64 1, ptr @frac, align 16, !tbaa !8 %cmp.not30 = icmp slt i64 %n, 1 br i1 %cmp.not30, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %n, 1 %0 = icmp eq i64 %n, 1 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %n, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.body ] %i.031.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %mul.epil = mul i64 %.unr, %i.031.unr %rem.epil = urem i64 %mul.epil, %m %arrayidx1.epil = getelementptr inbounds [10485760 x i64], ptr @frac, i64 0, i64 %i.031.unr store i64 %rem.epil, ptr %arrayidx1.epil, align 8, !tbaa !8 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %sub.i = add i64 %m, -2 %tobool.not12.i.i = icmp eq i64 %sub.i, 0 br i1 %tobool.not12.i.i, label %divide.exit, label %while.body.i.i.preheader while.body.i.i.preheader: ; preds = %for.cond.cleanup %arrayidx2 = getelementptr inbounds [10485760 x i64], ptr @frac, i64 0, i64 %n %1 = load i64, ptr %arrayidx2, align 8, !tbaa !8 br label %while.body.i.i while.body.i.i: ; preds = %while.body.i.i.preheader, %if.end.i.i %result.015.i.i = phi i64 [ %result.1.i.i, %if.end.i.i ], [ 1, %while.body.i.i.preheader ] %a.addr.014.i.i = phi i64 [ %rem3.i.i, %if.end.i.i ], [ %1, %while.body.i.i.preheader ] %x.addr.013.i.i = phi i64 [ %div11.i.i, %if.end.i.i ], [ %sub.i, %while.body.i.i.preheader ] %and.i.i = and i64 %x.addr.013.i.i, 1 %tobool1.not.i.i = icmp eq i64 %and.i.i, 0 br i1 %tobool1.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 i64 %a.addr.014.i.i, %result.015.i.i %rem.i.i = urem i64 %mul.i.i, %m br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i, %while.body.i.i %result.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %result.015.i.i, %while.body.i.i ] %div11.i.i = lshr i64 %x.addr.013.i.i, 1 %mul2.i.i = mul i64 %a.addr.014.i.i, %a.addr.014.i.i %rem3.i.i = urem i64 %mul2.i.i, %m %tobool.not.i.i = icmp ult i64 %x.addr.013.i.i, 2 br i1 %tobool.not.i.i, label %divide.exit, label %while.body.i.i, !llvm.loop !5 divide.exit: ; preds = %if.end.i.i, %for.cond.cleanup %result.0.lcssa.i.i = phi i64 [ 1, %for.cond.cleanup ], [ %result.1.i.i, %if.end.i.i ] %rem.i = urem i64 %result.0.lcssa.i.i, %m %arrayidx3 = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %n store i64 %rem.i, ptr %arrayidx3, align 8, !tbaa !8 %cmp732 = icmp sgt i64 %n, 0 br i1 %cmp732, label %for.body9.preheader, label %for.cond.cleanup8 for.body9.preheader: ; preds = %divide.exit %xtraiter34 = and i64 %n, 1 %lcmp.mod35.not = icmp eq i64 %xtraiter34, 0 br i1 %lcmp.mod35.not, label %for.body9.prol.loopexit, label %for.body9.prol for.body9.prol: ; preds = %for.body9.preheader %i4.0.prol = add nsw i64 %n, -1 %mul12.prol = mul i64 %rem.i, %n %rem13.prol = urem i64 %mul12.prol, %m %arrayidx14.prol = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %i4.0.prol store i64 %rem13.prol, ptr %arrayidx14.prol, align 8, !tbaa !8 br label %for.body9.prol.loopexit for.body9.prol.loopexit: ; preds = %for.body9.prol, %for.body9.preheader %.unr36 = phi i64 [ %rem.i, %for.body9.preheader ], [ %rem13.prol, %for.body9.prol ] %i4.0.in33.unr = phi i64 [ %n, %for.body9.preheader ], [ %i4.0.prol, %for.body9.prol ] %2 = icmp eq i64 %n, 1 br i1 %2, label %for.cond.cleanup8, label %for.body9 for.body: ; preds = %for.body, %for.body.preheader.new %3 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ] %i.031 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %mul = mul i64 %3, %i.031 %rem = urem i64 %mul, %m %arrayidx1 = getelementptr inbounds [10485760 x i64], ptr @frac, i64 0, i64 %i.031 store i64 %rem, ptr %arrayidx1, align 8, !tbaa !8 %inc = add nuw i64 %i.031, 1 %mul.1 = mul i64 %rem, %inc %rem.1 = urem i64 %mul.1, %m %arrayidx1.1 = getelementptr inbounds [10485760 x i64], ptr @frac, i64 0, i64 %inc store i64 %rem.1, ptr %arrayidx1.1, align 8, !tbaa !8 %inc.1 = add nuw i64 %i.031, 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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !23 for.cond.cleanup8: ; preds = %for.body9.prol.loopexit, %for.body9, %divide.exit ret void for.body9: ; preds = %for.body9.prol.loopexit, %for.body9 %4 = phi i64 [ %rem13.1, %for.body9 ], [ %.unr36, %for.body9.prol.loopexit ] %i4.0.in33 = phi i64 [ %i4.0.1, %for.body9 ], [ %i4.0.in33.unr, %for.body9.prol.loopexit ] %i4.0 = add nsw i64 %i4.0.in33, -1 %mul12 = mul i64 %4, %i4.0.in33 %rem13 = urem i64 %mul12, %m %arrayidx14 = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %i4.0 store i64 %rem13, ptr %arrayidx14, align 8, !tbaa !8 %i4.0.1 = add nsw i64 %i4.0.in33, -2 %mul12.1 = mul i64 %rem13, %i4.0 %rem13.1 = urem i64 %mul12.1, %m %arrayidx14.1 = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %i4.0.1 store i64 %rem13.1, ptr %arrayidx14.1, align 8, !tbaa !8 %cmp7.1 = icmp ugt i64 %i4.0, 1 br i1 %cmp7.1, label %for.body9, label %for.cond.cleanup8, !llvm.loop !24 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r, i64 noundef %m) local_unnamed_addr #8 { entry: %0 = or i64 %r, %n %or.cond.not = icmp slt i64 %0, 0 %cmp3 = icmp slt i64 %n, %r %or.cond = or i1 %cmp3, %or.cond.not br i1 %or.cond, label %return, label %if.end if.end: ; preds = %entry %arrayidx = getelementptr inbounds [10485760 x i64], ptr @frac, i64 0, i64 %n %1 = load i64, ptr %arrayidx, align 8, !tbaa !8 %arrayidx4 = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %r %2 = load i64, ptr %arrayidx4, align 8, !tbaa !8 %sub = sub nsw i64 %n, %r %arrayidx5 = getelementptr inbounds [10485760 x i64], ptr @invf, i64 0, i64 %sub %3 = load i64, ptr %arrayidx5, align 8, !tbaa !8 %mul = mul i64 %3, %2 %rem = urem i64 %mul, %m %mul6 = mul i64 %rem, %1 %rem7 = urem i64 %mul6, %m br label %return return: ; preds = %entry, %if.end %retval.0 = phi i64 [ %rem7, %if.end ], [ 0, %entry ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @make(i64 noundef %i, i64 noundef %c) local_unnamed_addr #9 { entry: %0 = load i64, ptr @n, align 8, !tbaa !8 %cmp = icmp eq i64 %0, %i br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp1.not11 = icmp slt i64 %c, 0 br i1 %cmp1.not11, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %for.cond.preheader %arrayidx = getelementptr inbounds [1048577 x i8], ptr @s, i64 0, i64 %i %add2 = add nsw i64 %i, 1 br label %for.body if.then: ; preds = %entry %call = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @s) br label %for.end for.body: ; preds = %for.body.lr.ph, %for.body %j.012 = phi i64 [ 0, %for.body.lr.ph ], [ %add3, %for.body ] %1 = trunc i64 %j.012 to i8 %conv = add i8 %1, 97 store i8 %conv, ptr %arrayidx, align 1, !tbaa !12 %add3 = add nuw i64 %j.012, 1 %cond.i = tail call i64 @llvm.smax.i64(i64 %add3, i64 %c) tail call void @make(i64 noundef %add2, i64 noundef %cond.i) %exitcond.not = icmp eq i64 %j.012, %c br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !25 for.end: ; preds = %for.body, %for.cond.preheader, %if.then ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #10 ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #9 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #12 %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @t) #12 %call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @u) #12 br label %for.cond for.cond: ; preds = %for.inc, %entry %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.inc ] %arrayidx = getelementptr inbounds [1048577 x i8], ptr @s, i64 0, i64 %i.0 %0 = load i8, ptr %arrayidx, align 1, !tbaa !12 switch i8 %0, label %for.inc [ i8 0, label %for.cond6 i8 63, label %if.then ] if.then: ; preds = %for.cond store i8 0, ptr %arrayidx, align 1, !tbaa !12 br label %for.inc for.inc: ; preds = %for.cond, %if.then %inc = add nuw nsw i64 %i.0, 1 br label %for.cond, !llvm.loop !26 for.cond6: ; preds = %for.cond, %for.inc17 %i.1 = phi i64 [ %inc18, %for.inc17 ], [ 0, %for.cond ] %arrayidx7 = getelementptr inbounds [1048577 x i8], ptr @t, i64 0, i64 %i.1 %1 = load i8, ptr %arrayidx7, align 1, !tbaa !12 switch i8 %1, label %for.inc17 [ i8 0, label %for.cond20 i8 63, label %if.then14 ] if.then14: ; preds = %for.cond6 store i8 0, ptr %arrayidx7, align 1, !tbaa !12 br label %for.inc17 for.inc17: ; preds = %for.cond6, %if.then14 %inc18 = add nuw nsw i64 %i.1, 1 br label %for.cond6, !llvm.loop !27 for.cond20: ; preds = %for.cond6, %for.inc31 %i.2 = phi i64 [ %inc32, %for.inc31 ], [ 0, %for.cond6 ] %arrayidx21 = getelementptr inbounds [1048577 x i8], ptr @u, i64 0, i64 %i.2 %2 = load i8, ptr %arrayidx21, align 1, !tbaa !12 switch i8 %2, label %for.inc31 [ i8 0, label %for.cond34.preheader i8 63, label %if.then28 ] for.cond34.preheader: ; preds = %for.cond20 %sub = add nsw i64 %call, 4019 br label %for.cond38.preheader if.then28: ; preds = %for.cond20 store i8 0, ptr %arrayidx21, align 1, !tbaa !12 br label %for.inc31 for.inc31: ; preds = %for.cond20, %if.then28 %inc32 = add nuw nsw i64 %i.2, 1 br label %for.cond20, !llvm.loop !28 for.cond38.preheader: ; preds = %for.cond34.preheader, %if.end72 %i.3345 = phi i64 [ 0, %for.cond34.preheader ], [ %inc74, %if.end72 ] %add48 = add nsw i64 %i.3345, %call1 br label %for.body42 for.body42: ; preds = %for.cond38.preheader, %if.end54 %j.0344 = phi i64 [ 0, %for.cond38.preheader ], [ %inc67, %if.end54 ] %isng.0343 = phi i8 [ 0, %for.cond38.preheader ], [ %isng.1, %if.end54 ] %cmp.i = icmp ugt i64 %j.0344, 4019 %cmp1.i = icmp sle i64 %j.0344, %sub %3 = and i1 %cmp.i, %cmp1.i br i1 %3, label %if.then44, label %if.end47 if.then44: ; preds = %for.body42 %sub45 = add nsw i64 %j.0344, -4020 %arrayidx46 = getelementptr inbounds [1048577 x i8], ptr @s, i64 0, i64 %sub45 %4 = load i8, ptr %arrayidx46, align 1, !tbaa !12 br label %if.end47 if.end47: ; preds = %if.then44, %for.body42 %ch.0 = phi i8 [ %4, %if.then44 ], [ 0, %for.body42 ] %cmp.i326 = icmp ule i64 %i.3345, %j.0344 %cmp1.i327 = icmp slt i64 %j.0344, %add48 %5 = and i1 %cmp.i326, %cmp1.i327 br i1 %5, label %if.then51, label %if.end54 if.then51: ; preds = %if.end47 %sub52 = sub nsw i64 %j.0344, %i.3345 %arrayidx53 = getelementptr inbounds [1048577 x i8], ptr @t, i64 0, i64 %sub52 %6 = load i8, ptr %arrayidx53, align 1, !tbaa !12 br label %if.end54 if.end54: ; preds = %if.then51, %if.end47 %dh.0 = phi i8 [ %6, %if.then51 ], [ 0, %if.end47 ] %tobool56 = icmp eq i8 %ch.0, 0 %tobool58 = icmp eq i8 %dh.0, 0 %or.cond.not342 = select i1 %tobool56, i1 true, i1 %tobool58 %cmp62.not = icmp eq i8 %ch.0, %dh.0 %or.cond323 = select i1 %or.cond.not342, i1 true, i1 %cmp62.not %isng.1 = select i1 %or.cond323, i8 %isng.0343, i8 1 %inc67 = add nuw nsw i64 %j.0344, 1 %exitcond.not = icmp eq i64 %inc67, 16080 br i1 %exitcond.not, label %for.end68, label %for.body42, !llvm.loop !29 for.end68: ; preds = %if.end54 %7 = and i8 %isng.1, 1 %tobool69.not = icmp eq i8 %7, 0 br i1 %tobool69.not, label %if.end72, label %if.then70 if.then70: ; preds = %for.end68 %arrayidx71 = getelementptr inbounds [88054 x i8], ptr @nog1, i64 0, i64 %i.3345 store i8 1, ptr %arrayidx71, align 1, !tbaa !30 br label %if.end72 if.end72: ; preds = %if.then70, %for.end68 %inc74 = add nuw nsw i64 %i.3345, 1 %exitcond357.not = icmp eq i64 %inc74, 8040 br i1 %exitcond357.not, label %for.cond82.preheader, label %for.cond38.preheader, !llvm.loop !32 for.cond82.preheader: ; preds = %if.end72, %if.end121 %i.4348 = phi i64 [ %inc123, %if.end121 ], [ 0, %if.end72 ] %add96 = add nsw i64 %i.4348, %call2 br label %for.body86 for.cond125.preheader: ; preds = %if.end121 %sub139 = add nsw i64 %call1, 4019 br label %for.cond131.preheader for.body86: ; preds = %for.cond82.preheader, %if.end102 %j.1347 = phi i64 [ 0, %for.cond82.preheader ], [ %inc116, %if.end102 ] %isng81.0346 = phi i8 [ 0, %for.cond82.preheader ], [ %isng81.1, %if.end102 ] %cmp.i328 = icmp ugt i64 %j.1347, 4019 %cmp1.i329 = icmp sle i64 %j.1347, %sub %8 = and i1 %cmp.i328, %cmp1.i329 br i1 %8, label %if.then92, label %if.end95 if.then92: ; preds = %for.body86 %sub93 = add nsw i64 %j.1347, -4020 %arrayidx94 = getelementptr inbounds [1048577 x i8], ptr @s, i64 0, i64 %sub93 %9 = load i8, ptr %arrayidx94, align 1, !tbaa !12 br label %if.end95 if.end95: ; preds = %if.then92, %for.body86 %ch87.0 = phi i8 [ %9, %if.then92 ], [ 0, %for.body86 ] %cmp.i330 = icmp ule i64 %i.4348, %j.1347 %cmp1.i331 = icmp slt i64 %j.1347, %add96 %10 = and i1 %cmp.i330, %cmp1.i331 br i1 %10, label %if.then99, label %if.end102 if.then99: ; preds = %if.end95 %sub100 = sub nsw i64 %j.1347, %i.4348 %arrayidx101 = getelementptr inbounds [1048577 x i8], ptr @u, i64 0, i64 %sub100 %11 = load i8, ptr %arrayidx101, align 1, !tbaa !12 br label %if.end102 if.end102: ; preds = %if.then99, %if.end95 %dh88.0 = phi i8 [ %11, %if.then99 ], [ 0, %if.end95 ] %tobool104 = icmp eq i8 %ch87.0, 0 %tobool107 = icmp eq i8 %dh88.0, 0 %or.cond229.not341 = select i1 %tobool104, i1 true, i1 %tobool107 %cmp111.not = icmp eq i8 %ch87.0, %dh88.0 %or.cond324 = select i1 %or.cond229.not341, i1 true, i1 %cmp111.not %isng81.1 = select i1 %or.cond324, i8 %isng81.0346, i8 1 %inc116 = add nuw nsw i64 %j.1347, 1 %exitcond358.not = icmp eq i64 %inc116, 16080 br i1 %exitcond358.not, label %for.end117, label %for.body86, !llvm.loop !33 for.end117: ; preds = %if.end102 %12 = and i8 %isng81.1, 1 %tobool118.not = icmp eq i8 %12, 0 br i1 %tobool118.not, label %if.end121, label %if.then119 if.then119: ; preds = %for.end117 %arrayidx120 = getelementptr inbounds [88054 x i8], ptr @nog2, i64 0, i64 %i.4348 store i8 1, ptr %arrayidx120, align 1, !tbaa !30 br label %if.end121 if.end121: ; preds = %if.then119, %for.end117 %inc123 = add nuw nsw i64 %i.4348, 1 %exitcond359.not = icmp eq i64 %inc123, 8040 br i1 %exitcond359.not, label %for.cond125.preheader, label %for.cond82.preheader, !llvm.loop !34 for.cond131.preheader: ; preds = %for.cond125.preheader, %if.end170 %i.5351 = phi i64 [ 0, %for.cond125.preheader ], [ %inc172, %if.end170 ] %add145 = add nsw i64 %i.5351, %call2 br label %for.body135 for.cond174.preheader: ; preds = %if.end170 %add203 = add nsw i64 %call, 4020 br label %for.cond179.preheader for.body135: ; preds = %for.cond131.preheader, %if.end151 %j.2350 = phi i64 [ 0, %for.cond131.preheader ], [ %inc165, %if.end151 ] %isng130.0349 = phi i8 [ 0, %for.cond131.preheader ], [ %isng130.1, %if.end151 ] %cmp.i332 = icmp ugt i64 %j.2350, 4019 %cmp1.i333 = icmp sle i64 %j.2350, %sub139 %13 = and i1 %cmp.i332, %cmp1.i333 br i1 %13, label %if.then141, label %if.end144 if.then141: ; preds = %for.body135 %sub142 = add nsw i64 %j.2350, -4020 %arrayidx143 = getelementptr inbounds [1048577 x i8], ptr @t, i64 0, i64 %sub142 %14 = load i8, ptr %arrayidx143, align 1, !tbaa !12 br label %if.end144 if.end144: ; preds = %if.then141, %for.body135 %ch136.0 = phi i8 [ %14, %if.then141 ], [ 0, %for.body135 ] %cmp.i334 = icmp ule i64 %i.5351, %j.2350 %cmp1.i335 = icmp slt i64 %j.2350, %add145 %15 = and i1 %cmp.i334, %cmp1.i335 br i1 %15, label %if.then148, label %if.end151 if.then148: ; preds = %if.end144 %sub149 = sub nsw i64 %j.2350, %i.5351 %arrayidx150 = getelementptr inbounds [1048577 x i8], ptr @u, i64 0, i64 %sub149 %16 = load i8, ptr %arrayidx150, align 1, !tbaa !12 br label %if.end151 if.end151: ; preds = %if.then148, %if.end144 %dh137.0 = phi i8 [ %16, %if.then148 ], [ 0, %if.end144 ] %tobool153 = icmp eq i8 %ch136.0, 0 %tobool156 = icmp eq i8 %dh137.0, 0 %or.cond230.not340 = select i1 %tobool153, i1 true, i1 %tobool156 %cmp160.not = icmp eq i8 %ch136.0, %dh137.0 %or.cond325 = select i1 %or.cond230.not340, i1 true, i1 %cmp160.not %isng130.1 = select i1 %or.cond325, i8 %isng130.0349, i8 1 %inc165 = add nuw nsw i64 %j.2350, 1 %exitcond360.not = icmp eq i64 %inc165, 32160 br i1 %exitcond360.not, label %for.end166, label %for.body135, !llvm.loop !35 for.end166: ; preds = %if.end151 %17 = and i8 %isng130.1, 1 %tobool167.not = icmp eq i8 %17, 0 br i1 %tobool167.not, label %if.end170, label %if.then168 if.then168: ; preds = %for.end166 %arrayidx169 = getelementptr inbounds [88054 x i8], ptr @nog3, i64 0, i64 %i.5351 store i8 1, ptr %arrayidx169, align 1, !tbaa !30 br label %if.end170 if.end170: ; preds = %if.then168, %for.end166 %inc172 = add nuw nsw i64 %i.5351, 1 %exitcond361.not = icmp eq i64 %inc172, 16080 br i1 %exitcond361.not, label %for.cond174.preheader, label %for.cond131.preheader, !llvm.loop !36 for.cond179.preheader: ; preds = %for.cond174.preheader, %for.inc210 %i.6355 = phi i64 [ 0, %for.cond174.preheader ], [ %inc211, %for.inc210 ] %result.0354 = phi i64 [ 2000000000000000007, %for.cond174.preheader ], [ %.us-phi, %for.inc210 ] %arrayidx184 = getelementptr inbounds [88054 x i8], ptr @nog1, i64 0, i64 %i.6355 %18 = load i8, ptr %arrayidx184, align 1, !tbaa !30, !range !37, !noundef !38 %tobool185.not = icmp eq i8 %18, 0 %add200 = add nsw i64 %i.6355, %call1 br i1 %tobool185.not, label %for.body183.us, label %for.inc210 for.body183.us: ; preds = %for.cond179.preheader, %for.inc207.us %j.3353.us = phi i64 [ %inc208.us, %for.inc207.us ], [ 0, %for.cond179.preheader ] %result.1352.us = phi i64 [ %result.2.us, %for.inc207.us ], [ %result.0354, %for.cond179.preheader ] %arrayidx188.us = getelementptr inbounds [88054 x i8], ptr @nog2, i64 0, i64 %j.3353.us %19 = load i8, ptr %arrayidx188.us, align 1, !tbaa !30, !range !37, !noundef !38 %tobool189.not.us = icmp eq i8 %19, 0 br i1 %tobool189.not.us, label %if.end191.us, label %for.inc207.us if.end191.us: ; preds = %for.body183.us %reass.sub = sub nsw i64 %j.3353.us, %i.6355 %add193.us = add nsw i64 %reass.sub, 4020 %arrayidx194.us = getelementptr inbounds [88054 x i8], ptr @nog3, i64 0, i64 %add193.us %20 = load i8, ptr %arrayidx194.us, align 1, !tbaa !30, !range !37, !noundef !38 %tobool195.not.us = icmp eq i8 %20, 0 br i1 %tobool195.not.us, label %if.end197.us, label %for.inc207.us if.end197.us: ; preds = %if.end191.us %cond.i.us = tail call i64 @llvm.smin.i64(i64 %i.6355, i64 %j.3353.us) %cond.i336.us = tail call i64 @llvm.smin.i64(i64 %cond.i.us, i64 4020) %add201.us = add nsw i64 %j.3353.us, %call2 %cond.i337.us = tail call i64 @llvm.smax.i64(i64 %add200, i64 %add201.us) %cond.i338.us = tail call i64 @llvm.smax.i64(i64 %cond.i337.us, i64 %add203) %sub205.us = sub nsw i64 %cond.i338.us, %cond.i336.us %cond.i339.us = tail call i64 @llvm.smin.i64(i64 %result.1352.us, i64 %sub205.us) br label %for.inc207.us for.inc207.us: ; preds = %if.end197.us, %if.end191.us, %for.body183.us %result.2.us = phi i64 [ %result.1352.us, %for.body183.us ], [ %result.1352.us, %if.end191.us ], [ %cond.i339.us, %if.end197.us ] %inc208.us = add nuw nsw i64 %j.3353.us, 1 %exitcond362.not = icmp eq i64 %inc208.us, 8040 br i1 %exitcond362.not, label %for.inc210, label %for.body183.us, !llvm.loop !39 for.inc210: ; preds = %for.inc207.us, %for.cond179.preheader %.us-phi = phi i64 [ %result.0354, %for.cond179.preheader ], [ %result.2.us, %for.inc207.us ] %inc211 = add nuw nsw i64 %i.6355, 1 %exitcond363.not = icmp eq i64 %inc211, 8040 br i1 %exitcond363.not, label %for.end212, label %for.cond179.preheader, !llvm.loop !40 for.end212: ; preds = %for.inc210 %call213 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.us-phi) ret i64 0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #9 { entry: store i64 3, ptr @n, align 8, !tbaa !8 store i64 0, ptr @m, align 8, !tbaa !8 store i64 5, ptr @h, align 8, !tbaa !8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @s) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @t) %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @u) %call4 = tail call i64 @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #11 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 nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { 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 #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"long", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = !{!10, !10, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"double", !10, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !10, i64 0} !17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8} !18 = !{i64 0, i64 8, !8} !19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8} !20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13} !21 = !{i64 0, i64 8, !13} !22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = distinct !{!25, !6} !26 = distinct !{!26, !6} !27 = distinct !{!27, !6} !28 = distinct !{!28, !6} !29 = distinct !{!29, !6} !30 = !{!31, !31, i64 0} !31 = !{!"_Bool", !10, i64 0} !32 = distinct !{!32, !6} !33 = distinct !{!33, !6} !34 = distinct !{!34, !6} !35 = distinct !{!35, !6} !36 = distinct !{!36, !6} !37 = !{i8 0, i8 2} !38 = !{} !39 = distinct !{!39, !6} !40 = distinct !{!40, !6}
#include<stdio.h> int main(void){ int a[3], b[3]; for(int i = 0; i < 3; i++){ scanf("%d %d",&a[i],&b[i]); } int num[4] = {0}; int ans = 1; //1 == true, 0 == false for(int i = 0 ; i < 3; i++){ num[a[i]-1]++; num[b[i]-1]++; } for(int i = 0; i < 4; i++){ if(num[i] < 3) ans = 1; else{ans = 0; break;} } if(ans == 1)printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234299/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234299/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"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 [3 x i32], align 4 %b = alloca [3 x i32], align 4 %num = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2) call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %num) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %num, i8 0, i64 16, i1 false) %0 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %idxprom10 = sext i32 %sub to i64 %arrayidx11 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom10 %1 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %inc12 = add nsw i32 %1, 1 store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub15 = add nsw i32 %2, -1 %idxprom16 = sext i32 %sub15 to i64 %arrayidx17 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom16 %3 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %inc18 = add nsw i32 %3, 1 store i32 %inc18, ptr %arrayidx17, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %sub.1 = add nsw i32 %4, -1 %idxprom10.1 = sext i32 %sub.1 to i64 %arrayidx11.1 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom10.1 %5 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %inc12.1 = add nsw i32 %5, 1 store i32 %inc12.1, ptr %arrayidx11.1, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub15.1 = add nsw i32 %6, -1 %idxprom16.1 = sext i32 %sub15.1 to i64 %arrayidx17.1 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom16.1 %7 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %inc18.1 = add nsw i32 %7, 1 store i32 %inc18.1, ptr %arrayidx17.1, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %sub.2 = add nsw i32 %8, -1 %idxprom10.2 = sext i32 %sub.2 to i64 %arrayidx11.2 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom10.2 %9 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5 %inc12.2 = add nsw i32 %9, 1 store i32 %inc12.2, ptr %arrayidx11.2, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %sub15.2 = add nsw i32 %10, -1 %idxprom16.2 = sext i32 %sub15.2 to i64 %arrayidx17.2 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom16.2 %11 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %inc18.2 = add nsw i32 %11, 1 store i32 %inc18.2, ptr %arrayidx17.2, align 4, !tbaa !5 %12 = load <4 x i32>, ptr %num, align 16 %.fr = freeze <4 x i32> %12 %13 = icmp sgt <4 x i32> %.fr, <i32 2, i32 2, i32 2, i32 2> %14 = bitcast <4 x i1> %13 to i4 %15 = icmp eq i4 %14, 0 %str.3.str = select i1 %15, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %num) #5 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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"}
#include <stdio.h> int main(void) { int a[3],b[3],i; int c[4]={}; for (i=0;i<3;i++) scanf("%d %d",&a[i],&b[i]); for (i=0;i<3;i++) { c[a[i]-1]++; c[b[i]-1]++; } for (i=0;i<4;i++) { if (c[i]>=3) { printf("NO\n"); return 0; } } printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3 x i32], align 4 %b = alloca [3 x i32], align 4 %c = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %c, i8 0, i64 16, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1) %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2) %0 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom8 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %inc10 = add nsw i32 %1, 1 store i32 %inc10, ptr %arrayidx9, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub13 = add nsw i32 %2, -1 %idxprom14 = sext i32 %sub13 to i64 %arrayidx15 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom14 %3 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %inc16 = add nsw i32 %3, 1 store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %sub.1 = add nsw i32 %4, -1 %idxprom8.1 = sext i32 %sub.1 to i64 %arrayidx9.1 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom8.1 %5 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %inc10.1 = add nsw i32 %5, 1 store i32 %inc10.1, ptr %arrayidx9.1, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %sub13.1 = add nsw i32 %6, -1 %idxprom14.1 = sext i32 %sub13.1 to i64 %arrayidx15.1 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom14.1 %7 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %inc16.1 = add nsw i32 %7, 1 store i32 %inc16.1, ptr %arrayidx15.1, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %sub.2 = add nsw i32 %8, -1 %idxprom8.2 = sext i32 %sub.2 to i64 %arrayidx9.2 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom8.2 %9 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5 %inc10.2 = add nsw i32 %9, 1 store i32 %inc10.2, ptr %arrayidx9.2, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %sub13.2 = add nsw i32 %10, -1 %idxprom14.2 = sext i32 %sub13.2 to i64 %arrayidx15.2 = getelementptr inbounds [4 x i32], ptr %c, i64 0, i64 %idxprom14.2 %11 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5 %inc16.2 = add nsw i32 %11, 1 store i32 %inc16.2, ptr %arrayidx15.2, align 4, !tbaa !5 %12 = load <4 x i32>, ptr %c, align 16 %.fr = freeze <4 x i32> %12 %13 = icmp sgt <4 x i32> %.fr, <i32 2, i32 2, i32 2, i32 2> %14 = bitcast <4 x i1> %13 to i4 %.not = icmp eq i4 %14, 0 %str.3.str = select i1 %.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 12, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int cpll(int p0[2],int p1[2],int p2[2],int p3[2],double *x,double *y){ int a=p1[0]-p0[0],c=p2[0]-p0[0],e=p3[0]-p2[0]; int b=p1[1]-p0[1],d=p2[1]-p0[1],f=p3[1]-p2[1]; if(b*e-a*f==0)return 0; *x=p2[0]+1.0*e*(a*d-b*c)/(b*e-a*f); *y=p2[1]+1.0*f*(a*d-b*c)/(b*e-a*f); return 1; } int main(){ int p[4][2],n,i; double x,y; scanf("%d",&n); while(n--){ for(i=0;i<8;i++)scanf("%d",&p[i/2][i%2]); if(cpll(p[0],p[1],p[2],p[3],&x,&y))printf("%.9f %0.9f\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234385/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%.9f %0.9f\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @cpll(ptr nocapture noundef readonly %p0, ptr nocapture noundef readonly %p1, ptr nocapture noundef readonly %p2, ptr nocapture noundef readonly %p3, ptr nocapture noundef writeonly %x, ptr nocapture noundef writeonly %y) local_unnamed_addr #0 { entry: %0 = load i32, ptr %p1, align 4, !tbaa !5 %1 = load i32, ptr %p0, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %p2, align 4, !tbaa !5 %3 = load i32, ptr %p3, align 4, !tbaa !5 %sub7 = sub nsw i32 %3, %2 %arrayidx8 = getelementptr inbounds i32, ptr %p1, i64 1 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %arrayidx9 = getelementptr inbounds i32, ptr %p0, i64 1 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %sub10 = sub nsw i32 %4, %5 %arrayidx11 = getelementptr inbounds i32, ptr %p2, i64 1 %6 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds i32, ptr %p3, i64 1 %7 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %sub16 = sub nsw i32 %7, %6 %mul = mul nsw i32 %sub10, %sub7 %mul17 = mul nsw i32 %sub16, %sub %cmp = icmp eq i32 %mul, %mul17 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %sub18 = sub nsw i32 %mul, %mul17 %sub13 = sub nsw i32 %6, %5 %sub4.neg = sub i32 %1, %2 %conv = sitofp i32 %2 to double %conv20 = sitofp i32 %sub7 to double %mul22 = mul nsw i32 %sub13, %sub %mul23.neg = mul i32 %sub10, %sub4.neg %sub24 = add i32 %mul22, %mul23.neg %conv25 = sitofp i32 %sub24 to double %mul26 = fmul double %conv20, %conv25 %conv30 = sitofp i32 %sub18 to double %div = fdiv double %mul26, %conv30 %add = fadd double %div, %conv store double %add, ptr %x, align 8, !tbaa !9 %conv32 = sitofp i32 %6 to double %conv33 = sitofp i32 %sub16 to double %mul39 = fmul double %conv33, %conv25 %div44 = fdiv double %mul39, %conv30 %add45 = fadd double %div44, %conv32 store double %add45, ptr %y, align 8, !tbaa !9 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ 1, %if.end ], [ 0, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %p = alloca [4 x [2 x i32]], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %p) #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 %dec25 = add nsw i32 %0, -1 store i32 %dec25, ptr %n, align 4, !tbaa !5 %tobool.not26 = icmp eq i32 %0, 0 br i1 %tobool.not26, label %while.end, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %entry %arrayidx5 = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 1 %arrayidx7 = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 2 %arrayidx9 = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 3 %arrayidx8.i = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 1, i64 1 %arrayidx9.i = getelementptr inbounds i32, ptr %p, i64 1 %arrayidx11.i = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 2, i64 1 %arrayidx14.i = getelementptr inbounds [4 x [2 x i32]], ptr %p, i64 0, i64 3, i64 1 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %if.end %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p) %call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.i) %call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %call3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.i) %call3.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %call3.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx11.i) %call3.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %call3.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx14.i) %1 = load i32, ptr %arrayidx5, align 8, !tbaa !5 %2 = load i32, ptr %p, align 16, !tbaa !5 %sub.i = sub nsw i32 %1, %2 %3 = load i32, ptr %arrayidx7, align 16, !tbaa !5 %4 = load i32, ptr %arrayidx9, align 8, !tbaa !5 %sub7.i = sub nsw i32 %4, %3 %5 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5 %sub10.i = sub nsw i32 %5, %6 %7 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %sub16.i = sub nsw i32 %8, %7 %mul.i = mul nsw i32 %sub10.i, %sub7.i %mul17.i = mul nsw i32 %sub16.i, %sub.i %cmp.i = icmp eq i32 %mul.i, %mul17.i br i1 %cmp.i, label %if.end, label %if.then if.then: ; preds = %for.cond.preheader %sub18.i = sub nsw i32 %mul.i, %mul17.i %sub13.i = sub nsw i32 %7, %6 %sub4.neg.i = sub i32 %2, %3 %conv.i = sitofp i32 %3 to double %conv20.i = sitofp i32 %sub7.i to double %mul22.i = mul nsw i32 %sub13.i, %sub.i %mul23.neg.i = mul i32 %sub10.i, %sub4.neg.i %sub24.i = add i32 %mul22.i, %mul23.neg.i %conv25.i = sitofp i32 %sub24.i to double %mul26.i = fmul double %conv20.i, %conv25.i %conv30.i = sitofp i32 %sub18.i to double %div.i = fdiv double %mul26.i, %conv30.i %add.i = fadd double %div.i, %conv.i %conv32.i = sitofp i32 %7 to double %conv33.i = sitofp i32 %sub16.i to double %mul39.i = fmul double %conv33.i, %conv25.i %div44.i = fdiv double %mul39.i, %conv30.i %add45.i = fadd double %div44.i, %conv32.i %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %add.i, double noundef %add45.i) br label %if.end if.end: ; preds = %for.cond.preheader, %if.then %9 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %9, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %9, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %p) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = !{!10, !10, i64 0} !10 = !{!"double", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int length_h[1500000],length_w[1500000]; int main(void){ int N,M,h[1501],w[1501],i,j,k,hh,ww,score; while(1){ scanf("%d %d",&N,&M); if(N==0&&M==0){break;} for(i=1;i<=N;i++){scanf("%d",&h[i]);} for(i=1;i<=M;i++){scanf("%d",&w[i]);} score=0; for(i=1;i<=1500000;i++){length_h[i]=0;length_w[i]=0;} for(i=1;i<=N;i++){ for(j=0;j<=N-i;j++){ hh=0; for(k=1;k<=i;k++){ hh+=h[j+k]; } length_h[hh]++; } } for(i=1;i<=M;i++){ for(j=0;j<=M-i;j++){ ww=0; for(k=1;k<=i;k++){ ww+=w[j+k]; } length_w[ww]++; } } for(i=1;i<=1500000;i++){ score+=(length_h[i]*length_w[i]); } printf("%d\n",score); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234428/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @length_h = dso_local local_unnamed_addr global [1500000 x i32] zeroinitializer, align 16 @length_w = dso_local local_unnamed_addr global [1500000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %h = alloca [1501 x i32], align 16 %w = alloca [1501 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 6004, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 6004, ptr nonnull %w) #5 %call138 = 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 %cmp139 = icmp eq i32 %0, 0 %1 = load i32, ptr %M, align 4 %cmp1140 = icmp eq i32 %1, 0 %or.cond141 = select i1 %cmp139, i1 %cmp1140, i1 false br i1 %or.cond141, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %middle.block %2 = phi i32 [ %35, %middle.block ], [ %1, %entry ] %3 = phi i32 [ %34, %middle.block ], [ %0, %entry ] %cmp2.not119 = icmp slt i32 %3, 1 br i1 %cmp2.not119, label %for.cond4.preheader, label %for.body for.cond4.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %M, align 4, !tbaa !5 br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit, %for.cond.preheader %4 = phi i32 [ %6, %for.cond4.preheader.loopexit ], [ %3, %for.cond.preheader ] %5 = phi i32 [ %.pre, %for.cond4.preheader.loopexit ], [ %2, %for.cond.preheader ] %cmp5.not121 = icmp slt i32 %5, 1 br i1 %cmp5.not121, label %for.cond13.preheader, label %for.body6 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1501 x i32], ptr %h, 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 %6 = load i32, ptr %N, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp2.not.not, label %for.body, label %for.cond4.preheader.loopexit, !llvm.loop !9 for.cond13.preheader.loopexit: ; preds = %for.body6 %.pre191 = load i32, ptr %N, align 4, !tbaa !5 br label %for.cond13.preheader for.cond13.preheader: ; preds = %for.cond13.preheader.loopexit, %for.cond4.preheader %8 = phi i32 [ %4, %for.cond4.preheader ], [ %.pre191, %for.cond13.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond4.preheader ], [ %9, %for.cond13.preheader.loopexit ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(6000000) getelementptr inbounds ([1500000 x i32], ptr @length_h, i64 0, i64 1), i8 0, i64 6000000, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(6000000) getelementptr inbounds ([1500000 x i32], ptr @length_w, i64 0, i64 1), i8 0, i64 6000000, i1 false), !tbaa !5 %cmp24.not128 = icmp slt i32 %8, 1 br i1 %cmp24.not128, label %for.cond47.preheader, label %for.cond26.preheader.preheader for.body6: ; preds = %for.cond4.preheader, %for.body6 %indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.body6 ], [ 1, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds [1501 x i32], ptr %w, i64 0, i64 %indvars.iv144 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8) %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %9 = load i32, ptr %M, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp5.not.not = icmp slt i64 %indvars.iv144, %10 br i1 %cmp5.not.not, label %for.body6, label %for.cond13.preheader.loopexit, !llvm.loop !11 for.cond26.preheader.preheader: ; preds = %for.cond13.preheader %11 = add nuw i32 %8, 2 %wide.trip.count166 = zext i32 %11 to i64 br label %for.cond26.preheader for.cond47.preheader: ; preds = %for.inc44, %for.cond13.preheader %cmp48.not134 = icmp slt i32 %.lcssa, 1 br i1 %cmp48.not134, label %vector.body.preheader, label %for.cond50.preheader.preheader for.cond50.preheader.preheader: ; preds = %for.cond47.preheader %12 = add nuw i32 %.lcssa, 2 %wide.trip.count185 = zext i32 %12 to i64 br label %for.cond50.preheader for.cond26.preheader: ; preds = %for.cond26.preheader.preheader, %for.inc44 %indvar214 = phi i64 [ 0, %for.cond26.preheader.preheader ], [ %indvar.next215, %for.inc44 ] %indvars.iv163 = phi i64 [ 2, %for.cond26.preheader.preheader ], [ %indvars.iv.next164, %for.inc44 ] %indvars.iv159 = phi i32 [ %8, %for.cond26.preheader.preheader ], [ %indvars.iv.next160, %for.inc44 ] %i.3129 = phi i32 [ 1, %for.cond26.preheader.preheader ], [ %inc45, %for.inc44 ] %13 = add i64 %indvar214, 1 %cmp27.not126 = icmp slt i32 %8, %i.3129 br i1 %cmp27.not126, label %for.inc44, label %for.cond29.preheader.preheader for.cond29.preheader.preheader: ; preds = %for.cond26.preheader %wide.trip.count161 = zext i32 %indvars.iv159 to i64 %min.iters.check218 = icmp ult i64 %13, 8 %n.vec221 = and i64 %13, -8 %ind.end222 = or i64 %n.vec221, 1 %cmp.n224 = icmp eq i64 %13, %n.vec221 br label %for.cond29.preheader for.cond29.preheader: ; preds = %for.cond29.preheader.preheader, %for.end37 %indvars.iv156 = phi i64 [ 0, %for.cond29.preheader.preheader ], [ %indvars.iv.next157, %for.end37 ] br i1 %min.iters.check218, label %for.body31.preheader, label %vector.body225 vector.body225: ; preds = %for.cond29.preheader, %vector.body225 %index226 = phi i64 [ %index.next232, %vector.body225 ], [ 0, %for.cond29.preheader ] %vec.phi227 = phi <4 x i32> [ %17, %vector.body225 ], [ zeroinitializer, %for.cond29.preheader ] %vec.phi228 = phi <4 x i32> [ %18, %vector.body225 ], [ zeroinitializer, %for.cond29.preheader ] %offset.idx229 = or i64 %index226, 1 %14 = add nuw nsw i64 %offset.idx229, %indvars.iv156 %15 = getelementptr inbounds [1501 x i32], ptr %h, i64 0, i64 %14 %wide.load230 = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = getelementptr inbounds i32, ptr %15, i64 4 %wide.load231 = load <4 x i32>, ptr %16, align 4, !tbaa !5 %17 = add <4 x i32> %wide.load230, %vec.phi227 %18 = add <4 x i32> %wide.load231, %vec.phi228 %index.next232 = add nuw i64 %index226, 8 %19 = icmp eq i64 %index.next232, %n.vec221 br i1 %19, label %middle.block216, label %vector.body225, !llvm.loop !12 middle.block216: ; preds = %vector.body225 %bin.rdx233 = add <4 x i32> %18, %17 %20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx233) br i1 %cmp.n224, label %for.end37, label %for.body31.preheader for.body31.preheader: ; preds = %for.cond29.preheader, %middle.block216 %indvars.iv150.ph = phi i64 [ 1, %for.cond29.preheader ], [ %ind.end222, %middle.block216 ] %hh.0125.ph = phi i32 [ 0, %for.cond29.preheader ], [ %20, %middle.block216 ] br label %for.body31 for.body31: ; preds = %for.body31.preheader, %for.body31 %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.body31 ], [ %indvars.iv150.ph, %for.body31.preheader ] %hh.0125 = phi i32 [ %add34, %for.body31 ], [ %hh.0125.ph, %for.body31.preheader ] %21 = add nuw nsw i64 %indvars.iv150, %indvars.iv156 %arrayidx33 = getelementptr inbounds [1501 x i32], ptr %h, i64 0, i64 %21 %22 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %add34 = add nsw i32 %22, %hh.0125 %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %exitcond.not = icmp eq i64 %indvars.iv.next151, %indvars.iv163 br i1 %exitcond.not, label %for.end37, label %for.body31, !llvm.loop !15 for.end37: ; preds = %for.body31, %middle.block216 %add34.lcssa = phi i32 [ %20, %middle.block216 ], [ %add34, %for.body31 ] %idxprom38 = sext i32 %add34.lcssa to i64 %arrayidx39 = getelementptr inbounds [1500000 x i32], ptr @length_h, i64 0, i64 %idxprom38 %23 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %inc40 = add nsw i32 %23, 1 store i32 %inc40, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count161 br i1 %exitcond162.not, label %for.inc44, label %for.cond29.preheader, !llvm.loop !16 for.inc44: ; preds = %for.end37, %for.cond26.preheader %inc45 = add nuw nsw i32 %i.3129, 1 %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %indvars.iv.next160 = add i32 %indvars.iv159, -1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 %indvar.next215 = add i64 %indvar214, 1 br i1 %exitcond167.not, label %for.cond47.preheader, label %for.cond26.preheader, !llvm.loop !17 vector.body: ; preds = %vector.body.preheader, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ] %vec.phi = phi <4 x i32> [ %30, %vector.body ], [ zeroinitializer, %vector.body.preheader ] %vec.phi196 = phi <4 x i32> [ %31, %vector.body ], [ zeroinitializer, %vector.body.preheader ] %offset.idx = or i64 %index, 1 %24 = getelementptr inbounds [1500000 x i32], ptr @length_h, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %24, align 4, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load197 = load <4 x i32>, ptr %25, align 4, !tbaa !5 %26 = getelementptr inbounds [1500000 x i32], ptr @length_w, i64 0, i64 %offset.idx %wide.load198 = load <4 x i32>, ptr %26, align 4, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load199 = load <4 x i32>, ptr %27, align 4, !tbaa !5 %28 = mul nsw <4 x i32> %wide.load198, %wide.load %29 = mul nsw <4 x i32> %wide.load199, %wide.load197 %30 = add <4 x i32> %28, %vec.phi %31 = add <4 x i32> %29, %vec.phi196 %index.next = add nuw i64 %index, 8 %32 = icmp eq i64 %index.next, 1500000 br i1 %32, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %31, %30 %33 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %34 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp eq i32 %34, 0 %35 = load i32, ptr %M, align 4 %cmp1 = icmp eq i32 %35, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader for.cond50.preheader: ; preds = %for.cond50.preheader.preheader, %for.inc70 %indvar = phi i64 [ 0, %for.cond50.preheader.preheader ], [ %indvar.next, %for.inc70 ] %indvars.iv182 = phi i64 [ 2, %for.cond50.preheader.preheader ], [ %indvars.iv.next183, %for.inc70 ] %indvars.iv178 = phi i32 [ %.lcssa, %for.cond50.preheader.preheader ], [ %indvars.iv.next179, %for.inc70 ] %i.4135 = phi i32 [ 1, %for.cond50.preheader.preheader ], [ %inc71, %for.inc70 ] %36 = add i64 %indvar, 1 %cmp52.not132 = icmp slt i32 %.lcssa, %i.4135 br i1 %cmp52.not132, label %for.inc70, label %for.cond54.preheader.preheader for.cond54.preheader.preheader: ; preds = %for.cond50.preheader %wide.trip.count180 = zext i32 %indvars.iv178 to i64 %min.iters.check = icmp ult i64 %36, 8 %n.vec = and i64 %36, -8 %ind.end = or i64 %n.vec, 1 %cmp.n = icmp eq i64 %36, %n.vec br label %for.cond54.preheader for.cond54.preheader: ; preds = %for.cond54.preheader.preheader, %for.end63 %indvars.iv175 = phi i64 [ 0, %for.cond54.preheader.preheader ], [ %indvars.iv.next176, %for.end63 ] br i1 %min.iters.check, label %for.body56.preheader, label %vector.body204 vector.body204: ; preds = %for.cond54.preheader, %vector.body204 %index205 = phi i64 [ %index.next211, %vector.body204 ], [ 0, %for.cond54.preheader ] %vec.phi206 = phi <4 x i32> [ %40, %vector.body204 ], [ zeroinitializer, %for.cond54.preheader ] %vec.phi207 = phi <4 x i32> [ %41, %vector.body204 ], [ zeroinitializer, %for.cond54.preheader ] %offset.idx208 = or i64 %index205, 1 %37 = add nuw nsw i64 %offset.idx208, %indvars.iv175 %38 = getelementptr inbounds [1501 x i32], ptr %w, i64 0, i64 %37 %wide.load209 = load <4 x i32>, ptr %38, align 4, !tbaa !5 %39 = getelementptr inbounds i32, ptr %38, i64 4 %wide.load210 = load <4 x i32>, ptr %39, align 4, !tbaa !5 %40 = add <4 x i32> %wide.load209, %vec.phi206 %41 = add <4 x i32> %wide.load210, %vec.phi207 %index.next211 = add nuw i64 %index205, 8 %42 = icmp eq i64 %index.next211, %n.vec br i1 %42, label %middle.block200, label %vector.body204, !llvm.loop !19 middle.block200: ; preds = %vector.body204 %bin.rdx212 = add <4 x i32> %41, %40 %43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx212) br i1 %cmp.n, label %for.end63, label %for.body56.preheader for.body56.preheader: ; preds = %for.cond54.preheader, %middle.block200 %indvars.iv168.ph = phi i64 [ 1, %for.cond54.preheader ], [ %ind.end, %middle.block200 ] %ww.0131.ph = phi i32 [ 0, %for.cond54.preheader ], [ %43, %middle.block200 ] br label %for.body56 for.body56: ; preds = %for.body56.preheader, %for.body56 %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.body56 ], [ %indvars.iv168.ph, %for.body56.preheader ] %ww.0131 = phi i32 [ %add60, %for.body56 ], [ %ww.0131.ph, %for.body56.preheader ] %44 = add nuw nsw i64 %indvars.iv168, %indvars.iv175 %arrayidx59 = getelementptr inbounds [1501 x i32], ptr %w, i64 0, i64 %44 %45 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %add60 = add nsw i32 %45, %ww.0131 %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond174.not = icmp eq i64 %indvars.iv.next169, %indvars.iv182 br i1 %exitcond174.not, label %for.end63, label %for.body56, !llvm.loop !20 for.end63: ; preds = %for.body56, %middle.block200 %add60.lcssa = phi i32 [ %43, %middle.block200 ], [ %add60, %for.body56 ] %idxprom64 = sext i32 %add60.lcssa to i64 %arrayidx65 = getelementptr inbounds [1500000 x i32], ptr @length_w, i64 0, i64 %idxprom64 %46 = load i32, ptr %arrayidx65, align 4, !tbaa !5 %inc66 = add nsw i32 %46, 1 store i32 %inc66, ptr %arrayidx65, align 4, !tbaa !5 %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %exitcond181.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count180 br i1 %exitcond181.not, label %for.inc70, label %for.cond54.preheader, !llvm.loop !21 for.inc70: ; preds = %for.end63, %for.cond50.preheader %inc71 = add nuw nsw i32 %i.4135, 1 %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1 %indvars.iv.next179 = add i32 %indvars.iv178, -1 %exitcond186.not = icmp eq i64 %indvars.iv.next183, %wide.trip.count185 %indvar.next = add i64 %indvar, 1 br i1 %exitcond186.not, label %vector.body.preheader, label %for.cond50.preheader, !llvm.loop !22 vector.body.preheader: ; preds = %for.inc70, %for.cond47.preheader br label %vector.body while.end: ; preds = %middle.block, %entry call void @llvm.lifetime.end.p0(i64 6004, ptr nonnull %w) #5 call void @llvm.lifetime.end.p0(i64 6004, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !13, !14} !19 = distinct !{!19, !10, !13, !14} !20 = distinct !{!20, !10, !14, !13} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#include <stdio.h> int main(){ int s_cnt = 0; int ans = 0; while(1){ char c = getchar(); if(c == 'S'){ s_cnt++; ans++; }else if(c == 'T' && s_cnt > 0){ s_cnt--; ans--; }else if(c == 'T'){ ans++; }else{ break; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234479/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234479/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond.outer while.cond.outer: ; preds = %while.cond.outer.backedge, %entry %s_cnt.0.ph = phi i32 [ 0, %entry ], [ %s_cnt.0.ph.be, %while.cond.outer.backedge ] %ans.0.ph = phi i32 [ 0, %entry ], [ %ans.0.ph.be, %while.cond.outer.backedge ] %cmp7 = icmp sgt i32 %s_cnt.0.ph, 0 br label %while.cond while.cond: ; preds = %while.cond.outer, %if.else11 %ans.0 = phi i32 [ %inc16, %if.else11 ], [ %ans.0.ph, %while.cond.outer ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i, 24 %cmp = icmp eq i32 %sext, 1392508928 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.cond %inc = add nsw i32 %s_cnt.0.ph, 1 %inc3 = add nsw i32 %ans.0, 1 br label %while.cond.outer.backedge while.cond.outer.backedge: ; preds = %if.then, %if.then9 %s_cnt.0.ph.be = phi i32 [ %dec, %if.then9 ], [ %inc, %if.then ] %ans.0.ph.be = phi i32 [ %dec10, %if.then9 ], [ %inc3, %if.then ] br label %while.cond.outer if.else: ; preds = %while.cond %cmp5 = icmp eq i32 %sext, 1409286144 %or.cond = select i1 %cmp5, i1 %cmp7, i1 false br i1 %or.cond, label %if.then9, label %if.else11 if.then9: ; preds = %if.else %dec = add nsw i32 %s_cnt.0.ph, -1 %dec10 = add nsw i32 %ans.0, -1 br label %while.cond.outer.backedge if.else11: ; preds = %if.else %inc16 = add nsw i32 %ans.0, 1 br i1 %cmp5, label %while.cond, label %while.end while.end: ; preds = %if.else11 %call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0) ret i32 0 } ; 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"}
#include <stdio.h> int N,M,X; int C[20],A[20][20],D[20]; int min_S=-1; void f(int p,int S){ int c=1; for(int i=1;i<=M;i++){ if(D[i]<X) c=0; } if(c==1){ if(min_S<0 || S<min_S){ min_S=S; return; } } for(int i=p+1;i<=N;i++){ for(int j=1;j<=M;j++){ D[j]+=A[i][j]; } f(i,S+C[i]); for(int j=1;j<=N;j++){ D[j]-=A[i][j]; } } return; } int main(){ scanf("%d %d %d",&N,&M,&X); for(int i=1;i<=N;i++){ scanf("%d",C+i); D[i]=0; for(int j=1;j<=M;j++){ scanf("%d",&A[i][j]); } } f(0,0); printf("%d\n",min_S); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234529/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234529/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @min_S = dso_local local_unnamed_addr global i32 -1, align 4 @M = dso_local global i32 0, align 4 @D = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16 @X = dso_local global i32 0, align 4 @N = dso_local global i32 0, align 4 @A = dso_local global [20 x [20 x i32]] zeroinitializer, align 16 @C = dso_local global [20 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @f(i32 noundef %p, i32 noundef %S) local_unnamed_addr #0 { entry: %0 = load i32, ptr @M, align 4, !tbaa !5 %cmp.not63 = icmp slt i32 %0, 1 br i1 %cmp.not63, label %if.then3, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @X, align 4, !tbaa !5 %2 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %2 to i64 %3 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph %n.vec = and i64 %3, -8 %ind.end = or i64 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %8, %vector.body ] %vec.phi88 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %9, %vector.body ] %offset.idx = or i64 %index, 1 %4 = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load89 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = icmp slt <4 x i32> %wide.load, %broadcast.splat %7 = icmp slt <4 x i32> %wide.load89, %broadcast.splat %8 = select <4 x i1> %6, <4 x i32> zeroinitializer, <4 x i32> %vec.phi %9 = select <4 x i1> %7, <4 x i32> zeroinitializer, <4 x i32> %vec.phi88 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.select.cmp.not = icmp ne <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1> %rdx.select.cmp90126 = icmp ne <4 x i32> %9, <i32 1, i32 1, i32 1, i32 1> %rdx.select.cmp90 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp90126 %11 = bitcast <4 x i1> %rdx.select.cmp90 to i4 %.not = icmp eq i4 %11, 0 %rdx.select91 = zext i1 %.not to i32 %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.lr.ph ], [ %ind.end, %middle.block ] %c.064.ph = phi i32 [ 1, %for.body.lr.ph ], [ %rdx.select91, %middle.block ] br label %for.body for.cond.cleanup.loopexit: ; preds = %for.body %12 = icmp eq i32 %spec.select, 1 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %middle.block %spec.select.lcssa = phi i1 [ %.not, %middle.block ], [ %12, %for.cond.cleanup.loopexit ] br i1 %spec.select.lcssa, label %if.then3, label %if.end8 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %c.064 = phi i32 [ %spec.select, %for.body ], [ %c.064.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %indvars.iv %13 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp slt i32 %13, %1 %spec.select = select i1 %cmp1, i32 0, i32 %c.064 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !13 if.then3: ; preds = %entry, %for.cond.cleanup %14 = load i32, ptr @min_S, align 4, !tbaa !5 %cmp4 = icmp slt i32 %14, 0 %cmp5 = icmp sgt i32 %14, %S %or.cond = or i1 %cmp4, %cmp5 br i1 %or.cond, label %if.then6, label %if.end8 if.then6: ; preds = %if.then3 store i32 %S, ptr @min_S, align 4, !tbaa !5 br label %cleanup if.end8: ; preds = %if.then3, %for.cond.cleanup %15 = load i32, ptr @N, align 4, !tbaa !5 %cmp11.not.not71 = icmp sgt i32 %15, %p br i1 %cmp11.not.not71, label %for.cond14.preheader.preheader, label %cleanup for.cond14.preheader.preheader: ; preds = %if.end8 %16 = sext i32 %p to i64 br label %for.cond14.preheader for.cond10.loopexit: ; preds = %for.body35, %middle.block92, %for.cond.cleanup16 %17 = sext i32 %30 to i64 %cmp11.not.not = icmp slt i64 %indvars.iv.next85, %17 br i1 %cmp11.not.not, label %for.cond14.preheader, label %cleanup, !llvm.loop !14 for.cond14.preheader: ; preds = %for.cond14.preheader.preheader, %for.cond10.loopexit %indvars.iv84 = phi i64 [ %16, %for.cond14.preheader.preheader ], [ %indvars.iv.next85, %for.cond10.loopexit ] %indvars.iv.next85 = add nsw i64 %indvars.iv84, 1 %18 = load i32, ptr @M, align 4, !tbaa !5 %cmp15.not66 = icmp slt i32 %18, 1 br i1 %cmp15.not66, label %for.cond.cleanup16, label %for.body17.lr.ph for.body17.lr.ph: ; preds = %for.cond14.preheader %19 = add nuw i32 %18, 1 %wide.trip.count77 = zext i32 %19 to i64 %20 = add nsw i64 %wide.trip.count77, -1 %min.iters.check111 = icmp ult i32 %18, 8 br i1 %min.iters.check111, label %for.body17.preheader, label %vector.ph112 vector.ph112: ; preds = %for.body17.lr.ph %n.vec114 = and i64 %20, -8 %ind.end115 = or i64 %n.vec114, 1 br label %vector.body118 vector.body118: ; preds = %vector.body118, %vector.ph112 %index119 = phi i64 [ 0, %vector.ph112 ], [ %index.next125, %vector.body118 ] %offset.idx120 = or i64 %index119, 1 %21 = getelementptr inbounds [20 x [20 x i32]], ptr @A, i64 0, i64 %indvars.iv.next85, i64 %offset.idx120 %wide.load121 = load <4 x i32>, ptr %21, align 4, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 %wide.load122 = load <4 x i32>, ptr %22, align 4, !tbaa !5 %23 = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %offset.idx120 %wide.load123 = load <4 x i32>, ptr %23, align 4, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 %wide.load124 = load <4 x i32>, ptr %24, align 4, !tbaa !5 %25 = add nsw <4 x i32> %wide.load123, %wide.load121 %26 = add nsw <4 x i32> %wide.load124, %wide.load122 store <4 x i32> %25, ptr %23, align 4, !tbaa !5 store <4 x i32> %26, ptr %24, align 4, !tbaa !5 %index.next125 = add nuw i64 %index119, 8 %27 = icmp eq i64 %index.next125, %n.vec114 br i1 %27, label %middle.block109, label %vector.body118, !llvm.loop !15 middle.block109: ; preds = %vector.body118 %cmp.n117 = icmp eq i64 %20, %n.vec114 br i1 %cmp.n117, label %for.cond.cleanup16, label %for.body17.preheader for.body17.preheader: ; preds = %for.body17.lr.ph, %middle.block109 %indvars.iv74.ph = phi i64 [ 1, %for.body17.lr.ph ], [ %ind.end115, %middle.block109 ] br label %for.body17 for.cond.cleanup16: ; preds = %for.body17, %middle.block109, %for.cond14.preheader %arrayidx29 = getelementptr inbounds [20 x i32], ptr @C, i64 0, i64 %indvars.iv.next85 %28 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %add30 = add nsw i32 %28, %S %29 = trunc i64 %indvars.iv.next85 to i32 tail call void @f(i32 noundef %29, i32 noundef %add30) %30 = load i32, ptr @N, align 4, !tbaa !5 %cmp33.not68 = icmp slt i32 %30, 1 br i1 %cmp33.not68, label %for.cond10.loopexit, label %for.body35.preheader for.body35.preheader: ; preds = %for.cond.cleanup16 %31 = add nuw i32 %30, 1 %wide.trip.count82 = zext i32 %31 to i64 %32 = add nsw i64 %wide.trip.count82, -1 %min.iters.check94 = icmp ult i32 %30, 8 br i1 %min.iters.check94, label %for.body35.preheader127, label %vector.ph95 vector.ph95: ; preds = %for.body35.preheader %n.vec97 = and i64 %32, -8 %ind.end98 = or i64 %n.vec97, 1 br label %vector.body101 vector.body101: ; preds = %vector.body101, %vector.ph95 %index102 = phi i64 [ 0, %vector.ph95 ], [ %index.next108, %vector.body101 ] %offset.idx103 = or i64 %index102, 1 %33 = getelementptr inbounds [20 x [20 x i32]], ptr @A, i64 0, i64 %indvars.iv.next85, i64 %offset.idx103 %wide.load104 = load <4 x i32>, ptr %33, align 4, !tbaa !5 %34 = getelementptr inbounds i32, ptr %33, i64 4 %wide.load105 = load <4 x i32>, ptr %34, align 4, !tbaa !5 %35 = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %offset.idx103 %wide.load106 = load <4 x i32>, ptr %35, align 4, !tbaa !5 %36 = getelementptr inbounds i32, ptr %35, i64 4 %wide.load107 = load <4 x i32>, ptr %36, align 4, !tbaa !5 %37 = sub nsw <4 x i32> %wide.load106, %wide.load104 %38 = sub nsw <4 x i32> %wide.load107, %wide.load105 store <4 x i32> %37, ptr %35, align 4, !tbaa !5 store <4 x i32> %38, ptr %36, align 4, !tbaa !5 %index.next108 = add nuw i64 %index102, 8 %39 = icmp eq i64 %index.next108, %n.vec97 br i1 %39, label %middle.block92, label %vector.body101, !llvm.loop !16 middle.block92: ; preds = %vector.body101 %cmp.n100 = icmp eq i64 %32, %n.vec97 br i1 %cmp.n100, label %for.cond10.loopexit, label %for.body35.preheader127 for.body35.preheader127: ; preds = %for.body35.preheader, %middle.block92 %indvars.iv79.ph = phi i64 [ 1, %for.body35.preheader ], [ %ind.end98, %middle.block92 ] br label %for.body35 for.body17: ; preds = %for.body17.preheader, %for.body17 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body17 ], [ %indvars.iv74.ph, %for.body17.preheader ] %arrayidx21 = getelementptr inbounds [20 x [20 x i32]], ptr @A, i64 0, i64 %indvars.iv.next85, i64 %indvars.iv74 %40 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %indvars.iv74 %41 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %add24 = add nsw i32 %41, %40 store i32 %add24, ptr %arrayidx23, align 4, !tbaa !5 %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77 br i1 %exitcond78.not, label %for.cond.cleanup16, label %for.body17, !llvm.loop !17 for.body35: ; preds = %for.body35.preheader127, %for.body35 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body35 ], [ %indvars.iv79.ph, %for.body35.preheader127 ] %arrayidx39 = getelementptr inbounds [20 x [20 x i32]], ptr @A, i64 0, i64 %indvars.iv.next85, i64 %indvars.iv79 %42 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %arrayidx41 = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %indvars.iv79 %43 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %sub = sub nsw i32 %43, %42 store i32 %sub, ptr %arrayidx41, align 4, !tbaa !5 %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82 br i1 %exitcond83.not, label %for.cond10.loopexit, label %for.body35, !llvm.loop !18 cleanup: ; preds = %for.cond10.loopexit, %if.end8, %if.then6 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @M, ptr noundef nonnull @X) %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp.not23 = icmp slt i32 %0, 1 br i1 %cmp.not23, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.cond.cleanup4, %entry tail call void @f(i32 noundef 0, i32 noundef 0) %1 = load i32, ptr @min_S, align 4, !tbaa !5 %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) ret i32 0 for.body: ; preds = %entry, %for.cond.cleanup4 %indvars.iv26 = phi i64 [ %indvars.iv.next27, %for.cond.cleanup4 ], [ 1, %entry ] %add.ptr = getelementptr inbounds i32, ptr @C, i64 %indvars.iv26 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %arrayidx = getelementptr inbounds [20 x i32], ptr @D, i64 0, i64 %indvars.iv26 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %2 = load i32, ptr @M, align 4, !tbaa !5 %cmp3.not21 = icmp slt i32 %2, 1 br i1 %cmp3.not21, label %for.cond.cleanup4, label %for.body5 for.cond.cleanup4: ; preds = %for.body5, %for.body %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 %3 = load i32, ptr @N, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp.not.not = icmp slt i64 %indvars.iv26, %4 br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !19 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 1, %for.body ] %arrayidx9 = getelementptr inbounds [20 x [20 x i32]], ptr @A, i64 0, i64 %indvars.iv26, i64 %indvars.iv %call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr @M, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp3.not.not, label %for.body5, label %for.cond.cleanup4, !llvm.loop !20 } ; 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 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !11, !12} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> #define rep(i,n)for(int i=0;i<(int)(n);i++) int main(){ int n,m,x,c[12]={0},a[12][12]={0},y,z[12],b,d=2e9; scanf("%d%d%d",&n,&m,&x); rep(i,n){ scanf("%d",&c[i]); rep(j,m){ scanf("%d",&a[i][j]); } } rep(i,2){rep(j,2){rep(k,2){rep(l,2){rep(o,2){rep(p,2){rep(q,2){rep(r,2){rep(s,2){rep(t,2){rep(u,2){rep(v,2){ y=i*c[0]+j*c[1]+k*c[2]+l*c[3]+o*c[4]+p*c[5]+q*c[6]+r*c[7]+s*c[8]+t*c[9]+u*c[10]+v*c[11]; for(b=0;b<m;b++){ z[b]=i*a[0][b]+j*a[1][b]+k*a[2][b]+l*a[3][b]+o*a[4][b]+p*a[5][b]+q*a[6][b]+r*a[7][b]+s*a[8][b]+t*a[9][b]+u*a[10][b]+v*a[11][b]; if(z[b]<x)break; } if(b==m&&y<d)d = y; }}}}}}}}}}}} if(d==(int)2e9)puts("-1"); else printf("%d",d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234572/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234572/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %x = alloca i32, align 4 %c = alloca [12 x i32], align 16 %a = alloca [12 x [12 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %c, i8 0, i64 48, i1 false) call void @llvm.lifetime.start.p0(i64 576, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(576) %a, i8 0, i64 576, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp274 = icmp sgt i32 %0, 0 br i1 %cmp274, label %for.body, label %entry.for.cond15.preheader_crit_edge entry.for.cond15.preheader_crit_edge: ; preds = %entry %.pre568 = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader.loopexit: ; preds = %for.cond.cleanup4 %.pre = load i32, ptr %c, align 16, !tbaa !5 %arrayidx65.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 1 %.pre557 = load i32, ptr %arrayidx65.phi.trans.insert, align 4, !tbaa !5 %arrayidx67.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 2 %.pre558 = load i32, ptr %arrayidx67.phi.trans.insert, align 8, !tbaa !5 %arrayidx70.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 3 %.pre559 = load i32, ptr %arrayidx70.phi.trans.insert, align 4, !tbaa !5 %arrayidx73.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 4 %.pre560 = load i32, ptr %arrayidx73.phi.trans.insert, align 16, !tbaa !5 %arrayidx76.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 5 %.pre561 = load i32, ptr %arrayidx76.phi.trans.insert, align 4, !tbaa !5 %arrayidx79.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 6 %.pre562 = load i32, ptr %arrayidx79.phi.trans.insert, align 8, !tbaa !5 %arrayidx82.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 7 %.pre563 = load i32, ptr %arrayidx82.phi.trans.insert, align 4, !tbaa !5 %arrayidx85.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 8 %.pre564 = load i32, ptr %arrayidx85.phi.trans.insert, align 16, !tbaa !5 %arrayidx88.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 9 %.pre565 = load i32, ptr %arrayidx88.phi.trans.insert, align 4, !tbaa !5 %arrayidx91.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 10 %.pre566 = load i32, ptr %arrayidx91.phi.trans.insert, align 8, !tbaa !5 %arrayidx94.phi.trans.insert = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 11 %.pre567 = load i32, ptr %arrayidx94.phi.trans.insert, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader: ; preds = %entry.for.cond15.preheader_crit_edge, %for.cond15.preheader.loopexit %1 = phi i32 [ %64, %for.cond15.preheader.loopexit ], [ %.pre568, %entry.for.cond15.preheader_crit_edge ] %2 = phi i32 [ %.pre567, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %3 = phi i32 [ %.pre566, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %4 = phi i32 [ %.pre565, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %5 = phi i32 [ %.pre564, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %6 = phi i32 [ %.pre563, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %7 = phi i32 [ %.pre562, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %8 = phi i32 [ %.pre561, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %9 = phi i32 [ %.pre560, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %10 = phi i32 [ %.pre559, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %11 = phi i32 [ %.pre558, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %12 = phi i32 [ %.pre557, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %13 = phi i32 [ %.pre, %for.cond15.preheader.loopexit ], [ 0, %entry.for.cond15.preheader_crit_edge ] %.fr = freeze i32 %1 %cmp98276 = icmp sgt i32 %.fr, 0 %14 = load i32, ptr %x, align 4 br i1 %cmp98276, label %for.cond20.preheader.us.preheader, label %for.cond15.preheader.split for.cond20.preheader.us.preheader: ; preds = %for.cond15.preheader %wide.trip.count = zext i32 %.fr to i64 br label %for.cond20.preheader.us for.cond20.preheader.us: ; preds = %for.cond20.preheader.us.preheader, %for.cond.cleanup22.split.us.us %cmp16.us = phi i1 [ false, %for.cond.cleanup22.split.us.us ], [ true, %for.cond20.preheader.us.preheader ] %i14.0410.us = phi i32 [ 1, %for.cond.cleanup22.split.us.us ], [ 0, %for.cond20.preheader.us.preheader ] %d.0409.us = phi i32 [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup22.split.us.us ], [ 2000000000, %for.cond20.preheader.us.preheader ] %mul.us = mul nuw nsw i32 %13, %i14.0410.us br label %for.cond24.preheader.us.us for.cond24.preheader.us.us: ; preds = %for.cond.cleanup26.split.us.us.us, %for.cond20.preheader.us %cmp21.us.us = phi i1 [ true, %for.cond20.preheader.us ], [ false, %for.cond.cleanup26.split.us.us.us ] %j19.0399.us.us = phi i32 [ 0, %for.cond20.preheader.us ], [ 1, %for.cond.cleanup26.split.us.us.us ] %d.1398.us.us = phi i32 [ %d.0409.us, %for.cond20.preheader.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup26.split.us.us.us ] %mul66.us.us = mul nuw nsw i32 %12, %j19.0399.us.us %add.us.us = add nsw i32 %mul66.us.us, %mul.us br label %for.cond28.preheader.us.us.us for.cond28.preheader.us.us.us: ; preds = %for.cond.cleanup30.split.us.us.us.us, %for.cond24.preheader.us.us %cmp25.us.us.us = phi i1 [ true, %for.cond24.preheader.us.us ], [ false, %for.cond.cleanup30.split.us.us.us.us ] %k.0388.us.us.us = phi i32 [ 0, %for.cond24.preheader.us.us ], [ 1, %for.cond.cleanup30.split.us.us.us.us ] %d.2387.us.us.us = phi i32 [ %d.1398.us.us, %for.cond24.preheader.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup30.split.us.us.us.us ] %mul68.us.us.us = mul nuw nsw i32 %11, %k.0388.us.us.us %add69.us.us.us = add nsw i32 %add.us.us, %mul68.us.us.us br label %for.cond32.preheader.us.us.us.us for.cond32.preheader.us.us.us.us: ; preds = %for.cond.cleanup34.split.us.us.us.us.us, %for.cond28.preheader.us.us.us %cmp29.us.us.us.us = phi i1 [ true, %for.cond28.preheader.us.us.us ], [ false, %for.cond.cleanup34.split.us.us.us.us.us ] %l.0376.us.us.us.us = phi i32 [ 0, %for.cond28.preheader.us.us.us ], [ 1, %for.cond.cleanup34.split.us.us.us.us.us ] %d.3375.us.us.us.us = phi i32 [ %d.2387.us.us.us, %for.cond28.preheader.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup34.split.us.us.us.us.us ] %mul71.us.us.us.us = mul nuw nsw i32 %10, %l.0376.us.us.us.us %add72.us.us.us.us = add nsw i32 %add69.us.us.us, %mul71.us.us.us.us br label %for.cond36.preheader.us.us.us.us.us for.cond36.preheader.us.us.us.us.us: ; preds = %for.cond.cleanup38.split.us.us.us.us.us.us, %for.cond32.preheader.us.us.us.us %cmp33.us.us.us.us.us = phi i1 [ true, %for.cond32.preheader.us.us.us.us ], [ false, %for.cond.cleanup38.split.us.us.us.us.us.us ] %o.0365.us.us.us.us.us = phi i32 [ 0, %for.cond32.preheader.us.us.us.us ], [ 1, %for.cond.cleanup38.split.us.us.us.us.us.us ] %d.4364.us.us.us.us.us = phi i32 [ %d.3375.us.us.us.us, %for.cond32.preheader.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup38.split.us.us.us.us.us.us ] %mul74.us.us.us.us.us = mul nuw nsw i32 %9, %o.0365.us.us.us.us.us %add75.us.us.us.us.us = add nsw i32 %add72.us.us.us.us, %mul74.us.us.us.us.us br label %for.cond40.preheader.us.us.us.us.us.us for.cond40.preheader.us.us.us.us.us.us: ; preds = %for.cond.cleanup42.split.us.us.us.us.us.us.us, %for.cond36.preheader.us.us.us.us.us %cmp37.us.us.us.us.us.us = phi i1 [ true, %for.cond36.preheader.us.us.us.us.us ], [ false, %for.cond.cleanup42.split.us.us.us.us.us.us.us ] %p.0354.us.us.us.us.us.us = phi i32 [ 0, %for.cond36.preheader.us.us.us.us.us ], [ 1, %for.cond.cleanup42.split.us.us.us.us.us.us.us ] %d.5353.us.us.us.us.us.us = phi i32 [ %d.4364.us.us.us.us.us, %for.cond36.preheader.us.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup42.split.us.us.us.us.us.us.us ] %mul77.us.us.us.us.us.us = mul nuw nsw i32 %8, %p.0354.us.us.us.us.us.us %add78.us.us.us.us.us.us = add nsw i32 %add75.us.us.us.us.us, %mul77.us.us.us.us.us.us br label %for.cond44.preheader.us.us.us.us.us.us.us for.cond44.preheader.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup46.split.us.us.us.us.us.us.us.us, %for.cond40.preheader.us.us.us.us.us.us %cmp41.us.us.us.us.us.us.us = phi i1 [ true, %for.cond40.preheader.us.us.us.us.us.us ], [ false, %for.cond.cleanup46.split.us.us.us.us.us.us.us.us ] %q.0342.us.us.us.us.us.us.us = phi i32 [ 0, %for.cond40.preheader.us.us.us.us.us.us ], [ 1, %for.cond.cleanup46.split.us.us.us.us.us.us.us.us ] %d.6341.us.us.us.us.us.us.us = phi i32 [ %d.5353.us.us.us.us.us.us, %for.cond40.preheader.us.us.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup46.split.us.us.us.us.us.us.us.us ] %mul80.us.us.us.us.us.us.us = mul nuw nsw i32 %7, %q.0342.us.us.us.us.us.us.us %add81.us.us.us.us.us.us.us = add nsw i32 %add78.us.us.us.us.us.us, %mul80.us.us.us.us.us.us.us br label %for.cond48.preheader.us.us.us.us.us.us.us.us for.cond48.preheader.us.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us, %for.cond44.preheader.us.us.us.us.us.us.us %cmp45.us.us.us.us.us.us.us.us = phi i1 [ true, %for.cond44.preheader.us.us.us.us.us.us.us ], [ false, %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us ] %r.0331.us.us.us.us.us.us.us.us = phi i32 [ 0, %for.cond44.preheader.us.us.us.us.us.us.us ], [ 1, %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us ] %d.7330.us.us.us.us.us.us.us.us = phi i32 [ %d.6341.us.us.us.us.us.us.us, %for.cond44.preheader.us.us.us.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us ] %mul83.us.us.us.us.us.us.us.us = mul nuw nsw i32 %6, %r.0331.us.us.us.us.us.us.us.us %add84.us.us.us.us.us.us.us.us = add nsw i32 %add81.us.us.us.us.us.us.us, %mul83.us.us.us.us.us.us.us.us br label %for.cond52.preheader.us.us.us.us.us.us.us.us.us for.cond52.preheader.us.us.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us, %for.cond48.preheader.us.us.us.us.us.us.us.us %cmp49.us.us.us.us.us.us.us.us.us = phi i1 [ true, %for.cond48.preheader.us.us.us.us.us.us.us.us ], [ false, %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us ] %s.0320.us.us.us.us.us.us.us.us.us = phi i32 [ 0, %for.cond48.preheader.us.us.us.us.us.us.us.us ], [ 1, %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us ] %d.8319.us.us.us.us.us.us.us.us.us = phi i32 [ %d.7330.us.us.us.us.us.us.us.us, %for.cond48.preheader.us.us.us.us.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us ] %mul86.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %5, %s.0320.us.us.us.us.us.us.us.us.us %add87.us.us.us.us.us.us.us.us.us = add nsw i32 %add84.us.us.us.us.us.us.us.us, %mul86.us.us.us.us.us.us.us.us.us br label %for.cond56.preheader.us.us.us.us.us.us.us.us.us.us for.cond56.preheader.us.us.us.us.us.us.us.us.us.us: ; preds = %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond52.preheader.us.us.us.us.us.us.us.us.us %cmp53.us.us.us.us.us.us.us.us.us.us = phi i1 [ true, %for.cond52.preheader.us.us.us.us.us.us.us.us.us ], [ false, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1 ] %t.0308.us.us.us.us.us.us.us.us.us.us = phi i32 [ 0, %for.cond52.preheader.us.us.us.us.us.us.us.us.us ], [ 1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1 ] %d.9307.us.us.us.us.us.us.us.us.us.us = phi i32 [ %d.8319.us.us.us.us.us.us.us.us.us, %for.cond52.preheader.us.us.us.us.us.us.us.us.us ], [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1 ] %mul89.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %4, %t.0308.us.us.us.us.us.us.us.us.us.us %add90.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add87.us.us.us.us.us.us.us.us.us, %mul89.us.us.us.us.us.us.us.us.us.us br label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us for.body99.us.us.us.us.us.us.us.us.us.us.us.us: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us, %for.cond56.preheader.us.us.us.us.us.us.us.us.us.us %indvars.iv509 = phi i64 [ %indvars.iv.next510, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us ], [ 0, %for.cond56.preheader.us.us.us.us.us.us.us.us.us.us ] %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x i32], ptr %a, i64 0, i64 %indvars.iv509 %15 = load i32, ptr %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul103.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %15, %i14.0410.us %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv509 %16 = load i32, ptr %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul107.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %16, %j19.0399.us.us %add108.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %mul107.us.us.us.us.us.us.us.us.us.us.us.us, %mul103.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv509 %17 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul112.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %17, %k.0388.us.us.us %add113.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add108.us.us.us.us.us.us.us.us.us.us.us.us, %mul112.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 3, i64 %indvars.iv509 %18 = load i32, ptr %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul117.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %18, %l.0376.us.us.us.us %add118.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add113.us.us.us.us.us.us.us.us.us.us.us.us, %mul117.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 4, i64 %indvars.iv509 %19 = load i32, ptr %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul122.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %19, %o.0365.us.us.us.us.us %add123.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add118.us.us.us.us.us.us.us.us.us.us.us.us, %mul122.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 5, i64 %indvars.iv509 %20 = load i32, ptr %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul127.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %20, %p.0354.us.us.us.us.us.us %add128.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add123.us.us.us.us.us.us.us.us.us.us.us.us, %mul127.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 6, i64 %indvars.iv509 %21 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul132.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %21, %q.0342.us.us.us.us.us.us.us %add133.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add128.us.us.us.us.us.us.us.us.us.us.us.us, %mul132.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 7, i64 %indvars.iv509 %22 = load i32, ptr %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul137.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %22, %r.0331.us.us.us.us.us.us.us.us %add138.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add133.us.us.us.us.us.us.us.us.us.us.us.us, %mul137.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 8, i64 %indvars.iv509 %23 = load i32, ptr %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul142.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %23, %s.0320.us.us.us.us.us.us.us.us.us %add143.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add138.us.us.us.us.us.us.us.us.us.us.us.us, %mul142.us.us.us.us.us.us.us.us.us.us.us.us %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 9, i64 %indvars.iv509 %24 = load i32, ptr %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %mul147.us.us.us.us.us.us.us.us.us.us.us.us = mul nuw nsw i32 %24, %t.0308.us.us.us.us.us.us.us.us.us.us %add148.us.us.us.us.us.us.us.us.us.us.us.us = add nsw i32 %add143.us.us.us.us.us.us.us.us.us.us.us.us, %mul147.us.us.us.us.us.us.us.us.us.us.us.us %cmp163.us.us.us.us.us.us.us.us.us.us.us.us = icmp slt i32 %add148.us.us.us.us.us.us.us.us.us.us.us.us, %14 br i1 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.split.loop.exit573, label %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us for.inc164.us.us.us.us.us.us.us.us.us.us.us.us: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us %indvars.iv.next510 = add nuw nsw i64 %indvars.iv509, 1 %exitcond.not = icmp eq i64 %indvars.iv.next510, %wide.trip.count br i1 %exitcond.not, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us, label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us, !llvm.loop !9 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.split.loop.exit573: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us %25 = trunc i64 %indvars.iv509 to i32 br label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us for.end166.us.us.us.us.us.us.us.us.us.us.us.us: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.split.loop.exit573 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us = phi i32 [ %25, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.split.loop.exit573 ], [ %.fr, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us ] %cmp167.us.us.us.us.us.us.us.us.us.us.us.us = icmp eq i32 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us, %.fr %cmp168.us.us.us.us.us.us.us.us.us.us.us.us = icmp slt i32 %add90.us.us.us.us.us.us.us.us.us.us, %d.9307.us.us.us.us.us.us.us.us.us.us %or.cond.us.us.us.us.us.us.us.us.us.us.us.us = select i1 %cmp167.us.us.us.us.us.us.us.us.us.us.us.us, i1 %cmp168.us.us.us.us.us.us.us.us.us.us.us.us, i1 false %d.12.us.us.us.us.us.us.us.us.us.us.us.us = select i1 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us, i32 %add90.us.us.us.us.us.us.us.us.us.us, i32 %d.9307.us.us.us.us.us.us.us.us.us.us %add96.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add90.us.us.us.us.us.us.us.us.us.us, %2 br label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1 for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us %indvars.iv509.1 = phi i64 [ %indvars.iv.next510.1, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1 ], [ 0, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us ] %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x i32], ptr %a, i64 0, i64 %indvars.iv509.1 %26 = load i32, ptr %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %26, %i14.0410.us %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv509.1 %27 = load i32, ptr %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %27, %j19.0399.us.us %add108.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv509.1 %28 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %28, %k.0388.us.us.us %add113.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add108.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 3, i64 %indvars.iv509.1 %29 = load i32, ptr %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %29, %l.0376.us.us.us.us %add118.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add113.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 4, i64 %indvars.iv509.1 %30 = load i32, ptr %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %30, %o.0365.us.us.us.us.us %add123.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add118.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 5, i64 %indvars.iv509.1 %31 = load i32, ptr %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %31, %p.0354.us.us.us.us.us.us %add128.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add123.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 6, i64 %indvars.iv509.1 %32 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %32, %q.0342.us.us.us.us.us.us.us %add133.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add128.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 7, i64 %indvars.iv509.1 %33 = load i32, ptr %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %33, %r.0331.us.us.us.us.us.us.us.us %add138.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add133.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 8, i64 %indvars.iv509.1 %34 = load i32, ptr %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %34, %s.0320.us.us.us.us.us.us.us.us.us %add143.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add138.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 9, i64 %indvars.iv509.1 %35 = load i32, ptr %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1 = mul nuw nsw i32 %35, %t.0308.us.us.us.us.us.us.us.us.us.us %add148.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add143.us.us.us.us.us.us.us.us.us.us.us.us.1, %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1 %arrayidx156.us.us.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 11, i64 %indvars.iv509.1 %36 = load i32, ptr %arrayidx156.us.us.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %add158.us.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add148.us.us.us.us.us.us.us.us.us.us.us.us.1, %36 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1 = icmp slt i32 %add158.us.us.us.us.us.us.us.us.us.us.us.us.1, %14 br i1 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.split.loop.exit575, label %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1 for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv.next510.1 = add nuw nsw i64 %indvars.iv509.1, 1 %exitcond.1.not = icmp eq i64 %indvars.iv.next510.1, %wide.trip.count br i1 %exitcond.1.not, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1, label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1, !llvm.loop !9 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.split.loop.exit575: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1 %37 = trunc i64 %indvars.iv509.1 to i32 br label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.split.loop.exit575 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1 = phi i32 [ %37, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.split.loop.exit575 ], [ %.fr, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1 ] %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1 = icmp eq i32 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1, %.fr %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1 = icmp slt i32 %add96.us.us.us.us.us.us.us.us.us.us.us.us.1, %d.12.us.us.us.us.us.us.us.us.us.us.us.us %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1 = select i1 %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1, i1 %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1, i1 false %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1 = select i1 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1, i32 %add96.us.us.us.us.us.us.us.us.us.us.us.us.1, i32 %d.12.us.us.us.us.us.us.us.us.us.us.us.us %add93.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add90.us.us.us.us.us.us.us.us.us.us, %3 br label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1547 for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1547: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv509.1513 = phi i64 [ %indvars.iv.next510.1548, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550 ], [ 0, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1 ] %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1514 = getelementptr inbounds [12 x i32], ptr %a, i64 0, i64 %indvars.iv509.1513 %38 = load i32, ptr %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1514, align 4, !tbaa !5 %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1515 = mul nuw nsw i32 %38, %i14.0410.us %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1516 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv509.1513 %39 = load i32, ptr %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1516, align 4, !tbaa !5 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1517 = mul nuw nsw i32 %39, %j19.0399.us.us %add108.us.us.us.us.us.us.us.us.us.us.us.us.1518 = add nsw i32 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1517, %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1515 %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1519 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv509.1513 %40 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1519, align 4, !tbaa !5 %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1520 = mul nuw nsw i32 %40, %k.0388.us.us.us %add113.us.us.us.us.us.us.us.us.us.us.us.us.1521 = add nsw i32 %add108.us.us.us.us.us.us.us.us.us.us.us.us.1518, %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1520 %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1522 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 3, i64 %indvars.iv509.1513 %41 = load i32, ptr %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1522, align 4, !tbaa !5 %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1523 = mul nuw nsw i32 %41, %l.0376.us.us.us.us %add118.us.us.us.us.us.us.us.us.us.us.us.us.1524 = add nsw i32 %add113.us.us.us.us.us.us.us.us.us.us.us.us.1521, %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1523 %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1525 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 4, i64 %indvars.iv509.1513 %42 = load i32, ptr %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1525, align 4, !tbaa !5 %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1526 = mul nuw nsw i32 %42, %o.0365.us.us.us.us.us %add123.us.us.us.us.us.us.us.us.us.us.us.us.1527 = add nsw i32 %add118.us.us.us.us.us.us.us.us.us.us.us.us.1524, %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1526 %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1528 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 5, i64 %indvars.iv509.1513 %43 = load i32, ptr %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1528, align 4, !tbaa !5 %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1529 = mul nuw nsw i32 %43, %p.0354.us.us.us.us.us.us %add128.us.us.us.us.us.us.us.us.us.us.us.us.1530 = add nsw i32 %add123.us.us.us.us.us.us.us.us.us.us.us.us.1527, %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1529 %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1531 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 6, i64 %indvars.iv509.1513 %44 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1531, align 4, !tbaa !5 %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1532 = mul nuw nsw i32 %44, %q.0342.us.us.us.us.us.us.us %add133.us.us.us.us.us.us.us.us.us.us.us.us.1533 = add nsw i32 %add128.us.us.us.us.us.us.us.us.us.us.us.us.1530, %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1532 %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1534 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 7, i64 %indvars.iv509.1513 %45 = load i32, ptr %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1534, align 4, !tbaa !5 %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1535 = mul nuw nsw i32 %45, %r.0331.us.us.us.us.us.us.us.us %add138.us.us.us.us.us.us.us.us.us.us.us.us.1536 = add nsw i32 %add133.us.us.us.us.us.us.us.us.us.us.us.us.1533, %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1535 %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1537 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 8, i64 %indvars.iv509.1513 %46 = load i32, ptr %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1537, align 4, !tbaa !5 %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1538 = mul nuw nsw i32 %46, %s.0320.us.us.us.us.us.us.us.us.us %add143.us.us.us.us.us.us.us.us.us.us.us.us.1539 = add nsw i32 %add138.us.us.us.us.us.us.us.us.us.us.us.us.1536, %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1538 %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1540 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 9, i64 %indvars.iv509.1513 %47 = load i32, ptr %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1540, align 4, !tbaa !5 %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1541 = mul nuw nsw i32 %47, %t.0308.us.us.us.us.us.us.us.us.us.us %add148.us.us.us.us.us.us.us.us.us.us.us.us.1542 = add nsw i32 %add143.us.us.us.us.us.us.us.us.us.us.us.us.1539, %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1541 %arrayidx151.us.us.us.us.us.us.us.us.us.us.us.us.1543 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 10, i64 %indvars.iv509.1513 %48 = load i32, ptr %arrayidx151.us.us.us.us.us.us.us.us.us.us.us.us.1543, align 4, !tbaa !5 %add153.us.us.us.us.us.us.us.us.us.us.us.us.1545 = add nsw i32 %add148.us.us.us.us.us.us.us.us.us.us.us.us.1542, %48 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1546 = icmp slt i32 %add153.us.us.us.us.us.us.us.us.us.us.us.us.1545, %14 br i1 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1546, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556.split.loop.exit577, label %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550 for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1547 %indvars.iv.next510.1548 = add nuw nsw i64 %indvars.iv509.1513, 1 %exitcond.1549.not = icmp eq i64 %indvars.iv.next510.1548, %wide.trip.count br i1 %exitcond.1549.not, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556, label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1547, !llvm.loop !9 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556.split.loop.exit577: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1547 %49 = trunc i64 %indvars.iv509.1513 to i32 br label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556.split.loop.exit577 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1551 = phi i32 [ %49, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556.split.loop.exit577 ], [ %.fr, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1550 ] %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1552 = icmp eq i32 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1551, %.fr %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1553 = icmp slt i32 %add93.us.us.us.us.us.us.us.us.us.us.us.1, %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1554 = select i1 %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1552, i1 %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1553, i1 false %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1555 = select i1 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1554, i32 %add93.us.us.us.us.us.us.us.us.us.us.us.1, i32 %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1 %add96.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add93.us.us.us.us.us.us.us.us.us.us.us.1, %2 br label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1.1 for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1.1: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556 %indvars.iv509.1.1 = phi i64 [ %indvars.iv.next510.1.1, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1 ], [ 0, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1556 ] %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x i32], ptr %a, i64 0, i64 %indvars.iv509.1.1 %50 = load i32, ptr %arrayidx102.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %50, %i14.0410.us %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv509.1.1 %51 = load i32, ptr %arrayidx106.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %51, %j19.0399.us.us %add108.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %mul107.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul103.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv509.1.1 %52 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %52, %k.0388.us.us.us %add113.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add108.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul112.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 3, i64 %indvars.iv509.1.1 %53 = load i32, ptr %arrayidx116.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %53, %l.0376.us.us.us.us %add118.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add113.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul117.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 4, i64 %indvars.iv509.1.1 %54 = load i32, ptr %arrayidx121.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %54, %o.0365.us.us.us.us.us %add123.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add118.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul122.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 5, i64 %indvars.iv509.1.1 %55 = load i32, ptr %arrayidx126.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %55, %p.0354.us.us.us.us.us.us %add128.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add123.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul127.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 6, i64 %indvars.iv509.1.1 %56 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %56, %q.0342.us.us.us.us.us.us.us %add133.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add128.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul132.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 7, i64 %indvars.iv509.1.1 %57 = load i32, ptr %arrayidx136.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %57, %r.0331.us.us.us.us.us.us.us.us %add138.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add133.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul137.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 8, i64 %indvars.iv509.1.1 %58 = load i32, ptr %arrayidx141.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %58, %s.0320.us.us.us.us.us.us.us.us.us %add143.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add138.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul142.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 9, i64 %indvars.iv509.1.1 %59 = load i32, ptr %arrayidx146.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = mul nuw nsw i32 %59, %t.0308.us.us.us.us.us.us.us.us.us.us %add148.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add143.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %mul147.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx151.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 10, i64 %indvars.iv509.1.1 %60 = load i32, ptr %arrayidx151.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %add153.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add148.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %60 %arrayidx156.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 11, i64 %indvars.iv509.1.1 %61 = load i32, ptr %arrayidx156.us.us.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %add158.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add153.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %61 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = icmp slt i32 %add158.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %14 br i1 %cmp163.us.us.us.us.us.us.us.us.us.us.us.us.1.1, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1.split.loop.exit579, label %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1 for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %indvars.iv.next510.1.1 = add nuw nsw i64 %indvars.iv509.1.1, 1 %exitcond.1.1.not = icmp eq i64 %indvars.iv.next510.1.1, %wide.trip.count br i1 %exitcond.1.1.not, label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1, label %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1.1, !llvm.loop !9 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1.split.loop.exit579: ; preds = %for.body99.us.us.us.us.us.us.us.us.us.us.us.us.1.1 %62 = trunc i64 %indvars.iv509.1.1 to i32 br label %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1 for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1: ; preds = %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1.split.loop.exit579 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = phi i32 [ %62, %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1.split.loop.exit579 ], [ %.fr, %for.inc164.us.us.us.us.us.us.us.us.us.us.us.us.1.1 ] %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = icmp eq i32 %b.0.lcssa.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %.fr %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = icmp slt i32 %add96.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1555 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = select i1 %cmp167.us.us.us.us.us.us.us.us.us.us.us.us.1.1, i1 %cmp168.us.us.us.us.us.us.us.us.us.us.us.us.1.1, i1 false %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1 = select i1 %or.cond.us.us.us.us.us.us.us.us.us.us.us.us.1.1, i32 %add96.us.us.us.us.us.us.us.us.us.us.us.us.1.1, i32 %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1555 br i1 %cmp53.us.us.us.us.us.us.us.us.us.us, label %for.cond56.preheader.us.us.us.us.us.us.us.us.us.us, label %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us, !llvm.loop !11 for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us: ; preds = %for.end166.us.us.us.us.us.us.us.us.us.us.us.us.1.1 br i1 %cmp49.us.us.us.us.us.us.us.us.us, label %for.cond52.preheader.us.us.us.us.us.us.us.us.us, label %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us, !llvm.loop !12 for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup54.split.us.us.us.us.us.us.us.us.us.us br i1 %cmp45.us.us.us.us.us.us.us.us, label %for.cond48.preheader.us.us.us.us.us.us.us.us, label %for.cond.cleanup46.split.us.us.us.us.us.us.us.us, !llvm.loop !13 for.cond.cleanup46.split.us.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup50.split.us.us.us.us.us.us.us.us.us br i1 %cmp41.us.us.us.us.us.us.us, label %for.cond44.preheader.us.us.us.us.us.us.us, label %for.cond.cleanup42.split.us.us.us.us.us.us.us, !llvm.loop !14 for.cond.cleanup42.split.us.us.us.us.us.us.us: ; preds = %for.cond.cleanup46.split.us.us.us.us.us.us.us.us br i1 %cmp37.us.us.us.us.us.us, label %for.cond40.preheader.us.us.us.us.us.us, label %for.cond.cleanup38.split.us.us.us.us.us.us, !llvm.loop !15 for.cond.cleanup38.split.us.us.us.us.us.us: ; preds = %for.cond.cleanup42.split.us.us.us.us.us.us.us br i1 %cmp33.us.us.us.us.us, label %for.cond36.preheader.us.us.us.us.us, label %for.cond.cleanup34.split.us.us.us.us.us, !llvm.loop !16 for.cond.cleanup34.split.us.us.us.us.us: ; preds = %for.cond.cleanup38.split.us.us.us.us.us.us br i1 %cmp29.us.us.us.us, label %for.cond32.preheader.us.us.us.us, label %for.cond.cleanup30.split.us.us.us.us, !llvm.loop !17 for.cond.cleanup30.split.us.us.us.us: ; preds = %for.cond.cleanup34.split.us.us.us.us.us br i1 %cmp25.us.us.us, label %for.cond28.preheader.us.us.us, label %for.cond.cleanup26.split.us.us.us, !llvm.loop !18 for.cond.cleanup26.split.us.us.us: ; preds = %for.cond.cleanup30.split.us.us.us.us br i1 %cmp21.us.us, label %for.cond24.preheader.us.us, label %for.cond.cleanup22.split.us.us, !llvm.loop !19 for.cond.cleanup22.split.us.us: ; preds = %for.cond.cleanup26.split.us.us.us br i1 %cmp16.us, label %for.cond20.preheader.us, label %for.cond.cleanup17, !llvm.loop !20 for.cond15.preheader.split: ; preds = %for.cond15.preheader %cmp167 = icmp eq i32 %.fr, 0 br i1 %cmp167, label %for.cond20.preheader.us412, label %if.then208 for.cond20.preheader.us412: ; preds = %for.cond15.preheader.split, %for.cond.cleanup22.split.split.us.us %cmp16.us417 = phi i1 [ false, %for.cond.cleanup22.split.split.us.us ], [ true, %for.cond15.preheader.split ] %i14.0410.us413 = phi i32 [ 1, %for.cond.cleanup22.split.split.us.us ], [ 0, %for.cond15.preheader.split ] %d.0409.us414 = phi i32 [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup22.split.split.us.us ], [ 2000000000, %for.cond15.preheader.split ] %mul.us415 = mul nuw nsw i32 %13, %i14.0410.us413 br label %for.cond24.preheader.us401.us for.cond24.preheader.us401.us: ; preds = %for.cond.cleanup26.split.split.us.us.us, %for.cond20.preheader.us412 %cmp21.us407.us = phi i1 [ true, %for.cond20.preheader.us412 ], [ false, %for.cond.cleanup26.split.split.us.us.us ] %j19.0399.us402.us = phi i32 [ 0, %for.cond20.preheader.us412 ], [ 1, %for.cond.cleanup26.split.split.us.us.us ] %d.1398.us403.us = phi i32 [ %d.0409.us414, %for.cond20.preheader.us412 ], [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup26.split.split.us.us.us ] %mul66.us404.us = mul nuw nsw i32 %12, %j19.0399.us402.us %add.us405.us = add nsw i32 %mul66.us404.us, %mul.us415 br label %for.cond28.preheader.us389.us.us for.cond28.preheader.us389.us.us: ; preds = %for.cond.cleanup30.split.split.us.us.us.us, %for.cond24.preheader.us401.us %cmp25.us395.us.us = phi i1 [ true, %for.cond24.preheader.us401.us ], [ false, %for.cond.cleanup30.split.split.us.us.us.us ] %k.0388.us390.us.us = phi i32 [ 0, %for.cond24.preheader.us401.us ], [ 1, %for.cond.cleanup30.split.split.us.us.us.us ] %d.2387.us391.us.us = phi i32 [ %d.1398.us403.us, %for.cond24.preheader.us401.us ], [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup30.split.split.us.us.us.us ] %mul68.us392.us.us = mul nuw nsw i32 %11, %k.0388.us390.us.us %add69.us393.us.us = add nsw i32 %add.us405.us, %mul68.us392.us.us br label %for.cond32.preheader.us378.us.us.us for.cond32.preheader.us378.us.us.us: ; preds = %for.cond.cleanup34.split.split.us.us.us.us.us, %for.cond28.preheader.us389.us.us %cmp29.us384.us.us.us = phi i1 [ true, %for.cond28.preheader.us389.us.us ], [ false, %for.cond.cleanup34.split.split.us.us.us.us.us ] %l.0376.us379.us.us.us = phi i32 [ 0, %for.cond28.preheader.us389.us.us ], [ 1, %for.cond.cleanup34.split.split.us.us.us.us.us ] %d.3375.us380.us.us.us = phi i32 [ %d.2387.us391.us.us, %for.cond28.preheader.us389.us.us ], [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup34.split.split.us.us.us.us.us ] %mul71.us381.us.us.us = mul nuw nsw i32 %10, %l.0376.us379.us.us.us %add72.us382.us.us.us = add nsw i32 %add69.us393.us.us, %mul71.us381.us.us.us br label %for.cond36.preheader.us367.us.us.us.us for.cond36.preheader.us367.us.us.us.us: ; preds = %for.cond.cleanup38.split.split.us.us.us.us.us.us, %for.cond32.preheader.us378.us.us.us %cmp33.us373.us.us.us.us = phi i1 [ true, %for.cond32.preheader.us378.us.us.us ], [ false, %for.cond.cleanup38.split.split.us.us.us.us.us.us ] %o.0365.us368.us.us.us.us = phi i32 [ 0, %for.cond32.preheader.us378.us.us.us ], [ 1, %for.cond.cleanup38.split.split.us.us.us.us.us.us ] %d.4364.us369.us.us.us.us = phi i32 [ %d.3375.us380.us.us.us, %for.cond32.preheader.us378.us.us.us ], [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup38.split.split.us.us.us.us.us.us ] %mul74.us370.us.us.us.us = mul nuw nsw i32 %9, %o.0365.us368.us.us.us.us %add75.us371.us.us.us.us = add nsw i32 %add72.us382.us.us.us, %mul74.us370.us.us.us.us br label %for.cond40.preheader.us355.us.us.us.us.us for.cond40.preheader.us355.us.us.us.us.us: ; preds = %for.cond40.preheader.us355.us.us.us.us.us, %for.cond36.preheader.us367.us.us.us.us %cmp37.us361.us.us.us.us.us = phi i1 [ true, %for.cond36.preheader.us367.us.us.us.us ], [ false, %for.cond40.preheader.us355.us.us.us.us.us ] %p.0354.us356.us.us.us.us.us = phi i32 [ 0, %for.cond36.preheader.us367.us.us.us.us ], [ 1, %for.cond40.preheader.us355.us.us.us.us.us ] %d.5353.us357.us.us.us.us.us = phi i32 [ %d.4364.us369.us.us.us.us, %for.cond36.preheader.us367.us.us.us.us ], [ %spec.select.1.1.1.1.1.1, %for.cond40.preheader.us355.us.us.us.us.us ] %mul77.us358.us.us.us.us.us = mul nuw nsw i32 %8, %p.0354.us356.us.us.us.us.us %add78.us359.us.us.us.us.us = add nsw i32 %add75.us371.us.us.us.us, %mul77.us358.us.us.us.us.us %spec.select = call i32 @llvm.smin.i32(i32 %add78.us359.us.us.us.us.us, i32 %d.5353.us357.us.us.us.us.us) %add96.us.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %2 %spec.select.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1, i32 %spec.select) %add93.us301.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %3 %spec.select.1426 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1, i32 %spec.select.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1, %2 %spec.select.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1, i32 %spec.select.1426) %add90.us314.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %4 %spec.select.1427 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1, i32 %spec.select.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1, %2 %spec.select.1.1429 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428, i32 %spec.select.1427) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1, %3 %spec.select.1426.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1, i32 %spec.select.1.1429) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1, %2 %spec.select.1.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1, i32 %spec.select.1426.1) %add87.us325.us.us.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %5 %spec.select.1432 = call i32 @llvm.smin.i32(i32 %add87.us325.us.us.us.us.us.us.us.us.1, i32 %spec.select.1.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1, %2 %spec.select.1.1434 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433, i32 %spec.select.1432) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1, %3 %spec.select.1426.1437 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435, i32 %spec.select.1.1434) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435, %2 %spec.select.1.1.1439 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438, i32 %spec.select.1426.1437) %add90.us314.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1, %4 %spec.select.1427.1 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1, i32 %spec.select.1.1.1439) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1, %2 %spec.select.1.1429.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1, i32 %spec.select.1427.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1, %3 %spec.select.1426.1.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1, i32 %spec.select.1.1429.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1, %2 %spec.select.1.1.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1, i32 %spec.select.1426.1.1) %add84.us337.us.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %6 %spec.select.1443 = call i32 @llvm.smin.i32(i32 %add84.us337.us.us.us.us.us.us.us.1, i32 %spec.select.1.1.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1444 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1, %2 %spec.select.1.1445 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1444, i32 %spec.select.1443) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1, %3 %spec.select.1426.1448 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446, i32 %spec.select.1.1445) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1449 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446, %2 %spec.select.1.1.1450 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1449, i32 %spec.select.1426.1448) %add90.us314.us.us.us.us.us.us.us.us.us.1.1451 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1, %4 %spec.select.1427.1454 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451, i32 %spec.select.1.1.1450) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1455 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451, %2 %spec.select.1.1429.1456 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1455, i32 %spec.select.1427.1454) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451, %3 %spec.select.1426.1.1459 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457, i32 %spec.select.1.1429.1456) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1460 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457, %2 %spec.select.1.1.1.1461 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1460, i32 %spec.select.1426.1.1459) %add87.us325.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1, %5 %spec.select.1432.1 = call i32 @llvm.smin.i32(i32 %add87.us325.us.us.us.us.us.us.us.us.1.1, i32 %spec.select.1.1.1.1461) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1, %2 %spec.select.1.1434.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1, i32 %spec.select.1432.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1, %3 %spec.select.1426.1437.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1, i32 %spec.select.1.1434.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1, %2 %spec.select.1.1.1439.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1, i32 %spec.select.1426.1437.1) %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1, %4 %spec.select.1427.1.1 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1, i32 %spec.select.1.1.1439.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1, %2 %spec.select.1.1429.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1, i32 %spec.select.1427.1.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1, %3 %spec.select.1426.1.1.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1, i32 %spec.select.1.1429.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1, %2 %spec.select.1.1.1.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1, i32 %spec.select.1426.1.1.1) %add81.us348.us.us.us.us.us.us.1 = add nsw i32 %add78.us359.us.us.us.us.us, %7 %spec.select.1466 = call i32 @llvm.smin.i32(i32 %add81.us348.us.us.us.us.us.us.1, i32 %spec.select.1.1.1.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1467 = add nsw i32 %add81.us348.us.us.us.us.us.us.1, %2 %spec.select.1.1468 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1467, i32 %spec.select.1466) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1469 = add nsw i32 %add81.us348.us.us.us.us.us.us.1, %3 %spec.select.1426.1471 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1469, i32 %spec.select.1.1468) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1472 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1469, %2 %spec.select.1.1.1473 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1472, i32 %spec.select.1426.1471) %add90.us314.us.us.us.us.us.us.us.us.us.1.1474 = add nsw i32 %add81.us348.us.us.us.us.us.us.1, %4 %spec.select.1427.1477 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1474, i32 %spec.select.1.1.1473) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1478 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1474, %2 %spec.select.1.1429.1479 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1478, i32 %spec.select.1427.1477) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1480 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1474, %3 %spec.select.1426.1.1482 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1480, i32 %spec.select.1.1429.1479) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1483 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1480, %2 %spec.select.1.1.1.1484 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1483, i32 %spec.select.1426.1.1482) %add87.us325.us.us.us.us.us.us.us.us.1.1485 = add nsw i32 %add81.us348.us.us.us.us.us.us.1, %5 %spec.select.1432.1489 = call i32 @llvm.smin.i32(i32 %add87.us325.us.us.us.us.us.us.us.us.1.1485, i32 %spec.select.1.1.1.1484) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1490 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1485, %2 %spec.select.1.1434.1491 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1490, i32 %spec.select.1432.1489) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1492 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1485, %3 %spec.select.1426.1437.1494 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1492, i32 %spec.select.1.1434.1491) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1495 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1492, %2 %spec.select.1.1.1439.1496 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1495, i32 %spec.select.1426.1437.1494) %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1497 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1485, %4 %spec.select.1427.1.1500 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1497, i32 %spec.select.1.1.1439.1496) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1501 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1497, %2 %spec.select.1.1429.1.1502 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1501, i32 %spec.select.1427.1.1500) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1503 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1497, %3 %spec.select.1426.1.1.1505 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1503, i32 %spec.select.1.1429.1.1502) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1506 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1503, %2 %spec.select.1.1.1.1.1507 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1506, i32 %spec.select.1426.1.1.1505) %add84.us337.us.us.us.us.us.us.us.1.1 = add nsw i32 %add81.us348.us.us.us.us.us.us.1, %6 %spec.select.1443.1 = call i32 @llvm.smin.i32(i32 %add84.us337.us.us.us.us.us.us.us.1.1, i32 %spec.select.1.1.1.1.1507) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1444.1 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1.1, %2 %spec.select.1.1445.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1444.1, i32 %spec.select.1443.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446.1 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1.1, %3 %spec.select.1426.1448.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446.1, i32 %spec.select.1.1445.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1449.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1446.1, %2 %spec.select.1.1.1450.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1449.1, i32 %spec.select.1426.1448.1) %add90.us314.us.us.us.us.us.us.us.us.us.1.1451.1 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1.1, %4 %spec.select.1427.1454.1 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451.1, i32 %spec.select.1.1.1450.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1455.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451.1, %2 %spec.select.1.1429.1456.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1455.1, i32 %spec.select.1427.1454.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1451.1, %3 %spec.select.1426.1.1459.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457.1, i32 %spec.select.1.1429.1456.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1460.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1457.1, %2 %spec.select.1.1.1.1461.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1460.1, i32 %spec.select.1426.1.1459.1) %add87.us325.us.us.us.us.us.us.us.us.1.1.1 = add nsw i32 %add84.us337.us.us.us.us.us.us.us.1.1, %5 %spec.select.1432.1.1 = call i32 @llvm.smin.i32(i32 %add87.us325.us.us.us.us.us.us.us.us.1.1.1, i32 %spec.select.1.1.1.1461.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1.1, %2 %spec.select.1.1434.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1433.1.1, i32 %spec.select.1432.1.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1.1, %3 %spec.select.1426.1437.1.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1.1, i32 %spec.select.1.1434.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1435.1.1, %2 %spec.select.1.1.1439.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1438.1.1, i32 %spec.select.1426.1437.1.1) %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1.1 = add nsw i32 %add87.us325.us.us.us.us.us.us.us.us.1.1.1, %4 %spec.select.1427.1.1.1 = call i32 @llvm.smin.i32(i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1.1, i32 %spec.select.1.1.1439.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1.1, %2 %spec.select.1.1429.1.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1428.1.1.1, i32 %spec.select.1427.1.1.1) %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1 = add nsw i32 %add90.us314.us.us.us.us.us.us.us.us.us.1.1.1.1, %3 %spec.select.1426.1.1.1.1 = call i32 @llvm.smin.i32(i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1, i32 %spec.select.1.1429.1.1.1) %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1.1 = add nsw i32 %add93.us301.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1, %2 %spec.select.1.1.1.1.1.1 = call i32 @llvm.smin.i32(i32 %add96.us.us.us.us.us.us.us.us.us.us.us.1.1.1.1.1.1, i32 %spec.select.1426.1.1.1.1) br i1 %cmp37.us361.us.us.us.us.us, label %for.cond40.preheader.us355.us.us.us.us.us, label %for.cond.cleanup38.split.split.us.us.us.us.us.us, !llvm.loop !15 for.cond.cleanup38.split.split.us.us.us.us.us.us: ; preds = %for.cond40.preheader.us355.us.us.us.us.us br i1 %cmp33.us373.us.us.us.us, label %for.cond36.preheader.us367.us.us.us.us, label %for.cond.cleanup34.split.split.us.us.us.us.us, !llvm.loop !16 for.cond.cleanup34.split.split.us.us.us.us.us: ; preds = %for.cond.cleanup38.split.split.us.us.us.us.us.us br i1 %cmp29.us384.us.us.us, label %for.cond32.preheader.us378.us.us.us, label %for.cond.cleanup30.split.split.us.us.us.us, !llvm.loop !17 for.cond.cleanup30.split.split.us.us.us.us: ; preds = %for.cond.cleanup34.split.split.us.us.us.us.us br i1 %cmp25.us395.us.us, label %for.cond28.preheader.us389.us.us, label %for.cond.cleanup26.split.split.us.us.us, !llvm.loop !18 for.cond.cleanup26.split.split.us.us.us: ; preds = %for.cond.cleanup30.split.split.us.us.us.us br i1 %cmp21.us407.us, label %for.cond24.preheader.us401.us, label %for.cond.cleanup22.split.split.us.us, !llvm.loop !19 for.cond.cleanup22.split.split.us.us: ; preds = %for.cond.cleanup26.split.split.us.us.us br i1 %cmp16.us417, label %for.cond20.preheader.us412, label %for.cond.cleanup17, !llvm.loop !20 for.body: ; preds = %entry, %for.cond.cleanup4 %indvars.iv423 = phi i64 [ %indvars.iv.next424, %for.cond.cleanup4 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv423 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %63 = load i32, ptr %m, align 4, !tbaa !5 %cmp3272 = icmp sgt i32 %63, 0 br i1 %cmp3272, label %for.body5, label %for.cond.cleanup4 for.cond.cleanup4: ; preds = %for.body5, %for.body %64 = phi i32 [ %63, %for.body ], [ %67, %for.body5 ] %indvars.iv.next424 = add nuw nsw i64 %indvars.iv423, 1 %65 = load i32, ptr %n, align 4, !tbaa !5 %66 = sext i32 %65 to i64 %cmp = icmp slt i64 %indvars.iv.next424, %66 br i1 %cmp, label %for.body, label %for.cond15.preheader.loopexit, !llvm.loop !21 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx9 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 %indvars.iv423, i64 %indvars.iv %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %67 = load i32, ptr %m, align 4, !tbaa !5 %68 = sext i32 %67 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %68 br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !22 for.cond.cleanup17: ; preds = %for.cond.cleanup22.split.split.us.us, %for.cond.cleanup22.split.us.us %.us-phi411 = phi i32 [ %d.12.us.us.us.us.us.us.us.us.us.us.us.us.1.1, %for.cond.cleanup22.split.us.us ], [ %spec.select.1.1.1.1.1.1, %for.cond.cleanup22.split.split.us.us ] %cmp207 = icmp eq i32 %.us-phi411, 2000000000 br i1 %cmp207, label %if.then208, label %if.else if.then208: ; preds = %for.cond15.preheader.split, %for.cond.cleanup17 %call209 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end211 if.else: ; preds = %for.cond.cleanup17 %call210 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi411) br label %if.end211 if.end211: ; preds = %if.else, %if.then208 call void @llvm.lifetime.end.p0(i64 576, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#include <stdio.h> int main(){ int n,m,x,i,j,c[12],a[12][12],u[13],min,s[12],cs,mino; scanf("%d %d %d",&n,&m,&x); min=1; for (i=0;i<n;i++) { scanf("%d",&c[i]); min+=c[i]; u[i]=0; for (j=0;j<m;j++) scanf("%d",&a[i][j]); } mino=min; u[n]=0; for (;;) { for (i=0;i<n;i++) if (u[i]==0) { u[i]=1; break; } else u[i]=0; if (i==n) break; for (i=0;i<m;i++) s[i]=0; cs=0; for (i=0;i<n;i++) if (u[i]) { for (j=0;j<m;j++) s[j]+=a[i][j]; cs+=c[i]; } for (i=0;i<m;i++) if (s[i]<x) break; if (i==m && cs<min) min=cs; } if (min<mino) printf("%d\n",min); else puts("-1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234615/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234615/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %x = alloca i32, align 4 %c = alloca [12 x i32], align 16 %a = alloca [12 x [12 x i32]], align 16 %u = alloca [13 x i32], align 16 %s = alloca [12 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 %x) #4 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 576, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp132 = icmp sgt i32 %0, 0 br i1 %cmp132, label %for.body, label %entry.for.end16_crit_edge entry.for.end16_crit_edge: ; preds = %entry %.pre = load i32, ptr %m, align 4 br label %for.end16 for.body: ; preds = %entry, %for.inc14 %indvars.iv311 = phi i64 [ %indvars.iv.next312, %for.inc14 ], [ 0, %entry ] %min.0133 = phi i32 [ %add, %for.inc14 ], [ 1, %entry ] %arrayidx = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv311 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %min.0133 %arrayidx5 = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv311 store i32 0, ptr %arrayidx5, align 4, !tbaa !5 %2 = load i32, ptr %m, align 4 %cmp7130 = icmp sgt i32 %2, 0 br i1 %cmp7130, label %for.body8, label %for.inc14 for.body8: ; preds = %for.body, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 0, %for.body ] %arrayidx12 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 %indvars.iv311, i64 %indvars.iv %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx12) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %m, align 4 %4 = sext i32 %3 to i64 %cmp7 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp7, label %for.body8, label %for.inc14, !llvm.loop !9 for.inc14: ; preds = %for.body8, %for.body %5 = phi i32 [ %2, %for.body ], [ %3, %for.body8 ] %indvars.iv.next312 = add nuw nsw i64 %indvars.iv311, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next312, %7 br i1 %cmp, label %for.body, label %for.end16, !llvm.loop !11 for.end16: ; preds = %for.inc14, %entry.for.end16_crit_edge %8 = phi i32 [ %.pre, %entry.for.end16_crit_edge ], [ %5, %for.inc14 ] %min.0.lcssa = phi i32 [ 1, %entry.for.end16_crit_edge ], [ %add, %for.inc14 ] %.lcssa129 = phi i32 [ %0, %entry.for.end16_crit_edge ], [ %6, %for.inc14 ] %.lcssa129.fr = freeze i32 %.lcssa129 %idxprom17 = sext i32 %.lcssa129.fr to i64 %arrayidx18 = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %idxprom17 store i32 0, ptr %arrayidx18, align 4, !tbaa !5 %cmp21136 = icmp sgt i32 %.lcssa129.fr, 0 %.fr = freeze i32 %8 %cmp37139 = icmp sgt i32 %.fr, 0 %9 = load i32, ptr %x, align 4 br i1 %cmp21136, label %for.cond19.us.preheader, label %for.end16.split.split for.cond19.us.preheader: ; preds = %for.end16 %10 = zext i32 %.fr to i64 %11 = shl nuw nsw i64 %10, 2 %wide.trip.count336 = zext i32 %.lcssa129.fr to i64 %wide.trip.count354 = zext i32 %.lcssa129.fr to i64 %xtraiter = and i64 %wide.trip.count354, 1 %12 = icmp eq i32 %.lcssa129.fr, 1 %unroll_iter = and i64 %wide.trip.count354, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %min.iters.check = icmp ult i32 %.fr, 8 %n.vec = and i64 %10, 4294967288 %cmp.n = icmp eq i64 %n.vec, %10 br label %for.body22.us.preheader for.body22.us.preheader: ; preds = %for.end80.us, %for.cond19.us.preheader %min.1.us = phi i32 [ %min.2.us, %for.end80.us ], [ %min.0.lcssa, %for.cond19.us.preheader ] br label %for.body22.us for.body22.us: ; preds = %for.body22.us.preheader, %if.else.us %indvars.iv333 = phi i64 [ 0, %for.body22.us.preheader ], [ %indvars.iv.next334, %if.else.us ] %arrayidx24.us = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv333 %13 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5 %cmp25.us = icmp eq i32 %13, 0 br i1 %cmp25.us, label %for.end32.us, label %if.else.us if.else.us: ; preds = %for.body22.us store i32 0, ptr %arrayidx24.us, align 4, !tbaa !5 %indvars.iv.next334 = add nuw nsw i64 %indvars.iv333, 1 %exitcond337.not = icmp eq i64 %indvars.iv.next334, %wide.trip.count336 br i1 %exitcond337.not, label %for.end85, label %for.body22.us, !llvm.loop !12 for.end32.us: ; preds = %for.body22.us %14 = trunc i64 %indvars.iv333 to i32 store i32 1, ptr %arrayidx24.us, align 4, !tbaa !5 %cmp33.us = icmp eq i32 %.lcssa129.fr, %14 br i1 %cmp33.us, label %for.end85, label %for.cond36.preheader.us for.body72.us: ; preds = %for.cond44.for.cond70.preheader_crit_edge.us, %for.inc78.us %indvars.iv356 = phi i64 [ %indvars.iv.next357, %for.inc78.us ], [ 0, %for.cond44.for.cond70.preheader_crit_edge.us ] %arrayidx74.us = getelementptr inbounds [12 x i32], ptr %s, i64 0, i64 %indvars.iv356 %15 = load i32, ptr %arrayidx74.us, align 4, !tbaa !5 %cmp75.us = icmp slt i32 %15, %9 br i1 %cmp75.us, label %for.end80.us.loopexit.split.loop.exit, label %for.inc78.us for.inc78.us: ; preds = %for.body72.us %indvars.iv.next357 = add nuw nsw i64 %indvars.iv356, 1 %exitcond360.not = icmp eq i64 %indvars.iv.next357, %10 br i1 %exitcond360.not, label %for.end80.us, label %for.body72.us, !llvm.loop !13 for.end80.us.loopexit.split.loop.exit: ; preds = %for.body72.us %16 = trunc i64 %indvars.iv356 to i32 br label %for.end80.us for.end80.us: ; preds = %for.inc78.us, %for.end80.us.loopexit.split.loop.exit, %for.cond44.for.cond70.preheader_crit_edge.us %i.4.lcssa.us = phi i32 [ 0, %for.cond44.for.cond70.preheader_crit_edge.us ], [ %16, %for.end80.us.loopexit.split.loop.exit ], [ %.fr, %for.inc78.us ] %cmp81.us = icmp eq i32 %i.4.lcssa.us, %.fr %cmp82.us = icmp slt i32 %.us-phi.us, %min.1.us %or.cond.us = select i1 %cmp81.us, i1 %cmp82.us, i1 false %min.2.us = select i1 %or.cond.us, i32 %.us-phi.us, i32 %min.1.us br label %for.body22.us.preheader for.body46.us152: ; preds = %for.body46.us152.preheader, %for.inc67.us158.1 %indvars.iv341 = phi i64 [ %indvars.iv.next342.1, %for.inc67.us158.1 ], [ 0, %for.body46.us152.preheader ] %cs.0145.us154 = phi i32 [ %cs.1.us159.1, %for.inc67.us158.1 ], [ 0, %for.body46.us152.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc67.us158.1 ], [ 0, %for.body46.us152.preheader ] %arrayidx48.us156 = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv341 %17 = load i32, ptr %arrayidx48.us156, align 8, !tbaa !5 %tobool.not.us157 = icmp eq i32 %17, 0 br i1 %tobool.not.us157, label %for.inc67.us158, label %for.cond50.preheader.us162 for.inc67.us158: ; preds = %for.cond50.preheader.us162, %for.body46.us152 %cs.1.us159 = phi i32 [ %add65.us164, %for.cond50.preheader.us162 ], [ %cs.0145.us154, %for.body46.us152 ] %indvars.iv.next342 = or i64 %indvars.iv341, 1 %arrayidx48.us156.1 = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv.next342 %18 = load i32, ptr %arrayidx48.us156.1, align 4, !tbaa !5 %tobool.not.us157.1 = icmp eq i32 %18, 0 br i1 %tobool.not.us157.1, label %for.inc67.us158.1, label %for.cond50.preheader.us162.1 for.cond50.preheader.us162.1: ; preds = %for.inc67.us158 %arrayidx64.us163.1 = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv.next342 %19 = load i32, ptr %arrayidx64.us163.1, align 4, !tbaa !5 %add65.us164.1 = add nsw i32 %19, %cs.1.us159 br label %for.inc67.us158.1 for.inc67.us158.1: ; preds = %for.cond50.preheader.us162.1, %for.inc67.us158 %cs.1.us159.1 = phi i32 [ %add65.us164.1, %for.cond50.preheader.us162.1 ], [ %cs.1.us159, %for.inc67.us158 ] %indvars.iv.next342.1 = add nuw nsw i64 %indvars.iv341, 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.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa, label %for.body46.us152, !llvm.loop !14 for.cond50.preheader.us162: ; preds = %for.body46.us152 %arrayidx64.us163 = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv341 %20 = load i32, ptr %arrayidx64.us163, align 8, !tbaa !5 %add65.us164 = add nsw i32 %20, %cs.0145.us154 br label %for.inc67.us158 for.body46.us.us.preheader: ; preds = %for.cond36.preheader.us call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 0, i64 %11, i1 false), !tbaa !5 br label %for.body46.us.us for.cond36.preheader.us: ; preds = %for.end32.us br i1 %cmp37139, label %for.body46.us.us.preheader, label %for.body46.us152.preheader for.body46.us152.preheader: ; preds = %for.cond36.preheader.us br i1 %12, label %for.cond44.for.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa, label %for.body46.us152 for.cond44.for.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa: ; preds = %for.inc67.us158.1, %for.body46.us152.preheader %cs.1.us159.lcssa.ph = phi i32 [ undef, %for.body46.us152.preheader ], [ %cs.1.us159.1, %for.inc67.us158.1 ] %indvars.iv341.unr = phi i64 [ 0, %for.body46.us152.preheader ], [ %indvars.iv.next342.1, %for.inc67.us158.1 ] %cs.0145.us154.unr = phi i32 [ 0, %for.body46.us152.preheader ], [ %cs.1.us159.1, %for.inc67.us158.1 ] br i1 %lcmp.mod.not, label %for.cond44.for.cond70.preheader_crit_edge.us, label %for.body46.us152.epil for.body46.us152.epil: ; preds = %for.cond44.for.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa %arrayidx48.us156.epil = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv341.unr %21 = load i32, ptr %arrayidx48.us156.epil, align 4, !tbaa !5 %tobool.not.us157.epil = icmp eq i32 %21, 0 br i1 %tobool.not.us157.epil, label %for.cond44.for.cond70.preheader_crit_edge.us, label %for.cond50.preheader.us162.epil for.cond50.preheader.us162.epil: ; preds = %for.body46.us152.epil %arrayidx64.us163.epil = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv341.unr %22 = load i32, ptr %arrayidx64.us163.epil, align 4, !tbaa !5 %add65.us164.epil = add nsw i32 %22, %cs.0145.us154.unr br label %for.cond44.for.cond70.preheader_crit_edge.us for.cond44.for.cond70.preheader_crit_edge.us: ; preds = %for.cond44.for.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa, %for.cond50.preheader.us162.epil, %for.body46.us152.epil, %for.inc67.us.us %.us-phi.us = phi i32 [ %cs.1.us.us, %for.inc67.us.us ], [ %cs.1.us159.lcssa.ph, %for.cond44.for.cond70.preheader_crit_edge.us.loopexit388.unr-lcssa ], [ %add65.us164.epil, %for.cond50.preheader.us162.epil ], [ %cs.0145.us154.unr, %for.body46.us152.epil ] br i1 %cmp37139, label %for.body72.us, label %for.end80.us for.body46.us.us: ; preds = %for.body46.us.us.preheader, %for.inc67.us.us %indvars.iv351 = phi i64 [ 0, %for.body46.us.us.preheader ], [ %indvars.iv.next352, %for.inc67.us.us ] %cs.0145.us.us = phi i32 [ 0, %for.body46.us.us.preheader ], [ %cs.1.us.us, %for.inc67.us.us ] %arrayidx48.us.us = getelementptr inbounds [13 x i32], ptr %u, i64 0, i64 %indvars.iv351 %23 = load i32, ptr %arrayidx48.us.us, align 4, !tbaa !5 %tobool.not.us.us = icmp eq i32 %23, 0 br i1 %tobool.not.us.us, label %for.inc67.us.us, label %for.body52.us.us.preheader for.body52.us.us.preheader: ; preds = %for.body46.us.us br i1 %min.iters.check, label %for.body52.us.us.preheader387, label %vector.body vector.body: ; preds = %for.body52.us.us.preheader, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body52.us.us.preheader ] %24 = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 %indvars.iv351, i64 %index %wide.load = load <4 x i32>, ptr %24, align 16, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load384 = load <4 x i32>, ptr %25, align 16, !tbaa !5 %26 = getelementptr inbounds [12 x i32], ptr %s, i64 0, i64 %index %wide.load385 = load <4 x i32>, ptr %26, align 16, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load386 = load <4 x i32>, ptr %27, align 16, !tbaa !5 %28 = add nsw <4 x i32> %wide.load385, %wide.load %29 = add nsw <4 x i32> %wide.load386, %wide.load384 store <4 x i32> %28, ptr %26, align 16, !tbaa !5 store <4 x i32> %29, ptr %27, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %30 = icmp eq i64 %index.next, %n.vec br i1 %30, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond50.for.end62_crit_edge.us.us, label %for.body52.us.us.preheader387 for.body52.us.us.preheader387: ; preds = %for.body52.us.us.preheader, %middle.block %indvars.iv346.ph = phi i64 [ 0, %for.body52.us.us.preheader ], [ %n.vec, %middle.block ] br label %for.body52.us.us for.body52.us.us: ; preds = %for.body52.us.us.preheader387, %for.body52.us.us %indvars.iv346 = phi i64 [ %indvars.iv.next347, %for.body52.us.us ], [ %indvars.iv346.ph, %for.body52.us.us.preheader387 ] %arrayidx56.us.us = getelementptr inbounds [12 x [12 x i32]], ptr %a, i64 0, i64 %indvars.iv351, i64 %indvars.iv346 %31 = load i32, ptr %arrayidx56.us.us, align 4, !tbaa !5 %arrayidx58.us.us = getelementptr inbounds [12 x i32], ptr %s, i64 0, i64 %indvars.iv346 %32 = load i32, ptr %arrayidx58.us.us, align 4, !tbaa !5 %add59.us.us = add nsw i32 %32, %31 store i32 %add59.us.us, ptr %arrayidx58.us.us, align 4, !tbaa !5 %indvars.iv.next347 = add nuw nsw i64 %indvars.iv346, 1 %exitcond350.not = icmp eq i64 %indvars.iv.next347, %10 br i1 %exitcond350.not, label %for.cond50.for.end62_crit_edge.us.us, label %for.body52.us.us, !llvm.loop !18 for.inc67.us.us: ; preds = %for.cond50.for.end62_crit_edge.us.us, %for.body46.us.us %cs.1.us.us = phi i32 [ %add65.us.us, %for.cond50.for.end62_crit_edge.us.us ], [ %cs.0145.us.us, %for.body46.us.us ] %indvars.iv.next352 = add nuw nsw i64 %indvars.iv351, 1 %exitcond355.not = icmp eq i64 %indvars.iv.next352, %wide.trip.count354 br i1 %exitcond355.not, label %for.cond44.for.cond70.preheader_crit_edge.us, label %for.body46.us.us, !llvm.loop !14 for.cond50.for.end62_crit_edge.us.us: ; preds = %for.body52.us.us, %middle.block %arrayidx64.us.us = getelementptr inbounds [12 x i32], ptr %c, i64 0, i64 %indvars.iv351 %33 = load i32, ptr %arrayidx64.us.us, align 4, !tbaa !5 %add65.us.us = add nsw i32 %33, %cs.0145.us.us br label %for.inc67.us.us for.end16.split.split: ; preds = %for.end16 %cmp33 = icmp eq i32 %.lcssa129.fr, 0 br i1 %cmp33, label %if.else89, label %for.cond36.preheader.lr.ph.split for.cond36.preheader.lr.ph.split: ; preds = %for.end16.split.split br i1 %cmp37139, label %for.cond36.preheader.us252.preheader, label %for.cond36.preheader.lr.ph.split.split for.cond36.preheader.us252.preheader: ; preds = %for.cond36.preheader.lr.ph.split %34 = zext i32 %.fr to i64 %35 = shl nuw nsw i64 %34, 2 br label %for.cond44.preheader.us274 for.cond44.preheader.us274: ; preds = %for.cond44.preheader.us274, %for.cond36.preheader.us252.preheader call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 0, i64 %35, i1 false), !tbaa !5 br label %for.cond44.preheader.us274, !llvm.loop !13 for.cond36.preheader.lr.ph.split.split: ; preds = %for.cond36.preheader.lr.ph.split %cmp81 = icmp eq i32 %.fr, 0 br i1 %cmp81, label %for.cond36.preheader, label %for.cond36.preheader.us296 for.cond36.preheader.us296: ; preds = %for.cond36.preheader.lr.ph.split.split, %for.cond36.preheader.us296 br label %for.cond36.preheader.us296 for.cond36.preheader: ; preds = %for.cond36.preheader.lr.ph.split.split, %for.cond36.preheader br label %for.cond36.preheader for.end85: ; preds = %for.end32.us, %if.else.us %cmp86 = icmp slt i32 %min.1.us, %min.0.lcssa br i1 %cmp86, label %if.then87, label %if.else89 if.then87: ; preds = %for.end85 %call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.1.us) br label %if.end91 if.else89: ; preds = %for.end16.split.split, %for.end85 %call90 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3) br label %if.end91 if.end91: ; preds = %if.else89, %if.then87 call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %u) #4 call void @llvm.lifetime.end.p0(i64 576, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 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} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16}
#include <stdio.h> #include <stdlib.h> int cmpint(const void *a, const void *b) { return *(int *)b - *(int *)a; } int min(int x, int y) { return x < y ? x : y; } int main() { int n, a[100000], ans = 0, max = 0, num = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } qsort(a, n, sizeof(int), cmpint); for (int i = 1; i < n; i++) { ans = min(a[i], a[0] - a[i]); if (ans >= max) { max = ans; num = i; } } printf("%d %d\n", a[0], a[num]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234673/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #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 nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %x, i32 %y) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %a = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre44 = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre44, %entry.for.cond.cleanup_crit_edge ], [ %5, %for.body ] call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmpint) #7 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %1, 1 %.pre = load i32, ptr %a, align 16, !tbaa !5 br i1 %cmp433, label %for.body7.lr.ph, label %for.cond.cleanup6 for.body7.lr.ph: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %2, 1 %3 = icmp eq i32 %1, 2 br i1 %3, label %for.cond.cleanup6.loopexit.unr-lcssa, label %for.body7.lr.ph.new for.body7.lr.ph.new: ; preds = %for.body7.lr.ph %unroll_iter = and i64 %2, -2 br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 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 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup6.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.lr.ph %spec.select30.lcssa.ph = phi i32 [ undef, %for.body7.lr.ph ], [ %spec.select30.1, %for.body7 ] %indvars.iv40.unr = phi i64 [ 1, %for.body7.lr.ph ], [ %indvars.iv.next41.1, %for.body7 ] %num.035.unr = phi i32 [ 0, %for.body7.lr.ph ], [ %spec.select30.1, %for.body7 ] %max.034.unr = phi i32 [ 0, %for.body7.lr.ph ], [ %spec.select.1, %for.body7 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup6.loopexit, label %for.body7.epil for.body7.epil: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa %arrayidx9.epil = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv40.unr %6 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 %.pre, %6 %cond.i.epil = call i32 @llvm.smin.i32(i32 %6, i32 %sub.epil) %cmp14.not.epil = icmp slt i32 %cond.i.epil, %max.034.unr %7 = trunc i64 %indvars.iv40.unr to i32 %spec.select30.epil = select i1 %cmp14.not.epil, i32 %num.035.unr, i32 %7 br label %for.cond.cleanup6.loopexit for.cond.cleanup6.loopexit: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa, %for.body7.epil %spec.select30.lcssa = phi i32 [ %spec.select30.lcssa.ph, %for.cond.cleanup6.loopexit.unr-lcssa ], [ %spec.select30.epil, %for.body7.epil ] %idxprom20.phi.trans.insert = sext i32 %spec.select30.lcssa to i64 %arrayidx21.phi.trans.insert = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom20.phi.trans.insert %.pre43 = load i32, ptr %arrayidx21.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.cleanup6 for.cond.cleanup6: ; preds = %for.cond.cleanup, %for.cond.cleanup6.loopexit %8 = phi i32 [ %.pre43, %for.cond.cleanup6.loopexit ], [ %.pre, %for.cond.cleanup ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %8) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 for.body7: ; preds = %for.body7, %for.body7.lr.ph.new %indvars.iv40 = phi i64 [ 1, %for.body7.lr.ph.new ], [ %indvars.iv.next41.1, %for.body7 ] %num.035 = phi i32 [ 0, %for.body7.lr.ph.new ], [ %spec.select30.1, %for.body7 ] %max.034 = phi i32 [ 0, %for.body7.lr.ph.new ], [ %spec.select.1, %for.body7 ] %niter = phi i64 [ 0, %for.body7.lr.ph.new ], [ %niter.next.1, %for.body7 ] %arrayidx9 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv40 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %sub = sub nsw i32 %.pre, %9 %cond.i = call i32 @llvm.smin.i32(i32 %9, i32 %sub) %cmp14.not = icmp slt i32 %cond.i, %max.034 %spec.select = call i32 @llvm.smax.i32(i32 %cond.i, i32 %max.034) %10 = trunc i64 %indvars.iv40 to i32 %spec.select30 = select i1 %cmp14.not, i32 %num.035, i32 %10 %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %arrayidx9.1 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv.next41 %11 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %.pre, %11 %cond.i.1 = call i32 @llvm.smin.i32(i32 %11, i32 %sub.1) %cmp14.not.1 = icmp slt i32 %cond.i.1, %spec.select %spec.select.1 = call i32 @llvm.smax.i32(i32 %cond.i.1, i32 %spec.select) %12 = trunc i64 %indvars.iv.next41 to i32 %spec.select30.1 = select i1 %cmp14.not.1, i32 %spec.select30, i32 %12 %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 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.cond.cleanup6.loopexit.unr-lcssa, label %for.body7, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 ; 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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> void change(int *x, int *y); int n; int a[100000]; int max=0; int rec; int main(void){ scanf("%d", &n); for(int i=0;i<n;i++) scanf("%d", &a[i]); for(int i=0;i<n;i++){ if(a[max]<a[i]) max=i; } if(max==0) rec=1; else rec=0; for(int i=0;i<n;i++){ if(abs(a[max]/2-a[i]) < abs(a[max]/2-a[rec]) && i!=max) rec=i; } printf("%d %d", a[max], a[rec]); return 0; } void change(int *x, int *y){ int z; z = *x; *x = *y; *y = z; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234716/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @max = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @a = dso_local global [100000 x i32] zeroinitializer, align 16 @rec = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond3.preheader.thread for.cond3.preheader.thread: ; preds = %entry %max.promoted77 = load i32, ptr @max, align 4, !tbaa !5 br label %for.cond.cleanup5.thread for.cond3.preheader: ; preds = %for.body %max.promoted = load i32, ptr @max, align 4, !tbaa !5 %cmp458 = icmp sgt i32 %2, 0 br i1 %cmp458, label %for.body6.preheader, label %for.cond.cleanup5.thread for.body6.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %2, 1 br i1 %1, label %for.cond.cleanup5.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr @a, 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 %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.cond3.preheader, !llvm.loop !9 for.cond.cleanup5.thread: ; preds = %for.cond3.preheader, %for.cond3.preheader.thread %.ph = phi i32 [ %max.promoted77, %for.cond3.preheader.thread ], [ %max.promoted, %for.cond3.preheader ] %cmp1583 = icmp eq i32 %.ph, 0 %.84 = zext i1 %cmp1583 to i32 store i32 %.84, ptr @rec, align 4, !tbaa !5 br label %for.cond.cleanup5.for.cond.cleanup21_crit_edge for.cond.cleanup5.unr-lcssa: ; preds = %for.inc12.1, %for.body6.preheader %i2.056.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %i2.056.1, %for.inc12.1 ] %indvars.iv68.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next69.1, %for.inc12.1 ] %i2.05759.unr = phi i32 [ %max.promoted, %for.body6.preheader ], [ %i2.056.1, %for.inc12.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup5, label %for.body6.epil for.body6.epil: ; preds = %for.cond.cleanup5.unr-lcssa %idxprom7.epil = sext i32 %i2.05759.unr to i64 %arrayidx8.epil = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom7.epil %4 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %arrayidx10.epil = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv68.unr %5 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %cmp11.epil = icmp slt i32 %4, %5 br i1 %cmp11.epil, label %if.then.epil, label %for.cond.cleanup5 if.then.epil: ; preds = %for.body6.epil %6 = trunc i64 %indvars.iv68.unr to i32 store i32 %6, ptr @max, align 4, !tbaa !5 br label %for.cond.cleanup5 for.cond.cleanup5: ; preds = %for.body6.epil, %if.then.epil, %for.cond.cleanup5.unr-lcssa %i2.056.lcssa = phi i32 [ %i2.056.lcssa.ph, %for.cond.cleanup5.unr-lcssa ], [ %i2.05759.unr, %for.body6.epil ], [ %6, %if.then.epil ] %cmp15 = icmp eq i32 %i2.056.lcssa, 0 %. = zext i1 %cmp15 to i32 store i32 %., ptr @rec, align 4, !tbaa !5 br i1 %cmp458, label %for.body22.lr.ph, label %for.cond.cleanup5.for.cond.cleanup21_crit_edge for.cond.cleanup5.for.cond.cleanup21_crit_edge: ; preds = %for.cond.cleanup5.thread, %for.cond.cleanup5 %.85 = phi i32 [ %.84, %for.cond.cleanup5.thread ], [ %., %for.cond.cleanup5 ] %7 = phi i32 [ %.ph, %for.cond.cleanup5.thread ], [ %i2.056.lcssa, %for.cond.cleanup5 ] %idxprom40.phi.trans.insert = sext i32 %7 to i64 %arrayidx41.phi.trans.insert = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom40.phi.trans.insert %.pre = load i32, ptr %arrayidx41.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.cleanup21 for.body22.lr.ph: ; preds = %for.cond.cleanup5 %idxprom23 = sext i32 %i2.056.lcssa to i64 %arrayidx24 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom23 %8 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %div = sdiv i32 %8, 2 %9 = zext i32 %i2.056.lcssa to i64 %wide.trip.count74 = zext i32 %2 to i64 br label %for.body22 for.body6: ; preds = %for.inc12.1, %for.body6.preheader.new %indvars.iv68 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next69.1, %for.inc12.1 ] %i2.05759 = phi i32 [ %max.promoted, %for.body6.preheader.new ], [ %i2.056.1, %for.inc12.1 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc12.1 ] %idxprom7 = sext i32 %i2.05759 to i64 %arrayidx8 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom7 %10 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv68 %11 = load i32, ptr %arrayidx10, align 8, !tbaa !5 %cmp11 = icmp slt i32 %10, %11 br i1 %cmp11, label %if.then, label %for.inc12 if.then: ; preds = %for.body6 %12 = trunc i64 %indvars.iv68 to i32 store i32 %12, ptr @max, align 4, !tbaa !5 br label %for.inc12 for.inc12: ; preds = %for.body6, %if.then %i2.056 = phi i32 [ %i2.05759, %for.body6 ], [ %12, %if.then ] %indvars.iv.next69 = or i64 %indvars.iv68, 1 %idxprom7.1 = sext i32 %i2.056 to i64 %arrayidx8.1 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom7.1 %13 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %arrayidx10.1 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next69 %14 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %cmp11.1 = icmp slt i32 %13, %14 br i1 %cmp11.1, label %if.then.1, label %for.inc12.1 if.then.1: ; preds = %for.inc12 %15 = trunc i64 %indvars.iv.next69 to i32 store i32 %15, ptr @max, align 4, !tbaa !5 br label %for.inc12.1 for.inc12.1: ; preds = %if.then.1, %for.inc12 %i2.056.1 = phi i32 [ %i2.056, %for.inc12 ], [ %15, %if.then.1 ] %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup5.unr-lcssa, label %for.body6, !llvm.loop !11 for.cond.cleanup21: ; preds = %for.inc37, %for.cond.cleanup5.for.cond.cleanup21_crit_edge %16 = phi i32 [ %.85, %for.cond.cleanup5.for.cond.cleanup21_crit_edge ], [ %i18.061, %for.inc37 ] %17 = phi i32 [ %.pre, %for.cond.cleanup5.for.cond.cleanup21_crit_edge ], [ %8, %for.inc37 ] %idxprom42 = sext i32 %16 to i64 %arrayidx43 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom42 %18 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %call44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17, i32 noundef %18) ret i32 0 for.body22: ; preds = %for.body22.lr.ph, %for.inc37 %indvars.iv71 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next72, %for.inc37 ] %i18.06264 = phi i32 [ %., %for.body22.lr.ph ], [ %i18.061, %for.inc37 ] %arrayidx26 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv71 %19 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %sub = sub nsw i32 %div, %19 %20 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %idxprom30 = sext i32 %i18.06264 to i64 %arrayidx31 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom30 %21 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %sub32 = sub nsw i32 %div, %21 %22 = tail call i32 @llvm.abs.i32(i32 %sub32, i1 true) %cmp33 = icmp uge i32 %20, %22 %cmp34.not = icmp eq i64 %indvars.iv71, %9 %or.cond = or i1 %cmp34.not, %cmp33 br i1 %or.cond, label %for.inc37, label %if.then35 if.then35: ; preds = %for.body22 %23 = trunc i64 %indvars.iv71 to i32 store i32 %23, ptr @rec, align 4, !tbaa !5 br label %for.inc37 for.inc37: ; preds = %for.body22, %if.then35 %i18.061 = phi i32 [ %i18.06264, %for.body22 ], [ %23, %if.then35 ] %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74 br i1 %exitcond75.not, label %for.cond.cleanup21, label %for.body22, !llvm.loop !12 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @change(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 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
// AOJ 2153: Mirror Cave // 2017.11.11 bal4u@uu #include <stdio.h> #include <string.h> #define TM 0 #if TM #include <time.h> #endif #define QMAX 150000 typedef struct { char lr, lc, rr, rc; } Q; Q q[QMAX+2]; int top, end; char ml[50][51], mr[50][51]; char mk[50][50][50][50]; int mvl[4][2] = {{-1,0},{0,1},{1,0},{0,-1}}; int mvr[4][2] = {{-1,0},{0,-1},{1,0},{0,1}}; int main() { int w, h, r, c, lr, lc, rr, rc, lr2, lc2, rr2, rc2, i, f; int slr, slc, srr, src; #if TM clock_t start, end; start = clock(); #endif while (scanf("%d%d", &w, &h) && w > 0) { for (f = 0, r = 0; r < h; r++) { scanf("%s%s", ml[r], mr[r]); if (f < 3) for (c = 0; c < w; c++) { if (ml[r][c] == 'L') slr = r, slc = c, f |= 1; if (mr[r][c] == 'R') srr = r, src = c, f |= 2; } } memset(mk, 0, sizeof(mk)); q[0].lr = slr, q[0].lc = slc, q[0].rr = srr, q[0].rc = src, top = 0, end = 1; mk[slr][slc][srr][src] = 1; f = 0; while (top != end) { lr = q[top].lr, lc = q[top].lc, rr = q[top].rr, rc = q[top].rc; if (++top == QMAX) top = 0; if (ml[lr][lc] == '%' && mr[rr][rc] == '%') { f = 1; break; } if (ml[lr][lc] == '%' || mr[rr][rc] == '%') continue; for (i = 0; i < 4; i++) { lr2 = lr + mvl[i][0], lc2 = lc + mvl[i][1]; rr2 = rr + mvr[i][0], rc2 = rc + mvr[i][1]; if (lr2 < 0 || lr2 >= h || lc2 < 0 || lc2 >= w || ml[lr2][lc2] == '#') lr2 = lr, lc2 = lc; if (rr2 < 0 || rr2 >= h || rc2 < 0 || rc2 >= w || mr[rr2][rc2] == '#') rr2 = rr, rc2 = rc; if (mk[lr2][lc2][rr2][rc2]) continue; mk[lr2][lc2][rr2][rc2] = 1; q[end].lr = lr2, q[end].lc = lc2, q[end].rr = rr2, q[end].rc = rc2; if (++end == QMAX) end = 0; } } puts(f ? "Yes" : "No"); } #if TM end = clock(); printf("time %lf\n", (double)(end-start)/CLOCKS_PER_SEC); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234802/source.c" target datalayout = "e-m:e-p270: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.Q = type { i8, i8, i8, i8 } @mvl = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 -1]], align 16 @mvr = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 -1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1]], align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @ml = dso_local global [50 x [51 x i8]] zeroinitializer, align 16 @mr = dso_local global [50 x [51 x i8]] zeroinitializer, align 16 @mk = dso_local local_unnamed_addr global [50 x [50 x [50 x [50 x i8]]]] zeroinitializer, align 16 @q = dso_local local_unnamed_addr global [150002 x %struct.Q] zeroinitializer, align 16 @top = dso_local local_unnamed_addr global i32 0, align 4 @end = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca i32, align 4 %h = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 %call309 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h) %tobool310 = icmp ne i32 %call309, 0 %0 = load i32, ptr %w, align 4 %cmp311 = icmp sgt i32 %0, 0 %1 = select i1 %tobool310, i1 %cmp311, i1 false br i1 %1, label %for.cond.preheader, label %while.end206 for.cond.preheader: ; preds = %entry, %while.end %src.0315 = phi i32 [ %src.1.lcssa, %while.end ], [ undef, %entry ] %srr.0314 = phi i32 [ %srr.1.lcssa, %while.end ], [ undef, %entry ] %slc.0313 = phi i32 [ %slc.1.lcssa, %while.end ], [ undef, %entry ] %slr.0312 = phi i32 [ %slr.1.lcssa, %while.end ], [ undef, %entry ] %2 = load i32, ptr %h, align 4, !tbaa !5 %cmp1280 = icmp sgt i32 %2, 0 br i1 %cmp1280, label %for.body, label %while.body46.lr.ph for.body: ; preds = %for.cond.preheader, %for.inc28 %indvars.iv319 = phi i64 [ %indvars.iv.next320, %for.inc28 ], [ 0, %for.cond.preheader ] %src.1287 = phi i32 [ %src.4, %for.inc28 ], [ %src.0315, %for.cond.preheader ] %srr.1286 = phi i32 [ %srr.4, %for.inc28 ], [ %srr.0314, %for.cond.preheader ] %slc.1285 = phi i32 [ %slc.4, %for.inc28 ], [ %slc.0313, %for.cond.preheader ] %slr.1284 = phi i32 [ %slr.4, %for.inc28 ], [ %slr.0312, %for.cond.preheader ] %f.0283 = phi i32 [ %f.4, %for.inc28 ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %indvars.iv319 %arrayidx3 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %indvars.iv319 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %cmp6 = icmp slt i32 %f.0283, 3 br i1 %cmp6, label %for.cond7.preheader, label %for.inc28 for.cond7.preheader: ; preds = %for.body %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp8269 = icmp sgt i32 %3, 0 br i1 %cmp8269, label %for.body9.preheader, label %for.inc28 for.body9.preheader: ; preds = %for.cond7.preheader %wide.trip.count = zext i32 %3 to i64 %4 = trunc i64 %indvars.iv319 to i32 br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.body9 %indvars.iv = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next, %for.body9 ] %src.2275 = phi i32 [ %src.1287, %for.body9.preheader ], [ %src.3, %for.body9 ] %srr.2274 = phi i32 [ %srr.1286, %for.body9.preheader ], [ %srr.3, %for.body9 ] %slc.2273 = phi i32 [ %slc.1285, %for.body9.preheader ], [ %slc.3, %for.body9 ] %slr.2272 = phi i32 [ %slr.1284, %for.body9.preheader ], [ %slr.3, %for.body9 ] %f.1271 = phi i32 [ %f.0283, %for.body9.preheader ], [ %f.3, %for.body9 ] %arrayidx13 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %indvars.iv319, i64 %indvars.iv %5 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %cmp14 = icmp eq i8 %5, 76 %or = zext i1 %cmp14 to i32 %f.2 = or i32 %f.1271, %or %slr.3 = select i1 %cmp14, i32 %4, i32 %slr.2272 %6 = trunc i64 %indvars.iv to i32 %slc.3 = select i1 %cmp14, i32 %6, i32 %slc.2273 %arrayidx20 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %indvars.iv319, i64 %indvars.iv %7 = load i8, ptr %arrayidx20, align 1, !tbaa !9 %cmp22 = icmp eq i8 %7, 82 %or25 = or i32 %f.2, 2 %f.3 = select i1 %cmp22, i32 %or25, i32 %f.2 %srr.3 = select i1 %cmp22, i32 %4, i32 %srr.2274 %src.3 = select i1 %cmp22, i32 %6, i32 %src.2275 %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.inc28, label %for.body9, !llvm.loop !10 for.inc28: ; preds = %for.body9, %for.cond7.preheader, %for.body %f.4 = phi i32 [ 3, %for.body ], [ %f.0283, %for.cond7.preheader ], [ %f.3, %for.body9 ] %slr.4 = phi i32 [ %slr.1284, %for.body ], [ %slr.1284, %for.cond7.preheader ], [ %slr.3, %for.body9 ] %slc.4 = phi i32 [ %slc.1285, %for.body ], [ %slc.1285, %for.cond7.preheader ], [ %slc.3, %for.body9 ] %srr.4 = phi i32 [ %srr.1286, %for.body ], [ %srr.1286, %for.cond7.preheader ], [ %srr.3, %for.body9 ] %src.4 = phi i32 [ %src.1287, %for.body ], [ %src.1287, %for.cond7.preheader ], [ %src.3, %for.body9 ] %indvars.iv.next320 = add nuw nsw i64 %indvars.iv319, 1 %8 = load i32, ptr %h, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp1 = icmp slt i64 %indvars.iv.next320, %9 br i1 %cmp1, label %for.body, label %while.body46.lr.ph, !llvm.loop !12 while.body46.lr.ph: ; preds = %for.inc28, %for.cond.preheader %slr.1.lcssa = phi i32 [ %slr.0312, %for.cond.preheader ], [ %slr.4, %for.inc28 ] %slc.1.lcssa = phi i32 [ %slc.0313, %for.cond.preheader ], [ %slc.4, %for.inc28 ] %srr.1.lcssa = phi i32 [ %srr.0314, %for.cond.preheader ], [ %srr.4, %for.inc28 ] %src.1.lcssa = phi i32 [ %src.0315, %for.cond.preheader ], [ %src.4, %for.inc28 ] %.lcssa = phi i32 [ %2, %for.cond.preheader ], [ %8, %for.inc28 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(6250000) @mk, i8 0, i64 6250000, i1 false) %conv31 = trunc i32 %slr.1.lcssa to i8 store i8 %conv31, ptr @q, align 16, !tbaa !13 %conv32 = trunc i32 %slc.1.lcssa to i8 store i8 %conv32, ptr getelementptr inbounds ([150002 x %struct.Q], ptr @q, i64 0, i64 0, i32 1), align 1, !tbaa !15 %conv33 = trunc i32 %srr.1.lcssa to i8 store i8 %conv33, ptr getelementptr inbounds ([150002 x %struct.Q], ptr @q, i64 0, i64 0, i32 2), align 2, !tbaa !16 %conv34 = trunc i32 %src.1.lcssa to i8 store i8 %conv34, ptr getelementptr inbounds ([150002 x %struct.Q], ptr @q, i64 0, i64 0, i32 3), align 1, !tbaa !17 store i32 1, ptr @end, align 4, !tbaa !5 %idxprom35 = sext i32 %slr.1.lcssa to i64 %idxprom37 = sext i32 %slc.1.lcssa to i64 %idxprom39 = sext i32 %srr.1.lcssa to i64 %idxprom41 = sext i32 %src.1.lcssa to i64 %arrayidx42 = getelementptr inbounds [50 x [50 x [50 x [50 x i8]]]], ptr @mk, i64 0, i64 %idxprom35, i64 %idxprom37, i64 %idxprom39, i64 %idxprom41 store i8 1, ptr %arrayidx42, align 1, !tbaa !9 %10 = load i32, ptr %w, align 4 %11 = load i32, ptr @mvl, align 16 %12 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 0, i64 1), align 4 %13 = load i32, ptr @mvr, align 16 %14 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 0, i64 1), align 4 %15 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 1), align 8 %16 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 1, i64 1), align 4 %17 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 1), align 8 %18 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 1, i64 1), align 4 %19 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 2), align 16 %20 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 2, i64 1), align 4 %21 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 2), align 16 %22 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 2, i64 1), align 4 %23 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 3), align 8 %24 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvl, i64 0, i64 3, i64 1), align 4 %25 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 3), align 8 %26 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mvr, i64 0, i64 3, i64 1), align 4 br label %while.body46 while.body46: ; preds = %while.body46.lr.ph, %while.cond43.backedge %spec.store.select297305 = phi i32 [ 0, %while.body46.lr.ph ], [ %spec.store.select, %while.cond43.backedge ] %end.promoted302304 = phi i32 [ 1, %while.body46.lr.ph ], [ %end.promoted299, %while.cond43.backedge ] %idxprom47 = sext i32 %spec.store.select297305 to i64 %arrayidx48 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom47 %27 = load i8, ptr %arrayidx48, align 4, !tbaa !13 %conv50 = sext i8 %27 to i32 %lc53 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom47, i32 1 %28 = load i8, ptr %lc53, align 1, !tbaa !15 %conv54 = sext i8 %28 to i32 %rr57 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom47, i32 2 %29 = load i8, ptr %rr57, align 2, !tbaa !16 %conv58 = sext i8 %29 to i32 %rc61 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom47, i32 3 %30 = load i8, ptr %rc61, align 1, !tbaa !17 %conv62 = sext i8 %30 to i32 %inc63 = add nsw i32 %spec.store.select297305, 1 %cmp64 = icmp eq i32 %inc63, 150000 %spec.store.select = select i1 %cmp64, i32 0, i32 %inc63 %idxprom68 = sext i8 %27 to i64 %idxprom70 = sext i8 %28 to i64 %arrayidx71 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %idxprom68, i64 %idxprom70 %31 = load i8, ptr %arrayidx71, align 1, !tbaa !9 %cmp73 = icmp eq i8 %31, 37 %idxprom75 = sext i8 %29 to i64 %idxprom77 = sext i8 %30 to i64 %arrayidx78 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %idxprom75, i64 %idxprom77 %32 = load i8, ptr %arrayidx78, align 1, !tbaa !9 %cmp80 = icmp eq i8 %32, 37 br i1 %cmp73, label %land.lhs.true, label %lor.lhs.false land.lhs.true: ; preds = %while.body46 br i1 %cmp80, label %while.end, label %while.cond43.backedge lor.lhs.false: ; preds = %while.body46 br i1 %cmp80, label %while.cond43.backedge, label %for.body103.preheader for.body103.preheader: ; preds = %lor.lhs.false %add = add nsw i32 %11, %conv50 %add110 = add nsw i32 %12, %conv54 %add114 = add nsw i32 %13, %conv58 %add118 = add nsw i32 %14, %conv62 %cmp119 = icmp slt i32 %add, 0 br i1 %cmp119, label %if.then138, label %lor.lhs.false121 while.cond43.backedge: ; preds = %if.end160.3, %if.end171.3, %lor.lhs.false, %land.lhs.true %end.promoted299 = phi i32 [ %end.promoted302304, %land.lhs.true ], [ %end.promoted302304, %lor.lhs.false ], [ %end.promoted300.2, %if.end160.3 ], [ %spec.store.select208.3, %if.end171.3 ] %cmp44.not = icmp eq i32 %spec.store.select, %end.promoted299 br i1 %cmp44.not, label %while.end, label %while.body46, !llvm.loop !18 lor.lhs.false121: ; preds = %for.body103.preheader %cmp122 = icmp slt i32 %add, %.lcssa %cmp125 = icmp sgt i32 %add110, -1 %or.cond.not267 = select i1 %cmp122, i1 %cmp125, i1 false %cmp128.not = icmp slt i32 %add110, %10 %or.cond265 = select i1 %or.cond.not267, i1 %cmp128.not, i1 false br i1 %or.cond265, label %lor.lhs.false130, label %if.then138 lor.lhs.false130: ; preds = %lor.lhs.false121 %idxprom131 = zext i32 %add to i64 %idxprom133 = zext i32 %add110 to i64 %arrayidx134 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %idxprom131, i64 %idxprom133 %33 = load i8, ptr %arrayidx134, align 1, !tbaa !9 %cmp136 = icmp eq i8 %33, 35 br i1 %cmp136, label %if.then138, label %if.end139 if.then138: ; preds = %lor.lhs.false130, %lor.lhs.false121, %for.body103.preheader br label %if.end139 if.end139: ; preds = %if.then138, %lor.lhs.false130 %lr2.0 = phi i32 [ %conv50, %if.then138 ], [ %add, %lor.lhs.false130 ] %lc2.0 = phi i32 [ %conv54, %if.then138 ], [ %add110, %lor.lhs.false130 ] %cmp140 = icmp slt i32 %add114, 0 br i1 %cmp140, label %if.then159, label %lor.lhs.false142 lor.lhs.false142: ; preds = %if.end139 %cmp143 = icmp slt i32 %add114, %.lcssa %cmp146 = icmp sgt i32 %add118, -1 %or.cond207.not268 = select i1 %cmp143, i1 %cmp146, i1 false %cmp149.not = icmp slt i32 %add118, %10 %or.cond266 = select i1 %or.cond207.not268, i1 %cmp149.not, i1 false br i1 %or.cond266, label %lor.lhs.false151, label %if.then159 lor.lhs.false151: ; preds = %lor.lhs.false142 %idxprom152 = zext i32 %add114 to i64 %idxprom154 = zext i32 %add118 to i64 %arrayidx155 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %idxprom152, i64 %idxprom154 %34 = load i8, ptr %arrayidx155, align 1, !tbaa !9 %cmp157 = icmp eq i8 %34, 35 br i1 %cmp157, label %if.then159, label %if.end160 if.then159: ; preds = %lor.lhs.false151, %lor.lhs.false142, %if.end139 br label %if.end160 if.end160: ; preds = %if.then159, %lor.lhs.false151 %rr2.0 = phi i32 [ %conv58, %if.then159 ], [ %add114, %lor.lhs.false151 ] %rc2.0 = phi i32 [ %conv62, %if.then159 ], [ %add118, %lor.lhs.false151 ] %idxprom161 = sext i32 %lr2.0 to i64 %idxprom163 = sext i32 %lc2.0 to i64 %idxprom165 = sext i32 %rr2.0 to i64 %idxprom167 = sext i32 %rc2.0 to i64 %arrayidx168 = getelementptr inbounds [50 x [50 x [50 x [50 x i8]]]], ptr @mk, i64 0, i64 %idxprom161, i64 %idxprom163, i64 %idxprom165, i64 %idxprom167 %35 = load i8, ptr %arrayidx168, align 1, !tbaa !9 %tobool169.not = icmp eq i8 %35, 0 br i1 %tobool169.not, label %if.end171, label %for.inc201 if.end171: ; preds = %if.end160 store i8 1, ptr %arrayidx168, align 1, !tbaa !9 %conv180 = trunc i32 %lr2.0 to i8 %idxprom181 = sext i32 %end.promoted302304 to i64 %arrayidx182 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181 store i8 %conv180, ptr %arrayidx182, align 4, !tbaa !13 %conv184 = trunc i32 %lc2.0 to i8 %lc187 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181, i32 1 store i8 %conv184, ptr %lc187, align 1, !tbaa !15 %conv188 = trunc i32 %rr2.0 to i8 %rr191 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181, i32 2 store i8 %conv188, ptr %rr191, align 2, !tbaa !16 %conv192 = trunc i32 %rc2.0 to i8 %rc195 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181, i32 3 store i8 %conv192, ptr %rc195, align 1, !tbaa !17 %inc196 = add nsw i32 %end.promoted302304, 1 %cmp197 = icmp eq i32 %inc196, 150000 %spec.store.select208 = select i1 %cmp197, i32 0, i32 %inc196 store i32 %spec.store.select208, ptr @end, align 4 br label %for.inc201 for.inc201: ; preds = %if.end160, %if.end171 %end.promoted300 = phi i32 [ %end.promoted302304, %if.end160 ], [ %spec.store.select208, %if.end171 ] %add.1 = add nsw i32 %15, %conv50 %add110.1 = add nsw i32 %16, %conv54 %add114.1 = add nsw i32 %17, %conv58 %add118.1 = add nsw i32 %18, %conv62 %cmp119.1 = icmp slt i32 %add.1, 0 br i1 %cmp119.1, label %if.then138.1, label %lor.lhs.false121.1 lor.lhs.false121.1: ; preds = %for.inc201 %cmp122.1 = icmp slt i32 %add.1, %.lcssa %cmp125.1 = icmp sgt i32 %add110.1, -1 %or.cond.not267.1 = select i1 %cmp122.1, i1 %cmp125.1, i1 false %cmp128.not.1 = icmp slt i32 %add110.1, %10 %or.cond265.1 = select i1 %or.cond.not267.1, i1 %cmp128.not.1, i1 false br i1 %or.cond265.1, label %lor.lhs.false130.1, label %if.then138.1 lor.lhs.false130.1: ; preds = %lor.lhs.false121.1 %idxprom131.1 = zext i32 %add.1 to i64 %idxprom133.1 = zext i32 %add110.1 to i64 %arrayidx134.1 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %idxprom131.1, i64 %idxprom133.1 %36 = load i8, ptr %arrayidx134.1, align 1, !tbaa !9 %cmp136.1 = icmp eq i8 %36, 35 br i1 %cmp136.1, label %if.then138.1, label %if.end139.1 if.then138.1: ; preds = %lor.lhs.false130.1, %lor.lhs.false121.1, %for.inc201 br label %if.end139.1 if.end139.1: ; preds = %if.then138.1, %lor.lhs.false130.1 %lr2.0.1 = phi i32 [ %conv50, %if.then138.1 ], [ %add.1, %lor.lhs.false130.1 ] %lc2.0.1 = phi i32 [ %conv54, %if.then138.1 ], [ %add110.1, %lor.lhs.false130.1 ] %cmp140.1 = icmp slt i32 %add114.1, 0 br i1 %cmp140.1, label %if.then159.1, label %lor.lhs.false142.1 lor.lhs.false142.1: ; preds = %if.end139.1 %cmp143.1 = icmp slt i32 %add114.1, %.lcssa %cmp146.1 = icmp sgt i32 %add118.1, -1 %or.cond207.not268.1 = select i1 %cmp143.1, i1 %cmp146.1, i1 false %cmp149.not.1 = icmp slt i32 %add118.1, %10 %or.cond266.1 = select i1 %or.cond207.not268.1, i1 %cmp149.not.1, i1 false br i1 %or.cond266.1, label %lor.lhs.false151.1, label %if.then159.1 lor.lhs.false151.1: ; preds = %lor.lhs.false142.1 %idxprom152.1 = zext i32 %add114.1 to i64 %idxprom154.1 = zext i32 %add118.1 to i64 %arrayidx155.1 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %idxprom152.1, i64 %idxprom154.1 %37 = load i8, ptr %arrayidx155.1, align 1, !tbaa !9 %cmp157.1 = icmp eq i8 %37, 35 br i1 %cmp157.1, label %if.then159.1, label %if.end160.1 if.then159.1: ; preds = %lor.lhs.false151.1, %lor.lhs.false142.1, %if.end139.1 br label %if.end160.1 if.end160.1: ; preds = %if.then159.1, %lor.lhs.false151.1 %rr2.0.1 = phi i32 [ %conv58, %if.then159.1 ], [ %add114.1, %lor.lhs.false151.1 ] %rc2.0.1 = phi i32 [ %conv62, %if.then159.1 ], [ %add118.1, %lor.lhs.false151.1 ] %idxprom161.1 = sext i32 %lr2.0.1 to i64 %idxprom163.1 = sext i32 %lc2.0.1 to i64 %idxprom165.1 = sext i32 %rr2.0.1 to i64 %idxprom167.1 = sext i32 %rc2.0.1 to i64 %arrayidx168.1 = getelementptr inbounds [50 x [50 x [50 x [50 x i8]]]], ptr @mk, i64 0, i64 %idxprom161.1, i64 %idxprom163.1, i64 %idxprom165.1, i64 %idxprom167.1 %38 = load i8, ptr %arrayidx168.1, align 1, !tbaa !9 %tobool169.not.1 = icmp eq i8 %38, 0 br i1 %tobool169.not.1, label %if.end171.1, label %for.inc201.1 if.end171.1: ; preds = %if.end160.1 store i8 1, ptr %arrayidx168.1, align 1, !tbaa !9 %conv180.1 = trunc i32 %lr2.0.1 to i8 %idxprom181.1 = sext i32 %end.promoted300 to i64 %arrayidx182.1 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.1 store i8 %conv180.1, ptr %arrayidx182.1, align 4, !tbaa !13 %conv184.1 = trunc i32 %lc2.0.1 to i8 %lc187.1 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.1, i32 1 store i8 %conv184.1, ptr %lc187.1, align 1, !tbaa !15 %conv188.1 = trunc i32 %rr2.0.1 to i8 %rr191.1 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.1, i32 2 store i8 %conv188.1, ptr %rr191.1, align 2, !tbaa !16 %conv192.1 = trunc i32 %rc2.0.1 to i8 %rc195.1 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.1, i32 3 store i8 %conv192.1, ptr %rc195.1, align 1, !tbaa !17 %inc196.1 = add nsw i32 %end.promoted300, 1 %cmp197.1 = icmp eq i32 %inc196.1, 150000 %spec.store.select208.1 = select i1 %cmp197.1, i32 0, i32 %inc196.1 store i32 %spec.store.select208.1, ptr @end, align 4 br label %for.inc201.1 for.inc201.1: ; preds = %if.end171.1, %if.end160.1 %end.promoted300.1 = phi i32 [ %end.promoted300, %if.end160.1 ], [ %spec.store.select208.1, %if.end171.1 ] %add.2 = add nsw i32 %19, %conv50 %add110.2 = add nsw i32 %20, %conv54 %add114.2 = add nsw i32 %21, %conv58 %add118.2 = add nsw i32 %22, %conv62 %cmp119.2 = icmp slt i32 %add.2, 0 br i1 %cmp119.2, label %if.then138.2, label %lor.lhs.false121.2 lor.lhs.false121.2: ; preds = %for.inc201.1 %cmp122.2 = icmp slt i32 %add.2, %.lcssa %cmp125.2 = icmp sgt i32 %add110.2, -1 %or.cond.not267.2 = select i1 %cmp122.2, i1 %cmp125.2, i1 false %cmp128.not.2 = icmp slt i32 %add110.2, %10 %or.cond265.2 = select i1 %or.cond.not267.2, i1 %cmp128.not.2, i1 false br i1 %or.cond265.2, label %lor.lhs.false130.2, label %if.then138.2 lor.lhs.false130.2: ; preds = %lor.lhs.false121.2 %idxprom131.2 = zext i32 %add.2 to i64 %idxprom133.2 = zext i32 %add110.2 to i64 %arrayidx134.2 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %idxprom131.2, i64 %idxprom133.2 %39 = load i8, ptr %arrayidx134.2, align 1, !tbaa !9 %cmp136.2 = icmp eq i8 %39, 35 br i1 %cmp136.2, label %if.then138.2, label %if.end139.2 if.then138.2: ; preds = %lor.lhs.false130.2, %lor.lhs.false121.2, %for.inc201.1 br label %if.end139.2 if.end139.2: ; preds = %if.then138.2, %lor.lhs.false130.2 %lr2.0.2 = phi i32 [ %conv50, %if.then138.2 ], [ %add.2, %lor.lhs.false130.2 ] %lc2.0.2 = phi i32 [ %conv54, %if.then138.2 ], [ %add110.2, %lor.lhs.false130.2 ] %cmp140.2 = icmp slt i32 %add114.2, 0 br i1 %cmp140.2, label %if.then159.2, label %lor.lhs.false142.2 lor.lhs.false142.2: ; preds = %if.end139.2 %cmp143.2 = icmp slt i32 %add114.2, %.lcssa %cmp146.2 = icmp sgt i32 %add118.2, -1 %or.cond207.not268.2 = select i1 %cmp143.2, i1 %cmp146.2, i1 false %cmp149.not.2 = icmp slt i32 %add118.2, %10 %or.cond266.2 = select i1 %or.cond207.not268.2, i1 %cmp149.not.2, i1 false br i1 %or.cond266.2, label %lor.lhs.false151.2, label %if.then159.2 lor.lhs.false151.2: ; preds = %lor.lhs.false142.2 %idxprom152.2 = zext i32 %add114.2 to i64 %idxprom154.2 = zext i32 %add118.2 to i64 %arrayidx155.2 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %idxprom152.2, i64 %idxprom154.2 %40 = load i8, ptr %arrayidx155.2, align 1, !tbaa !9 %cmp157.2 = icmp eq i8 %40, 35 br i1 %cmp157.2, label %if.then159.2, label %if.end160.2 if.then159.2: ; preds = %lor.lhs.false151.2, %lor.lhs.false142.2, %if.end139.2 br label %if.end160.2 if.end160.2: ; preds = %if.then159.2, %lor.lhs.false151.2 %rr2.0.2 = phi i32 [ %conv58, %if.then159.2 ], [ %add114.2, %lor.lhs.false151.2 ] %rc2.0.2 = phi i32 [ %conv62, %if.then159.2 ], [ %add118.2, %lor.lhs.false151.2 ] %idxprom161.2 = sext i32 %lr2.0.2 to i64 %idxprom163.2 = sext i32 %lc2.0.2 to i64 %idxprom165.2 = sext i32 %rr2.0.2 to i64 %idxprom167.2 = sext i32 %rc2.0.2 to i64 %arrayidx168.2 = getelementptr inbounds [50 x [50 x [50 x [50 x i8]]]], ptr @mk, i64 0, i64 %idxprom161.2, i64 %idxprom163.2, i64 %idxprom165.2, i64 %idxprom167.2 %41 = load i8, ptr %arrayidx168.2, align 1, !tbaa !9 %tobool169.not.2 = icmp eq i8 %41, 0 br i1 %tobool169.not.2, label %if.end171.2, label %for.inc201.2 if.end171.2: ; preds = %if.end160.2 store i8 1, ptr %arrayidx168.2, align 1, !tbaa !9 %conv180.2 = trunc i32 %lr2.0.2 to i8 %idxprom181.2 = sext i32 %end.promoted300.1 to i64 %arrayidx182.2 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.2 store i8 %conv180.2, ptr %arrayidx182.2, align 4, !tbaa !13 %conv184.2 = trunc i32 %lc2.0.2 to i8 %lc187.2 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.2, i32 1 store i8 %conv184.2, ptr %lc187.2, align 1, !tbaa !15 %conv188.2 = trunc i32 %rr2.0.2 to i8 %rr191.2 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.2, i32 2 store i8 %conv188.2, ptr %rr191.2, align 2, !tbaa !16 %conv192.2 = trunc i32 %rc2.0.2 to i8 %rc195.2 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.2, i32 3 store i8 %conv192.2, ptr %rc195.2, align 1, !tbaa !17 %inc196.2 = add nsw i32 %end.promoted300.1, 1 %cmp197.2 = icmp eq i32 %inc196.2, 150000 %spec.store.select208.2 = select i1 %cmp197.2, i32 0, i32 %inc196.2 store i32 %spec.store.select208.2, ptr @end, align 4 br label %for.inc201.2 for.inc201.2: ; preds = %if.end171.2, %if.end160.2 %end.promoted300.2 = phi i32 [ %end.promoted300.1, %if.end160.2 ], [ %spec.store.select208.2, %if.end171.2 ] %add.3 = add nsw i32 %23, %conv50 %add110.3 = add nsw i32 %24, %conv54 %add114.3 = add nsw i32 %25, %conv58 %add118.3 = add nsw i32 %26, %conv62 %cmp119.3 = icmp slt i32 %add.3, 0 br i1 %cmp119.3, label %if.then138.3, label %lor.lhs.false121.3 lor.lhs.false121.3: ; preds = %for.inc201.2 %cmp122.3 = icmp slt i32 %add.3, %.lcssa %cmp125.3 = icmp sgt i32 %add110.3, -1 %or.cond.not267.3 = select i1 %cmp122.3, i1 %cmp125.3, i1 false %cmp128.not.3 = icmp slt i32 %add110.3, %10 %or.cond265.3 = select i1 %or.cond.not267.3, i1 %cmp128.not.3, i1 false br i1 %or.cond265.3, label %lor.lhs.false130.3, label %if.then138.3 lor.lhs.false130.3: ; preds = %lor.lhs.false121.3 %idxprom131.3 = zext i32 %add.3 to i64 %idxprom133.3 = zext i32 %add110.3 to i64 %arrayidx134.3 = getelementptr inbounds [50 x [51 x i8]], ptr @ml, i64 0, i64 %idxprom131.3, i64 %idxprom133.3 %42 = load i8, ptr %arrayidx134.3, align 1, !tbaa !9 %cmp136.3 = icmp eq i8 %42, 35 br i1 %cmp136.3, label %if.then138.3, label %if.end139.3 if.then138.3: ; preds = %lor.lhs.false130.3, %lor.lhs.false121.3, %for.inc201.2 br label %if.end139.3 if.end139.3: ; preds = %if.then138.3, %lor.lhs.false130.3 %lr2.0.3 = phi i32 [ %conv50, %if.then138.3 ], [ %add.3, %lor.lhs.false130.3 ] %lc2.0.3 = phi i32 [ %conv54, %if.then138.3 ], [ %add110.3, %lor.lhs.false130.3 ] %cmp140.3 = icmp slt i32 %add114.3, 0 br i1 %cmp140.3, label %if.then159.3, label %lor.lhs.false142.3 lor.lhs.false142.3: ; preds = %if.end139.3 %cmp143.3 = icmp slt i32 %add114.3, %.lcssa %cmp146.3 = icmp sgt i32 %add118.3, -1 %or.cond207.not268.3 = select i1 %cmp143.3, i1 %cmp146.3, i1 false %cmp149.not.3 = icmp slt i32 %add118.3, %10 %or.cond266.3 = select i1 %or.cond207.not268.3, i1 %cmp149.not.3, i1 false br i1 %or.cond266.3, label %lor.lhs.false151.3, label %if.then159.3 lor.lhs.false151.3: ; preds = %lor.lhs.false142.3 %idxprom152.3 = zext i32 %add114.3 to i64 %idxprom154.3 = zext i32 %add118.3 to i64 %arrayidx155.3 = getelementptr inbounds [50 x [51 x i8]], ptr @mr, i64 0, i64 %idxprom152.3, i64 %idxprom154.3 %43 = load i8, ptr %arrayidx155.3, align 1, !tbaa !9 %cmp157.3 = icmp eq i8 %43, 35 br i1 %cmp157.3, label %if.then159.3, label %if.end160.3 if.then159.3: ; preds = %lor.lhs.false151.3, %lor.lhs.false142.3, %if.end139.3 br label %if.end160.3 if.end160.3: ; preds = %if.then159.3, %lor.lhs.false151.3 %rr2.0.3 = phi i32 [ %conv58, %if.then159.3 ], [ %add114.3, %lor.lhs.false151.3 ] %rc2.0.3 = phi i32 [ %conv62, %if.then159.3 ], [ %add118.3, %lor.lhs.false151.3 ] %idxprom161.3 = sext i32 %lr2.0.3 to i64 %idxprom163.3 = sext i32 %lc2.0.3 to i64 %idxprom165.3 = sext i32 %rr2.0.3 to i64 %idxprom167.3 = sext i32 %rc2.0.3 to i64 %arrayidx168.3 = getelementptr inbounds [50 x [50 x [50 x [50 x i8]]]], ptr @mk, i64 0, i64 %idxprom161.3, i64 %idxprom163.3, i64 %idxprom165.3, i64 %idxprom167.3 %44 = load i8, ptr %arrayidx168.3, align 1, !tbaa !9 %tobool169.not.3 = icmp eq i8 %44, 0 br i1 %tobool169.not.3, label %if.end171.3, label %while.cond43.backedge if.end171.3: ; preds = %if.end160.3 store i8 1, ptr %arrayidx168.3, align 1, !tbaa !9 %conv180.3 = trunc i32 %lr2.0.3 to i8 %idxprom181.3 = sext i32 %end.promoted300.2 to i64 %arrayidx182.3 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.3 store i8 %conv180.3, ptr %arrayidx182.3, align 4, !tbaa !13 %conv184.3 = trunc i32 %lc2.0.3 to i8 %lc187.3 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.3, i32 1 store i8 %conv184.3, ptr %lc187.3, align 1, !tbaa !15 %conv188.3 = trunc i32 %rr2.0.3 to i8 %rr191.3 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.3, i32 2 store i8 %conv188.3, ptr %rr191.3, align 2, !tbaa !16 %conv192.3 = trunc i32 %rc2.0.3 to i8 %rc195.3 = getelementptr inbounds [150002 x %struct.Q], ptr @q, i64 0, i64 %idxprom181.3, i32 3 store i8 %conv192.3, ptr %rc195.3, align 1, !tbaa !17 %inc196.3 = add nsw i32 %end.promoted300.2, 1 %cmp197.3 = icmp eq i32 %inc196.3, 150000 %spec.store.select208.3 = select i1 %cmp197.3, i32 0, i32 %inc196.3 store i32 %spec.store.select208.3, ptr @end, align 4 br label %while.cond43.backedge while.end: ; preds = %while.cond43.backedge, %land.lhs.true %cond = phi ptr [ @.str.2, %land.lhs.true ], [ @.str.3, %while.cond43.backedge ] store i32 %spec.store.select, ptr @top, align 4 %call205 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h) %tobool = icmp ne i32 %call, 0 %45 = load i32, ptr %w, align 4 %cmp = icmp sgt i32 %45, 0 %46 = select i1 %tobool, i1 %cmp, i1 false br i1 %46, label %for.cond.preheader, label %while.end206, !llvm.loop !19 while.end206: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = !{!14, !7, i64 0} !14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3} !15 = !{!14, !7, i64 1} !16 = !{!14, !7, i64 2} !17 = !{!14, !7, i64 3} !18 = distinct !{!18, !11} !19 = distinct !{!19, !11}
#include <float.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <math.h> #ifdef __cplusplus #include <bits/stdc++.h> #endif #define getchar getchar #define putchar putchar int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; } int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; } uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; } int main(void){ int n=nextint(); int x=nextint(); if(x==1 || x==n*2-1){ puts("No"); }else{ puts("Yes"); if(n==2){ puts("1"); puts("2"); puts("3"); }else{ if(x==2){ int now=1; if(now==x-1) now+=4; for(int i=0; i<n-2; i++){ printf("%d\n", now); now++; if(now==x-1) now+=4; } printf("%d\n", x+1); printf("%d\n", x); printf("%d\n", x-1); printf("%d\n", x+2); for(int i=0; i<n-3; i++){ printf("%d\n", now); now++; if(now==x-1) now+=4; } }else{ int now=1; if(now==x-2) now+=4; for(int i=0; i<n-2; i++){ printf("%d\n", now); now++; if(now==x-2) now+=4; } printf("%d\n", x-1); printf("%d\n", x); printf("%d\n", x+1); printf("%d\n", x-2); for(int i=0; i<n-3; i++){ printf("%d\n", now); now++; if(now==x-2) now+=4; } } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234846/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234846/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @.str.5 = 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 @nextint() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext45 = shl i32 %call.i, 24 %cmp.not46 = icmp ne i32 %sext45, 754974720 %1 = add i32 %sext45, -956301313 %2 = icmp ult i32 %1, -150994945 %or.cond47 = and i1 %cmp.not46, %2 br i1 %or.cond47, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i42 = tail call i32 @getc(ptr noundef %3) %sext = shl i32 %call.i42, 24 %cmp.not = icmp ne i32 %sext, 754974720 %4 = add i32 %sext, -956301313 %5 = icmp ult i32 %4, -150994945 %or.cond = and i1 %cmp.not, %5 br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %c.0.in.lcssa = phi i32 [ %call.i, %entry ], [ %call.i42, %while.body ] %sext.lcssa = phi i32 [ %sext45, %entry ], [ %sext, %while.body ] %cmp12 = icmp eq i32 %sext.lcssa, 754974720 br i1 %cmp12, label %if.then, label %if.end if.then: ; preds = %while.end %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i43 = tail call i32 @getc(ptr noundef %6) br label %if.end if.end: ; preds = %if.then, %while.end %c.1.in = phi i32 [ %call.i43, %if.then ], [ %c.0.in.lcssa, %while.end ] %sext4049 = shl i32 %c.1.in, 24 %7 = add i32 %sext4049, -788529153 %8 = icmp ult i32 %7, 184549375 br i1 %8, label %while.body25, label %while.end29 while.body25: ; preds = %if.end, %while.body25 %x.051 = phi i32 [ %sub, %while.body25 ], [ 0, %if.end ] %c.2.in50 = phi i32 [ %call.i44, %while.body25 ], [ %c.1.in, %if.end ] %conv17 = and i32 %c.2.in50, 255 %mul = mul i32 %x.051, 10 %add = add nsw i32 %conv17, -48 %sub = add i32 %add, %mul %9 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i44 = tail call i32 @getc(ptr noundef %9) %sext40 = shl i32 %call.i44, 24 %10 = add i32 %sext40, -788529153 %11 = icmp ult i32 %10, 184549375 br i1 %11, label %while.body25, label %while.end29, !llvm.loop !11 while.end29: ; preds = %while.body25, %if.end %x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %while.body25 ] %sub31 = sub i32 0, %x.0.lcssa %cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @nextlong() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext45 = shl i32 %call.i, 24 %cmp.not46 = icmp ne i32 %sext45, 754974720 %1 = add i32 %sext45, -956301313 %2 = icmp ult i32 %1, -150994945 %or.cond47 = and i1 %cmp.not46, %2 br i1 %or.cond47, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i42 = tail call i32 @getc(ptr noundef %3) %sext = shl i32 %call.i42, 24 %cmp.not = icmp ne i32 %sext, 754974720 %4 = add i32 %sext, -956301313 %5 = icmp ult i32 %4, -150994945 %or.cond = and i1 %cmp.not, %5 br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %entry %c.0.in.lcssa = phi i32 [ %call.i, %entry ], [ %call.i42, %while.body ] %sext.lcssa = phi i32 [ %sext45, %entry ], [ %sext, %while.body ] %cmp12.not = icmp eq i32 %sext.lcssa, 754974720 br i1 %cmp12.not, label %if.then, label %if.end if.then: ; preds = %while.end %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i43 = tail call i32 @getc(ptr noundef %6) br label %if.end if.end: ; preds = %if.then, %while.end %c.1.in = phi i32 [ %call.i43, %if.then ], [ %c.0.in.lcssa, %while.end ] %sext3949 = shl i32 %c.1.in, 24 %7 = add i32 %sext3949, -788529153 %8 = icmp ult i32 %7, 184549375 br i1 %8, label %while.body25, label %while.end29 while.body25: ; preds = %if.end, %while.body25 %x.051 = phi i64 [ %sub, %while.body25 ], [ 0, %if.end ] %c.2.in50 = phi i32 [ %call.i44, %while.body25 ], [ %c.1.in, %if.end ] %c.2 = zext i32 %c.2.in50 to i64 %mul = mul i64 %x.051, 10 %sext40 = shl i64 %c.2, 56 %conv26 = ashr exact i64 %sext40, 56 %add = add i64 %mul, -48 %sub = add i64 %add, %conv26 %9 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i44 = tail call i32 @getc(ptr noundef %9) %sext39 = shl i32 %call.i44, 24 %10 = add i32 %sext39, -788529153 %11 = icmp ult i32 %10, 184549375 br i1 %11, label %while.body25, label %while.end29, !llvm.loop !13 while.end29: ; preds = %while.body25, %if.end %x.0.lcssa = phi i64 [ 0, %if.end ], [ %sub, %while.body25 ] %sub30 = sub i64 0, %x.0.lcssa %cond = select i1 %cmp12.not, i64 %sub30, i64 %x.0.lcssa ret i64 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i26 = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i26, 24 switch i32 %sext, label %while.cond8 [ i32 536870912, label %while.cond.backedge i32 167772160, label %while.cond.backedge ] while.cond.backedge: ; preds = %while.cond, %while.cond br label %while.cond, !llvm.loop !14 while.cond8: ; preds = %while.cond, %while.body15 %s.addr.0 = phi ptr [ %incdec.ptr, %while.body15 ], [ %s, %while.cond ] %c.1.in = phi i32 [ %call.i27, %while.body15 ], [ %call.i26, %while.cond ] %len.0 = phi i32 [ %inc, %while.body15 ], [ 0, %while.cond ] %sext25 = shl i32 %c.1.in, 24 switch i32 %sext25, label %while.body15 [ i32 536870912, label %while.end18 i32 167772160, label %while.end18 ] while.body15: ; preds = %while.cond8 %c.1 = trunc i32 %c.1.in to i8 %incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1 store i8 %c.1, ptr %s.addr.0, align 1, !tbaa !15 %inc = add i32 %len.0, 1 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i27 = tail call i32 @getc(ptr noundef %1) br label %while.cond8, !llvm.loop !16 while.end18: ; preds = %while.cond8, %while.cond8 store i8 0, ptr %s.addr.0, align 1, !tbaa !15 ret i32 %len.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 @nextint() %call1 = tail call i32 @nextint() %cmp = icmp eq i32 %call1, 1 br i1 %cmp, label %if.end96.sink.split, label %lor.lhs.false lor.lhs.false: ; preds = %entry %mul = shl nsw i32 %call, 1 %sub = add nsw i32 %mul, -1 %cmp2 = icmp eq i32 %call1, %sub br i1 %cmp2, label %if.end96.sink.split, label %if.else if.else: ; preds = %lor.lhs.false %call4 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) %cmp5 = icmp eq i32 %call, 2 br i1 %cmp5, label %if.then6, label %if.else10 if.then6: ; preds = %if.else %call7 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) %call8 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3) br label %if.end96.sink.split if.else10: ; preds = %if.else %cmp11 = icmp eq i32 %call1, 2 br i1 %cmp11, label %for.cond.preheader, label %if.else48 for.cond.preheader: ; preds = %if.else10 %cmp17151 = icmp sgt i32 %call, 2 br i1 %cmp17151, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %for.cond.preheader %0 = add i32 %call, -3 br label %for.body for.cond.cleanup: ; preds = %for.body, %for.cond.preheader %now.1.lcssa = phi i32 [ 5, %for.cond.preheader ], [ %spec.select, %for.body ] %call26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3) %call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2) %call29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1) %call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4) %cmp35155 = icmp sgt i32 %call, 3 br i1 %cmp35155, label %for.body37.preheader, label %if.end96 for.body37.preheader: ; preds = %for.cond.cleanup %1 = add i32 %call, -4 br label %for.body37 for.body: ; preds = %for.body.preheader, %for.body %i.0153 = phi i32 [ %inc24, %for.body ], [ 0, %for.body.preheader ] %now.1152 = phi i32 [ %spec.select, %for.body ], [ 5, %for.body.preheader ] %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %now.1152) %inc = add nsw i32 %now.1152, 1 %cmp20 = icmp eq i32 %now.1152, 0 %spec.select = select i1 %cmp20, i32 5, i32 %inc %inc24 = add nuw nsw i32 %i.0153, 1 %exitcond160.not = icmp eq i32 %i.0153, %0 br i1 %exitcond160.not, label %for.cond.cleanup, label %for.body, !llvm.loop !17 for.body37: ; preds = %for.body37.preheader, %for.body37 %i32.0157 = phi i32 [ %inc46, %for.body37 ], [ 0, %for.body37.preheader ] %now.3156 = phi i32 [ %spec.select140, %for.body37 ], [ %now.1.lcssa, %for.body37.preheader ] %call38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %now.3156) %inc39 = add nsw i32 %now.3156, 1 %cmp41 = icmp eq i32 %now.3156, 0 %spec.select140 = select i1 %cmp41, i32 5, i32 %inc39 %inc46 = add nuw nsw i32 %i32.0157, 1 %exitcond161.not = icmp eq i32 %i32.0157, %1 br i1 %exitcond161.not, label %if.end96, label %for.body37, !llvm.loop !18 if.else48: ; preds = %if.else10 %sub50 = add nsw i32 %call1, -2 %cmp51 = icmp eq i32 %sub50, 1 %spec.select141 = select i1 %cmp51, i32 5, i32 1 %cmp58145 = icmp sgt i32 %call, 2 br i1 %cmp58145, label %for.body60.preheader, label %for.cond.cleanup59 for.body60.preheader: ; preds = %if.else48 %2 = add i32 %call, -3 br label %for.body60 for.cond.cleanup59: ; preds = %for.body60, %if.else48 %now49.1.lcssa = phi i32 [ %spec.select141, %if.else48 ], [ %spec.select142, %for.body60 ] %sub71 = add nsw i32 %call1, -1 %call72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %sub71) %call73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %call1) %add74 = add nsw i32 %call1, 1 %call75 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add74) %call77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %sub50) %cmp81148 = icmp sgt i32 %call, 3 br i1 %cmp81148, label %for.body83.preheader, label %if.end96 for.body83.preheader: ; preds = %for.cond.cleanup59 %3 = add i32 %call, -4 br label %for.body83 for.body60: ; preds = %for.body60.preheader, %for.body60 %i55.0147 = phi i32 [ %inc69, %for.body60 ], [ 0, %for.body60.preheader ] %now49.1146 = phi i32 [ %spec.select142, %for.body60 ], [ %spec.select141, %for.body60.preheader ] %call61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %now49.1146) %inc62 = add nsw i32 %now49.1146, 1 %cmp64 = icmp eq i32 %inc62, %sub50 %add66 = add nsw i32 %now49.1146, 5 %spec.select142 = select i1 %cmp64, i32 %add66, i32 %inc62 %inc69 = add nuw nsw i32 %i55.0147, 1 %exitcond.not = icmp eq i32 %i55.0147, %2 br i1 %exitcond.not, label %for.cond.cleanup59, label %for.body60, !llvm.loop !19 for.body83: ; preds = %for.body83.preheader, %for.body83 %i78.0150 = phi i32 [ %inc92, %for.body83 ], [ 0, %for.body83.preheader ] %now49.3149 = phi i32 [ %spec.select143, %for.body83 ], [ %now49.1.lcssa, %for.body83.preheader ] %call84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %now49.3149) %inc85 = add nsw i32 %now49.3149, 1 %cmp87 = icmp eq i32 %inc85, %sub50 %add89 = add nsw i32 %now49.3149, 5 %spec.select143 = select i1 %cmp87, i32 %add89, i32 %inc85 %inc92 = add nuw nsw i32 %i78.0150, 1 %exitcond159.not = icmp eq i32 %i78.0150, %3 br i1 %exitcond159.not, label %if.end96, label %for.body83, !llvm.loop !20 if.end96.sink.split: ; preds = %entry, %lor.lhs.false, %if.then6 %.str.4.sink = phi ptr [ @.str.4, %if.then6 ], [ @.str, %lor.lhs.false ], [ @.str, %entry ] %call9 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink) br label %if.end96 if.end96: ; preds = %for.body83, %for.body37, %if.end96.sink.split, %for.cond.cleanup59, %for.cond.cleanup ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1 ; 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = !{!7, !7, i64 0} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> int main() { double count=0,f; int i,N; scanf("%d",&N); for(i=0;i<=N;i++) { if(i%2!=0) count=count+1; } f=count/N; printf("%.10lf\n",f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234897/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not6 = icmp slt i32 %0, 0 br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = add i32 %0, 1 %xtraiter = and i32 %1, 1 %2 = icmp eq i32 %0, 0 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %1, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %count.07 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %add.1 = fadd double %count.07, 1.000000e+00 %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 !9 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %count.1.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ] %count.07.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 %count.1.lcssa = select i1 %lcmp.mod.not, double %count.1.lcssa.ph, double %count.07.unr br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %entry %count.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %count.1.lcssa, %for.end.loopexit.unr-lcssa ] %conv = sitofp i32 %0 to double %div = fdiv double %count.0.lcssa, %conv %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int a,b=0,i; double sum; scanf("%d",&a); for(i=1;i<=a;i=i+2) { b++; } sum=(double)b/(double)a; printf("%.10lf\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234947/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234947/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.10lf\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 %cmp.not5 = icmp slt i32 %0, 1 %1 = add nsw i32 %0, -1 %2 = lshr i32 %1, 1 %3 = add nuw nsw i32 %2, 1 %4 = sitofp i32 %3 to double %b.0.lcssa = select i1 %cmp.not5, double 0.000000e+00, double %4 %conv1 = sitofp i32 %0 to double %div = fdiv double %b.0.lcssa, %conv1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double 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"}
#include<stdio.h> int main(void) { int a, b; scanf("%d", &a); if (a % 2 == 0) printf("0.5"); else { b = a - a / 2; printf("%.10lf\n", (double)b / (double)a); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234990/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234990/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"0.5\00", align 1 @.str.2 = private unnamed_addr constant [8 x i8] c"%.10lf\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 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end if.else: ; preds = %entry %div.neg = sdiv i32 %0, -2 %sub = add i32 %div.neg, %0 %conv = sitofp i32 %sub to double %conv2 = sitofp i32 %0 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div3) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { double n,s,c; int b; s = 0; scanf("%lf",&n); if(n >= 1&&n <= 100){ for(b = 1;b <= n;b++) { if(b % 2 != 0) { s = s + 1; } } } c = s / n; printf("%f",c); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235032/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235032/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load double, ptr %n, align 8 %cmp = fcmp ult double %0, 1.000000e+00 %cmp1 = fcmp ugt double %0, 1.000000e+02 %or.cond.not16 = or i1 %cmp, %cmp1 br i1 %or.cond.not16, label %if.end7, label %for.body for.body: ; preds = %entry, %for.body %b.014 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %s.013 = phi double [ %s.1, %for.body ], [ 0.000000e+00, %entry ] %rem = and i32 %b.014, 1 %cmp4.not = icmp eq i32 %rem, 0 %add = fadd double %s.013, 1.000000e+00 %s.1 = select i1 %cmp4.not, double %s.013, double %add %inc = add nuw nsw i32 %b.014, 1 %conv = sitofp i32 %inc to double %cmp2 = fcmp ult double %0, %conv br i1 %cmp2, label %if.end7, label %for.body, !llvm.loop !5 if.end7: ; preds = %for.body, %entry %s.2 = phi double [ 0.000000e+00, %entry ], [ %s.1, %for.body ] %div = fdiv double %s.2, %0 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int n; scanf("%d", &n); printf("%lf", (n - n / 2) / (double)n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235076/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %div.neg = sdiv i32 %0, -2 %sub = add i32 %div.neg, %0 %conv = sitofp i32 %sub to double %conv1 = sitofp i32 %0 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { double N,b; scanf("%lf",&N); if((int)N%2==0){ b=N/(2*N); } else{ b=((int)N+1)/(2*N); } printf("%.10lf\n",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235126/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load double, ptr %N, align 8, !tbaa !5 %conv = fptosi double %0 to i32 %1 = and i32 %conv, 1 %cmp = icmp eq i32 %1, 0 %add = add nsw i32 %conv, 1 %conv3 = sitofp i32 %add to double %conv3.sink = select i1 %cmp, double %0, double %conv3 %mul4 = fmul double %0, 2.000000e+00 %div5 = fdiv double %conv3.sink, %mul4 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div5) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> typedef struct { int left_numerator, left_denominator, right_numerator, right_denominator, target; } data_t; data_t getdata(void) { data_t data; scanf("%d%d%d%d%d", &data.left_numerator, &data.right_numerator, &data.left_denominator, &data.right_denominator, &data.target ); return data; } void search(data_t data) { int left = data.left_denominator, right = data.right_denominator; while (true) { int guess = (left + right) / 2; if (guess == left) break; if ((long long)guess * data.target > data.right_numerator) { right = guess; continue; } if ((long long)guess * data.target < data.left_numerator) { left = guess; continue; } puts("YES"); exit(EXIT_SUCCESS); } if ( ( (long long)left * data.target <= data.right_numerator && (long long)left * data.target >= data.left_numerator ) || ( (long long)right * data.target <= data.right_numerator && (long long)right * data.target >= data.left_numerator ) ) { puts("YES"); exit(EXIT_SUCCESS); } } int main(void) { data_t data; data = getdata(); search(data); puts("NO"); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23517/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23517/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.data_t = type { i32, i32, i32, i32, i32 } @.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @getdata(ptr noalias sret(%struct.data_t) align 4 %agg.result) local_unnamed_addr #0 { entry: %right_numerator = getelementptr inbounds %struct.data_t, ptr %agg.result, i64 0, i32 2 %left_denominator = getelementptr inbounds %struct.data_t, ptr %agg.result, i64 0, i32 1 %right_denominator = getelementptr inbounds %struct.data_t, ptr %agg.result, i64 0, i32 3 %target = getelementptr inbounds %struct.data_t, ptr %agg.result, i64 0, i32 4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %agg.result, ptr noundef nonnull %right_numerator, ptr noundef nonnull %left_denominator, ptr noundef nonnull %right_denominator, ptr noundef nonnull %target) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nounwind uwtable define dso_local void @search(ptr nocapture noundef readonly byval(%struct.data_t) align 8 %data) local_unnamed_addr #2 { entry: %left_denominator = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 1 %0 = load i32, ptr %left_denominator, align 4, !tbaa !5 %right_denominator = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 3 %1 = load i32, ptr %right_denominator, align 4, !tbaa !10 %add71 = add nsw i32 %0, %1 %div72 = sdiv i32 %add71, 2 %cmp73 = icmp eq i32 %div72, %0 %target17.phi.trans.insert = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 4 %.pre = load i32, ptr %target17.phi.trans.insert, align 8, !tbaa !11 br i1 %cmp73, label %entry.while.end_crit_edge, label %if.end.lr.ph entry.while.end_crit_edge: ; preds = %entry %right_numerator20.phi.trans.insert = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 2 %.pre78 = load i32, ptr %right_numerator20.phi.trans.insert, align 8, !tbaa !12 %.pre79 = load i32, ptr %data, align 8 %.pre80 = sext i32 %.pre to i64 %.pre81 = sext i32 %.pre78 to i64 %.pre82 = sext i32 %.pre79 to i64 br label %while.end if.end.lr.ph: ; preds = %entry %conv1 = sext i32 %.pre to i64 %right_numerator = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 2 %2 = load i32, ptr %right_numerator, align 8, !tbaa !12 %conv2 = sext i32 %2 to i64 %3 = load i32, ptr %data, align 8 %conv11 = sext i32 %3 to i64 br label %if.end if.end: ; preds = %if.end.lr.ph, %cleanup %div76 = phi i32 [ %div72, %if.end.lr.ph ], [ %div, %cleanup ] %left.075 = phi i32 [ %0, %if.end.lr.ph ], [ %left.1, %cleanup ] %right.074 = phi i32 [ %1, %if.end.lr.ph ], [ %right.1, %cleanup ] %conv = sext i32 %div76 to i64 %mul = mul nsw i64 %conv1, %conv %cmp3 = icmp sgt i64 %mul, %conv2 br i1 %cmp3, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp12 = icmp slt i64 %mul, %conv11 br i1 %cmp12, label %cleanup, label %if.end15 if.end15: ; preds = %if.end6 %call = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) tail call void @exit(i32 noundef 0) #5 unreachable cleanup: ; preds = %if.end6, %if.end %right.1 = phi i32 [ %div76, %if.end ], [ %right.074, %if.end6 ] %left.1 = phi i32 [ %left.075, %if.end ], [ %div76, %if.end6 ] %add = add nsw i32 %left.1, %right.1 %div = sdiv i32 %add, 2 %cmp = icmp eq i32 %div, %left.1 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %cleanup, %entry.while.end_crit_edge %conv29.pre-phi = phi i64 [ %.pre82, %entry.while.end_crit_edge ], [ %conv11, %cleanup ] %conv21.pre-phi = phi i64 [ %.pre81, %entry.while.end_crit_edge ], [ %conv2, %cleanup ] %conv18.pre-phi = phi i64 [ %.pre80, %entry.while.end_crit_edge ], [ %conv1, %cleanup ] %right.0.lcssa = phi i32 [ %1, %entry.while.end_crit_edge ], [ %right.1, %cleanup ] %left.0.lcssa = phi i32 [ %0, %entry.while.end_crit_edge ], [ %left.1, %cleanup ] %conv16 = sext i32 %left.0.lcssa to i64 %mul19 = mul nsw i64 %conv18.pre-phi, %conv16 %cmp22.not = icmp sgt i64 %mul19, %conv21.pre-phi %cmp30.not = icmp slt i64 %mul19, %conv29.pre-phi %or.cond = select i1 %cmp22.not, i1 true, i1 %cmp30.not br i1 %or.cond, label %lor.lhs.false, label %if.then49 lor.lhs.false: ; preds = %while.end %conv32 = sext i32 %right.0.lcssa to i64 %mul35 = mul nsw i64 %conv18.pre-phi, %conv32 %cmp38.not = icmp sgt i64 %mul35, %conv21.pre-phi %cmp47.not = icmp slt i64 %mul35, %conv29.pre-phi %or.cond61 = select i1 %cmp38.not, i1 true, i1 %cmp47.not br i1 %or.cond61, label %if.end51, label %if.then49 if.then49: ; preds = %lor.lhs.false, %while.end %call50 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) tail call void @exit(i32 noundef 0) #5 unreachable if.end51: ; preds = %lor.lhs.false ret void } ; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %tmp = alloca %struct.data_t, align 4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) #6 %right_numerator.i = getelementptr inbounds %struct.data_t, ptr %tmp, i64 0, i32 2 %left_denominator.i = getelementptr inbounds %struct.data_t, ptr %tmp, i64 0, i32 1 %right_denominator.i = getelementptr inbounds %struct.data_t, ptr %tmp, i64 0, i32 3 %target.i = getelementptr inbounds %struct.data_t, ptr %tmp, i64 0, i32 4 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp, ptr noundef nonnull %right_numerator.i, ptr noundef nonnull %left_denominator.i, ptr noundef nonnull %right_denominator.i, ptr noundef nonnull %target.i) %data.sroa.0.0.copyload = load i32, ptr %tmp, align 4, !tbaa.struct !13 %data.sroa.4.0.copyload = load i32, ptr %left_denominator.i, align 4, !tbaa.struct !15 %data.sroa.5.0.copyload = load i32, ptr %right_numerator.i, align 4, !tbaa.struct !16 %data.sroa.6.0.copyload = load i32, ptr %right_denominator.i, align 4, !tbaa.struct !17 %data.sroa.7.0.copyload = load i32, ptr %target.i, align 4, !tbaa.struct !18 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #6 %add71.i = add nsw i32 %data.sroa.6.0.copyload, %data.sroa.4.0.copyload %div72.i = sdiv i32 %add71.i, 2 %cmp73.i = icmp eq i32 %div72.i, %data.sroa.4.0.copyload %.pre80.i = sext i32 %data.sroa.7.0.copyload to i64 %.pre81.i = sext i32 %data.sroa.5.0.copyload to i64 %.pre82.i = sext i32 %data.sroa.0.0.copyload to i64 br i1 %cmp73.i, label %while.end.i, label %if.end.i if.end.i: ; preds = %entry, %cleanup.i %div76.i = phi i32 [ %div.i, %cleanup.i ], [ %div72.i, %entry ] %left.075.i = phi i32 [ %left.1.i, %cleanup.i ], [ %data.sroa.4.0.copyload, %entry ] %right.074.i = phi i32 [ %right.1.i, %cleanup.i ], [ %data.sroa.6.0.copyload, %entry ] %conv.i = sext i32 %div76.i to i64 %mul.i = mul nsw i64 %conv.i, %.pre80.i %cmp3.i = icmp sgt i64 %mul.i, %.pre81.i br i1 %cmp3.i, label %cleanup.i, label %if.end6.i if.end6.i: ; preds = %if.end.i %cmp12.i = icmp slt i64 %mul.i, %.pre82.i br i1 %cmp12.i, label %cleanup.i, label %if.end15.i if.end15.i: ; preds = %if.end6.i %call.i5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) call void @exit(i32 noundef 0) #5 unreachable cleanup.i: ; preds = %if.end6.i, %if.end.i %right.1.i = phi i32 [ %div76.i, %if.end.i ], [ %right.074.i, %if.end6.i ] %left.1.i = phi i32 [ %left.075.i, %if.end.i ], [ %div76.i, %if.end6.i ] %add.i = add nsw i32 %left.1.i, %right.1.i %div.i = sdiv i32 %add.i, 2 %cmp.i = icmp eq i32 %div.i, %left.1.i br i1 %cmp.i, label %while.end.i, label %if.end.i while.end.i: ; preds = %cleanup.i, %entry %right.0.lcssa.i = phi i32 [ %data.sroa.6.0.copyload, %entry ], [ %right.1.i, %cleanup.i ] %left.0.lcssa.i = phi i32 [ %data.sroa.4.0.copyload, %entry ], [ %left.1.i, %cleanup.i ] %conv16.i = sext i32 %left.0.lcssa.i to i64 %mul19.i = mul nsw i64 %.pre80.i, %conv16.i %cmp22.not.i = icmp sgt i64 %mul19.i, %.pre81.i %cmp30.not.i = icmp slt i64 %mul19.i, %.pre82.i %or.cond.i = select i1 %cmp22.not.i, i1 true, i1 %cmp30.not.i br i1 %or.cond.i, label %lor.lhs.false.i, label %if.then49.i lor.lhs.false.i: ; preds = %while.end.i %conv32.i = sext i32 %right.0.lcssa.i to i64 %mul35.i = mul nsw i64 %.pre80.i, %conv32.i %cmp38.not.i = icmp sgt i64 %mul35.i, %.pre81.i %cmp47.not.i = icmp slt i64 %mul35.i, %.pre82.i %or.cond61.i = select i1 %cmp38.not.i, i1 true, i1 %cmp47.not.i br i1 %or.cond61.i, label %search.exit, label %if.then49.i if.then49.i: ; preds = %lor.lhs.false.i, %while.end.i %call50.i = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) call void @exit(i32 noundef 0) #5 unreachable search.exit: ; preds = %lor.lhs.false.i %call = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) ret i32 0 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { 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 #5 = { noreturn 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, !7, i64 4} !6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 12} !11 = !{!6, !7, i64 16} !12 = !{!6, !7, i64 8} !13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 12, i64 4, !14, i64 16, i64 4, !14} !14 = !{!7, !7, i64 0} !15 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 12, i64 4, !14} !16 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14} !17 = !{i64 0, i64 4, !14, i64 4, i64 4, !14} !18 = !{i64 0, i64 4, !14}
#include<stdio.h> int main() { int n; float a, b; scanf("%d", &n); a = (n / 2) + (n % 2); b = a / (float)n; printf("%f",b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235212/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235212/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %0, 2 %rem = srem i32 %0, 2 %add = add nsw i32 %div, %rem %conv = sitofp i32 %add to float %conv1 = sitofp i32 %0 to float %div2 = fdiv float %conv, %conv1 %conv3 = fpext float %div2 to double %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv3) 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"}
/* * main.c * * Created on: 2019/07/21 * Author: family */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int N = 0; scanf("%d", &N); int remain = N%2 + N/2; double ans = (double) remain / (double)N; printf("%f\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235256/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235256/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 store i32 0, ptr %N, align 4, !tbaa !5 %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, 2 %div = sdiv i32 %0, 2 %add = add nsw i32 %rem, %div %conv = sitofp i32 %add to double %conv1 = sitofp i32 %0 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> char s[100]; int main() { long long int i,n,m,a[100]={0},p=0,ans=0; scanf("%lld %lld",&n,&m); for(i=0;i<n;i++) {scanf("%s",s);if(strlen(s)>4)a[i]=2;else a[i]=1;} for(i=n-1;i>=0;i--){if(a[i]==2){p++;ans=ans*2+1;}else ans=ans*2;} ans=ans*m-p*m/2; printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2353/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [100 x i8] zeroinitializer, align 16 @.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 i64, align 8 %m = alloca i64, align 8 %a = alloca [100 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %a, i8 0, i64 800, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp31 = icmp sgt i64 %0, 0 br i1 %cmp31, label %for.body, label %for.end16 for.cond5.preheader: ; preds = %for.body %cmp633 = icmp sgt i64 %3, 0 br i1 %cmp633, label %for.body7.preheader, label %for.end16 for.body7.preheader: ; preds = %for.cond5.preheader %xtraiter = and i64 %3, 1 %1 = icmp eq i64 %3, 1 br i1 %1, label %for.end16.loopexit.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %3, -2 br label %for.body7 for.body: ; preds = %entry, %for.body %i.032 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #6 %cmp3 = icmp ugt i64 %call2, 4 %spec.select = select i1 %cmp3, i64 2, i64 1 %2 = getelementptr inbounds [100 x i64], ptr %a, i64 0, i64 %i.032 store i64 %spec.select, ptr %2, align 8 %inc = add nuw nsw i64 %i.032, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.body7: ; preds = %for.body7, %for.body7.preheader.new %ans.036 = phi i64 [ 0, %for.body7.preheader.new ], [ %ans.1.1, %for.body7 ] %p.035 = phi i64 [ 0, %for.body7.preheader.new ], [ %p.1.1, %for.body7 ] %i.1.in34 = phi i64 [ %3, %for.body7.preheader.new ], [ %i.1.1, %for.body7 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.body7 ] %i.1 = add nsw i64 %i.1.in34, -1 %arrayidx8 = getelementptr inbounds [100 x i64], ptr %a, i64 0, i64 %i.1 %4 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %cmp9 = icmp eq i64 %4, 2 %inc11 = zext i1 %cmp9 to i64 %p.1 = add nuw nsw i64 %p.035, %inc11 %i.1.1 = add nsw i64 %i.1.in34, -2 %arrayidx8.1 = getelementptr inbounds [100 x i64], ptr %a, i64 0, i64 %i.1.1 %5 = load i64, ptr %arrayidx8.1, align 8, !tbaa !5 %cmp9.1 = icmp eq i64 %5, 2 %6 = shl i64 %ans.036, 2 %7 = select i1 %cmp9, i64 2, i64 0 %mul.1 = or i64 %6, %7 %inc11.1 = zext i1 %cmp9.1 to i64 %p.1.1 = add nuw nsw i64 %p.1, %inc11.1 %ans.1.1 = or i64 %mul.1, %inc11.1 %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.end16.loopexit.unr-lcssa.loopexit, label %for.body7, !llvm.loop !11 for.end16.loopexit.unr-lcssa.loopexit: ; preds = %for.body7 %8 = shl nsw i64 %ans.1.1, 1 br label %for.end16.loopexit.unr-lcssa for.end16.loopexit.unr-lcssa: ; preds = %for.end16.loopexit.unr-lcssa.loopexit, %for.body7.preheader %p.1.lcssa.ph = phi i64 [ undef, %for.body7.preheader ], [ %p.1.1, %for.end16.loopexit.unr-lcssa.loopexit ] %ans.1.lcssa.ph = phi i64 [ undef, %for.body7.preheader ], [ %ans.1.1, %for.end16.loopexit.unr-lcssa.loopexit ] %ans.036.unr = phi i64 [ 0, %for.body7.preheader ], [ %8, %for.end16.loopexit.unr-lcssa.loopexit ] %p.035.unr = phi i64 [ 0, %for.body7.preheader ], [ %p.1.1, %for.end16.loopexit.unr-lcssa.loopexit ] %i.1.in34.unr = phi i64 [ %3, %for.body7.preheader ], [ %i.1.1, %for.end16.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end16, label %for.body7.epil for.body7.epil: ; preds = %for.end16.loopexit.unr-lcssa %i.1.epil = add nsw i64 %i.1.in34.unr, -1 %arrayidx8.epil = getelementptr inbounds [100 x i64], ptr %a, i64 0, i64 %i.1.epil %9 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !5 %cmp9.epil = icmp eq i64 %9, 2 %inc11.epil = zext i1 %cmp9.epil to i64 %p.1.epil = add nuw nsw i64 %p.035.unr, %inc11.epil %ans.1.epil = or i64 %ans.036.unr, %inc11.epil br label %for.end16 for.end16: ; preds = %for.body7.epil, %for.end16.loopexit.unr-lcssa, %entry, %for.cond5.preheader %p.0.lcssa = phi i64 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %p.1.lcssa.ph, %for.end16.loopexit.unr-lcssa ], [ %p.1.epil, %for.body7.epil ] %ans.0.lcssa = phi i64 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %ans.1.lcssa.ph, %for.end16.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body7.epil ] %10 = load i64, ptr %m, align 8, !tbaa !5 %mul17 = mul nsw i64 %10, %ans.0.lcssa %mul18 = mul nsw i64 %10, %p.0.lcssa %div.neg = sdiv i64 %mul18, -2 %sub19 = add i64 %div.neg, %mul17 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub19) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: 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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #define lli long long int #define MAX(a,b) (((a)>(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b)) int main(void) { lli n; scanf("%lld", &n); lli sign = n%2; lli *a; a = (lli *)malloc(sizeof(lli)*(n+1)); lli i,j,k; i = 0; j = 0; k = 0; while (i < n) { scanf("%lld",&(a[i])); i++; } lli **dp; i = 0; j = 0; dp = (lli **)malloc(sizeof(lli *)*(n + 1)); while (i <= n) { dp[i] = (lli *)malloc(sizeof(lli)*(n+1)); j = 0; while (j <= n) { dp[i][j] = 0; j++; } i++; } i =1; j =0; k =0; while (i <= n)//length { j = 0; while (j <= n-i)//start { if ((sign + i)%2 == 0) { dp[i][j] = MAX(dp[i-1][j]+a[j+i-1],dp[i-1][j+1]+a[j]); //printf("debug00100\n"); } else { dp[i][j] = MIN(dp[i-1][j]-a[j+i-1],dp[i-1][j+1]-a[j]); //printf("debug00200\n"); } j++; } i++; } printf("%lld\n",dp[n][0]); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235342/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %add = shl i64 %0, 3 %mul = add i64 %add, 8 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp169 = icmp sgt i64 %0, 0 br i1 %cmp169, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.0170 = phi i64 [ %inc, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %call1, i64 %i.0170 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %inc = add nuw nsw i64 %i.0170, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %while.body, label %while.end.loopexit, !llvm.loop !9 while.end.loopexit: ; preds = %while.body %.pre = shl i64 %1, 3 %.pre187 = add i64 %.pre, 8 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %mul4.pre-phi = phi i64 [ %.pre187, %while.end.loopexit ], [ %mul, %entry ] %2 = phi i64 [ %1, %while.end.loopexit ], [ %0, %entry ] %call5 = call noalias ptr @malloc(i64 noundef %mul4.pre-phi) #7 %cmp7.not173 = icmp slt i64 %2, 0 br i1 %cmp7.not173, label %while.end96, label %while.body8 while.cond22.preheader: ; preds = %while.body8 %cmp23.not178 = icmp slt i64 %2, 1 br i1 %cmp23.not178, label %while.end96, label %while.cond25.preheader while.body8: ; preds = %while.end, %while.body8 %i.1174 = phi i64 [ %inc20, %while.body8 ], [ 0, %while.end ] %calloc = call ptr @calloc(i64 1, i64 %mul4.pre-phi) %arrayidx12 = getelementptr inbounds ptr, ptr %call5, i64 %i.1174 store ptr %calloc, ptr %arrayidx12, align 8, !tbaa !11 %inc20 = add nuw i64 %i.1174, 1 %exitcond.not = icmp eq i64 %i.1174, %2 br i1 %exitcond.not, label %while.cond22.preheader, label %while.body8, !llvm.loop !13 while.cond25.preheader: ; preds = %while.cond22.preheader, %while.end94 %3 = phi i64 [ %22, %while.end94 ], [ %2, %while.cond22.preheader ] %i.2179 = phi i64 [ %inc95, %while.end94 ], [ 1, %while.cond22.preheader ] %cmp26.not176 = icmp slt i64 %3, %i.2179 br i1 %cmp26.not176, label %while.end94, label %while.body27.lr.ph while.body27.lr.ph: ; preds = %while.cond25.preheader %add28 = add i64 %i.2179, %0 %4 = and i64 %add28, 1 %cmp30 = icmp eq i64 %4, 0 %5 = getelementptr ptr, ptr %call5, i64 %i.2179 %arrayidx32 = getelementptr ptr, ptr %5, i64 -1 %6 = load ptr, ptr %arrayidx32, align 8, !tbaa !11 %7 = load ptr, ptr %5, align 8, !tbaa !11 br i1 %cmp30, label %while.body27.us, label %while.body27 while.body27.us: ; preds = %while.body27.lr.ph, %while.body27.us %j.1177.us = phi i64 [ %inc93.us, %while.body27.us ], [ 0, %while.body27.lr.ph ] %arrayidx33.us = getelementptr inbounds i64, ptr %6, i64 %j.1177.us %8 = load i64, ptr %arrayidx33.us, align 8, !tbaa !5 %9 = getelementptr i64, ptr %call1, i64 %j.1177.us %10 = getelementptr i64, ptr %9, i64 %i.2179 %arrayidx36.us = getelementptr i64, ptr %10, i64 -1 %11 = load i64, ptr %arrayidx36.us, align 8, !tbaa !5 %add37.us = add nsw i64 %11, %8 %arrayidx41.us = getelementptr i64, ptr %arrayidx33.us, i64 1 %12 = load i64, ptr %arrayidx41.us, align 8, !tbaa !5 %13 = load i64, ptr %9, align 8, !tbaa !5 %add43.us = add nsw i64 %13, %12 %add37.add43.us = call i64 @llvm.smax.i64(i64 %add37.us, i64 %add43.us) %arrayidx59.us = getelementptr inbounds i64, ptr %7, i64 %j.1177.us store i64 %add37.add43.us, ptr %arrayidx59.us, align 8, !tbaa !5 %inc93.us = add nuw nsw i64 %j.1177.us, 1 %14 = load i64, ptr %n, align 8, !tbaa !5 %sub.us = sub nsw i64 %14, %i.2179 %cmp26.not.us.not = icmp slt i64 %j.1177.us, %sub.us br i1 %cmp26.not.us.not, label %while.body27.us, label %while.end94, !llvm.loop !14 while.body27: ; preds = %while.body27.lr.ph, %while.body27 %j.1177 = phi i64 [ %inc93, %while.body27 ], [ 0, %while.body27.lr.ph ] %arrayidx62 = getelementptr inbounds i64, ptr %6, i64 %j.1177 %15 = load i64, ptr %arrayidx62, align 8, !tbaa !5 %16 = getelementptr i64, ptr %call1, i64 %j.1177 %17 = getelementptr i64, ptr %16, i64 %i.2179 %arrayidx65 = getelementptr i64, ptr %17, i64 -1 %18 = load i64, ptr %arrayidx65, align 8, !tbaa !5 %sub66 = sub nsw i64 %15, %18 %arrayidx70 = getelementptr i64, ptr %arrayidx62, i64 1 %19 = load i64, ptr %arrayidx70, align 8, !tbaa !5 %20 = load i64, ptr %16, align 8, !tbaa !5 %sub72 = sub nsw i64 %19, %20 %sub66.sub72 = call i64 @llvm.smin.i64(i64 %sub66, i64 %sub72) %arrayidx92 = getelementptr inbounds i64, ptr %7, i64 %j.1177 store i64 %sub66.sub72, ptr %arrayidx92, align 8, !tbaa !5 %inc93 = add nuw nsw i64 %j.1177, 1 %21 = load i64, ptr %n, align 8, !tbaa !5 %sub = sub nsw i64 %21, %i.2179 %cmp26.not.not = icmp slt i64 %j.1177, %sub br i1 %cmp26.not.not, label %while.body27, label %while.end94, !llvm.loop !14 while.end94: ; preds = %while.body27, %while.body27.us, %while.cond25.preheader %22 = phi i64 [ %3, %while.cond25.preheader ], [ %14, %while.body27.us ], [ %21, %while.body27 ] %inc95 = add nuw nsw i64 %i.2179, 1 %cmp23.not.not = icmp slt i64 %i.2179, %22 br i1 %cmp23.not.not, label %while.cond25.preheader, label %while.end96, !llvm.loop !15 while.end96: ; preds = %while.end94, %while.end, %while.cond22.preheader %.lcssa = phi i64 [ %2, %while.cond22.preheader ], [ %2, %while.end ], [ %22, %while.end94 ] %arrayidx97 = getelementptr inbounds ptr, ptr %call5, i64 %.lcssa %23 = load ptr, ptr %arrayidx97, align 8, !tbaa !11 %24 = load i64, ptr %23, align 8, !tbaa !5 %call99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %24) call void @llvm.lifetime.end.p0(i64 8, 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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) 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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"any pointer", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> #include<stdlib.h> typedef long long int int64; void run(void){ int n,q; scanf("%d%d",&n,&q); int *a=(int *)calloc(n,sizeof(int)); int i; for(i=0;i<n;i++) scanf("%d",a+i); while(q--){ int64 x; scanf("%lld",&x); int64 ans=0; int j=0; for(i=0;i<n;i++){ while(j<n && x-a[j]>=0) x-=a[j++]; ans+=j-i; x+=a[i]; } printf("%lld\n",ans); } } int main(void){ run(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235393/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @run() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #5 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %q, align 4, !tbaa !5 %dec63 = add nsw i32 %1, -1 store i32 %dec63, ptr %q, align 4, !tbaa !5 %tobool.not64 = icmp eq i32 %1, 0 br i1 %tobool.not64, label %while.end31, label %while.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr) %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 %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %for.end29 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp657 = icmp sgt i32 %4, 0 br i1 %cmp657, label %while.cond9.preheader.preheader, label %for.end29 while.cond9.preheader.preheader: ; preds = %while.body %x.promoted52 = load i64, ptr %x, align 8, !tbaa !11 %5 = zext i32 %4 to i64 %wide.trip.count = zext i32 %4 to i64 br label %while.cond9.preheader while.cond9.preheader: ; preds = %while.cond9.preheader.preheader, %while.end %indvars.iv69 = phi i64 [ 0, %while.cond9.preheader.preheader ], [ %indvars.iv.next70, %while.end ] %j.061 = phi i32 [ 0, %while.cond9.preheader.preheader ], [ %j.1.lcssa, %while.end ] %ans.060 = phi i64 [ 0, %while.cond9.preheader.preheader ], [ %add, %while.end ] %x.promoted5358 = phi i64 [ %x.promoted52, %while.cond9.preheader.preheader ], [ %add26, %while.end ] %cmp1048 = icmp slt i32 %j.061, %4 br i1 %cmp1048, label %land.rhs.preheader, label %while.end land.rhs.preheader: ; preds = %while.cond9.preheader %6 = sext i32 %j.061 to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body15 %indvars.iv66 = phi i64 [ %6, %land.rhs.preheader ], [ %indvars.iv.next67, %while.body15 ] %sub4749 = phi i64 [ %x.promoted5358, %land.rhs.preheader ], [ %sub, %while.body15 ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv66 %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv12 = sext i32 %7 to i64 %sub = sub nsw i64 %sub4749, %conv12 %cmp13 = icmp sgt i64 %sub, -1 br i1 %cmp13, label %while.body15, label %while.end.loopexit.split.loop.exit73 while.body15: ; preds = %land.rhs %indvars.iv.next67 = add nsw i64 %indvars.iv66, 1 %exitcond.not = icmp eq i64 %indvars.iv.next67, %5 br i1 %exitcond.not, label %while.end, label %land.rhs, !llvm.loop !13 while.end.loopexit.split.loop.exit73: ; preds = %land.rhs %8 = trunc i64 %indvars.iv66 to i32 br label %while.end while.end: ; preds = %while.body15, %while.end.loopexit.split.loop.exit73, %while.cond9.preheader %x.promoted54 = phi i64 [ %x.promoted5358, %while.cond9.preheader ], [ %sub4749, %while.end.loopexit.split.loop.exit73 ], [ %sub, %while.body15 ] %j.1.lcssa = phi i32 [ %j.061, %while.cond9.preheader ], [ %8, %while.end.loopexit.split.loop.exit73 ], [ %4, %while.body15 ] %9 = trunc i64 %indvars.iv69 to i32 %sub21 = sub nsw i32 %j.1.lcssa, %9 %conv22 = sext i32 %sub21 to i64 %add = add nsw i64 %ans.060, %conv22 %arrayidx24 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv69 %10 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %conv25 = sext i32 %10 to i64 %add26 = add nsw i64 %x.promoted54, %conv25 %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1 %exitcond72.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count br i1 %exitcond72.not, label %for.cond5.for.end29_crit_edge, label %while.cond9.preheader, !llvm.loop !14 for.cond5.for.end29_crit_edge: ; preds = %while.end store i64 %add26, ptr %x, align 8, !tbaa !11 br label %for.end29 for.end29: ; preds = %for.cond5.for.end29_crit_edge, %while.body %ans.0.lcssa = phi i64 [ %add, %for.cond5.for.end29_crit_edge ], [ 0, %while.body ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 %11 = load i32, ptr %q, align 4, !tbaa !5 %dec = add nsw i32 %11, -1 store i32 %dec, ptr %q, align 4, !tbaa !5 %tobool.not = icmp eq i32 %11, 0 br i1 %tobool.not, label %while.end31, label %while.body, !llvm.loop !15 while.end31: ; preds = %for.end29, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: tail call void @run() ret i32 0 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int m, n; int arr[90][90]; int dy[] = {0, 0, -1, 1}; int dx[] = {1, -1, 0, 0}; int dfs(int y, int x) { int i; if (arr[y][x] == 0) return 0; arr[y][x] = 0; int ans = 0, a; for (i = 0; i < 4; ++i) { int py, px; py = y + dy[i]; px = x + dx[i]; if (py < 0 || px < 0 || py >= m || px >= n) continue; a = dfs(py, px); if (ans < a) ans = a; } arr[y][x] = 1; return ans + 1; } int main(void) { while (1) { scanf("%d%d", &m, &n); if (m * n == 0) return 0; int i, j, ans = 0, k; for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { scanf("%d", &arr[i][j]); } } for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { k = dfs(i, j); if (k > ans) ans = k; } } printf("%d\n", ans); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235436/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235436/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @dy = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 -1, i32 1], align 16 @dx = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @arr = dso_local global [90 x [90 x i32]] zeroinitializer, align 16 @m = dso_local global i32 0, align 4 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %y, i32 noundef %x) local_unnamed_addr #0 { entry: %idxprom = sext i32 %y to i64 %idxprom1 = sext i32 %x to i64 %arrayidx2 = getelementptr inbounds [90 x [90 x i32]], ptr @arr, i64 0, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %cleanup32, label %if.end if.end: ; preds = %entry store i32 0, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @dy, align 16, !tbaa !5 %add = add nsw i32 %1, %y %2 = load i32, ptr @dx, align 16, !tbaa !5 %add12 = add nsw i32 %2, %x %cmp13 = icmp sgt i32 %add, -1 %cmp14 = icmp sgt i32 %add12, -1 %or.cond.not50 = select i1 %cmp13, i1 %cmp14, i1 false %3 = load i32, ptr @m, align 4 %cmp16.not = icmp slt i32 %add, %3 %or.cond48 = select i1 %or.cond.not50, i1 %cmp16.not, i1 false %4 = load i32, ptr @n, align 4 %cmp18.not = icmp slt i32 %add12, %4 %or.cond49 = select i1 %or.cond48, i1 %cmp18.not, i1 false br i1 %or.cond49, label %if.end20, label %cleanup if.end20: ; preds = %if.end %call = tail call i32 @dfs(i32 noundef %add, i32 noundef %add12), !range !9 %spec.select = tail call i32 @llvm.smax.i32(i32 %call, i32 0) %.pre = load i32, ptr @m, align 4 %.pre54 = load i32, ptr @n, align 4 br label %cleanup cleanup: ; preds = %if.end, %if.end20 %5 = phi i32 [ %.pre54, %if.end20 ], [ %4, %if.end ] %6 = phi i32 [ %.pre, %if.end20 ], [ %3, %if.end ] %ans.2 = phi i32 [ %spec.select, %if.end20 ], [ 0, %if.end ] %7 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5 %add.1 = add nsw i32 %7, %y %8 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5 %add12.1 = add nsw i32 %8, %x %cmp13.1 = icmp sgt i32 %add.1, -1 %cmp14.1 = icmp sgt i32 %add12.1, -1 %or.cond.not50.1 = select i1 %cmp13.1, i1 %cmp14.1, i1 false %cmp16.not.1 = icmp slt i32 %add.1, %6 %or.cond48.1 = select i1 %or.cond.not50.1, i1 %cmp16.not.1, i1 false %cmp18.not.1 = icmp slt i32 %add12.1, %5 %or.cond49.1 = select i1 %or.cond48.1, i1 %cmp18.not.1, i1 false br i1 %or.cond49.1, label %if.end20.1, label %cleanup.1 if.end20.1: ; preds = %cleanup %call.1 = tail call i32 @dfs(i32 noundef %add.1, i32 noundef %add12.1), !range !9 %spec.select.1 = tail call i32 @llvm.smax.i32(i32 %ans.2, i32 %call.1) %.pre55 = load i32, ptr @m, align 4 %.pre56 = load i32, ptr @n, align 4 br label %cleanup.1 cleanup.1: ; preds = %if.end20.1, %cleanup %9 = phi i32 [ %.pre56, %if.end20.1 ], [ %5, %cleanup ] %10 = phi i32 [ %.pre55, %if.end20.1 ], [ %6, %cleanup ] %ans.2.1 = phi i32 [ %spec.select.1, %if.end20.1 ], [ %ans.2, %cleanup ] %11 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5 %add.2 = add nsw i32 %11, %y %12 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5 %add12.2 = add nsw i32 %12, %x %cmp13.2 = icmp sgt i32 %add.2, -1 %cmp14.2 = icmp sgt i32 %add12.2, -1 %or.cond.not50.2 = select i1 %cmp13.2, i1 %cmp14.2, i1 false %cmp16.not.2 = icmp slt i32 %add.2, %10 %or.cond48.2 = select i1 %or.cond.not50.2, i1 %cmp16.not.2, i1 false %cmp18.not.2 = icmp slt i32 %add12.2, %9 %or.cond49.2 = select i1 %or.cond48.2, i1 %cmp18.not.2, i1 false br i1 %or.cond49.2, label %if.end20.2, label %cleanup.2 if.end20.2: ; preds = %cleanup.1 %call.2 = tail call i32 @dfs(i32 noundef %add.2, i32 noundef %add12.2), !range !9 %spec.select.2 = tail call i32 @llvm.smax.i32(i32 %ans.2.1, i32 %call.2) %.pre57 = load i32, ptr @m, align 4 %.pre58 = load i32, ptr @n, align 4 br label %cleanup.2 cleanup.2: ; preds = %if.end20.2, %cleanup.1 %13 = phi i32 [ %.pre58, %if.end20.2 ], [ %9, %cleanup.1 ] %14 = phi i32 [ %.pre57, %if.end20.2 ], [ %10, %cleanup.1 ] %ans.2.2 = phi i32 [ %spec.select.2, %if.end20.2 ], [ %ans.2.1, %cleanup.1 ] %15 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5 %add.3 = add nsw i32 %15, %y %16 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5 %add12.3 = add nsw i32 %16, %x %cmp13.3 = icmp sgt i32 %add.3, -1 %cmp14.3 = icmp sgt i32 %add12.3, -1 %or.cond.not50.3 = select i1 %cmp13.3, i1 %cmp14.3, i1 false %cmp16.not.3 = icmp slt i32 %add.3, %14 %or.cond48.3 = select i1 %or.cond.not50.3, i1 %cmp16.not.3, i1 false %cmp18.not.3 = icmp slt i32 %add12.3, %13 %or.cond49.3 = select i1 %or.cond48.3, i1 %cmp18.not.3, i1 false br i1 %or.cond49.3, label %if.end20.3, label %cleanup.3 if.end20.3: ; preds = %cleanup.2 %call.3 = tail call i32 @dfs(i32 noundef %add.3, i32 noundef %add12.3), !range !9 %spec.select.3 = tail call i32 @llvm.smax.i32(i32 %ans.2.2, i32 %call.3) br label %cleanup.3 cleanup.3: ; preds = %if.end20.3, %cleanup.2 %ans.2.3 = phi i32 [ %spec.select.3, %if.end20.3 ], [ %ans.2.2, %cleanup.2 ] store i32 1, ptr %arrayidx2, align 4, !tbaa !5 %add29 = add nuw nsw i32 %ans.2.3, 1 br label %cleanup32 cleanup32: ; preds = %entry, %cleanup.3 %retval.0 = phi i32 [ %add29, %cleanup.3 ], [ 0, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call51 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @n) %0 = load i32, ptr @m, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %mul52 = mul nsw i32 %1, %0 %cmp53 = icmp eq i32 %mul52, 0 br i1 %cmp53, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end26 %2 = phi i32 [ %19, %for.end26 ], [ %1, %entry ] %3 = phi i32 [ %18, %for.end26 ], [ %0, %entry ] %cmp142 = icmp sgt i32 %3, 0 %4 = icmp sgt i32 %2, 0 %or.cond = and i1 %cmp142, %4 br i1 %or.cond, label %for.cond2.preheader, label %for.end26 if.then: ; preds = %for.end26, %entry ret i32 0 for.cond11.preheader: ; preds = %for.inc8 %cmp1247 = icmp sgt i32 %10, 0 %5 = icmp sgt i32 %11, 0 %or.cond67 = and i1 %cmp1247, %5 br i1 %or.cond67, label %for.cond14.preheader, label %for.end26 for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc8 %6 = phi i32 [ %10, %for.inc8 ], [ %3, %for.cond.preheader ] %7 = phi i32 [ %11, %for.inc8 ], [ %2, %for.cond.preheader ] %indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.inc8 ], [ 0, %for.cond.preheader ] %cmp340 = icmp sgt i32 %7, 0 br i1 %cmp340, label %for.body4, label %for.inc8 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [90 x [90 x i32]], ptr @arr, i64 0, i64 %indvars.iv57, i64 %indvars.iv %call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr @n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp3, label %for.body4, label %for.inc8.loopexit, !llvm.loop !10 for.inc8.loopexit: ; preds = %for.body4 %.pre = load i32, ptr @m, align 4, !tbaa !5 br label %for.inc8 for.inc8: ; preds = %for.inc8.loopexit, %for.cond2.preheader %10 = phi i32 [ %.pre, %for.inc8.loopexit ], [ %6, %for.cond2.preheader ] %11 = phi i32 [ %8, %for.inc8.loopexit ], [ %7, %for.cond2.preheader ] %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %12 = sext i32 %10 to i64 %cmp1 = icmp slt i64 %indvars.iv.next58, %12 br i1 %cmp1, label %for.cond2.preheader, label %for.cond11.preheader, !llvm.loop !12 for.cond14.preheader: ; preds = %for.cond11.preheader, %for.inc24 %13 = phi i32 [ %16, %for.inc24 ], [ %10, %for.cond11.preheader ] %14 = phi i32 [ %17, %for.inc24 ], [ %11, %for.cond11.preheader ] %i.149 = phi i32 [ %inc25, %for.inc24 ], [ 0, %for.cond11.preheader ] %ans.048 = phi i32 [ %ans.1.lcssa, %for.inc24 ], [ 0, %for.cond11.preheader ] %cmp1544 = icmp sgt i32 %14, 0 br i1 %cmp1544, label %for.body16, label %for.inc24 for.body16: ; preds = %for.cond14.preheader, %for.body16 %ans.146 = phi i32 [ %spec.select, %for.body16 ], [ %ans.048, %for.cond14.preheader ] %j.145 = phi i32 [ %inc22, %for.body16 ], [ 0, %for.cond14.preheader ] %call17 = tail call i32 @dfs(i32 noundef %i.149, i32 noundef %j.145), !range !9 %spec.select = tail call i32 @llvm.smax.i32(i32 %call17, i32 %ans.146) %inc22 = add nuw nsw i32 %j.145, 1 %15 = load i32, ptr @n, align 4, !tbaa !5 %cmp15 = icmp slt i32 %inc22, %15 br i1 %cmp15, label %for.body16, label %for.inc24.loopexit, !llvm.loop !14 for.inc24.loopexit: ; preds = %for.body16 %.pre60 = load i32, ptr @m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond14.preheader %16 = phi i32 [ %13, %for.cond14.preheader ], [ %.pre60, %for.inc24.loopexit ] %17 = phi i32 [ %14, %for.cond14.preheader ], [ %15, %for.inc24.loopexit ] %ans.1.lcssa = phi i32 [ %ans.048, %for.cond14.preheader ], [ %spec.select, %for.inc24.loopexit ] %inc25 = add nuw nsw i32 %i.149, 1 %cmp12 = icmp slt i32 %inc25, %16 br i1 %cmp12, label %for.cond14.preheader, label %for.end26, !llvm.loop !15 for.end26: ; preds = %for.inc24, %for.cond.preheader, %for.cond11.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ 0, %for.cond.preheader ], [ %ans.1.lcssa, %for.inc24 ] %call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @n) %18 = load i32, ptr @m, align 4, !tbaa !5 %19 = load i32, ptr @n, align 4, !tbaa !5 %mul = mul nsw i32 %19, %18 %cmp = icmp eq i32 %mul, 0 br i1 %cmp, label %if.then, label %for.cond.preheader } ; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i32 0, i32 -2147483647} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11, !13}
#include<stdio.h> #include<math.h> int main() { int r,d; scanf("%d%d",&r,&d); int n; scanf("%d",&n); int arr[n]; int i; int x,y; int f; int c=0; for(i=0;i<n;i++) { scanf("%d%d%d",&x,&y,&f); double dd=sqrt(x*x+y*y); double dd1,dd2; dd1=dd-f; dd2=dd+f; //printf("%fdd%f\n",dd1,dd2); if(dd1>=(double)(r-d)&&dd2<=(double)(r)) {c++; //printf("sd"); } } printf("%d\n",c); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23548/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23548/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.3 = 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: %r = alloca i32, align 4 %d = alloca i32, align 4 %n = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r, ptr noundef nonnull %d) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %0 = call ptr @llvm.stacksave.p0() call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %1, 0 br i1 %cmp20, label %for.body, label %for.end for.body: ; preds = %entry, %if.end %i.022 = phi i32 [ %inc15, %if.end ], [ 0, %entry ] %c.021 = phi i32 [ %c.1, %if.end ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %f) %2 = load i32, ptr %x, align 4, !tbaa !5 %mul = mul nsw i32 %2, %2 %3 = load i32, ptr %y, align 4, !tbaa !5 %mul3 = mul nsw i32 %3, %3 %add = add nuw nsw i32 %mul3, %mul %conv = sitofp i32 %add to double %call4 = call double @sqrt(double noundef %conv) #5 %4 = load i32, ptr %f, align 4, !tbaa !5 %conv5 = sitofp i32 %4 to double %sub = fsub double %call4, %conv5 %5 = load i32, ptr %r, align 4, !tbaa !5 %6 = load i32, ptr %d, align 4, !tbaa !5 %sub8 = sub nsw i32 %5, %6 %conv9 = sitofp i32 %sub8 to double %cmp10 = fcmp ult double %sub, %conv9 br i1 %cmp10, label %if.end, label %land.lhs.true land.lhs.true: ; preds = %for.body %add7 = fadd double %call4, %conv5 %conv12 = sitofp i32 %5 to double %cmp13 = fcmp ugt double %add7, %conv12 br i1 %cmp13, label %if.end, label %if.then if.then: ; preds = %land.lhs.true %inc = add nsw i32 %c.021, 1 br label %if.end if.end: ; preds = %if.then, %land.lhs.true, %for.body %c.1 = phi i32 [ %inc, %if.then ], [ %c.021, %land.lhs.true ], [ %c.021, %for.body ] %inc15 = add nuw nsw i32 %i.022, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc15, %7 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.end, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %c.1, %if.end ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 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.stackrestore.p0(ptr %0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nofree nounwind willreturn memory(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 #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 n; scanf("%d", &n); int cur = 0; long long int sum = 0; while (n--) { int a; scanf("%d", &a); if (a < cur) { sum += cur-a; a = cur; } else cur = a; } printf("%lld\n", sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235522/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235522/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%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 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 %dec6 = add nsw i32 %0, -1 store i32 %dec6, ptr %n, align 4, !tbaa !5 %tobool.not7 = icmp eq i32 %0, 0 br i1 %tobool.not7, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %sum.09 = phi i64 [ %sum.1, %while.body ], [ 0, %entry ] %cur.08 = phi i32 [ %cur.1, %while.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %1, %cur.08 %sub = sub nsw i32 %cur.08, %1 %cur.1 = call i32 @llvm.smax.i32(i32 %1, i32 %cur.08) %narrow = select i1 %cmp, i32 %sub, i32 0 %add = sext i32 %narrow to i64 %sum.1 = add nsw i64 %sum.09, %add call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 %2 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %sum.1, %while.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> int main(){ int unused __attribute__((unused)); int i, N, *A, kijun; long long sum = 0; unused = scanf("%d", &N); A = malloc(sizeof(int)*N); for(i=0; i<N; i++) unused = scanf("%d", &A[i]); if(N > 1){ kijun = A[0]; for(i=1; i<N; i++){ if(A[i] < kijun){ sum += kijun-A[i]; }else{ kijun = A[i]; } } } printf("%lld", sum); free(A); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235566/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235566/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp41 = icmp sgt i32 %0, 0 br i1 %cmp41, label %for.body, label %if.end24 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %N, align 4, !tbaa !5 %1 = sext i32 %.pr to i64 %cmp = icmp slt i64 %indvars.iv.next, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp4 = icmp sgt i32 %.pr, 1 br i1 %cmp4, label %if.then, label %if.end24 if.then: ; preds = %for.end %2 = load i32, ptr %call1, align 4, !tbaa !5 %wide.trip.count = zext i32 %.pr to i64 %3 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %.pr, 2 br i1 %4, label %if.end24.loopexit.unr-lcssa, label %if.then.new if.then.new: ; preds = %if.then %unroll_iter = and i64 %3, -2 %invariant.gep = getelementptr i32, ptr %call1, i64 1 br label %for.body10 for.body10: ; preds = %for.body10, %if.then.new %indvars.iv47 = phi i64 [ 1, %if.then.new ], [ %indvars.iv.next48.1, %for.body10 ] %sum.045 = phi i64 [ 0, %if.then.new ], [ %sum.1.1, %for.body10 ] %kijun.044 = phi i32 [ %2, %if.then.new ], [ %kijun.1.1, %for.body10 ] %niter = phi i64 [ 0, %if.then.new ], [ %niter.next.1, %for.body10 ] %arrayidx12 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv47 %5 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %5, %kijun.044 %sub = sub nsw i32 %kijun.044, %5 %kijun.1 = call i32 @llvm.smax.i32(i32 %5, i32 %kijun.044) %narrow = select i1 %cmp13, i32 %sub, i32 0 %add = sext i32 %narrow to i64 %sum.1 = add nsw i64 %sum.045, %add %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv47 %6 = load i32, ptr %gep, align 4, !tbaa !5 %cmp13.1 = icmp slt i32 %6, %kijun.1 %sub.1 = sub nsw i32 %kijun.1, %6 %kijun.1.1 = call i32 @llvm.smax.i32(i32 %6, i32 %kijun.1) %narrow.1 = select i1 %cmp13.1, i32 %sub.1, i32 0 %add.1 = sext i32 %narrow.1 to i64 %sum.1.1 = add nsw i64 %sum.1, %add.1 %indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 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 %if.end24.loopexit.unr-lcssa, label %for.body10, !llvm.loop !11 if.end24.loopexit.unr-lcssa: ; preds = %for.body10, %if.then %sum.1.lcssa.ph = phi i64 [ undef, %if.then ], [ %sum.1.1, %for.body10 ] %indvars.iv47.unr = phi i64 [ 1, %if.then ], [ %indvars.iv.next48.1, %for.body10 ] %sum.045.unr = phi i64 [ 0, %if.then ], [ %sum.1.1, %for.body10 ] %kijun.044.unr = phi i32 [ %2, %if.then ], [ %kijun.1.1, %for.body10 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end24, label %for.body10.epil for.body10.epil: ; preds = %if.end24.loopexit.unr-lcssa %arrayidx12.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv47.unr %7 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5 %cmp13.epil = icmp slt i32 %7, %kijun.044.unr %sub.epil = sub nsw i32 %kijun.044.unr, %7 %narrow.epil = select i1 %cmp13.epil, i32 %sub.epil, i32 0 %add.epil = sext i32 %narrow.epil to i64 %sum.1.epil = add nsw i64 %sum.045.unr, %add.epil br label %if.end24 if.end24: ; preds = %for.body10.epil, %if.end24.loopexit.unr-lcssa, %entry, %for.end %sum.2 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %if.end24.loopexit.unr-lcssa ], [ %sum.1.epil, %for.body10.epil ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.2) call void @free(ptr noundef %call1) #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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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; scanf("%d",&n); long i,a[n],r,tool=0; for(i=0;i<n;i++) scanf("%ld ",&a[i]); for(i=1;i<n;i++) { if(a[i]>=a[i-1]) continue; else { r=a[i-1]-a[i]; a[i]+=r; tool+=r; } } printf("%ld",tool); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235609/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235609/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld \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 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 i64, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %conv34 = sext i32 %3 to i64 %cmp35 = icmp sgt i32 %3, 0 br i1 %cmp35, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %conv.lcssa = phi i64 [ %conv34, %entry ], [ %conv, %for.body ] %cmp537 = icmp sgt i64 %conv.lcssa, 1 br i1 %cmp537, label %for.body7.preheader, label %for.end20 for.body7.preheader: ; preds = %for.cond3.preheader %4 = add nsw i64 %conv.lcssa, -1 %xtraiter = and i64 %4, 1 %5 = icmp eq i64 %conv.lcssa, 2 br i1 %5, label %for.end20.loopexit.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %4, -2 br label %for.body7 for.body: ; preds = %entry, %for.body %i.036 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.036 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.036, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %6 to i64 %cmp = icmp slt i64 %inc, %conv br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body7: ; preds = %for.inc18.1, %for.body7.preheader.new %tool.039 = phi i64 [ 0, %for.body7.preheader.new ], [ %tool.1.1, %for.inc18.1 ] %i.138 = phi i64 [ 1, %for.body7.preheader.new ], [ %inc19.1, %for.inc18.1 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.inc18.1 ] %arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %i.138 %7 = load i64, ptr %arrayidx8, align 8, !tbaa !11 %arrayidx9 = getelementptr i64, ptr %arrayidx8, i64 -1 %8 = load i64, ptr %arrayidx9, align 8, !tbaa !11 %cmp10.not = icmp slt i64 %7, %8 br i1 %cmp10.not, label %if.else, label %for.inc18 if.else: ; preds = %for.body7 store i64 %8, ptr %arrayidx8, align 8, !tbaa !11 %sub15 = sub i64 %tool.039, %7 %add17 = add i64 %sub15, %8 br label %for.inc18 for.inc18: ; preds = %for.body7, %if.else %tool.1 = phi i64 [ %tool.039, %for.body7 ], [ %add17, %if.else ] %9 = getelementptr i64, ptr %vla, i64 %i.138 %arrayidx8.1 = getelementptr i64, ptr %9, i64 1 %10 = load i64, ptr %arrayidx8.1, align 8, !tbaa !11 %11 = load i64, ptr %9, align 8, !tbaa !11 %cmp10.not.1 = icmp slt i64 %10, %11 br i1 %cmp10.not.1, label %if.else.1, label %for.inc18.1 if.else.1: ; preds = %for.inc18 store i64 %11, ptr %arrayidx8.1, align 8, !tbaa !11 %sub15.1 = sub i64 %tool.1, %10 %add17.1 = add i64 %sub15.1, %11 br label %for.inc18.1 for.inc18.1: ; preds = %if.else.1, %for.inc18 %tool.1.1 = phi i64 [ %tool.1, %for.inc18 ], [ %add17.1, %if.else.1 ] %inc19.1 = add nuw nsw i64 %i.138, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end20.loopexit.unr-lcssa, label %for.body7, !llvm.loop !13 for.end20.loopexit.unr-lcssa: ; preds = %for.inc18.1, %for.body7.preheader %tool.1.lcssa.ph = phi i64 [ undef, %for.body7.preheader ], [ %tool.1.1, %for.inc18.1 ] %tool.039.unr = phi i64 [ 0, %for.body7.preheader ], [ %tool.1.1, %for.inc18.1 ] %i.138.unr = phi i64 [ 1, %for.body7.preheader ], [ %inc19.1, %for.inc18.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end20, label %for.body7.epil for.body7.epil: ; preds = %for.end20.loopexit.unr-lcssa %arrayidx8.epil = getelementptr inbounds i64, ptr %vla, i64 %i.138.unr %12 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !11 %arrayidx9.epil = getelementptr i64, ptr %arrayidx8.epil, i64 -1 %13 = load i64, ptr %arrayidx9.epil, align 8, !tbaa !11 %cmp10.not.epil = icmp slt i64 %12, %13 br i1 %cmp10.not.epil, label %if.else.epil, label %for.end20 if.else.epil: ; preds = %for.body7.epil store i64 %13, ptr %arrayidx8.epil, align 8, !tbaa !11 %sub15.epil = sub i64 %tool.039.unr, %12 %add17.epil = add i64 %sub15.epil, %13 br label %for.end20 for.end20: ; preds = %for.end20.loopexit.unr-lcssa, %if.else.epil, %for.body7.epil, %for.cond3.preheader %tool.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ %tool.1.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %tool.039.unr, %for.body7.epil ], [ %add17.epil, %if.else.epil ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %tool.0.lcssa) 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 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> int main(void){ int n; long a; long prev_a; long x = 0; scanf("%d", &n); for(int i=0; i<n; i++){ scanf("%ld", &a); if(i != 0){ if(a < prev_a){ x += prev_a - a; a = prev_a; } } prev_a = a; } printf("%ld\n", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235652/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235652/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, 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 %cmp12 = icmp sgt i32 %0, 0 br i1 %cmp12, label %if.end5.peel, label %for.cond.cleanup if.end5.peel: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %1, 1 br i1 %cmp.peel, label %if.then.preheader, label %for.cond.cleanup if.then.preheader: ; preds = %if.end5.peel %.pre = load i64, ptr %a, align 8, !tbaa !9 br label %if.then for.cond.cleanup: ; preds = %if.end5, %if.end5.peel, %entry %x.0.lcssa = phi i64 [ 0, %entry ], [ 0, %if.end5.peel ], [ %x.1, %if.end5 ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %x.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 if.then: ; preds = %if.then.preheader, %if.end5 %i.015 = phi i32 [ %inc, %if.end5 ], [ 1, %if.then.preheader ] %x.014 = phi i64 [ %x.1, %if.end5 ], [ 0, %if.then.preheader ] %prev_a.013 = phi i64 [ %3, %if.end5 ], [ %.pre, %if.then.preheader ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %2 = load i64, ptr %a, align 8, !tbaa !9 %cmp3 = icmp slt i64 %2, %prev_a.013 br i1 %cmp3, label %if.then4, label %if.end5 if.then4: ; preds = %if.then %sub = add i64 %x.014, %prev_a.013 %add = sub i64 %sub, %2 store i64 %prev_a.013, ptr %a, align 8, !tbaa !9 br label %if.end5 if.end5: ; preds = %if.then, %if.then4 %3 = phi i64 [ %prev_a.013, %if.then4 ], [ %2, %if.then ] %x.1 = phi i64 [ %add, %if.then4 ], [ %x.014, %if.then ] %inc = add nuw nsw i32 %i.015, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %if.then, label %for.cond.cleanup, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12, !13} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main(void){ char s[200001]; int i, n, a, b, c, d, flag1 = 1, flag2 = 1; scanf("%d %d %d %d %d %s", &n, &a, &b, &c, &d, s); if(c > d){ flag1=0; for(i = b-2; i < d-1; i++){ if(s[i] == '.' && s[i+1] == '.' && s[i+2] == '.') flag1 = 1; } } for(i = a-1; i < c-1; i++){ if(s[i] == '#' && s[i+1] == '#') flag2 = 0; } for(i = b-1; i < d-1; i++){ if(s[i] == '#' && s[i+1] == '#') flag2 = 0; } if(flag1 == 1 && flag2 == 1){printf("Yes\n");} else{ printf("No\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235702/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235702/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [200001 x i8], align 16 %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %s) #5 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %s) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %d, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end18 if.then: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp289.not = icmp sgt i32 %2, %1 br i1 %cmp289.not, label %if.end18, label %for.body.preheader for.body.preheader: ; preds = %if.then %sub1 = add i32 %1, -1 %3 = sext i32 %2 to i64 %4 = add nsw i64 %3, -2 %wide.trip.count = sext i32 %sub1 to i64 %5 = add nsw i64 %wide.trip.count, 2 %6 = sub nsw i64 %5, %3 %7 = add nsw i64 %wide.trip.count, 1 %xtraiter = and i64 %6, 1 %8 = icmp eq i64 %7, %3 br i1 %8, label %if.end18.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %6, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ %4, %for.body.preheader.new ], [ %15, %for.inc.1 ] %flag1.091 = phi i32 [ 0, %for.body.preheader.new ], [ %flag1.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv %9 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp3 = icmp eq i8 %9, 46 %10 = add nsw i64 %indvars.iv, 1 br i1 %cmp3, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx6 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %10 %11 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %cmp8 = icmp eq i8 %11, 46 br i1 %cmp8, label %land.lhs.true10, label %for.inc land.lhs.true10: ; preds = %land.lhs.true %12 = add nsw i64 %indvars.iv, 2 %arrayidx13 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %12 %13 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %cmp15 = icmp eq i8 %13, 46 %spec.select = select i1 %cmp15, i32 1, i32 %flag1.091 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true10, %land.lhs.true %flag1.1 = phi i32 [ %spec.select, %land.lhs.true10 ], [ %flag1.091, %land.lhs.true ], [ %flag1.091, %for.body ] %arrayidx.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %10 %14 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp3.1 = icmp eq i8 %14, 46 %15 = add nsw i64 %indvars.iv, 2 br i1 %cmp3.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %arrayidx6.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %15 %16 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9 %cmp8.1 = icmp eq i8 %16, 46 br i1 %cmp8.1, label %land.lhs.true10.1, label %for.inc.1 land.lhs.true10.1: ; preds = %land.lhs.true.1 %17 = add nsw i64 %indvars.iv, 3 %arrayidx13.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %17 %18 = load i8, ptr %arrayidx13.1, align 1, !tbaa !9 %cmp15.1 = icmp eq i8 %18, 46 %spec.select.1 = select i1 %cmp15.1, i32 1, i32 %flag1.1 br label %for.inc.1 for.inc.1: ; preds = %land.lhs.true10.1, %land.lhs.true.1, %for.inc %flag1.1.1 = phi i32 [ %spec.select.1, %land.lhs.true10.1 ], [ %flag1.1, %land.lhs.true.1 ], [ %flag1.1, %for.inc ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %if.end18.loopexit.unr-lcssa, label %for.body, !llvm.loop !10 if.end18.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %flag1.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %flag1.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ %4, %for.body.preheader ], [ %15, %for.inc.1 ] %flag1.091.unr = phi i32 [ 0, %for.body.preheader ], [ %flag1.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end18.loopexit, label %for.body.epil for.body.epil: ; preds = %if.end18.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %19 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp3.epil = icmp eq i8 %19, 46 br i1 %cmp3.epil, label %land.lhs.true.epil, label %if.end18.loopexit land.lhs.true.epil: ; preds = %for.body.epil %20 = add nsw i64 %indvars.iv.unr, 1 %arrayidx6.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %20 %21 = load i8, ptr %arrayidx6.epil, align 1, !tbaa !9 %cmp8.epil = icmp eq i8 %21, 46 br i1 %cmp8.epil, label %land.lhs.true10.epil, label %if.end18.loopexit land.lhs.true10.epil: ; preds = %land.lhs.true.epil %22 = add nsw i64 %indvars.iv.unr, 2 %arrayidx13.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %22 %23 = load i8, ptr %arrayidx13.epil, align 1, !tbaa !9 %cmp15.epil = icmp eq i8 %23, 46 %spec.select.epil = select i1 %cmp15.epil, i32 1, i32 %flag1.091.unr br label %if.end18.loopexit if.end18.loopexit: ; preds = %for.body.epil, %land.lhs.true.epil, %land.lhs.true10.epil, %if.end18.loopexit.unr-lcssa %flag1.1.lcssa = phi i32 [ %flag1.1.lcssa.ph, %if.end18.loopexit.unr-lcssa ], [ %spec.select.epil, %land.lhs.true10.epil ], [ %flag1.091.unr, %land.lhs.true.epil ], [ %flag1.091.unr, %for.body.epil ] %24 = icmp eq i32 %flag1.1.lcssa, 1 br label %if.end18 if.end18: ; preds = %if.end18.loopexit, %if.then, %entry %flag1.2 = phi i1 [ true, %entry ], [ false, %if.then ], [ %24, %if.end18.loopexit ] %25 = load i32, ptr %a, align 4, !tbaa !5 %cmp2292 = icmp slt i32 %25, %0 br i1 %cmp2292, label %for.body24.preheader, label %for.end41 for.body24.preheader: ; preds = %if.end18 %sub21 = add i32 %0, -1 %sub19 = add i32 %25, -1 %26 = sext i32 %sub19 to i64 %smax = call i32 @llvm.smax.i32(i32 %25, i32 %sub21) %27 = add i32 %smax, 1 %28 = sub i32 %27, %25 %xtraiter118 = and i32 %28, 1 %.not = icmp slt i32 %25, %sub21 br i1 %.not, label %for.body24.preheader.new, label %for.end41.loopexit.unr-lcssa for.body24.preheader.new: ; preds = %for.body24.preheader %unroll_iter121 = and i32 %28, -2 br label %for.body24 for.body24: ; preds = %for.inc39.1, %for.body24.preheader.new %indvars.iv103 = phi i64 [ %26, %for.body24.preheader.new ], [ %33, %for.inc39.1 ] %flag2.094 = phi i32 [ 1, %for.body24.preheader.new ], [ %flag2.1.1, %for.inc39.1 ] %niter122 = phi i32 [ 0, %for.body24.preheader.new ], [ %niter122.next.1, %for.inc39.1 ] %arrayidx26 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv103 %29 = load i8, ptr %arrayidx26, align 1, !tbaa !9 %cmp28 = icmp eq i8 %29, 35 %30 = add nsw i64 %indvars.iv103, 1 br i1 %cmp28, label %land.lhs.true30, label %for.inc39 land.lhs.true30: ; preds = %for.body24 %arrayidx33 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %30 %31 = load i8, ptr %arrayidx33, align 1, !tbaa !9 %cmp35 = icmp eq i8 %31, 35 %spec.select87 = select i1 %cmp35, i32 0, i32 %flag2.094 br label %for.inc39 for.inc39: ; preds = %for.body24, %land.lhs.true30 %flag2.1 = phi i32 [ %spec.select87, %land.lhs.true30 ], [ %flag2.094, %for.body24 ] %arrayidx26.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %30 %32 = load i8, ptr %arrayidx26.1, align 1, !tbaa !9 %cmp28.1 = icmp eq i8 %32, 35 %33 = add nsw i64 %indvars.iv103, 2 br i1 %cmp28.1, label %land.lhs.true30.1, label %for.inc39.1 land.lhs.true30.1: ; preds = %for.inc39 %arrayidx33.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %33 %34 = load i8, ptr %arrayidx33.1, align 1, !tbaa !9 %cmp35.1 = icmp eq i8 %34, 35 %spec.select87.1 = select i1 %cmp35.1, i32 0, i32 %flag2.1 br label %for.inc39.1 for.inc39.1: ; preds = %land.lhs.true30.1, %for.inc39 %flag2.1.1 = phi i32 [ %spec.select87.1, %land.lhs.true30.1 ], [ %flag2.1, %for.inc39 ] %niter122.next.1 = add i32 %niter122, 2 %niter122.ncmp.1 = icmp eq i32 %niter122.next.1, %unroll_iter121 br i1 %niter122.ncmp.1, label %for.end41.loopexit.unr-lcssa, label %for.body24, !llvm.loop !12 for.end41.loopexit.unr-lcssa: ; preds = %for.inc39.1, %for.body24.preheader %flag2.1.lcssa.ph = phi i32 [ undef, %for.body24.preheader ], [ %flag2.1.1, %for.inc39.1 ] %indvars.iv103.unr = phi i64 [ %26, %for.body24.preheader ], [ %33, %for.inc39.1 ] %flag2.094.unr = phi i32 [ 1, %for.body24.preheader ], [ %flag2.1.1, %for.inc39.1 ] %lcmp.mod119.not = icmp eq i32 %xtraiter118, 0 br i1 %lcmp.mod119.not, label %for.end41, label %for.body24.epil for.body24.epil: ; preds = %for.end41.loopexit.unr-lcssa %arrayidx26.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv103.unr %35 = load i8, ptr %arrayidx26.epil, align 1, !tbaa !9 %cmp28.epil = icmp eq i8 %35, 35 br i1 %cmp28.epil, label %land.lhs.true30.epil, label %for.end41 land.lhs.true30.epil: ; preds = %for.body24.epil %36 = add nsw i64 %indvars.iv103.unr, 1 %arrayidx33.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %36 %37 = load i8, ptr %arrayidx33.epil, align 1, !tbaa !9 %cmp35.epil = icmp eq i8 %37, 35 %spec.select87.epil = select i1 %cmp35.epil, i32 0, i32 %flag2.094.unr br label %for.end41 for.end41: ; preds = %for.end41.loopexit.unr-lcssa, %land.lhs.true30.epil, %for.body24.epil, %if.end18 %flag2.0.lcssa = phi i32 [ 1, %if.end18 ], [ %flag2.1.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %spec.select87.epil, %land.lhs.true30.epil ], [ %flag2.094.unr, %for.body24.epil ] %38 = load i32, ptr %b, align 4, !tbaa !5 %cmp4596 = icmp slt i32 %38, %1 br i1 %cmp4596, label %for.body47.preheader, label %for.end64 for.body47.preheader: ; preds = %for.end41 %sub44 = add i32 %1, -1 %sub42 = add i32 %38, -1 %39 = sext i32 %sub42 to i64 %smax112 = call i32 @llvm.smax.i32(i32 %38, i32 %sub44) %40 = add i32 %smax112, 1 %41 = sub i32 %40, %38 %xtraiter123 = and i32 %41, 1 %lcmp.mod124.not = icmp eq i32 %xtraiter123, 0 br i1 %lcmp.mod124.not, label %for.body47.prol.loopexit, label %for.body47.prol for.body47.prol: ; preds = %for.body47.preheader %arrayidx49.prol = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %39 %42 = load i8, ptr %arrayidx49.prol, align 1, !tbaa !9 %cmp51.prol = icmp eq i8 %42, 35 %43 = add nsw i64 %39, 1 br i1 %cmp51.prol, label %land.lhs.true53.prol, label %for.body47.prol.loopexit land.lhs.true53.prol: ; preds = %for.body47.prol %arrayidx56.prol = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %43 %44 = load i8, ptr %arrayidx56.prol, align 1, !tbaa !9 %cmp58.prol = icmp eq i8 %44, 35 %spec.select88.prol = select i1 %cmp58.prol, i32 0, i32 %flag2.0.lcssa br label %for.body47.prol.loopexit for.body47.prol.loopexit: ; preds = %for.body47.prol, %land.lhs.true53.prol, %for.body47.preheader %flag2.3.lcssa.unr = phi i32 [ undef, %for.body47.preheader ], [ %spec.select88.prol, %land.lhs.true53.prol ], [ %flag2.0.lcssa, %for.body47.prol ] %indvars.iv108.unr = phi i64 [ %39, %for.body47.preheader ], [ %43, %land.lhs.true53.prol ], [ %43, %for.body47.prol ] %flag2.298.unr = phi i32 [ %flag2.0.lcssa, %for.body47.preheader ], [ %spec.select88.prol, %land.lhs.true53.prol ], [ %flag2.0.lcssa, %for.body47.prol ] %.not125 = icmp slt i32 %38, %sub44 br i1 %.not125, label %for.body47, label %for.end64 for.body47: ; preds = %for.body47.prol.loopexit, %for.inc62.1 %indvars.iv108 = phi i64 [ %49, %for.inc62.1 ], [ %indvars.iv108.unr, %for.body47.prol.loopexit ] %flag2.298 = phi i32 [ %flag2.3.1, %for.inc62.1 ], [ %flag2.298.unr, %for.body47.prol.loopexit ] %arrayidx49 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv108 %45 = load i8, ptr %arrayidx49, align 1, !tbaa !9 %cmp51 = icmp eq i8 %45, 35 %46 = add nsw i64 %indvars.iv108, 1 br i1 %cmp51, label %land.lhs.true53, label %for.inc62 land.lhs.true53: ; preds = %for.body47 %arrayidx56 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %46 %47 = load i8, ptr %arrayidx56, align 1, !tbaa !9 %cmp58 = icmp eq i8 %47, 35 %spec.select88 = select i1 %cmp58, i32 0, i32 %flag2.298 br label %for.inc62 for.inc62: ; preds = %for.body47, %land.lhs.true53 %flag2.3 = phi i32 [ %spec.select88, %land.lhs.true53 ], [ %flag2.298, %for.body47 ] %arrayidx49.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %46 %48 = load i8, ptr %arrayidx49.1, align 1, !tbaa !9 %cmp51.1 = icmp eq i8 %48, 35 %49 = add nsw i64 %indvars.iv108, 2 br i1 %cmp51.1, label %land.lhs.true53.1, label %for.inc62.1 land.lhs.true53.1: ; preds = %for.inc62 %arrayidx56.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %49 %50 = load i8, ptr %arrayidx56.1, align 1, !tbaa !9 %cmp58.1 = icmp eq i8 %50, 35 %spec.select88.1 = select i1 %cmp58.1, i32 0, i32 %flag2.3 br label %for.inc62.1 for.inc62.1: ; preds = %land.lhs.true53.1, %for.inc62 %flag2.3.1 = phi i32 [ %spec.select88.1, %land.lhs.true53.1 ], [ %flag2.3, %for.inc62 ] %lftr.wideiv113.1 = trunc i64 %49 to i32 %exitcond114.not.1 = icmp eq i32 %smax112, %lftr.wideiv113.1 br i1 %exitcond114.not.1, label %for.end64, label %for.body47, !llvm.loop !13 for.end64: ; preds = %for.body47.prol.loopexit, %for.inc62.1, %for.end41 %flag2.2.lcssa = phi i32 [ %flag2.0.lcssa, %for.end41 ], [ %flag2.3.lcssa.unr, %for.body47.prol.loopexit ], [ %flag2.3.1, %for.inc62.1 ] %cmp68 = icmp eq i32 %flag2.2.lcssa, 1 %or.cond = select i1 %flag1.2, i1 %cmp68, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 200001, 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 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include <stdio.h> int main(){ int n,a,b,c,d; char s[200001]; scanf("%d %d %d %d %d",&n,&a,&b,&c,&d); scanf("%s",&s[1]); if (d>c) { while (b!=d && s[b]!='#') if (s[b+1]=='.') b++; else b+=2; if (s[b]=='#') { puts("No"); return 0; } while (a!=c && s[a]!='#') if (s[a+1]=='.') a++; else a+=2; if (s[a]=='#') puts("No"); else puts("Yes"); return 0; } while (b!=d && s[b]!='#' && (s[b+1]!='.' || s[b-1]!='.')) if (s[b+1]=='#') b+=2; else b++; if ((b==d && s[b+1]=='#') || s[b]=='#') { puts("No"); return 0; } s[b]='#'; while (a!=c && s[a]!='#') if (s[a+1]=='.') a++; else a+=2; if (s[a]=='#') { puts("No"); return 0; } s[b]='.'; while (b!=d && s[b]!='#') if (s[b+1]=='.') b++; else b+=2; if (s[b]=='#') puts("No"); else puts("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235746/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235746/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %s = alloca [200001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %arrayidx = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 1 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %0 = load i32, ptr %d, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %b.promoted207 = load i32, ptr %b, align 4, !tbaa !5 %cmp2.not209 = icmp eq i32 %b.promoted207, %0 br i1 %cmp, label %while.cond.preheader, label %while.cond55.preheader while.cond55.preheader: ; preds = %entry br i1 %cmp2.not209, label %land.lhs.true91, label %land.lhs.true while.cond.preheader: ; preds = %entry br i1 %cmp2.not209, label %while.end, label %land.rhs land.rhs: ; preds = %while.cond.preheader, %while.body %storemerge187208210 = phi i32 [ %storemerge187, %while.body ], [ %b.promoted207, %while.cond.preheader ] %idxprom = sext i32 %storemerge187208210 to i64 %arrayidx3 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom %2 = load i8, ptr %arrayidx3, align 1, !tbaa !9 %cmp4.not = icmp eq i8 %2, 35 br i1 %cmp4.not, label %while.end, label %while.body while.body: ; preds = %land.rhs %add = add nsw i32 %storemerge187208210, 1 %idxprom6 = sext i32 %add to i64 %arrayidx7 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom6 %3 = load i8, ptr %arrayidx7, align 1, !tbaa !9 %cmp9 = icmp eq i8 %3, 46 %add12 = add nsw i32 %storemerge187208210, 2 %storemerge187 = select i1 %cmp9, i32 %add, i32 %add12 store i32 %storemerge187, ptr %b, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %storemerge187, %0 br i1 %cmp2.not, label %while.end, label %land.rhs, !llvm.loop !10 while.end: ; preds = %land.rhs, %while.body, %while.cond.preheader %.lcssa188 = phi i32 [ %0, %while.cond.preheader ], [ %0, %while.body ], [ %storemerge187208210, %land.rhs ] %idxprom13 = sext i32 %.lcssa188 to i64 %arrayidx14 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom13 %4 = load i8, ptr %arrayidx14, align 1, !tbaa !9 %cmp16 = icmp eq i8 %4, 35 br i1 %cmp16, label %cleanup, label %while.cond21.preheader while.cond21.preheader: ; preds = %while.end %a.promoted213 = load i32, ptr %a, align 4, !tbaa !5 %cmp22.not215 = icmp eq i32 %a.promoted213, %1 br i1 %cmp22.not215, label %cleanup.sink.split, label %land.rhs24 land.rhs24: ; preds = %while.cond21.preheader, %while.body31 %storemerge186214216 = phi i32 [ %storemerge186, %while.body31 ], [ %a.promoted213, %while.cond21.preheader ] %idxprom25 = sext i32 %storemerge186214216 to i64 %arrayidx26 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom25 %5 = load i8, ptr %arrayidx26, align 1, !tbaa !9 %cmp28.not = icmp eq i8 %5, 35 br i1 %cmp28.not, label %cleanup.sink.split, label %while.body31 while.body31: ; preds = %land.rhs24 %add32 = add nsw i32 %storemerge186214216, 1 %idxprom33 = sext i32 %add32 to i64 %arrayidx34 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom33 %6 = load i8, ptr %arrayidx34, align 1, !tbaa !9 %cmp36 = icmp eq i8 %6, 46 %add41 = add nsw i32 %storemerge186214216, 2 %storemerge186 = select i1 %cmp36, i32 %add32, i32 %add41 store i32 %storemerge186, ptr %a, align 4, !tbaa !5 %cmp22.not = icmp eq i32 %storemerge186, %1 br i1 %cmp22.not, label %cleanup.sink.split, label %land.rhs24, !llvm.loop !12 land.lhs.true: ; preds = %while.cond55.preheader, %while.body76 %storemerge185193195 = phi i32 [ %storemerge185, %while.body76 ], [ %b.promoted207, %while.cond55.preheader ] %idxprom58 = sext i32 %storemerge185193195 to i64 %arrayidx59 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom58 %7 = load i8, ptr %arrayidx59, align 1, !tbaa !9 %cmp61.not = icmp eq i8 %7, 35 br i1 %cmp61.not, label %cleanup, label %land.rhs63 land.rhs63: ; preds = %land.lhs.true %add64 = add nsw i32 %storemerge185193195, 1 %idxprom65 = sext i32 %add64 to i64 %arrayidx66 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom65 %8 = load i8, ptr %arrayidx66, align 1, !tbaa !9 %cmp68.not = icmp eq i8 %8, 46 br i1 %cmp68.not, label %lor.rhs, label %while.body76 lor.rhs: ; preds = %land.rhs63 %sub = add nsw i32 %storemerge185193195, -1 %idxprom70 = sext i32 %sub to i64 %arrayidx71 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom70 %9 = load i8, ptr %arrayidx71, align 1, !tbaa !9 %cmp73.not = icmp eq i8 %9, 46 br i1 %cmp73.not, label %if.end105, label %while.body76 while.body76: ; preds = %land.rhs63, %lor.rhs %cmp81 = icmp eq i8 %8, 35 %add84 = add nsw i32 %storemerge185193195, 2 %storemerge185 = select i1 %cmp81, i32 %add84, i32 %add64 store i32 %storemerge185, ptr %b, align 4, !tbaa !5 %cmp56.not = icmp eq i32 %storemerge185, %0 br i1 %cmp56.not, label %land.lhs.true91, label %land.lhs.true, !llvm.loop !13 land.lhs.true91: ; preds = %while.body76, %while.cond55.preheader %add92 = add nsw i32 %0, 1 %idxprom93 = sext i32 %add92 to i64 %arrayidx94 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom93 %10 = load i8, ptr %arrayidx94, align 1, !tbaa !9 %cmp96 = icmp eq i8 %10, 35 br i1 %cmp96, label %cleanup, label %lor.lhs.false lor.lhs.false: ; preds = %land.lhs.true91 %idxprom98.phi.trans.insert = sext i32 %0 to i64 %arrayidx99.phi.trans.insert = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom98.phi.trans.insert %.pre = load i8, ptr %arrayidx99.phi.trans.insert, align 1, !tbaa !9 %cmp101 = icmp eq i8 %.pre, 35 br i1 %cmp101, label %cleanup, label %if.end105 if.end105: ; preds = %lor.rhs, %lor.lhs.false %idxprom58.pn = phi i64 [ %idxprom98.phi.trans.insert, %lor.lhs.false ], [ %idxprom58, %lor.rhs ] %b.promoted201231 = phi i32 [ %0, %lor.lhs.false ], [ %storemerge185193195, %lor.rhs ] %arrayidx99232 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom58.pn store i8 35, ptr %arrayidx99232, align 1, !tbaa !9 %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %cmp109.not197 = icmp eq i32 %a.promoted, %1 br i1 %cmp109.not197, label %while.end130, label %land.rhs111 land.rhs111: ; preds = %if.end105, %while.body118 %storemerge184196198 = phi i32 [ %storemerge184, %while.body118 ], [ %a.promoted, %if.end105 ] %idxprom112 = sext i32 %storemerge184196198 to i64 %arrayidx113 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom112 %11 = load i8, ptr %arrayidx113, align 1, !tbaa !9 %cmp115.not = icmp eq i8 %11, 35 br i1 %cmp115.not, label %while.end130, label %while.body118 while.body118: ; preds = %land.rhs111 %add119 = add nsw i32 %storemerge184196198, 1 %idxprom120 = sext i32 %add119 to i64 %arrayidx121 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom120 %12 = load i8, ptr %arrayidx121, align 1, !tbaa !9 %cmp123 = icmp eq i8 %12, 46 %add128 = add nsw i32 %storemerge184196198, 2 %storemerge184 = select i1 %cmp123, i32 %add119, i32 %add128 store i32 %storemerge184, ptr %a, align 4, !tbaa !5 %cmp109.not = icmp eq i32 %storemerge184, %1 br i1 %cmp109.not, label %while.end130, label %land.rhs111, !llvm.loop !14 while.end130: ; preds = %land.rhs111, %while.body118, %if.end105 %.lcssa190 = phi i32 [ %1, %if.end105 ], [ %1, %while.body118 ], [ %storemerge184196198, %land.rhs111 ] %idxprom131 = sext i32 %.lcssa190 to i64 %arrayidx132 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom131 %13 = load i8, ptr %arrayidx132, align 1, !tbaa !9 %cmp134 = icmp eq i8 %13, 35 br i1 %cmp134, label %cleanup, label %if.end138 if.end138: ; preds = %while.end130 store i8 46, ptr %arrayidx99232, align 1, !tbaa !9 %cmp142.not203 = icmp eq i32 %b.promoted201231, %0 br i1 %cmp142.not203, label %cleanup.sink.split, label %land.rhs144 land.rhs144: ; preds = %if.end138, %while.body151 %storemerge202204 = phi i32 [ %storemerge, %while.body151 ], [ %b.promoted201231, %if.end138 ] %idxprom145 = sext i32 %storemerge202204 to i64 %arrayidx146 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom145 %14 = load i8, ptr %arrayidx146, align 1, !tbaa !9 %cmp148.not = icmp eq i8 %14, 35 br i1 %cmp148.not, label %cleanup.sink.split, label %while.body151 while.body151: ; preds = %land.rhs144 %add152 = add nsw i32 %storemerge202204, 1 %idxprom153 = sext i32 %add152 to i64 %arrayidx154 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom153 %15 = load i8, ptr %arrayidx154, align 1, !tbaa !9 %cmp156 = icmp eq i8 %15, 46 %add161 = add nsw i32 %storemerge202204, 2 %storemerge = select i1 %cmp156, i32 %add152, i32 %add161 store i32 %storemerge, ptr %b, align 4, !tbaa !5 %cmp142.not = icmp eq i32 %storemerge, %0 br i1 %cmp142.not, label %cleanup.sink.split, label %land.rhs144, !llvm.loop !15 cleanup.sink.split: ; preds = %while.body151, %land.rhs144, %while.body31, %land.rhs24, %if.end138, %while.cond21.preheader %.lcssa189.sink = phi i32 [ %1, %while.cond21.preheader ], [ %0, %if.end138 ], [ %1, %while.body31 ], [ %storemerge186214216, %land.rhs24 ], [ %0, %while.body151 ], [ %storemerge202204, %land.rhs144 ] %idxprom164 = sext i32 %.lcssa189.sink to i64 %arrayidx165 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %idxprom164 %16 = load i8, ptr %arrayidx165, align 1, !tbaa !9 %cmp167 = icmp eq i8 %16, 35 %.str.2..str.3237 = select i1 %cmp167, ptr @.str.2, ptr @.str.3 br label %cleanup cleanup: ; preds = %land.lhs.true, %cleanup.sink.split, %while.end130, %land.lhs.true91, %lor.lhs.false, %while.end %.str.2.sink = phi ptr [ @.str.2, %while.end ], [ @.str.2, %lor.lhs.false ], [ @.str.2, %land.lhs.true91 ], [ @.str.2, %while.end130 ], [ %.str.2..str.3237, %cleanup.sink.split ], [ @.str.2, %land.lhs.true ] %call170 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main() { int n,k,x,i; scanf("%d%d%d",&n,&k,&x); int a[100005],sum=0; for(i=1;i<=n;i++) { scanf("%d",&a[i]); sum+=a[i]; } int t=0,p=k; i=0; while(k>0) { t+=a[n-i]; i++; k--; } if(t>x*p) { sum=sum-t+x*p; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23579/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %x = alloca i32, align 4 %a = alloca [100005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %x) call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 1 br i1 %cmp.not24, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %sum.025 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.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.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp428 = icmp sgt i32 %4, 0 br i1 %cmp428, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %for.end %5 = sext i32 %.lcssa to i64 %wide.trip.count = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %while.body.preheader43, label %vector.ph vector.ph: ; preds = %while.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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %6 = sub nsw i64 %5, %index %7 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %6 %8 = getelementptr inbounds i32, ptr %7, i64 -3 %wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5 %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %9 = getelementptr inbounds i32, ptr %7, i64 -7 %wide.load41 = load <4 x i32>, ptr %9, align 4, !tbaa !5 %reverse42 = shufflevector <4 x i32> %wide.load41, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %10 = add <4 x i32> %reverse, %vec.phi %11 = add <4 x i32> %reverse42, %vec.phi40 %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 !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %while.cond.while.end_crit_edge, label %while.body.preheader43 while.body.preheader43: ; preds = %while.body.preheader, %middle.block %indvars.iv34.ph = phi i64 [ 0, %while.body.preheader ], [ %n.vec, %middle.block ] %t.029.ph = phi i32 [ 0, %while.body.preheader ], [ %13, %middle.block ] br label %while.body while.body: ; preds = %while.body.preheader43, %while.body %indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body ], [ %indvars.iv34.ph, %while.body.preheader43 ] %t.029 = phi i32 [ %add7, %while.body ], [ %t.029.ph, %while.body.preheader43 ] %14 = sub nsw i64 %5, %indvars.iv34 %arrayidx6 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %14 %15 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add7 = add nsw i32 %15, %t.029 %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1 %exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count br i1 %exitcond.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !14 while.cond.while.end_crit_edge: ; preds = %while.body, %middle.block %add7.lcssa = phi i32 [ %13, %middle.block ], [ %add7, %while.body ] store i32 0, ptr %k, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %for.end %t.0.lcssa = phi i32 [ %add7.lcssa, %while.cond.while.end_crit_edge ], [ 0, %for.end ] %16 = load i32, ptr %x, align 4, !tbaa !5 %mul = mul nsw i32 %16, %4 %cmp9 = icmp sgt i32 %t.0.lcssa, %mul %sub10 = sub i32 %sum.0.lcssa, %t.0.lcssa %add12 = add nsw i32 %sub10, %mul %sum.1 = select i1 %cmp9, i32 %add12, i32 %sum.0.lcssa %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.1) call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, 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 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}
#include <stdio.h> int main(void) { int N; scanf("%d", &N); char S[N]; scanf("%s", S); int cnt = 0; for (int i = 0; i < N - 2; i++) { if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') { cnt++; } } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235832/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235832/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %1, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %3, 2 br i1 %cmp23, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %sub = add i32 %3, -2 %wide.trip.count = zext i32 %sub to i64 %invariant.gep = getelementptr i8, ptr %vla, i64 2 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %sub, 1 br i1 %4, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %cnt.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %14, %for.inc.1 ] %cnt.024.unr = phi i32 [ 0, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.unr %5 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp2.epil = icmp eq i8 %5, 65 br i1 %cmp2.epil, label %land.lhs.true.epil, label %for.cond.cleanup land.lhs.true.epil: ; preds = %for.body.epil %6 = getelementptr i8, ptr %vla, i64 %indvars.iv.unr %arrayidx5.epil = getelementptr i8, ptr %6, i64 1 %7 = load i8, ptr %arrayidx5.epil, align 1, !tbaa !9 %cmp7.epil = icmp eq i8 %7, 66 br i1 %cmp7.epil, label %land.lhs.true9.epil, label %for.cond.cleanup land.lhs.true9.epil: ; preds = %land.lhs.true.epil %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr %8 = load i8, ptr %gep.epil, align 1, !tbaa !9 %cmp14.epil = icmp eq i8 %8, 67 %inc.epil = zext i1 %cmp14.epil to i32 %spec.select.epil = add nsw i32 %cnt.024.unr, %inc.epil br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %land.lhs.true9.epil, %land.lhs.true.epil, %for.body.epil, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select.epil, %land.lhs.true9.epil ], [ %cnt.024.unr, %land.lhs.true.epil ], [ %cnt.024.unr, %for.body.epil ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %14, %for.inc.1 ] %cnt.024 = phi i32 [ 0, %for.body.preheader.new ], [ %cnt.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %9 = load i8, ptr %arrayidx, align 2, !tbaa !9 %cmp2 = icmp eq i8 %9, 65 %10 = or i64 %indvars.iv, 1 br i1 %cmp2, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx5 = getelementptr inbounds i8, ptr %vla, i64 %10 %11 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %cmp7 = icmp eq i8 %11, 66 br i1 %cmp7, label %land.lhs.true9, label %for.inc land.lhs.true9: ; preds = %land.lhs.true %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv %12 = load i8, ptr %gep, align 2, !tbaa !9 %cmp14 = icmp eq i8 %12, 67 %inc = zext i1 %cmp14 to i32 %spec.select = add nsw i32 %cnt.024, %inc br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true9, %land.lhs.true %cnt.1 = phi i32 [ %spec.select, %land.lhs.true9 ], [ %cnt.024, %land.lhs.true ], [ %cnt.024, %for.body ] %arrayidx.1 = getelementptr inbounds i8, ptr %vla, i64 %10 %13 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp2.1 = icmp eq i8 %13, 65 %14 = add nuw nsw i64 %indvars.iv, 2 br i1 %cmp2.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %arrayidx5.1 = getelementptr inbounds i8, ptr %vla, i64 %14 %15 = load i8, ptr %arrayidx5.1, align 2, !tbaa !9 %cmp7.1 = icmp eq i8 %15, 66 br i1 %cmp7.1, label %land.lhs.true9.1, label %for.inc.1 land.lhs.true9.1: ; preds = %land.lhs.true.1 %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %10 %16 = load i8, ptr %gep.1, align 1, !tbaa !9 %cmp14.1 = icmp eq i8 %16, 67 %inc.1 = zext i1 %cmp14.1 to i32 %spec.select.1 = add nsw i32 %cnt.1, %inc.1 br label %for.inc.1 for.inc.1: ; preds = %land.lhs.true9.1, %land.lhs.true.1, %for.inc %cnt.1.1 = phi i32 [ %spec.select.1, %land.lhs.true9.1 ], [ %cnt.1, %land.lhs.true.1 ], [ %cnt.1, %for.inc ] %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.cond.cleanup.loopexit.unr-lcssa, label %for.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: 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int n,i,m=0; char s[54]; scanf("%d%s",&n,s); for(i=0;i<n;i++) if((s[i]=='A')&&(s[i+1]=='B')&&(s[i+2]=='C')) m++; printf("%d",m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235876/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235876/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca [54 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 54, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %8, %for.inc.1 ] %m.024 = phi i32 [ 0, %for.body.preheader.new ], [ %m.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 2, !tbaa !9 %cmp1 = icmp eq i8 %2, 65 %3 = or i64 %indvars.iv, 1 br i1 %cmp1, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx4 = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %3 %4 = load i8, ptr %arrayidx4, align 1, !tbaa !9 %cmp6 = icmp eq i8 %4, 66 br i1 %cmp6, label %land.lhs.true8, label %for.inc land.lhs.true8: ; preds = %land.lhs.true %5 = add nuw nsw i64 %indvars.iv, 2 %arrayidx11 = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %5 %6 = load i8, ptr %arrayidx11, align 2, !tbaa !9 %cmp13 = icmp eq i8 %6, 67 %inc = zext i1 %cmp13 to i32 %spec.select = add nsw i32 %m.024, %inc br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true8, %land.lhs.true %m.1 = phi i32 [ %spec.select, %land.lhs.true8 ], [ %m.024, %land.lhs.true ], [ %m.024, %for.body ] %arrayidx.1 = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %3 %7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp1.1 = icmp eq i8 %7, 65 %8 = add nuw nsw i64 %indvars.iv, 2 br i1 %cmp1.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %arrayidx4.1 = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %8 %9 = load i8, ptr %arrayidx4.1, align 2, !tbaa !9 %cmp6.1 = icmp eq i8 %9, 66 br i1 %cmp6.1, label %land.lhs.true8.1, label %for.inc.1 land.lhs.true8.1: ; preds = %land.lhs.true.1 %10 = add nuw nsw i64 %indvars.iv, 3 %arrayidx11.1 = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %10 %11 = load i8, ptr %arrayidx11.1, align 1, !tbaa !9 %cmp13.1 = icmp eq i8 %11, 67 %inc.1 = zext i1 %cmp13.1 to i32 %spec.select.1 = add nsw i32 %m.1, %inc.1 br label %for.inc.1 for.inc.1: ; preds = %land.lhs.true8.1, %land.lhs.true.1, %for.inc %m.1.1 = phi i32 [ %spec.select.1, %land.lhs.true8.1 ], [ %m.1, %land.lhs.true.1 ], [ %m.1, %for.inc ] %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 !10 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %m.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %m.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %8, %for.inc.1 ] %m.024.unr = phi i32 [ 0, %for.body.preheader ], [ %m.1.1, %for.inc.1 ] %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 %arrayidx.epil = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %12 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp1.epil = icmp eq i8 %12, 65 br i1 %cmp1.epil, label %land.lhs.true.epil, label %for.end land.lhs.true.epil: ; preds = %for.body.epil %13 = add nuw nsw i64 %indvars.iv.unr, 1 %arrayidx4.epil = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %13 %14 = load i8, ptr %arrayidx4.epil, align 1, !tbaa !9 %cmp6.epil = icmp eq i8 %14, 66 br i1 %cmp6.epil, label %land.lhs.true8.epil, label %for.end land.lhs.true8.epil: ; preds = %land.lhs.true.epil %15 = add nuw nsw i64 %indvars.iv.unr, 2 %arrayidx11.epil = getelementptr inbounds [54 x i8], ptr %s, i64 0, i64 %15 %16 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !9 %cmp13.epil = icmp eq i8 %16, 67 %inc.epil = zext i1 %cmp13.epil to i32 %spec.select.epil = add nsw i32 %m.024.unr, %inc.epil br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %land.lhs.true8.epil, %land.lhs.true.epil, %for.body.epil, %entry %m.0.lcssa = phi i32 [ 0, %entry ], [ %m.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %land.lhs.true8.epil ], [ %m.024.unr, %land.lhs.true.epil ], [ %m.024.unr, %for.body.epil ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa) call void @llvm.lifetime.end.p0(i64 54, ptr nonnull %s) #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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main (){ int X=0; char str[50]; scanf("%d",&X); scanf("%s",str); int n = 0; for(int i = 0; i <48;i++){ if('A' == str[i] ){ if('B' == str[i+1]){ if('C' == str[i+2]){ n++; } } } } printf("%d",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235926/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235926/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 %str = alloca [50 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 store i32 0, ptr %X, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str) %wide.load = load <4 x i8>, ptr %str, align 16, !tbaa !9 %0 = icmp ne <4 x i8> %wide.load, <i8 65, i8 65, i8 65, i8 65> %1 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 1 %wide.load31 = load <4 x i8>, ptr %1, align 1, !tbaa !9 %2 = icmp eq <4 x i8> %wide.load31, <i8 66, i8 66, i8 66, i8 66> %3 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 2 %wide.load32 = load <4 x i8>, ptr %3, align 2, !tbaa !9 %4 = icmp eq <4 x i8> %wide.load32, <i8 67, i8 67, i8 67, i8 67> %.not35 = select <4 x i1> %0, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %2 %not. = xor <4 x i1> %0, <i1 true, i1 true, i1 true, i1 true> %5 = select <4 x i1> %not., <4 x i1> %.not35, <4 x i1> zeroinitializer %narrow36 = select <4 x i1> %5, <4 x i1> %4, <4 x i1> zeroinitializer %predphi = zext <4 x i1> %narrow36 to <4 x i32> %6 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 4 %wide.load.1 = load <4 x i8>, ptr %6, align 4, !tbaa !9 %7 = icmp ne <4 x i8> %wide.load.1, <i8 65, i8 65, i8 65, i8 65> %8 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 5 %wide.load31.1 = load <4 x i8>, ptr %8, align 1, !tbaa !9 %9 = icmp eq <4 x i8> %wide.load31.1, <i8 66, i8 66, i8 66, i8 66> %10 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 6 %wide.load32.1 = load <4 x i8>, ptr %10, align 2, !tbaa !9 %11 = icmp eq <4 x i8> %wide.load32.1, <i8 67, i8 67, i8 67, i8 67> %.not35.1 = select <4 x i1> %7, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %9 %not..1 = xor <4 x i1> %7, <i1 true, i1 true, i1 true, i1 true> %12 = select <4 x i1> %not..1, <4 x i1> %.not35.1, <4 x i1> zeroinitializer %narrow36.1 = select <4 x i1> %12, <4 x i1> %11, <4 x i1> zeroinitializer %predphi.1 = zext <4 x i1> %narrow36.1 to <4 x i32> %predphi33.1 = add nuw nsw <4 x i32> %predphi, %predphi.1 %13 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 8 %wide.load.2 = load <4 x i8>, ptr %13, align 8, !tbaa !9 %14 = icmp ne <4 x i8> %wide.load.2, <i8 65, i8 65, i8 65, i8 65> %15 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 9 %wide.load31.2 = load <4 x i8>, ptr %15, align 1, !tbaa !9 %16 = icmp eq <4 x i8> %wide.load31.2, <i8 66, i8 66, i8 66, i8 66> %17 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 10 %wide.load32.2 = load <4 x i8>, ptr %17, align 2, !tbaa !9 %18 = icmp eq <4 x i8> %wide.load32.2, <i8 67, i8 67, i8 67, i8 67> %.not35.2 = select <4 x i1> %14, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %16 %not..2 = xor <4 x i1> %14, <i1 true, i1 true, i1 true, i1 true> %19 = select <4 x i1> %not..2, <4 x i1> %.not35.2, <4 x i1> zeroinitializer %narrow36.2 = select <4 x i1> %19, <4 x i1> %18, <4 x i1> zeroinitializer %predphi.2 = zext <4 x i1> %narrow36.2 to <4 x i32> %predphi33.2 = add nuw nsw <4 x i32> %predphi33.1, %predphi.2 %20 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 12 %wide.load.3 = load <4 x i8>, ptr %20, align 4, !tbaa !9 %21 = icmp ne <4 x i8> %wide.load.3, <i8 65, i8 65, i8 65, i8 65> %22 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 13 %wide.load31.3 = load <4 x i8>, ptr %22, align 1, !tbaa !9 %23 = icmp eq <4 x i8> %wide.load31.3, <i8 66, i8 66, i8 66, i8 66> %24 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 14 %wide.load32.3 = load <4 x i8>, ptr %24, align 2, !tbaa !9 %25 = icmp eq <4 x i8> %wide.load32.3, <i8 67, i8 67, i8 67, i8 67> %.not35.3 = select <4 x i1> %21, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %23 %not..3 = xor <4 x i1> %21, <i1 true, i1 true, i1 true, i1 true> %26 = select <4 x i1> %not..3, <4 x i1> %.not35.3, <4 x i1> zeroinitializer %narrow36.3 = select <4 x i1> %26, <4 x i1> %25, <4 x i1> zeroinitializer %predphi.3 = zext <4 x i1> %narrow36.3 to <4 x i32> %predphi33.3 = add nuw nsw <4 x i32> %predphi33.2, %predphi.3 %27 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 16 %wide.load.4 = load <4 x i8>, ptr %27, align 16, !tbaa !9 %28 = icmp ne <4 x i8> %wide.load.4, <i8 65, i8 65, i8 65, i8 65> %29 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 17 %wide.load31.4 = load <4 x i8>, ptr %29, align 1, !tbaa !9 %30 = icmp eq <4 x i8> %wide.load31.4, <i8 66, i8 66, i8 66, i8 66> %31 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 18 %wide.load32.4 = load <4 x i8>, ptr %31, align 2, !tbaa !9 %32 = icmp eq <4 x i8> %wide.load32.4, <i8 67, i8 67, i8 67, i8 67> %.not35.4 = select <4 x i1> %28, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %30 %not..4 = xor <4 x i1> %28, <i1 true, i1 true, i1 true, i1 true> %33 = select <4 x i1> %not..4, <4 x i1> %.not35.4, <4 x i1> zeroinitializer %narrow36.4 = select <4 x i1> %33, <4 x i1> %32, <4 x i1> zeroinitializer %predphi.4 = zext <4 x i1> %narrow36.4 to <4 x i32> %predphi33.4 = add nuw nsw <4 x i32> %predphi33.3, %predphi.4 %34 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 20 %wide.load.5 = load <4 x i8>, ptr %34, align 4, !tbaa !9 %35 = icmp ne <4 x i8> %wide.load.5, <i8 65, i8 65, i8 65, i8 65> %36 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 21 %wide.load31.5 = load <4 x i8>, ptr %36, align 1, !tbaa !9 %37 = icmp eq <4 x i8> %wide.load31.5, <i8 66, i8 66, i8 66, i8 66> %38 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 22 %wide.load32.5 = load <4 x i8>, ptr %38, align 2, !tbaa !9 %39 = icmp eq <4 x i8> %wide.load32.5, <i8 67, i8 67, i8 67, i8 67> %.not35.5 = select <4 x i1> %35, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %37 %not..5 = xor <4 x i1> %35, <i1 true, i1 true, i1 true, i1 true> %40 = select <4 x i1> %not..5, <4 x i1> %.not35.5, <4 x i1> zeroinitializer %narrow36.5 = select <4 x i1> %40, <4 x i1> %39, <4 x i1> zeroinitializer %predphi.5 = zext <4 x i1> %narrow36.5 to <4 x i32> %predphi33.5 = add nuw nsw <4 x i32> %predphi33.4, %predphi.5 %41 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 24 %wide.load.6 = load <4 x i8>, ptr %41, align 8, !tbaa !9 %42 = icmp ne <4 x i8> %wide.load.6, <i8 65, i8 65, i8 65, i8 65> %43 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 25 %wide.load31.6 = load <4 x i8>, ptr %43, align 1, !tbaa !9 %44 = icmp eq <4 x i8> %wide.load31.6, <i8 66, i8 66, i8 66, i8 66> %45 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 26 %wide.load32.6 = load <4 x i8>, ptr %45, align 2, !tbaa !9 %46 = icmp eq <4 x i8> %wide.load32.6, <i8 67, i8 67, i8 67, i8 67> %.not35.6 = select <4 x i1> %42, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %44 %not..6 = xor <4 x i1> %42, <i1 true, i1 true, i1 true, i1 true> %47 = select <4 x i1> %not..6, <4 x i1> %.not35.6, <4 x i1> zeroinitializer %narrow36.6 = select <4 x i1> %47, <4 x i1> %46, <4 x i1> zeroinitializer %predphi.6 = zext <4 x i1> %narrow36.6 to <4 x i32> %predphi33.6 = add nuw nsw <4 x i32> %predphi33.5, %predphi.6 %48 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 28 %wide.load.7 = load <4 x i8>, ptr %48, align 4, !tbaa !9 %49 = icmp ne <4 x i8> %wide.load.7, <i8 65, i8 65, i8 65, i8 65> %50 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 29 %wide.load31.7 = load <4 x i8>, ptr %50, align 1, !tbaa !9 %51 = icmp eq <4 x i8> %wide.load31.7, <i8 66, i8 66, i8 66, i8 66> %52 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 30 %wide.load32.7 = load <4 x i8>, ptr %52, align 2, !tbaa !9 %53 = icmp eq <4 x i8> %wide.load32.7, <i8 67, i8 67, i8 67, i8 67> %.not35.7 = select <4 x i1> %49, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %51 %not..7 = xor <4 x i1> %49, <i1 true, i1 true, i1 true, i1 true> %54 = select <4 x i1> %not..7, <4 x i1> %.not35.7, <4 x i1> zeroinitializer %narrow36.7 = select <4 x i1> %54, <4 x i1> %53, <4 x i1> zeroinitializer %predphi.7 = zext <4 x i1> %narrow36.7 to <4 x i32> %predphi33.7 = add <4 x i32> %predphi33.6, %predphi.7 %55 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 32 %wide.load.8 = load <4 x i8>, ptr %55, align 16, !tbaa !9 %56 = icmp ne <4 x i8> %wide.load.8, <i8 65, i8 65, i8 65, i8 65> %57 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 33 %wide.load31.8 = load <4 x i8>, ptr %57, align 1, !tbaa !9 %58 = icmp eq <4 x i8> %wide.load31.8, <i8 66, i8 66, i8 66, i8 66> %59 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 34 %wide.load32.8 = load <4 x i8>, ptr %59, align 2, !tbaa !9 %60 = icmp eq <4 x i8> %wide.load32.8, <i8 67, i8 67, i8 67, i8 67> %.not35.8 = select <4 x i1> %56, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %58 %not..8 = xor <4 x i1> %56, <i1 true, i1 true, i1 true, i1 true> %61 = select <4 x i1> %not..8, <4 x i1> %.not35.8, <4 x i1> zeroinitializer %narrow36.8 = select <4 x i1> %61, <4 x i1> %60, <4 x i1> zeroinitializer %predphi.8 = zext <4 x i1> %narrow36.8 to <4 x i32> %predphi33.8 = add <4 x i32> %predphi33.7, %predphi.8 %62 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 36 %wide.load.9 = load <4 x i8>, ptr %62, align 4, !tbaa !9 %63 = icmp ne <4 x i8> %wide.load.9, <i8 65, i8 65, i8 65, i8 65> %64 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 37 %wide.load31.9 = load <4 x i8>, ptr %64, align 1, !tbaa !9 %65 = icmp eq <4 x i8> %wide.load31.9, <i8 66, i8 66, i8 66, i8 66> %66 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 38 %wide.load32.9 = load <4 x i8>, ptr %66, align 2, !tbaa !9 %67 = icmp eq <4 x i8> %wide.load32.9, <i8 67, i8 67, i8 67, i8 67> %.not35.9 = select <4 x i1> %63, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %65 %not..9 = xor <4 x i1> %63, <i1 true, i1 true, i1 true, i1 true> %68 = select <4 x i1> %not..9, <4 x i1> %.not35.9, <4 x i1> zeroinitializer %narrow36.9 = select <4 x i1> %68, <4 x i1> %67, <4 x i1> zeroinitializer %predphi.9 = zext <4 x i1> %narrow36.9 to <4 x i32> %predphi33.9 = add <4 x i32> %predphi33.8, %predphi.9 %69 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 40 %wide.load.10 = load <4 x i8>, ptr %69, align 8, !tbaa !9 %70 = icmp ne <4 x i8> %wide.load.10, <i8 65, i8 65, i8 65, i8 65> %71 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 41 %wide.load31.10 = load <4 x i8>, ptr %71, align 1, !tbaa !9 %72 = icmp eq <4 x i8> %wide.load31.10, <i8 66, i8 66, i8 66, i8 66> %73 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 42 %wide.load32.10 = load <4 x i8>, ptr %73, align 2, !tbaa !9 %74 = icmp eq <4 x i8> %wide.load32.10, <i8 67, i8 67, i8 67, i8 67> %.not35.10 = select <4 x i1> %70, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %72 %not..10 = xor <4 x i1> %70, <i1 true, i1 true, i1 true, i1 true> %75 = select <4 x i1> %not..10, <4 x i1> %.not35.10, <4 x i1> zeroinitializer %narrow36.10 = select <4 x i1> %75, <4 x i1> %74, <4 x i1> zeroinitializer %predphi.10 = zext <4 x i1> %narrow36.10 to <4 x i32> %predphi33.10 = add <4 x i32> %predphi33.9, %predphi.10 %76 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 44 %wide.load.11 = load <4 x i8>, ptr %76, align 4, !tbaa !9 %77 = icmp ne <4 x i8> %wide.load.11, <i8 65, i8 65, i8 65, i8 65> %78 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 45 %wide.load31.11 = load <4 x i8>, ptr %78, align 1, !tbaa !9 %79 = icmp eq <4 x i8> %wide.load31.11, <i8 66, i8 66, i8 66, i8 66> %80 = getelementptr inbounds [50 x i8], ptr %str, i64 0, i64 46 %wide.load32.11 = load <4 x i8>, ptr %80, align 2, !tbaa !9 %81 = icmp eq <4 x i8> %wide.load32.11, <i8 67, i8 67, i8 67, i8 67> %.not35.11 = select <4 x i1> %77, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %79 %not..11 = xor <4 x i1> %77, <i1 true, i1 true, i1 true, i1 true> %82 = select <4 x i1> %not..11, <4 x i1> %.not35.11, <4 x i1> zeroinitializer %narrow36.11 = select <4 x i1> %82, <4 x i1> %81, <4 x i1> zeroinitializer %predphi.11 = zext <4 x i1> %narrow36.11 to <4 x i32> %predphi33.11 = add <4 x i32> %predphi33.10, %predphi.11 %83 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi33.11) %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %83) call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %str) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> int main() { int n,k,x,i,j,sum=0; scanf("%d %d %d",&n,&k,&x); for(i=0;i<n;i++) { scanf("%d",&j); if(i<n-k) sum=sum+j; } sum=sum+(k*x); printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23597/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23597/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %x = alloca i32, align 4 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = load i32, ptr %k, align 4, !tbaa !5 br label %for.end for.body: ; preds = %entry, %for.body %sum.011 = phi i32 [ %sum.1, %for.body ], [ 0, %entry ] %i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %j) %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %cmp2 = icmp slt i32 %i.010, %sub %3 = load i32, ptr %j, align 4 %add = select i1 %cmp2, i32 %3, i32 0 %sum.1 = add nsw i32 %add, %sum.011 %inc = add nuw nsw i32 %i.010, 1 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %4 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry.for.end_crit_edge ], [ %sum.1, %for.body ] %5 = load i32, ptr %x, align 4, !tbaa !5 %mul = mul nsw i32 %5, %4 %add3 = add nsw i32 %mul, %sum.0.lcssa %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int main() { /* code */ int n=0,e,a=0; char str[56] = {0}; int *p; //char d="A",b="B",c="C"; scanf("%d\n", &e); scanf("%s\n", str); p = (int *)malloc(e * sizeof(int)); while (str[n+2] != '\0') { /* str[n] が終端文字(ヌル文字 '\0')でない間繰り返す */ if(str[n]=='A'){ if(str[n+1]=='B'){ if(str[n+2]=='C'){ a++; } } } n++; } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %e = alloca i32, align 4 %str = alloca [56 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %str) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %str, i8 0, i64 56, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str) %arrayidx33 = getelementptr inbounds [56 x i8], ptr %str, i64 0, i64 2 %0 = load i8, ptr %arrayidx33, align 2, !tbaa !5 %cmp.not34 = icmp eq i8 %0, 0 br i1 %cmp.not34, label %while.end, label %while.body while.body: ; preds = %entry, %if.end25 %indvars.iv = phi i64 [ %3, %if.end25 ], [ 0, %entry ] %1 = phi i8 [ %6, %if.end25 ], [ %0, %entry ] %a.035 = phi i32 [ %a.1, %if.end25 ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [56 x i8], ptr %str, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp eq i8 %2, 65 %3 = add nuw i64 %indvars.iv, 1 br i1 %cmp8, label %if.then, label %if.end25 if.then: ; preds = %while.body %arrayidx12 = getelementptr inbounds [56 x i8], ptr %str, i64 0, i64 %3 %4 = load i8, ptr %arrayidx12, align 1, !tbaa !5 %cmp14 = icmp eq i8 %4, 66 %cmp21 = icmp eq i8 %1, 67 %or.cond = and i1 %cmp21, %cmp14 %inc = zext i1 %or.cond to i32 %spec.select = add nsw i32 %a.035, %inc br label %if.end25 if.end25: ; preds = %while.body, %if.then %a.1 = phi i32 [ %spec.select, %if.then ], [ %a.035, %while.body ] %5 = add nuw nsw i64 %indvars.iv, 3 %arrayidx = getelementptr inbounds [56 x i8], ptr %str, i64 0, i64 %5 %6 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %6, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %if.end25, %entry %a.0.lcssa = phi i32 [ 0, %entry ], [ %a.1, %if.end25 ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.0.lcssa) call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %str) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, count, i; count = 0; char str[100]; scanf("%d", &a); scanf("%s",str); for(i=0;i <= a - 2;i++) { if(str[i]=='A') { if(str[i+1] == 'B'){ if(str[i+2] == 'C'){ count++; } } } } printf("%d", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236055/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not26 = icmp slt i32 %0, 2 br i1 %cmp.not26, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = add i32 %0, -1 %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %1, 1 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %9, %for.inc.1 ] %count.027 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %indvars.iv %3 = load i8, ptr %arrayidx, align 2, !tbaa !9 %cmp2 = icmp eq i8 %3, 65 %4 = or i64 %indvars.iv, 1 br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx5 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %4 %5 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %cmp7 = icmp eq i8 %5, 66 br i1 %cmp7, label %if.then9, label %for.inc if.then9: ; preds = %if.then %6 = add nuw nsw i64 %indvars.iv, 2 %arrayidx12 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %6 %7 = load i8, ptr %arrayidx12, align 2, !tbaa !9 %cmp14 = icmp eq i8 %7, 67 %inc = zext i1 %cmp14 to i32 %spec.select = add nsw i32 %count.027, %inc br label %for.inc for.inc: ; preds = %for.body, %if.then9, %if.then %count.1 = phi i32 [ %spec.select, %if.then9 ], [ %count.027, %if.then ], [ %count.027, %for.body ] %arrayidx.1 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %4 %8 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp2.1 = icmp eq i8 %8, 65 %9 = add nuw nsw i64 %indvars.iv, 2 br i1 %cmp2.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %arrayidx5.1 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %9 %10 = load i8, ptr %arrayidx5.1, align 2, !tbaa !9 %cmp7.1 = icmp eq i8 %10, 66 br i1 %cmp7.1, label %if.then9.1, label %for.inc.1 if.then9.1: ; preds = %if.then.1 %11 = add nuw nsw i64 %indvars.iv, 3 %arrayidx12.1 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %11 %12 = load i8, ptr %arrayidx12.1, align 1, !tbaa !9 %cmp14.1 = icmp eq i8 %12, 67 %inc.1 = zext i1 %cmp14.1 to i32 %spec.select.1 = add nsw i32 %count.1, %inc.1 br label %for.inc.1 for.inc.1: ; preds = %if.then9.1, %if.then.1, %for.inc %count.1.1 = phi i32 [ %spec.select.1, %if.then9.1 ], [ %count.1, %if.then.1 ], [ %count.1, %for.inc ] %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 !10 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %count.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %9, %for.inc.1 ] %count.027.unr = phi i32 [ 0, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %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 %arrayidx.epil = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %indvars.iv.unr %13 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp2.epil = icmp eq i8 %13, 65 br i1 %cmp2.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %14 = add nuw nsw i64 %indvars.iv.unr, 1 %arrayidx5.epil = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %14 %15 = load i8, ptr %arrayidx5.epil, align 1, !tbaa !9 %cmp7.epil = icmp eq i8 %15, 66 br i1 %cmp7.epil, label %if.then9.epil, label %for.end if.then9.epil: ; preds = %if.then.epil %16 = add nuw nsw i64 %indvars.iv.unr, 2 %arrayidx12.epil = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %16 %17 = load i8, ptr %arrayidx12.epil, align 1, !tbaa !9 %cmp14.epil = icmp eq i8 %17, 67 %inc.epil = zext i1 %cmp14.epil to i32 %spec.select.epil = add nsw i32 %count.027.unr, %inc.epil br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then9.epil, %if.then.epil, %for.body.epil, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %if.then9.epil ], [ %count.027.unr, %if.then.epil ], [ %count.027.unr, %for.body.epil ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { int N,i,count=0; char S[50]; scanf("%d %s", &N,&S); for (i = 0; i < N; i++) { if (S[i] == 'A') { if (S[i + 1] == 'B') { if (S[i + 2] == 'C') { count++; } } } } printf("%d", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %S = alloca [50 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %S) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %8, %for.inc.1 ] %count.027 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 2, !tbaa !9 %cmp1 = icmp eq i8 %2, 65 %3 = or i64 %indvars.iv, 1 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx4 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %3 %4 = load i8, ptr %arrayidx4, align 1, !tbaa !9 %cmp6 = icmp eq i8 %4, 66 br i1 %cmp6, label %if.then8, label %for.inc if.then8: ; preds = %if.then %5 = add nuw nsw i64 %indvars.iv, 2 %arrayidx11 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %5 %6 = load i8, ptr %arrayidx11, align 2, !tbaa !9 %cmp13 = icmp eq i8 %6, 67 %inc = zext i1 %cmp13 to i32 %spec.select = add nsw i32 %count.027, %inc br label %for.inc for.inc: ; preds = %for.body, %if.then8, %if.then %count.1 = phi i32 [ %spec.select, %if.then8 ], [ %count.027, %if.then ], [ %count.027, %for.body ] %arrayidx.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %3 %7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp1.1 = icmp eq i8 %7, 65 %8 = add nuw nsw i64 %indvars.iv, 2 br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %arrayidx4.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %8 %9 = load i8, ptr %arrayidx4.1, align 2, !tbaa !9 %cmp6.1 = icmp eq i8 %9, 66 br i1 %cmp6.1, label %if.then8.1, label %for.inc.1 if.then8.1: ; preds = %if.then.1 %10 = add nuw nsw i64 %indvars.iv, 3 %arrayidx11.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %10 %11 = load i8, ptr %arrayidx11.1, align 1, !tbaa !9 %cmp13.1 = icmp eq i8 %11, 67 %inc.1 = zext i1 %cmp13.1 to i32 %spec.select.1 = add nsw i32 %count.1, %inc.1 br label %for.inc.1 for.inc.1: ; preds = %if.then8.1, %if.then.1, %for.inc %count.1.1 = phi i32 [ %spec.select.1, %if.then8.1 ], [ %count.1, %if.then.1 ], [ %count.1, %for.inc ] %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 !10 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %count.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %8, %for.inc.1 ] %count.027.unr = phi i32 [ 0, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %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 %arrayidx.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv.unr %12 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp1.epil = icmp eq i8 %12, 65 br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %13 = add nuw nsw i64 %indvars.iv.unr, 1 %arrayidx4.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %13 %14 = load i8, ptr %arrayidx4.epil, align 1, !tbaa !9 %cmp6.epil = icmp eq i8 %14, 66 br i1 %cmp6.epil, label %if.then8.epil, label %for.end if.then8.epil: ; preds = %if.then.epil %15 = add nuw nsw i64 %indvars.iv.unr, 2 %arrayidx11.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %15 %16 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !9 %cmp13.epil = icmp eq i8 %16, 67 %inc.epil = zext i1 %cmp13.epil to i32 %spec.select.epil = add nsw i32 %count.027.unr, %inc.epil br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then8.epil, %if.then.epil, %for.body.epil, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %if.then8.epil ], [ %count.027.unr, %if.then.epil ], [ %count.027.unr, %for.body.epil ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %S) #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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int a[3][10]={0},b[3][10]={0},c[3][10]={0},d[3][10]={0}; int n,i,o,t,f,r,v,j; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&t,&f,&r,&v); switch(t){ case 1:a[f-1][r-1]+=v;break; case 2:b[f-1][r-1]+=v;break; case 3:c[f-1][r-1]+=v;break; case 4:d[f-1][r-1]+=v;break; } } for(o=0;o<3;puts(""),o++) for(j=0;j<10;j++) printf(" %d",a[o][j]); for(i=0;i<20;i++) printf("#%s",i==19?"\n":""); for(o=0;o<3;puts(""),o++) for(j=0;j<10;j++) printf(" %d",b[o][j]); for(i=0;i<20;i++) printf("#%s",i==19?"\n":""); for(o=0;o<3;puts(""),o++) for(j=0;j<10;j++) printf(" %d",c[o][j]); for(i=0;i<20;i++) printf("#%s",i==19?"\n":""); for(o=0;o<3;puts(""),o++) for(j=0;j<10;j++) printf(" %d",d[o][j]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236149/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236149/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"#%s\00", align 1 @.str.5 = 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: %a = alloca [3 x [10 x i32]], align 16 %b = alloca [3 x [10 x i32]], align 16 %c = alloca [3 x [10 x i32]], align 16 %d = alloca [3 x [10 x i32]], align 16 %n = alloca i32, align 4 %t = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %a, i8 0, i64 120, i1 false) call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %b, i8 0, i64 120, i1 false) call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %c, i8 0, i64 120, i1 false) call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %d) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %d, i8 0, i64 120, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp162 = icmp sgt i32 %0, 0 br i1 %cmp162, label %for.body, label %for.cond29.preheader for.cond29.preheader.loopexit: ; preds = %for.inc %.pre = load i32, ptr %a, align 16, !tbaa !5 %arrayidx38.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 1 %.pre199 = load i32, ptr %arrayidx38.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 2 %.pre200 = load i32, ptr %arrayidx38.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.3.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 3 %.pre201 = load i32, ptr %arrayidx38.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.4.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 4 %.pre202 = load i32, ptr %arrayidx38.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.5.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 5 %.pre203 = load i32, ptr %arrayidx38.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.6.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 6 %.pre204 = load i32, ptr %arrayidx38.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.7.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 7 %.pre205 = load i32, ptr %arrayidx38.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.8.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 8 %.pre206 = load i32, ptr %arrayidx38.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.9.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 0, i64 9 %.pre207 = load i32, ptr %arrayidx38.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.1177.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 0 %.pre208 = load i32, ptr %arrayidx38.1177.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.1.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 1 %.pre209 = load i32, ptr %arrayidx38.1.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.2.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 2 %.pre210 = load i32, ptr %arrayidx38.2.1.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.3.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 3 %.pre211 = load i32, ptr %arrayidx38.3.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.4.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 4 %.pre212 = load i32, ptr %arrayidx38.4.1.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.5.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 5 %.pre213 = load i32, ptr %arrayidx38.5.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.6.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 6 %.pre214 = load i32, ptr %arrayidx38.6.1.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.7.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 7 %.pre215 = load i32, ptr %arrayidx38.7.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.8.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 8 %.pre216 = load i32, ptr %arrayidx38.8.1.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.9.1.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 1, i64 9 %.pre217 = load i32, ptr %arrayidx38.9.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.2179.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 0 %.pre218 = load i32, ptr %arrayidx38.2179.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.1.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 1 %.pre219 = load i32, ptr %arrayidx38.1.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.2.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 2 %.pre220 = load i32, ptr %arrayidx38.2.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.3.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 3 %.pre221 = load i32, ptr %arrayidx38.3.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.4.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 4 %.pre222 = load i32, ptr %arrayidx38.4.2.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.5.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 5 %.pre223 = load i32, ptr %arrayidx38.5.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.6.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 6 %.pre224 = load i32, ptr %arrayidx38.6.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx38.7.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 7 %.pre225 = load i32, ptr %arrayidx38.7.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx38.8.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 8 %.pre226 = load i32, ptr %arrayidx38.8.2.phi.trans.insert, align 16, !tbaa !5 %arrayidx38.9.2.phi.trans.insert = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 2, i64 9 %.pre227 = load i32, ptr %arrayidx38.9.2.phi.trans.insert, align 4, !tbaa !5 br label %for.cond29.preheader for.cond29.preheader: ; preds = %for.cond29.preheader.loopexit, %entry %1 = phi i32 [ %.pre227, %for.cond29.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre226, %for.cond29.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre225, %for.cond29.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre224, %for.cond29.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre223, %for.cond29.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre222, %for.cond29.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre221, %for.cond29.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre220, %for.cond29.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre219, %for.cond29.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre218, %for.cond29.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre217, %for.cond29.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre216, %for.cond29.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre215, %for.cond29.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre214, %for.cond29.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre213, %for.cond29.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre212, %for.cond29.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre211, %for.cond29.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre210, %for.cond29.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre209, %for.cond29.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre208, %for.cond29.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre207, %for.cond29.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre206, %for.cond29.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre205, %for.cond29.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre204, %for.cond29.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre203, %for.cond29.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre202, %for.cond29.preheader.loopexit ], [ 0, %entry ] %27 = phi i32 [ %.pre201, %for.cond29.preheader.loopexit ], [ 0, %entry ] %28 = phi i32 [ %.pre200, %for.cond29.preheader.loopexit ], [ 0, %entry ] %29 = phi i32 [ %.pre199, %for.cond29.preheader.loopexit ], [ 0, %entry ] %30 = phi i32 [ %.pre, %for.cond29.preheader.loopexit ], [ 0, %entry ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %call39.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %call39.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %call39.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %call39.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %call39.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %call39.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %call39.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %call39.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %call39.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %putchar161 = call i32 @putchar(i32 10) %call39.1178 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %call39.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %call39.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %call39.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %call39.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %call39.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %call39.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %call39.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %call39.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %call39.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %putchar161.1 = call i32 @putchar(i32 10) %call39.2180 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %call39.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %call39.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %call39.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %call39.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6) %call39.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) %call39.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4) %call39.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3) %call39.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2) %call39.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) %putchar161.2 = call i32 @putchar(i32 10) %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call51.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.5) %31 = load i32, ptr %b, align 16, !tbaa !5 %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx64.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 1 %32 = load i32, ptr %arrayidx64.1, align 4, !tbaa !5 %call65.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx64.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 2 %33 = load i32, ptr %arrayidx64.2, align 8, !tbaa !5 %call65.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx64.3 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 3 %34 = load i32, ptr %arrayidx64.3, align 4, !tbaa !5 %call65.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx64.4 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 4 %35 = load i32, ptr %arrayidx64.4, align 16, !tbaa !5 %call65.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx64.5 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 5 %36 = load i32, ptr %arrayidx64.5, align 4, !tbaa !5 %call65.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %arrayidx64.6 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 6 %37 = load i32, ptr %arrayidx64.6, align 8, !tbaa !5 %call65.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37) %arrayidx64.7 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 7 %38 = load i32, ptr %arrayidx64.7, align 4, !tbaa !5 %call65.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %38) %arrayidx64.8 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 8 %39 = load i32, ptr %arrayidx64.8, align 16, !tbaa !5 %call65.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39) %arrayidx64.9 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 0, i64 9 %40 = load i32, ptr %arrayidx64.9, align 4, !tbaa !5 %call65.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %40) %putchar160 = call i32 @putchar(i32 10) %arrayidx64.1183 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 0 %41 = load i32, ptr %arrayidx64.1183, align 8, !tbaa !5 %call65.1184 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %41) %arrayidx64.1.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 1 %42 = load i32, ptr %arrayidx64.1.1, align 4, !tbaa !5 %call65.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %42) %arrayidx64.2.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 2 %43 = load i32, ptr %arrayidx64.2.1, align 16, !tbaa !5 %call65.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %43) %arrayidx64.3.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 3 %44 = load i32, ptr %arrayidx64.3.1, align 4, !tbaa !5 %call65.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44) %arrayidx64.4.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 4 %45 = load i32, ptr %arrayidx64.4.1, align 8, !tbaa !5 %call65.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45) %arrayidx64.5.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 5 %46 = load i32, ptr %arrayidx64.5.1, align 4, !tbaa !5 %call65.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %46) %arrayidx64.6.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 6 %47 = load i32, ptr %arrayidx64.6.1, align 16, !tbaa !5 %call65.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %47) %arrayidx64.7.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 7 %48 = load i32, ptr %arrayidx64.7.1, align 4, !tbaa !5 %call65.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %48) %arrayidx64.8.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 8 %49 = load i32, ptr %arrayidx64.8.1, align 8, !tbaa !5 %call65.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %49) %arrayidx64.9.1 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 1, i64 9 %50 = load i32, ptr %arrayidx64.9.1, align 4, !tbaa !5 %call65.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %50) %putchar160.1 = call i32 @putchar(i32 10) %arrayidx64.2185 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 0 %51 = load i32, ptr %arrayidx64.2185, align 16, !tbaa !5 %call65.2186 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51) %arrayidx64.1.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 1 %52 = load i32, ptr %arrayidx64.1.2, align 4, !tbaa !5 %call65.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %52) %arrayidx64.2.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 2 %53 = load i32, ptr %arrayidx64.2.2, align 8, !tbaa !5 %call65.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %53) %arrayidx64.3.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 3 %54 = load i32, ptr %arrayidx64.3.2, align 4, !tbaa !5 %call65.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %54) %arrayidx64.4.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 4 %55 = load i32, ptr %arrayidx64.4.2, align 16, !tbaa !5 %call65.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %55) %arrayidx64.5.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 5 %56 = load i32, ptr %arrayidx64.5.2, align 4, !tbaa !5 %call65.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %56) %arrayidx64.6.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 6 %57 = load i32, ptr %arrayidx64.6.2, align 8, !tbaa !5 %call65.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %57) %arrayidx64.7.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 7 %58 = load i32, ptr %arrayidx64.7.2, align 4, !tbaa !5 %call65.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %58) %arrayidx64.8.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 8 %59 = load i32, ptr %arrayidx64.8.2, align 16, !tbaa !5 %call65.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %59) %arrayidx64.9.2 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 2, i64 9 %60 = load i32, ptr %arrayidx64.9.2, align 4, !tbaa !5 %call65.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60) %putchar160.2 = call i32 @putchar(i32 10) %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call78.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.5) %61 = load i32, ptr %c, align 16, !tbaa !5 %call92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %61) %arrayidx91.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 1 %62 = load i32, ptr %arrayidx91.1, align 4, !tbaa !5 %call92.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %62) %arrayidx91.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 2 %63 = load i32, ptr %arrayidx91.2, align 8, !tbaa !5 %call92.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %63) %arrayidx91.3 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 3 %64 = load i32, ptr %arrayidx91.3, align 4, !tbaa !5 %call92.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64) %arrayidx91.4 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 4 %65 = load i32, ptr %arrayidx91.4, align 16, !tbaa !5 %call92.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %65) %arrayidx91.5 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 5 %66 = load i32, ptr %arrayidx91.5, align 4, !tbaa !5 %call92.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %66) %arrayidx91.6 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 6 %67 = load i32, ptr %arrayidx91.6, align 8, !tbaa !5 %call92.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %67) %arrayidx91.7 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 7 %68 = load i32, ptr %arrayidx91.7, align 4, !tbaa !5 %call92.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %68) %arrayidx91.8 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 8 %69 = load i32, ptr %arrayidx91.8, align 16, !tbaa !5 %call92.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69) %arrayidx91.9 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 0, i64 9 %70 = load i32, ptr %arrayidx91.9, align 4, !tbaa !5 %call92.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70) %putchar159 = call i32 @putchar(i32 10) %arrayidx91.1189 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 0 %71 = load i32, ptr %arrayidx91.1189, align 8, !tbaa !5 %call92.1190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %71) %arrayidx91.1.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 1 %72 = load i32, ptr %arrayidx91.1.1, align 4, !tbaa !5 %call92.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %72) %arrayidx91.2.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 2 %73 = load i32, ptr %arrayidx91.2.1, align 16, !tbaa !5 %call92.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %73) %arrayidx91.3.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 3 %74 = load i32, ptr %arrayidx91.3.1, align 4, !tbaa !5 %call92.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %74) %arrayidx91.4.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 4 %75 = load i32, ptr %arrayidx91.4.1, align 8, !tbaa !5 %call92.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %75) %arrayidx91.5.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 5 %76 = load i32, ptr %arrayidx91.5.1, align 4, !tbaa !5 %call92.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %76) %arrayidx91.6.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 6 %77 = load i32, ptr %arrayidx91.6.1, align 16, !tbaa !5 %call92.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %77) %arrayidx91.7.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 7 %78 = load i32, ptr %arrayidx91.7.1, align 4, !tbaa !5 %call92.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %78) %arrayidx91.8.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 8 %79 = load i32, ptr %arrayidx91.8.1, align 8, !tbaa !5 %call92.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79) %arrayidx91.9.1 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 1, i64 9 %80 = load i32, ptr %arrayidx91.9.1, align 4, !tbaa !5 %call92.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %80) %putchar159.1 = call i32 @putchar(i32 10) %arrayidx91.2191 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 0 %81 = load i32, ptr %arrayidx91.2191, align 16, !tbaa !5 %call92.2192 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %81) %arrayidx91.1.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 1 %82 = load i32, ptr %arrayidx91.1.2, align 4, !tbaa !5 %call92.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %82) %arrayidx91.2.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 2 %83 = load i32, ptr %arrayidx91.2.2, align 8, !tbaa !5 %call92.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %83) %arrayidx91.3.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 3 %84 = load i32, ptr %arrayidx91.3.2, align 4, !tbaa !5 %call92.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %84) %arrayidx91.4.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 4 %85 = load i32, ptr %arrayidx91.4.2, align 16, !tbaa !5 %call92.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %85) %arrayidx91.5.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 5 %86 = load i32, ptr %arrayidx91.5.2, align 4, !tbaa !5 %call92.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %86) %arrayidx91.6.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 6 %87 = load i32, ptr %arrayidx91.6.2, align 8, !tbaa !5 %call92.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %87) %arrayidx91.7.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 7 %88 = load i32, ptr %arrayidx91.7.2, align 4, !tbaa !5 %call92.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %88) %arrayidx91.8.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 8 %89 = load i32, ptr %arrayidx91.8.2, align 16, !tbaa !5 %call92.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %89) %arrayidx91.9.2 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 2, i64 9 %90 = load i32, ptr %arrayidx91.9.2, align 4, !tbaa !5 %call92.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %90) %putchar159.2 = call i32 @putchar(i32 10) %call105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.3) %call105.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.5) %91 = load i32, ptr %d, align 16, !tbaa !5 %call119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %91) %arrayidx118.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 1 %92 = load i32, ptr %arrayidx118.1, align 4, !tbaa !5 %call119.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %92) %arrayidx118.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 2 %93 = load i32, ptr %arrayidx118.2, align 8, !tbaa !5 %call119.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %93) %arrayidx118.3 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 3 %94 = load i32, ptr %arrayidx118.3, align 4, !tbaa !5 %call119.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %94) %arrayidx118.4 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 4 %95 = load i32, ptr %arrayidx118.4, align 16, !tbaa !5 %call119.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %95) %arrayidx118.5 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 5 %96 = load i32, ptr %arrayidx118.5, align 4, !tbaa !5 %call119.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %96) %arrayidx118.6 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 6 %97 = load i32, ptr %arrayidx118.6, align 8, !tbaa !5 %call119.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %97) %arrayidx118.7 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 7 %98 = load i32, ptr %arrayidx118.7, align 4, !tbaa !5 %call119.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %98) %arrayidx118.8 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 8 %99 = load i32, ptr %arrayidx118.8, align 16, !tbaa !5 %call119.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %99) %arrayidx118.9 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 0, i64 9 %100 = load i32, ptr %arrayidx118.9, align 4, !tbaa !5 %call119.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %100) %putchar = call i32 @putchar(i32 10) %arrayidx118.1195 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 0 %101 = load i32, ptr %arrayidx118.1195, align 8, !tbaa !5 %call119.1196 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %101) %arrayidx118.1.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 1 %102 = load i32, ptr %arrayidx118.1.1, align 4, !tbaa !5 %call119.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %102) %arrayidx118.2.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 2 %103 = load i32, ptr %arrayidx118.2.1, align 16, !tbaa !5 %call119.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %103) %arrayidx118.3.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 3 %104 = load i32, ptr %arrayidx118.3.1, align 4, !tbaa !5 %call119.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %104) %arrayidx118.4.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 4 %105 = load i32, ptr %arrayidx118.4.1, align 8, !tbaa !5 %call119.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %105) %arrayidx118.5.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 5 %106 = load i32, ptr %arrayidx118.5.1, align 4, !tbaa !5 %call119.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %106) %arrayidx118.6.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 6 %107 = load i32, ptr %arrayidx118.6.1, align 16, !tbaa !5 %call119.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %107) %arrayidx118.7.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 7 %108 = load i32, ptr %arrayidx118.7.1, align 4, !tbaa !5 %call119.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %108) %arrayidx118.8.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 8 %109 = load i32, ptr %arrayidx118.8.1, align 8, !tbaa !5 %call119.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %109) %arrayidx118.9.1 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 1, i64 9 %110 = load i32, ptr %arrayidx118.9.1, align 4, !tbaa !5 %call119.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %110) %putchar.1 = call i32 @putchar(i32 10) %arrayidx118.2197 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 0 %111 = load i32, ptr %arrayidx118.2197, align 16, !tbaa !5 %call119.2198 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %111) %arrayidx118.1.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 1 %112 = load i32, ptr %arrayidx118.1.2, align 4, !tbaa !5 %call119.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %112) %arrayidx118.2.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 2 %113 = load i32, ptr %arrayidx118.2.2, align 8, !tbaa !5 %call119.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %113) %arrayidx118.3.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 3 %114 = load i32, ptr %arrayidx118.3.2, align 4, !tbaa !5 %call119.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %114) %arrayidx118.4.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 4 %115 = load i32, ptr %arrayidx118.4.2, align 16, !tbaa !5 %call119.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %115) %arrayidx118.5.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 5 %116 = load i32, ptr %arrayidx118.5.2, align 4, !tbaa !5 %call119.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %116) %arrayidx118.6.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 6 %117 = load i32, ptr %arrayidx118.6.2, align 8, !tbaa !5 %call119.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %117) %arrayidx118.7.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 7 %118 = load i32, ptr %arrayidx118.7.2, align 4, !tbaa !5 %call119.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %118) %arrayidx118.8.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 8 %119 = load i32, ptr %arrayidx118.8.2, align 16, !tbaa !5 %call119.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %119) %arrayidx118.9.2 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 2, i64 9 %120 = load i32, ptr %arrayidx118.9.2, align 4, !tbaa !5 %call119.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %120) %putchar.2 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a) #5 ret i32 0 for.body: ; preds = %entry, %for.inc %i.0163 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %121 = load i32, ptr %t, align 4, !tbaa !5 switch i32 %121, label %for.inc [ i32 1, label %sw.bb i32 2, label %sw.bb5 i32 3, label %sw.bb13 i32 4, label %sw.bb21 ] sw.bb: ; preds = %for.body %122 = load i32, ptr %f, align 4, !tbaa !5 %sub = add nsw i32 %122, -1 %idxprom = sext i32 %sub to i64 %123 = load i32, ptr %r, align 4, !tbaa !5 %sub2 = add nsw i32 %123, -1 %idxprom3 = sext i32 %sub2 to i64 %arrayidx4 = getelementptr inbounds [3 x [10 x i32]], ptr %a, i64 0, i64 %idxprom, i64 %idxprom3 br label %for.inc.sink.split sw.bb5: ; preds = %for.body %124 = load i32, ptr %f, align 4, !tbaa !5 %sub6 = add nsw i32 %124, -1 %idxprom7 = sext i32 %sub6 to i64 %125 = load i32, ptr %r, align 4, !tbaa !5 %sub9 = add nsw i32 %125, -1 %idxprom10 = sext i32 %sub9 to i64 %arrayidx11 = getelementptr inbounds [3 x [10 x i32]], ptr %b, i64 0, i64 %idxprom7, i64 %idxprom10 br label %for.inc.sink.split sw.bb13: ; preds = %for.body %126 = load i32, ptr %f, align 4, !tbaa !5 %sub14 = add nsw i32 %126, -1 %idxprom15 = sext i32 %sub14 to i64 %127 = load i32, ptr %r, align 4, !tbaa !5 %sub17 = add nsw i32 %127, -1 %idxprom18 = sext i32 %sub17 to i64 %arrayidx19 = getelementptr inbounds [3 x [10 x i32]], ptr %c, i64 0, i64 %idxprom15, i64 %idxprom18 br label %for.inc.sink.split sw.bb21: ; preds = %for.body %128 = load i32, ptr %f, align 4, !tbaa !5 %sub22 = add nsw i32 %128, -1 %idxprom23 = sext i32 %sub22 to i64 %129 = load i32, ptr %r, align 4, !tbaa !5 %sub25 = add nsw i32 %129, -1 %idxprom26 = sext i32 %sub25 to i64 %arrayidx27 = getelementptr inbounds [3 x [10 x i32]], ptr %d, i64 0, i64 %idxprom23, i64 %idxprom26 br label %for.inc.sink.split for.inc.sink.split: ; preds = %sw.bb21, %sw.bb13, %sw.bb5, %sw.bb %arrayidx4.sink229 = phi ptr [ %arrayidx4, %sw.bb ], [ %arrayidx11, %sw.bb5 ], [ %arrayidx19, %sw.bb13 ], [ %arrayidx27, %sw.bb21 ] %.sink228 = load i32, ptr %v, align 4, !tbaa !5 %130 = load i32, ptr %arrayidx4.sink229, align 4, !tbaa !5 %add = add nsw i32 %130, %.sink228 store i32 %add, ptr %arrayidx4.sink229, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %for.body %inc = add nuw nsw i32 %i.0163, 1 %131 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %131 br i1 %cmp, label %for.body, label %for.cond29.preheader.loopexit, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress 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"}
#include <stdio.h> #include <string.h> int main() { long long int buyers, price, answer; char desc[1000],det[10]; scanf("%lld%lld",&buyers,&price); for(int i = 0 ; i < buyers ; ++i ) { scanf("%s",det); if(strcmp(det,"half")== 0) desc[i] = 'A'; else desc[i] = 'B'; } long long int apples = 1;answer = price/2; for(int i = buyers-2; i >= 0 ;--i) { if(desc[i] == 'B') { answer = answer + (apples*2 - apples)*price + (price/2); apples = apples*2 + 1; } if(desc[i] == 'A') { answer = answer + (apples*2 - apples)*price; apples = apples*2; } } printf("%lld\n",answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2362/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2362/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"half\00", align 1 @.str.3 = 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: %buyers = alloca i64, align 8 %price = alloca i64, align 8 %desc = alloca [1000 x i8], align 16 %det = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %buyers) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %price) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %desc) #4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %det) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buyers, ptr noundef nonnull %price) %0 = load i64, ptr %buyers, align 8, !tbaa !5 %cmp60 = icmp sgt i64 %0, 0 br i1 %cmp60, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i64 [ %0, %entry ], [ %7, %for.body ] %1 = load i64, ptr %price, align 8, !tbaa !5 %div = sdiv i64 %1, 2 %2 = trunc i64 %.lcssa to i32 %conv10 = add i32 %2, -2 %cmp1263 = icmp sgt i32 %conv10, -1 br i1 %cmp1263, label %for.body15.preheader, label %for.cond.cleanup14 for.body15.preheader: ; preds = %for.cond.cleanup %3 = zext i32 %conv10 to i64 %4 = add nuw nsw i64 %3, 1 %xtraiter = and i64 %4, 1 %5 = icmp eq i32 %conv10, 0 br i1 %5, label %for.cond.cleanup14.loopexit.unr-lcssa, label %for.body15.preheader.new for.body15.preheader.new: ; preds = %for.body15.preheader %unroll_iter = and i64 %4, 8589934590 br label %for.body15 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %det) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) %det, ptr noundef nonnull dereferenceable(5) @.str.2, i64 5) %cmp5 = icmp eq i32 %bcmp, 0 %spec.select = select i1 %cmp5, i8 65, i8 66 %6 = getelementptr inbounds [1000 x i8], ptr %desc, i64 0, i64 %indvars.iv store i8 %spec.select, ptr %6, align 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i64, ptr %buyers, align 8, !tbaa !5 %cmp = icmp sgt i64 %7, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup14.loopexit.unr-lcssa: ; preds = %for.inc41.1, %for.body15.preheader %answer.2.lcssa.ph = phi i64 [ undef, %for.body15.preheader ], [ %answer.2.1, %for.inc41.1 ] %indvars.iv70.unr = phi i64 [ %3, %for.body15.preheader ], [ %indvars.iv.next71.1, %for.inc41.1 ] %apples.065.unr = phi i64 [ 1, %for.body15.preheader ], [ %apples.2.1, %for.inc41.1 ] %answer.064.unr = phi i64 [ %div, %for.body15.preheader ], [ %answer.2.1, %for.inc41.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup14, label %for.body15.epil for.body15.epil: ; preds = %for.cond.cleanup14.loopexit.unr-lcssa %arrayidx17.epil = getelementptr inbounds [1000 x i8], ptr %desc, i64 0, i64 %indvars.iv70.unr %8 = load i8, ptr %arrayidx17.epil, align 1, !tbaa !11 switch i8 %8, label %for.cond.cleanup14 [ i8 66, label %if.end28.thread.epil i8 65, label %if.then34.epil ] if.then34.epil: ; preds = %for.body15.epil %mul37.epil = mul nsw i64 %apples.065.unr, %1 %add38.epil = add nsw i64 %mul37.epil, %answer.064.unr br label %for.cond.cleanup14 if.end28.thread.epil: ; preds = %for.body15.epil %mul23.epil = mul nsw i64 %apples.065.unr, %1 %add.epil = add i64 %answer.064.unr, %div %add25.epil = add i64 %add.epil, %mul23.epil br label %for.cond.cleanup14 for.cond.cleanup14: ; preds = %for.cond.cleanup14.loopexit.unr-lcssa, %if.end28.thread.epil, %if.then34.epil, %for.body15.epil, %for.cond.cleanup %answer.0.lcssa = phi i64 [ %div, %for.cond.cleanup ], [ %answer.2.lcssa.ph, %for.cond.cleanup14.loopexit.unr-lcssa ], [ %add38.epil, %if.then34.epil ], [ %add25.epil, %if.end28.thread.epil ], [ %answer.064.unr, %for.body15.epil ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %answer.0.lcssa) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %det) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %desc) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %price) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %buyers) #4 ret i32 0 for.body15: ; preds = %for.inc41.1, %for.body15.preheader.new %indvars.iv70 = phi i64 [ %3, %for.body15.preheader.new ], [ %indvars.iv.next71.1, %for.inc41.1 ] %apples.065 = phi i64 [ 1, %for.body15.preheader.new ], [ %apples.2.1, %for.inc41.1 ] %answer.064 = phi i64 [ %div, %for.body15.preheader.new ], [ %answer.2.1, %for.inc41.1 ] %niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.1, %for.inc41.1 ] %arrayidx17 = getelementptr inbounds [1000 x i8], ptr %desc, i64 0, i64 %indvars.iv70 %9 = load i8, ptr %arrayidx17, align 1, !tbaa !11 switch i8 %9, label %for.inc41 [ i8 66, label %if.end28.thread i8 65, label %if.then34 ] if.end28.thread: ; preds = %for.body15 %mul = shl nsw i64 %apples.065, 1 %mul23 = mul nsw i64 %apples.065, %1 %add = add i64 %answer.064, %div %add25 = add i64 %add, %mul23 %add27 = or i64 %mul, 1 br label %for.inc41 if.then34: ; preds = %for.body15 %mul35 = shl nsw i64 %apples.065, 1 %mul37 = mul nsw i64 %apples.065, %1 %add38 = add nsw i64 %mul37, %answer.064 br label %for.inc41 for.inc41: ; preds = %for.body15, %if.end28.thread, %if.then34 %answer.2 = phi i64 [ %add38, %if.then34 ], [ %add25, %if.end28.thread ], [ %answer.064, %for.body15 ] %apples.2 = phi i64 [ %mul35, %if.then34 ], [ %add27, %if.end28.thread ], [ %apples.065, %for.body15 ] %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %arrayidx17.1 = getelementptr inbounds [1000 x i8], ptr %desc, i64 0, i64 %indvars.iv.next71 %10 = load i8, ptr %arrayidx17.1, align 1, !tbaa !11 switch i8 %10, label %for.inc41.1 [ i8 66, label %if.end28.thread.1 i8 65, label %if.then34.1 ] if.then34.1: ; preds = %for.inc41 %mul35.1 = shl nsw i64 %apples.2, 1 %mul37.1 = mul nsw i64 %apples.2, %1 %add38.1 = add nsw i64 %mul37.1, %answer.2 br label %for.inc41.1 if.end28.thread.1: ; preds = %for.inc41 %mul.1 = shl nsw i64 %apples.2, 1 %mul23.1 = mul nsw i64 %apples.2, %1 %add.1 = add i64 %answer.2, %div %add25.1 = add i64 %add.1, %mul23.1 %add27.1 = or i64 %mul.1, 1 br label %for.inc41.1 for.inc41.1: ; preds = %if.end28.thread.1, %if.then34.1, %for.inc41 %answer.2.1 = phi i64 [ %add38.1, %if.then34.1 ], [ %add25.1, %if.end28.thread.1 ], [ %answer.2, %for.inc41 ] %apples.2.1 = phi i64 [ %mul35.1, %if.then34.1 ], [ %add27.1, %if.end28.thread.1 ], [ %apples.2, %for.inc41 ] %indvars.iv.next71.1 = add nsw i64 %indvars.iv70, -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.cond.cleanup14.loopexit.unr-lcssa, label %for.body15, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10}
#include<stdio.h> int main(){ int N,a,b,c,d,i,j,k,p[4][3][10]; scanf("%d",&N); for(i=0;i<4;i++)for(j=0;j<3;j++)for(k=0;k<10;k++)p[i][j][k]=0; for(i=0;i<N;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); p[a-1][b-1][c-1]+=d; } for(i=0;i<4;i++){ for(j=0;j<3;j++){ for(k=0;k<10;k++)printf(" %d",p[i][j][k]); printf("\n"); } if(i!=3)printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236242/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236242/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %p = alloca [4 x [3 x [10 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 %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %p) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %p, i8 0, i64 480, i1 false), !tbaa !5 %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp1881 = icmp sgt i32 %0, 0 br i1 %cmp1881, label %for.body19, label %for.cond35.preheader.preheader for.body19: ; preds = %entry, %for.body19 %i.182 = phi i32 [ %inc30, %for.body19 ], [ 0, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %1 = load i32, ptr %d, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom21 = sext i32 %sub to i64 %3 = load i32, ptr %b, align 4, !tbaa !5 %sub23 = add nsw i32 %3, -1 %idxprom24 = sext i32 %sub23 to i64 %4 = load i32, ptr %c, align 4, !tbaa !5 %sub26 = add nsw i32 %4, -1 %idxprom27 = sext i32 %sub26 to i64 %arrayidx28 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %idxprom21, i64 %idxprom24, i64 %idxprom27 %5 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx28, align 4, !tbaa !5 %inc30 = add nuw nsw i32 %i.182, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc30, %6 br i1 %cmp18, label %for.body19, label %for.cond35.preheader.preheader, !llvm.loop !9 for.cond35.preheader.preheader: ; preds = %for.body19, %entry br label %for.cond35.preheader for.cond35.preheader: ; preds = %for.cond35.preheader.preheader, %for.inc57 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc57 ], [ 0, %for.cond35.preheader.preheader ] %arrayidx46 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx46, align 8, !tbaa !5 %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx46.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5 %call47.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx46.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx46.2, align 8, !tbaa !5 %call47.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx46.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx46.3, align 4, !tbaa !5 %call47.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx46.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx46.4, align 8, !tbaa !5 %call47.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx46.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx46.5, align 4, !tbaa !5 %call47.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx46.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx46.6, align 8, !tbaa !5 %call47.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx46.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx46.7, align 4, !tbaa !5 %call47.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx46.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx46.8, align 8, !tbaa !5 %call47.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx46.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx46.9, align 4, !tbaa !5 %call47.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx46.194 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx46.194, align 8, !tbaa !5 %call47.195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx46.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx46.1.1, align 4, !tbaa !5 %call47.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx46.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx46.2.1, align 8, !tbaa !5 %call47.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx46.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx46.3.1, align 4, !tbaa !5 %call47.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx46.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx46.4.1, align 8, !tbaa !5 %call47.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx46.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx46.5.1, align 4, !tbaa !5 %call47.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx46.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx46.6.1, align 8, !tbaa !5 %call47.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx46.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx46.7.1, align 4, !tbaa !5 %call47.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx46.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx46.8.1, align 8, !tbaa !5 %call47.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx46.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx46.9.1, align 4, !tbaa !5 %call47.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx46.296 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx46.296, align 8, !tbaa !5 %call47.297 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx46.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx46.1.2, align 4, !tbaa !5 %call47.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx46.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx46.2.2, align 8, !tbaa !5 %call47.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx46.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx46.3.2, align 4, !tbaa !5 %call47.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx46.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx46.4.2, align 8, !tbaa !5 %call47.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx46.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx46.5.2, align 4, !tbaa !5 %call47.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx46.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx46.6.2, align 8, !tbaa !5 %call47.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx46.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx46.7.2, align 4, !tbaa !5 %call47.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx46.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx46.8.2, align 8, !tbaa !5 %call47.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx46.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx46.9.2, align 4, !tbaa !5 %call47.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp55.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp55.not, label %for.end59, label %for.inc57 for.inc57: ; preds = %for.cond35.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond35.preheader for.end59: ; preds = %for.cond35.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i,n,b,f,r,v; int house[5][4][11]; for(b=0;b<5;b++){ for(f=0;f<4;f++){ for(r=0;r<11;r++){ house[b][f][r]=0; } } } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); house[b][f][r]+=v; } for(b=1;b<5;b++){ for(f=1;f<4;f++){ for(r=1;r<11;r++){ printf("%2d",house[b][f][r]); } printf("\n"); } if(b!=4){ printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%2d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %house = alloca [5 x [4 x [11 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 880, ptr nonnull %house) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(880) %house, i8 0, i64 880, i1 false), !tbaa !5 store i32 5, ptr %b, align 4, !tbaa !5 store i32 4, ptr %f, align 4, !tbaa !5 store i32 11, ptr %r, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1871 = icmp sgt i32 %0, 0 br i1 %cmp1871, label %for.body19, label %for.cond30.preheader for.cond30.preheader: ; preds = %for.body19, %entry store i32 1, ptr %b, align 4, !tbaa !5 br label %for.cond33.preheader for.body19: ; preds = %entry, %for.body19 %i.072 = phi i32 [ %inc28, %for.body19 ], [ 0, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %idxprom21 = sext i32 %2 to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %idxprom23 = sext i32 %3 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %idxprom25 = sext i32 %4 to i64 %arrayidx26 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %house, i64 0, i64 %idxprom21, i64 %idxprom23, i64 %idxprom25 %5 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx26, align 4, !tbaa !5 %inc28 = add nuw nsw i32 %i.072, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc28, %6 br i1 %cmp18, label %for.body19, label %for.cond30.preheader, !llvm.loop !9 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.inc55 store i32 1, ptr %f, align 4, !tbaa !5 br label %for.cond36.preheader for.cond36.preheader: ; preds = %for.cond33.preheader, %for.end48 store i32 1, ptr %r, align 4, !tbaa !5 br label %for.body38 for.body38: ; preds = %for.cond36.preheader, %for.body38 %storemerge6273 = phi i32 [ 1, %for.cond36.preheader ], [ %inc47, %for.body38 ] %7 = load i32, ptr %b, align 4, !tbaa !5 %idxprom39 = sext i32 %7 to i64 %8 = load i32, ptr %f, align 4, !tbaa !5 %idxprom41 = sext i32 %8 to i64 %idxprom43 = sext i32 %storemerge6273 to i64 %arrayidx44 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %house, i64 0, i64 %idxprom39, i64 %idxprom41, i64 %idxprom43 %9 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %10 = load i32, ptr %r, align 4, !tbaa !5 %inc47 = add nsw i32 %10, 1 store i32 %inc47, ptr %r, align 4, !tbaa !5 %cmp37 = icmp slt i32 %10, 10 br i1 %cmp37, label %for.body38, label %for.end48, !llvm.loop !11 for.end48: ; preds = %for.body38 %putchar = call i32 @putchar(i32 10) %11 = load i32, ptr %f, align 4, !tbaa !5 %inc51 = add nsw i32 %11, 1 store i32 %inc51, ptr %f, align 4, !tbaa !5 %cmp34 = icmp slt i32 %11, 3 br i1 %cmp34, label %for.cond36.preheader, label %for.end52, !llvm.loop !12 for.end52: ; preds = %for.end48 %12 = load i32, ptr %b, align 4, !tbaa !5 %cmp53.not = icmp eq i32 %12, 4 br i1 %cmp53.not, label %for.end57, label %for.inc55 for.inc55: ; preds = %for.end52 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre = load i32, ptr %b, align 4, !tbaa !5 %inc56 = add nsw i32 %.pre, 1 store i32 %inc56, ptr %b, align 4, !tbaa !5 %cmp31 = icmp slt i32 %.pre, 4 br i1 %cmp31, label %for.cond33.preheader, label %for.end57, !llvm.loop !13 for.end57: ; preds = %for.inc55, %for.end52 call void @llvm.lifetime.end.p0(i64 880, ptr nonnull %house) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #define BUILDING_NUM 4 #define FLOOR_NUM 3 #define ROOM_NUM 10 int main(void) { int i, j, k; int data_num; int building; int floor; int room; int value; int data[BUILDING_NUM][FLOOR_NUM][ROOM_NUM] = { 0 }; scanf("%d", &data_num); for (i = 0; i < data_num; i++) { scanf("%d %d %d %d", &building, &floor, &room, &value); data[building - 1][floor - 1][room - 1] += value; if(data[building - 1][floor - 1][room - 1] < 0) { data[building - 1][floor - 1][room - 1] = 0; } } for (i = 0; i < BUILDING_NUM; i++) { for (j = 0; j < FLOOR_NUM; j++) { for (k = 0; k < ROOM_NUM; k++) { printf(" %d", data[i][j][k]); } printf("\n"); } if (i != BUILDING_NUM - 1) { puts("####################"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236329/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236329/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.4 = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %data_num = alloca i32, align 4 %building = alloca i32, align 4 %floor = alloca i32, align 4 %room = alloca i32, align 4 %value = alloca i32, align 4 %data = alloca [4 x [3 x [10 x i32]]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %data_num) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %building) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %floor) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %room) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value) #6 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %data) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %data, i8 0, i64 480, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data_num) %0 = load i32, ptr %data_num, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body, label %for.cond30.preheader.preheader for.body: ; preds = %entry, %for.body %i.067 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %building, ptr noundef nonnull %floor, ptr noundef nonnull %room, ptr noundef nonnull %value) %1 = load i32, ptr %value, align 4, !tbaa !5 %2 = load i32, ptr %building, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %floor, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %room, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 %spec.store.select = call i32 @llvm.smax.i32(i32 %add, i32 0) store i32 %spec.store.select, ptr %arrayidx7, align 4 %inc = add nuw nsw i32 %i.067, 1 %6 = load i32, ptr %data_num, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond30.preheader.preheader, !llvm.loop !9 for.cond30.preheader.preheader: ; preds = %for.body, %entry br label %for.cond30.preheader for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.inc54 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc54 ], [ 0, %for.cond30.preheader.preheader ] %arrayidx41 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx41, align 8, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx41.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %call42.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx41.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx41.2, align 8, !tbaa !5 %call42.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx41.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx41.3, align 4, !tbaa !5 %call42.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx41.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx41.4, align 8, !tbaa !5 %call42.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx41.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx41.5, align 4, !tbaa !5 %call42.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx41.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx41.6, align 8, !tbaa !5 %call42.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx41.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx41.7, align 4, !tbaa !5 %call42.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx41.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx41.8, align 8, !tbaa !5 %call42.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx41.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx41.9, align 4, !tbaa !5 %call42.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx41.173 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx41.173, align 8, !tbaa !5 %call42.174 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx41.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx41.1.1, align 4, !tbaa !5 %call42.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx41.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx41.2.1, align 8, !tbaa !5 %call42.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx41.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx41.3.1, align 4, !tbaa !5 %call42.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx41.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx41.4.1, align 8, !tbaa !5 %call42.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx41.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx41.5.1, align 4, !tbaa !5 %call42.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx41.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx41.6.1, align 8, !tbaa !5 %call42.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx41.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx41.7.1, align 4, !tbaa !5 %call42.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx41.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx41.8.1, align 8, !tbaa !5 %call42.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx41.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx41.9.1, align 4, !tbaa !5 %call42.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx41.275 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx41.275, align 8, !tbaa !5 %call42.276 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx41.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx41.1.2, align 4, !tbaa !5 %call42.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx41.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx41.2.2, align 8, !tbaa !5 %call42.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx41.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx41.3.2, align 4, !tbaa !5 %call42.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx41.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx41.4.2, align 8, !tbaa !5 %call42.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx41.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx41.5.2, align 4, !tbaa !5 %call42.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx41.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx41.6.2, align 8, !tbaa !5 %call42.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx41.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx41.7.2, align 4, !tbaa !5 %call42.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx41.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx41.8.2, align 8, !tbaa !5 %call42.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx41.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %data, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx41.9.2, align 4, !tbaa !5 %call42.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp50.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp50.not, label %for.end56, label %for.inc54 for.inc54: ; preds = %for.cond30.preheader %call52 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond30.preheader for.end56: ; preds = %for.cond30.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %data) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %room) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %floor) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %building) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %data_num) #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: 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: nofree nounwind declare noundef i32 @puts(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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress 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 = { 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(void){ int a[3][10][4] = {0}; int i, j, k; int n, p; int b, f, r, v; /* b?£?f???r???????????¨?±????v??? [???][??¨?±?][?£?] */ scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d%d%d%d", &b, &f, &r, &v); a[f-1][r-1][b-1] += v; } for(k=0; k<4; k++){ for(i=0; i<3; i++){ for(j=0; j<10; j++){ if(a[i][j][k] == 0){ printf(" 0"); }else{ printf(" %d", a[i][j][k]); } } printf("\n"); } if(k != 3){ printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236372/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236372/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c" 0\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3 x [10 x [4 x i32]]], align 16 %n = alloca i32, align 4 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %a, i8 0, i64 480, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp58 = icmp sgt i32 %0, 0 br i1 %cmp58, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.059 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %f, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %r, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %b, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.059, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc43 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.inc43 ], [ 0, %for.cond11.preheader.preheader ] br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond11.preheader, %for.inc32.9 %indvars.iv = phi i64 [ 0, %for.cond11.preheader ], [ %indvars.iv.next, %for.inc32.9 ] %arrayidx22 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 0, i64 %indvars.iv65 %7 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp eq i32 %7, 0 br i1 %cmp23, label %if.then, label %if.else if.then: ; preds = %for.cond14.preheader %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32 if.else: ; preds = %for.cond14.preheader %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %7) br label %for.inc32 for.inc32: ; preds = %if.then, %if.else %arrayidx22.1 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 1, i64 %indvars.iv65 %8 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5 %cmp23.1 = icmp eq i32 %8, 0 br i1 %cmp23.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc32 %call31.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8) br label %for.inc32.1 if.then.1: ; preds = %for.inc32 %call24.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.1 for.inc32.1: ; preds = %if.then.1, %if.else.1 %arrayidx22.2 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 2, i64 %indvars.iv65 %9 = load i32, ptr %arrayidx22.2, align 4, !tbaa !5 %cmp23.2 = icmp eq i32 %9, 0 br i1 %cmp23.2, label %if.then.2, label %if.else.2 if.else.2: ; preds = %for.inc32.1 %call31.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %9) br label %for.inc32.2 if.then.2: ; preds = %for.inc32.1 %call24.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.2 for.inc32.2: ; preds = %if.then.2, %if.else.2 %arrayidx22.3 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 3, i64 %indvars.iv65 %10 = load i32, ptr %arrayidx22.3, align 4, !tbaa !5 %cmp23.3 = icmp eq i32 %10, 0 br i1 %cmp23.3, label %if.then.3, label %if.else.3 if.else.3: ; preds = %for.inc32.2 %call31.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10) br label %for.inc32.3 if.then.3: ; preds = %for.inc32.2 %call24.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.3 for.inc32.3: ; preds = %if.then.3, %if.else.3 %arrayidx22.4 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 4, i64 %indvars.iv65 %11 = load i32, ptr %arrayidx22.4, align 4, !tbaa !5 %cmp23.4 = icmp eq i32 %11, 0 br i1 %cmp23.4, label %if.then.4, label %if.else.4 if.else.4: ; preds = %for.inc32.3 %call31.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %11) br label %for.inc32.4 if.then.4: ; preds = %for.inc32.3 %call24.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.4 for.inc32.4: ; preds = %if.then.4, %if.else.4 %arrayidx22.5 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 5, i64 %indvars.iv65 %12 = load i32, ptr %arrayidx22.5, align 4, !tbaa !5 %cmp23.5 = icmp eq i32 %12, 0 br i1 %cmp23.5, label %if.then.5, label %if.else.5 if.else.5: ; preds = %for.inc32.4 %call31.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12) br label %for.inc32.5 if.then.5: ; preds = %for.inc32.4 %call24.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.5 for.inc32.5: ; preds = %if.then.5, %if.else.5 %arrayidx22.6 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 6, i64 %indvars.iv65 %13 = load i32, ptr %arrayidx22.6, align 4, !tbaa !5 %cmp23.6 = icmp eq i32 %13, 0 br i1 %cmp23.6, label %if.then.6, label %if.else.6 if.else.6: ; preds = %for.inc32.5 %call31.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13) br label %for.inc32.6 if.then.6: ; preds = %for.inc32.5 %call24.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.6 for.inc32.6: ; preds = %if.then.6, %if.else.6 %arrayidx22.7 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 7, i64 %indvars.iv65 %14 = load i32, ptr %arrayidx22.7, align 4, !tbaa !5 %cmp23.7 = icmp eq i32 %14, 0 br i1 %cmp23.7, label %if.then.7, label %if.else.7 if.else.7: ; preds = %for.inc32.6 %call31.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %14) br label %for.inc32.7 if.then.7: ; preds = %for.inc32.6 %call24.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.7 for.inc32.7: ; preds = %if.then.7, %if.else.7 %arrayidx22.8 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 8, i64 %indvars.iv65 %15 = load i32, ptr %arrayidx22.8, align 4, !tbaa !5 %cmp23.8 = icmp eq i32 %15, 0 br i1 %cmp23.8, label %if.then.8, label %if.else.8 if.else.8: ; preds = %for.inc32.7 %call31.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %15) br label %for.inc32.8 if.then.8: ; preds = %for.inc32.7 %call24.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.8 for.inc32.8: ; preds = %if.then.8, %if.else.8 %arrayidx22.9 = getelementptr inbounds [3 x [10 x [4 x i32]]], ptr %a, i64 0, i64 %indvars.iv, i64 9, i64 %indvars.iv65 %16 = load i32, ptr %arrayidx22.9, align 4, !tbaa !5 %cmp23.9 = icmp eq i32 %16, 0 br i1 %cmp23.9, label %if.then.9, label %if.else.9 if.else.9: ; preds = %for.inc32.8 %call31.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %16) br label %for.inc32.9 if.then.9: ; preds = %for.inc32.8 %call24.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %for.inc32.9 for.inc32.9: ; preds = %if.then.9, %if.else.9 %putchar = call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 3 br i1 %exitcond.not, label %for.end38, label %for.cond14.preheader, !llvm.loop !11 for.end38: ; preds = %for.inc32.9 %cmp39.not = icmp eq i64 %indvars.iv65, 3 br i1 %cmp39.not, label %for.end45, label %for.inc43 for.inc43: ; preds = %for.end38 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 br label %for.cond11.preheader for.end45: ; preds = %for.end38 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 480, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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}
#include <stdio.h> int main(void){ int n,i,j,k,b[250],f[250],r[250],v[250]; int d1[250][250],d2[250][250],d3[250][250],d4[250][250]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b[i],&f[i],&r[i],&v[i]); } for(i=0;i<3;i++){ d1[i][j]=0; d2[i][j]=0; d3[i][j]=0; d4[i][j]=0; } for(k=0;k<n;k++){ if(b[k]==1){ d1[f[k]-1][r[k]-1]+=v[k]; }else if(b[k]==2){ d2[f[k]-1][r[k]-1]+=v[k]; }else if(b[k]==3){ d3[f[k]-1][r[k]-1]+=v[k]; }else if(b[k]==4){ d4[f[k]-1][r[k]-1]+=v[k]; } } for(i=0;i<3;i++){ for(j=0;j<10;j++){ printf(" %d",d1[i][j]); } printf("\n"); } printf("####################\n"); for(i=0;i<3;i++){ for(j=0;j<10;j++){ printf(" %d",d2[i][j]); } printf("\n"); } printf("####################\n"); for(i=0;i<3;i++){ for(j=0;j<10;j++){ printf(" %d",d3[i][j]); } printf("\n"); } printf("####################\n"); for(i=0;i<3;i++){ for(j=0;j<10;j++){ printf(" %d",d4[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str.6 = private unnamed_addr constant [21 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 %b = alloca [250 x i32], align 16 %f = alloca [250 x i32], align 16 %r = alloca [250 x i32], align 16 %v = alloca [250 x i32], align 16 %d1 = alloca [250 x [250 x i32]], align 16 %d2 = alloca [250 x [250 x i32]], align 16 %d3 = alloca [250 x [250 x i32]], align 16 %d4 = alloca [250 x [250 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %f) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 250000, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 250000, ptr nonnull %d2) #4 call void @llvm.lifetime.start.p0(i64 250000, ptr nonnull %d3) #4 call void @llvm.lifetime.start.p0(i64 250000, ptr nonnull %d4) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp241 = icmp sgt i32 %0, 0 br i1 %cmp241, label %for.body, label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 0, ptr %d1, align 16, !tbaa !5 store i32 0, ptr %d2, align 16, !tbaa !5 store i32 0, ptr %d3, align 16, !tbaa !5 store i32 0, ptr %d4, align 16, !tbaa !5 %arrayidx12.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1 store i32 0, ptr %arrayidx12.1, align 8, !tbaa !5 %arrayidx16.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1 store i32 0, ptr %arrayidx16.1, align 8, !tbaa !5 %arrayidx20.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1 store i32 0, ptr %arrayidx20.1, align 8, !tbaa !5 %arrayidx24.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1 store i32 0, ptr %arrayidx24.1, align 8, !tbaa !5 %arrayidx12.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2 store i32 0, ptr %arrayidx12.2, align 16, !tbaa !5 %arrayidx16.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2 store i32 0, ptr %arrayidx16.2, align 16, !tbaa !5 %arrayidx20.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2 store i32 0, ptr %arrayidx20.2, align 16, !tbaa !5 %arrayidx24.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2 store i32 0, ptr %arrayidx24.2, align 16, !tbaa !5 %cmp31244 = icmp sgt i32 %.lcssa, 0 br i1 %cmp31244, label %for.body32.preheader, label %for.cond106.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [250 x i32], ptr %b, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [250 x i32], ptr %f, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [250 x i32], ptr %r, i64 0, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [250 x i32], ptr %v, i64 0, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6) %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.cond8.preheader, !llvm.loop !9 for.body32.preheader: ; preds = %for.cond8.preheader %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body32 for.cond106.preheader.loopexit: ; preds = %for.inc103 %.pre = load i32, ptr %d1, align 16, !tbaa !5 %arrayidx115.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 1 %.pre310 = load i32, ptr %arrayidx115.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 2 %.pre311 = load i32, ptr %arrayidx115.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.3.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 3 %.pre312 = load i32, ptr %arrayidx115.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.4.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 4 %.pre313 = load i32, ptr %arrayidx115.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.5.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 5 %.pre314 = load i32, ptr %arrayidx115.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.6.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 6 %.pre315 = load i32, ptr %arrayidx115.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.7.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 7 %.pre316 = load i32, ptr %arrayidx115.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.8.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 8 %.pre317 = load i32, ptr %arrayidx115.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.9.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 0, i64 9 %.pre318 = load i32, ptr %arrayidx115.9.phi.trans.insert, align 4, !tbaa !5 %.pre319 = load i32, ptr %arrayidx12.1, align 8, !tbaa !5 %arrayidx115.1.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 1 %.pre320 = load i32, ptr %arrayidx115.1.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.2.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 2 %.pre321 = load i32, ptr %arrayidx115.2.1.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.3.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 3 %.pre322 = load i32, ptr %arrayidx115.3.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.4.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 4 %.pre323 = load i32, ptr %arrayidx115.4.1.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.5.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 5 %.pre324 = load i32, ptr %arrayidx115.5.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.6.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 6 %.pre325 = load i32, ptr %arrayidx115.6.1.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.7.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 7 %.pre326 = load i32, ptr %arrayidx115.7.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.8.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 8 %.pre327 = load i32, ptr %arrayidx115.8.1.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.9.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 1, i64 9 %.pre328 = load i32, ptr %arrayidx115.9.1.phi.trans.insert, align 4, !tbaa !5 %.pre329 = load i32, ptr %arrayidx12.2, align 16, !tbaa !5 %arrayidx115.1.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 1 %.pre330 = load i32, ptr %arrayidx115.1.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.2.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 2 %.pre331 = load i32, ptr %arrayidx115.2.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.3.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 3 %.pre332 = load i32, ptr %arrayidx115.3.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.4.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 4 %.pre333 = load i32, ptr %arrayidx115.4.2.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.5.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 5 %.pre334 = load i32, ptr %arrayidx115.5.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.6.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 6 %.pre335 = load i32, ptr %arrayidx115.6.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx115.7.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 7 %.pre336 = load i32, ptr %arrayidx115.7.2.phi.trans.insert, align 4, !tbaa !5 %arrayidx115.8.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 8 %.pre337 = load i32, ptr %arrayidx115.8.2.phi.trans.insert, align 16, !tbaa !5 %arrayidx115.9.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d1, i64 0, i64 2, i64 9 %.pre338 = load i32, ptr %arrayidx115.9.2.phi.trans.insert, align 4, !tbaa !5 %.pre339 = load i32, ptr %d2, align 16, !tbaa !5 %arrayidx134.1.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 1 %.pre340 = load i32, ptr %arrayidx134.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx134.2.phi.trans.insert = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 2 %.pre341 = load i32, ptr %arrayidx134.2.phi.trans.insert, align 8, !tbaa !5 br label %for.cond106.preheader for.cond106.preheader: ; preds = %for.cond106.preheader.loopexit, %for.cond8.preheader %3 = phi i32 [ %.pre341, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %4 = phi i32 [ %.pre340, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %5 = phi i32 [ %.pre339, %for.cond106.preheader.loopexit ], [ 0, %for.cond8.preheader ] %6 = phi i32 [ %.pre338, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %7 = phi i32 [ %.pre337, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %8 = phi i32 [ %.pre336, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %9 = phi i32 [ %.pre335, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %10 = phi i32 [ %.pre334, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %11 = phi i32 [ %.pre333, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %12 = phi i32 [ %.pre332, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %13 = phi i32 [ %.pre331, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %14 = phi i32 [ %.pre330, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %15 = phi i32 [ %.pre329, %for.cond106.preheader.loopexit ], [ 0, %for.cond8.preheader ] %16 = phi i32 [ %.pre328, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %17 = phi i32 [ %.pre327, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %18 = phi i32 [ %.pre326, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %19 = phi i32 [ %.pre325, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %20 = phi i32 [ %.pre324, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %21 = phi i32 [ %.pre323, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %22 = phi i32 [ %.pre322, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %23 = phi i32 [ %.pre321, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %24 = phi i32 [ %.pre320, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %25 = phi i32 [ %.pre319, %for.cond106.preheader.loopexit ], [ 0, %for.cond8.preheader ] %26 = phi i32 [ %.pre318, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %27 = phi i32 [ %.pre317, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %28 = phi i32 [ %.pre316, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %29 = phi i32 [ %.pre315, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %30 = phi i32 [ %.pre314, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %31 = phi i32 [ %.pre313, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %32 = phi i32 [ %.pre312, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %33 = phi i32 [ %.pre311, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %34 = phi i32 [ %.pre310, %for.cond106.preheader.loopexit ], [ undef, %for.cond8.preheader ] %35 = phi i32 [ %.pre, %for.cond106.preheader.loopexit ], [ 0, %for.cond8.preheader ] %call116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %call116.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %call116.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %call116.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %call116.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %call116.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %call116.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %call116.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %call116.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %call116.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar240 = call i32 @putchar(i32 10) %call116.1271 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %call116.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %call116.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %call116.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %call116.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %call116.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %call116.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %call116.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %call116.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %call116.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar240.1 = call i32 @putchar(i32 10) %call116.2273 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %call116.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %call116.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %call116.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %call116.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %call116.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %call116.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %call116.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %call116.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %call116.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6) %putchar240.2 = call i32 @putchar(i32 10) %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %call135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) %call135.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4) %call135.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3) %arrayidx134.3 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 3 %36 = load i32, ptr %arrayidx134.3, align 4, !tbaa !5 %call135.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %arrayidx134.4 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 4 %37 = load i32, ptr %arrayidx134.4, align 16, !tbaa !5 %call135.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37) %arrayidx134.5 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 5 %38 = load i32, ptr %arrayidx134.5, align 4, !tbaa !5 %call135.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %38) %arrayidx134.6 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 6 %39 = load i32, ptr %arrayidx134.6, align 8, !tbaa !5 %call135.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39) %arrayidx134.7 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 7 %40 = load i32, ptr %arrayidx134.7, align 4, !tbaa !5 %call135.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %40) %arrayidx134.8 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 8 %41 = load i32, ptr %arrayidx134.8, align 16, !tbaa !5 %call135.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %41) %arrayidx134.9 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 0, i64 9 %42 = load i32, ptr %arrayidx134.9, align 4, !tbaa !5 %call135.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %42) %putchar239 = call i32 @putchar(i32 10) %43 = load i32, ptr %arrayidx16.1, align 8, !tbaa !5 %call135.1283 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %43) %arrayidx134.1.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 1 %44 = load i32, ptr %arrayidx134.1.1, align 4, !tbaa !5 %call135.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44) %arrayidx134.2.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 2 %45 = load i32, ptr %arrayidx134.2.1, align 16, !tbaa !5 %call135.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45) %arrayidx134.3.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 3 %46 = load i32, ptr %arrayidx134.3.1, align 4, !tbaa !5 %call135.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %46) %arrayidx134.4.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 4 %47 = load i32, ptr %arrayidx134.4.1, align 8, !tbaa !5 %call135.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %47) %arrayidx134.5.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 5 %48 = load i32, ptr %arrayidx134.5.1, align 4, !tbaa !5 %call135.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %48) %arrayidx134.6.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 6 %49 = load i32, ptr %arrayidx134.6.1, align 16, !tbaa !5 %call135.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %49) %arrayidx134.7.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 7 %50 = load i32, ptr %arrayidx134.7.1, align 4, !tbaa !5 %call135.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %50) %arrayidx134.8.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 8 %51 = load i32, ptr %arrayidx134.8.1, align 8, !tbaa !5 %call135.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51) %arrayidx134.9.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 1, i64 9 %52 = load i32, ptr %arrayidx134.9.1, align 4, !tbaa !5 %call135.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %52) %putchar239.1 = call i32 @putchar(i32 10) %53 = load i32, ptr %arrayidx16.2, align 16, !tbaa !5 %call135.2285 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %53) %arrayidx134.1.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 1 %54 = load i32, ptr %arrayidx134.1.2, align 4, !tbaa !5 %call135.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %54) %arrayidx134.2.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 2 %55 = load i32, ptr %arrayidx134.2.2, align 8, !tbaa !5 %call135.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %55) %arrayidx134.3.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 3 %56 = load i32, ptr %arrayidx134.3.2, align 4, !tbaa !5 %call135.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %56) %arrayidx134.4.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 4 %57 = load i32, ptr %arrayidx134.4.2, align 16, !tbaa !5 %call135.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %57) %arrayidx134.5.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 5 %58 = load i32, ptr %arrayidx134.5.2, align 4, !tbaa !5 %call135.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %58) %arrayidx134.6.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 6 %59 = load i32, ptr %arrayidx134.6.2, align 8, !tbaa !5 %call135.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %59) %arrayidx134.7.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 7 %60 = load i32, ptr %arrayidx134.7.2, align 4, !tbaa !5 %call135.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60) %arrayidx134.8.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 8 %61 = load i32, ptr %arrayidx134.8.2, align 16, !tbaa !5 %call135.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %61) %arrayidx134.9.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d2, i64 0, i64 2, i64 9 %62 = load i32, ptr %arrayidx134.9.2, align 4, !tbaa !5 %call135.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %62) %putchar239.2 = call i32 @putchar(i32 10) %puts236 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %63 = load i32, ptr %d3, align 16, !tbaa !5 %call154 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %63) %arrayidx153.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 1 %64 = load i32, ptr %arrayidx153.1, align 4, !tbaa !5 %call154.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64) %arrayidx153.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 2 %65 = load i32, ptr %arrayidx153.2, align 8, !tbaa !5 %call154.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %65) %arrayidx153.3 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 3 %66 = load i32, ptr %arrayidx153.3, align 4, !tbaa !5 %call154.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %66) %arrayidx153.4 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 4 %67 = load i32, ptr %arrayidx153.4, align 16, !tbaa !5 %call154.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %67) %arrayidx153.5 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 5 %68 = load i32, ptr %arrayidx153.5, align 4, !tbaa !5 %call154.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %68) %arrayidx153.6 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 6 %69 = load i32, ptr %arrayidx153.6, align 8, !tbaa !5 %call154.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69) %arrayidx153.7 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 7 %70 = load i32, ptr %arrayidx153.7, align 4, !tbaa !5 %call154.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70) %arrayidx153.8 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 8 %71 = load i32, ptr %arrayidx153.8, align 16, !tbaa !5 %call154.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %71) %arrayidx153.9 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 0, i64 9 %72 = load i32, ptr %arrayidx153.9, align 4, !tbaa !5 %call154.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %72) %putchar238 = call i32 @putchar(i32 10) %73 = load i32, ptr %arrayidx20.1, align 8, !tbaa !5 %call154.1295 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %73) %arrayidx153.1.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 1 %74 = load i32, ptr %arrayidx153.1.1, align 4, !tbaa !5 %call154.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %74) %arrayidx153.2.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 2 %75 = load i32, ptr %arrayidx153.2.1, align 16, !tbaa !5 %call154.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %75) %arrayidx153.3.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 3 %76 = load i32, ptr %arrayidx153.3.1, align 4, !tbaa !5 %call154.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %76) %arrayidx153.4.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 4 %77 = load i32, ptr %arrayidx153.4.1, align 8, !tbaa !5 %call154.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %77) %arrayidx153.5.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 5 %78 = load i32, ptr %arrayidx153.5.1, align 4, !tbaa !5 %call154.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %78) %arrayidx153.6.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 6 %79 = load i32, ptr %arrayidx153.6.1, align 16, !tbaa !5 %call154.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79) %arrayidx153.7.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 7 %80 = load i32, ptr %arrayidx153.7.1, align 4, !tbaa !5 %call154.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %80) %arrayidx153.8.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 8 %81 = load i32, ptr %arrayidx153.8.1, align 8, !tbaa !5 %call154.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %81) %arrayidx153.9.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 1, i64 9 %82 = load i32, ptr %arrayidx153.9.1, align 4, !tbaa !5 %call154.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %82) %putchar238.1 = call i32 @putchar(i32 10) %83 = load i32, ptr %arrayidx20.2, align 16, !tbaa !5 %call154.2297 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %83) %arrayidx153.1.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 1 %84 = load i32, ptr %arrayidx153.1.2, align 4, !tbaa !5 %call154.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %84) %arrayidx153.2.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 2 %85 = load i32, ptr %arrayidx153.2.2, align 8, !tbaa !5 %call154.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %85) %arrayidx153.3.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 3 %86 = load i32, ptr %arrayidx153.3.2, align 4, !tbaa !5 %call154.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %86) %arrayidx153.4.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 4 %87 = load i32, ptr %arrayidx153.4.2, align 16, !tbaa !5 %call154.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %87) %arrayidx153.5.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 5 %88 = load i32, ptr %arrayidx153.5.2, align 4, !tbaa !5 %call154.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %88) %arrayidx153.6.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 6 %89 = load i32, ptr %arrayidx153.6.2, align 8, !tbaa !5 %call154.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %89) %arrayidx153.7.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 7 %90 = load i32, ptr %arrayidx153.7.2, align 4, !tbaa !5 %call154.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %90) %arrayidx153.8.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 8 %91 = load i32, ptr %arrayidx153.8.2, align 16, !tbaa !5 %call154.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %91) %arrayidx153.9.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d3, i64 0, i64 2, i64 9 %92 = load i32, ptr %arrayidx153.9.2, align 4, !tbaa !5 %call154.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %92) %putchar238.2 = call i32 @putchar(i32 10) %puts237 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %93 = load i32, ptr %d4, align 16, !tbaa !5 %call173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %93) %arrayidx172.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 1 %94 = load i32, ptr %arrayidx172.1, align 4, !tbaa !5 %call173.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %94) %arrayidx172.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 2 %95 = load i32, ptr %arrayidx172.2, align 8, !tbaa !5 %call173.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %95) %arrayidx172.3 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 3 %96 = load i32, ptr %arrayidx172.3, align 4, !tbaa !5 %call173.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %96) %arrayidx172.4 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 4 %97 = load i32, ptr %arrayidx172.4, align 16, !tbaa !5 %call173.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %97) %arrayidx172.5 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 5 %98 = load i32, ptr %arrayidx172.5, align 4, !tbaa !5 %call173.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %98) %arrayidx172.6 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 6 %99 = load i32, ptr %arrayidx172.6, align 8, !tbaa !5 %call173.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %99) %arrayidx172.7 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 7 %100 = load i32, ptr %arrayidx172.7, align 4, !tbaa !5 %call173.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %100) %arrayidx172.8 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 8 %101 = load i32, ptr %arrayidx172.8, align 16, !tbaa !5 %call173.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %101) %arrayidx172.9 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 0, i64 9 %102 = load i32, ptr %arrayidx172.9, align 4, !tbaa !5 %call173.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %102) %putchar = call i32 @putchar(i32 10) %103 = load i32, ptr %arrayidx24.1, align 8, !tbaa !5 %call173.1307 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %103) %arrayidx172.1.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 1 %104 = load i32, ptr %arrayidx172.1.1, align 4, !tbaa !5 %call173.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %104) %arrayidx172.2.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 2 %105 = load i32, ptr %arrayidx172.2.1, align 16, !tbaa !5 %call173.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %105) %arrayidx172.3.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 3 %106 = load i32, ptr %arrayidx172.3.1, align 4, !tbaa !5 %call173.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %106) %arrayidx172.4.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 4 %107 = load i32, ptr %arrayidx172.4.1, align 8, !tbaa !5 %call173.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %107) %arrayidx172.5.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 5 %108 = load i32, ptr %arrayidx172.5.1, align 4, !tbaa !5 %call173.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %108) %arrayidx172.6.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 6 %109 = load i32, ptr %arrayidx172.6.1, align 16, !tbaa !5 %call173.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %109) %arrayidx172.7.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 7 %110 = load i32, ptr %arrayidx172.7.1, align 4, !tbaa !5 %call173.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %110) %arrayidx172.8.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 8 %111 = load i32, ptr %arrayidx172.8.1, align 8, !tbaa !5 %call173.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %111) %arrayidx172.9.1 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 1, i64 9 %112 = load i32, ptr %arrayidx172.9.1, align 4, !tbaa !5 %call173.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %112) %putchar.1 = call i32 @putchar(i32 10) %113 = load i32, ptr %arrayidx24.2, align 16, !tbaa !5 %call173.2309 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %113) %arrayidx172.1.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 1 %114 = load i32, ptr %arrayidx172.1.2, align 4, !tbaa !5 %call173.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %114) %arrayidx172.2.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 2 %115 = load i32, ptr %arrayidx172.2.2, align 8, !tbaa !5 %call173.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %115) %arrayidx172.3.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 3 %116 = load i32, ptr %arrayidx172.3.2, align 4, !tbaa !5 %call173.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %116) %arrayidx172.4.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 4 %117 = load i32, ptr %arrayidx172.4.2, align 16, !tbaa !5 %call173.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %117) %arrayidx172.5.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 5 %118 = load i32, ptr %arrayidx172.5.2, align 4, !tbaa !5 %call173.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %118) %arrayidx172.6.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 6 %119 = load i32, ptr %arrayidx172.6.2, align 8, !tbaa !5 %call173.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %119) %arrayidx172.7.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 7 %120 = load i32, ptr %arrayidx172.7.2, align 4, !tbaa !5 %call173.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %120) %arrayidx172.8.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 8 %121 = load i32, ptr %arrayidx172.8.2, align 16, !tbaa !5 %call173.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %121) %arrayidx172.9.2 = getelementptr inbounds [250 x [250 x i32]], ptr %d4, i64 0, i64 2, i64 9 %122 = load i32, ptr %arrayidx172.9.2, align 4, !tbaa !5 %call173.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %122) %putchar.2 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 250000, ptr nonnull %d4) #4 call void @llvm.lifetime.end.p0(i64 250000, ptr nonnull %d3) #4 call void @llvm.lifetime.end.p0(i64 250000, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 250000, ptr nonnull %d1) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body32: ; preds = %for.body32.preheader, %for.inc103 %indvars.iv259 = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next260, %for.inc103 ] %arrayidx34 = getelementptr inbounds [250 x i32], ptr %b, i64 0, i64 %indvars.iv259 %123 = load i32, ptr %arrayidx34, align 4, !tbaa !5 switch i32 %123, label %for.inc103 [ i32 1, label %for.inc103.sink.split i32 2, label %if.then50 i32 3, label %if.then68 i32 4, label %if.then86 ] if.then50: ; preds = %for.body32 br label %for.inc103.sink.split if.then68: ; preds = %for.body32 br label %for.inc103.sink.split if.then86: ; preds = %for.body32 br label %for.inc103.sink.split for.inc103.sink.split: ; preds = %for.body32, %if.then50, %if.then86, %if.then68 %d2.sink = phi ptr [ %d2, %if.then50 ], [ %d4, %if.then86 ], [ %d3, %if.then68 ], [ %d1, %for.body32 ] %arrayidx52 = getelementptr inbounds [250 x i32], ptr %v, i64 0, i64 %indvars.iv259 %124 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %arrayidx54 = getelementptr inbounds [250 x i32], ptr %f, i64 0, i64 %indvars.iv259 %125 = load i32, ptr %arrayidx54, align 4, !tbaa !5 %sub55 = add nsw i32 %125, -1 %idxprom56 = sext i32 %sub55 to i64 %arrayidx59 = getelementptr inbounds [250 x i32], ptr %r, i64 0, i64 %indvars.iv259 %126 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %sub60 = add nsw i32 %126, -1 %idxprom61 = sext i32 %sub60 to i64 %arrayidx62 = getelementptr inbounds [250 x [250 x i32]], ptr %d2.sink, i64 0, i64 %idxprom56, i64 %idxprom61 %127 = load i32, ptr %arrayidx62, align 4, !tbaa !5 %add = add nsw i32 %127, %124 store i32 %add, ptr %arrayidx62, align 4, !tbaa !5 br label %for.inc103 for.inc103: ; preds = %for.inc103.sink.split, %for.body32 %indvars.iv.next260 = add nuw nsw i64 %indvars.iv259, 1 %exitcond.not = icmp eq i64 %indvars.iv.next260, %wide.trip.count br i1 %exitcond.not, label %for.cond106.preheader.loopexit, label %for.body32, !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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define ROOM 10 #define FLOOR 3 #define BUILD 4 int main(){ int n; int b, f, r, v; int House[BUILD][FLOOR][ROOM]={0}; int i, j, k; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d %d %d %d", &b, &f, &r, &v); House[b-1][f-1][r-1] += v; } for(i=0;i<BUILD;i++){ for(j=0;j<FLOOR;j++){ for(k=0;k<ROOM;k++){ if(k==ROOM-1) printf(" %d\n", House[i][j][k]); else printf(" %d", House[i][j][k]); } } if(i!=BUILD-1) printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c" %d\0A\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %House = alloca [4 x [3 x [10 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %House) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %House, i8 0, i64 480, 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 %cmp58 = icmp sgt i32 %0, 0 br i1 %cmp58, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.059 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.059, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc42 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.inc42 ], [ 0, %for.cond11.preheader.preheader ] %arrayidx23 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 9 %arrayidx30 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 0 %7 = load i32, ptr %arrayidx30, align 8, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %7) %arrayidx30.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 1 %8 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %call31.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8) %arrayidx30.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 2 %9 = load i32, ptr %arrayidx30.2, align 8, !tbaa !5 %call31.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %9) %arrayidx30.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 3 %10 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 %call31.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10) %arrayidx30.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 4 %11 = load i32, ptr %arrayidx30.4, align 8, !tbaa !5 %call31.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %11) %arrayidx30.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 5 %12 = load i32, ptr %arrayidx30.5, align 4, !tbaa !5 %call31.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12) %arrayidx30.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 6 %13 = load i32, ptr %arrayidx30.6, align 8, !tbaa !5 %call31.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13) %arrayidx30.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 7 %14 = load i32, ptr %arrayidx30.7, align 4, !tbaa !5 %call31.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %14) %arrayidx30.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 0, i64 8 %15 = load i32, ptr %arrayidx30.8, align 8, !tbaa !5 %call31.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %15) %16 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %call24.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %arrayidx23.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 9 %arrayidx30.171 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 0 %17 = load i32, ptr %arrayidx30.171, align 8, !tbaa !5 %call31.172 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %17) %arrayidx30.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 1 %18 = load i32, ptr %arrayidx30.1.1, align 4, !tbaa !5 %call31.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %18) %arrayidx30.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 2 %19 = load i32, ptr %arrayidx30.2.1, align 8, !tbaa !5 %call31.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %19) %arrayidx30.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 3 %20 = load i32, ptr %arrayidx30.3.1, align 4, !tbaa !5 %call31.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %20) %arrayidx30.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 4 %21 = load i32, ptr %arrayidx30.4.1, align 8, !tbaa !5 %call31.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %21) %arrayidx30.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 5 %22 = load i32, ptr %arrayidx30.5.1, align 4, !tbaa !5 %call31.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %22) %arrayidx30.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 6 %23 = load i32, ptr %arrayidx30.6.1, align 8, !tbaa !5 %call31.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %23) %arrayidx30.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 7 %24 = load i32, ptr %arrayidx30.7.1, align 4, !tbaa !5 %call31.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %24) %arrayidx30.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 1, i64 8 %25 = load i32, ptr %arrayidx30.8.1, align 8, !tbaa !5 %call31.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %25) %26 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %call24.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %arrayidx23.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 9 %arrayidx30.273 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 0 %27 = load i32, ptr %arrayidx30.273, align 8, !tbaa !5 %call31.274 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %27) %arrayidx30.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 1 %28 = load i32, ptr %arrayidx30.1.2, align 4, !tbaa !5 %call31.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %28) %arrayidx30.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 2 %29 = load i32, ptr %arrayidx30.2.2, align 8, !tbaa !5 %call31.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29) %arrayidx30.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 3 %30 = load i32, ptr %arrayidx30.3.2, align 4, !tbaa !5 %call31.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %30) %arrayidx30.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 4 %31 = load i32, ptr %arrayidx30.4.2, align 8, !tbaa !5 %call31.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %31) %arrayidx30.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 5 %32 = load i32, ptr %arrayidx30.5.2, align 4, !tbaa !5 %call31.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %32) %arrayidx30.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 6 %33 = load i32, ptr %arrayidx30.6.2, align 8, !tbaa !5 %call31.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %33) %arrayidx30.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 7 %34 = load i32, ptr %arrayidx30.7.2, align 4, !tbaa !5 %call31.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %34) %arrayidx30.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %House, i64 0, i64 %indvars.iv65, i64 2, i64 8 %35 = load i32, ptr %arrayidx30.8.2, align 8, !tbaa !5 %call31.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %35) %36 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5 %call24.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %cmp38.not = icmp eq i64 %indvars.iv65, 3 br i1 %cmp38.not, label %for.end44, label %for.inc42 for.inc42: ; preds = %for.cond11.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 br label %for.cond11.preheader for.end44: ; preds = %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %House) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int n,b,f,r,v; int i,j,k; int x[4][3][10] = {0}; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); x[b-1][f-1][r-1] += v; } for(i=0;i<4;i++){ for(j=0;j<3;j++){ for(k=0;k<10;k++){ printf(" %d",x[i][j][k]); } printf("\n"); } if(i != 3) printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %x = alloca [4 x [3 x [10 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %x) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %x, i8 0, i64 480, 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 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.046 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.046, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc33 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc33 ], [ 0, %for.cond11.preheader.preheader ] %arrayidx22 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx22, align 8, !tbaa !5 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx22.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5 %call23.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx22.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx22.2, align 8, !tbaa !5 %call23.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx22.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx22.3, align 4, !tbaa !5 %call23.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx22.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx22.4, align 8, !tbaa !5 %call23.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx22.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx22.5, align 4, !tbaa !5 %call23.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx22.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx22.6, align 8, !tbaa !5 %call23.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx22.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx22.7, align 4, !tbaa !5 %call23.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx22.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx22.8, align 8, !tbaa !5 %call23.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx22.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx22.9, align 4, !tbaa !5 %call23.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx22.152 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx22.152, align 8, !tbaa !5 %call23.153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx22.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx22.1.1, align 4, !tbaa !5 %call23.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx22.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx22.2.1, align 8, !tbaa !5 %call23.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx22.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx22.3.1, align 4, !tbaa !5 %call23.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx22.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx22.4.1, align 8, !tbaa !5 %call23.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx22.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx22.5.1, align 4, !tbaa !5 %call23.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx22.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx22.6.1, align 8, !tbaa !5 %call23.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx22.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx22.7.1, align 4, !tbaa !5 %call23.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx22.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx22.8.1, align 8, !tbaa !5 %call23.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx22.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx22.9.1, align 4, !tbaa !5 %call23.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx22.254 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx22.254, align 8, !tbaa !5 %call23.255 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx22.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx22.1.2, align 4, !tbaa !5 %call23.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx22.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx22.2.2, align 8, !tbaa !5 %call23.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx22.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx22.3.2, align 4, !tbaa !5 %call23.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx22.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx22.4.2, align 8, !tbaa !5 %call23.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx22.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx22.5.2, align 4, !tbaa !5 %call23.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx22.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx22.6.2, align 8, !tbaa !5 %call23.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx22.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx22.7.2, align 4, !tbaa !5 %call23.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx22.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx22.8.2, align 8, !tbaa !5 %call23.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx22.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %x, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx22.9.2, align 4, !tbaa !5 %call23.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp31.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp31.not, label %for.end35, label %for.inc33 for.inc33: ; preds = %for.cond11.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond11.preheader for.end35: ; preds = %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; 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"}
#include <stdio.h> int main(void){ int heya[4][3][10]={0}; int i,j,k,n,b,f,r,v; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); heya[b-1][f-1][r-1]=heya[b-1][f-1][r-1]+v; } for(i=0;i<4;i++){ for(j=0;j<3;j++){ for(k=0;k<10;k++){ printf(" %d",heya[i][j][k]); } printf("\n"); } if(i==3){ break; } printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236552/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236552/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %heya = alloca [4 x [3 x [10 x i32]]], align 16 %n = alloca i32, align 4 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %heya) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %heya, i8 0, i64 480, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond20.preheader.preheader for.body: ; preds = %entry, %for.body %i.055 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %idxprom = sext i32 %sub to i64 %2 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %2, -1 %idxprom3 = sext i32 %sub2 to i64 %3 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %3, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %5 = load i32, ptr %v, align 4, !tbaa !5 %add = add nsw i32 %5, %4 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.055, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond20.preheader.preheader, !llvm.loop !9 for.cond20.preheader.preheader: ; preds = %for.body, %entry br label %for.cond20.preheader for.cond20.preheader: ; preds = %for.cond20.preheader.preheader, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %for.cond20.preheader.preheader ] %arrayidx31 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx31, align 8, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx31.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5 %call32.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx31.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx31.2, align 8, !tbaa !5 %call32.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx31.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5 %call32.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx31.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx31.4, align 8, !tbaa !5 %call32.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx31.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx31.5, align 4, !tbaa !5 %call32.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx31.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx31.6, align 8, !tbaa !5 %call32.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx31.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx31.7, align 4, !tbaa !5 %call32.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx31.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx31.8, align 8, !tbaa !5 %call32.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx31.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx31.9, align 4, !tbaa !5 %call32.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx31.161 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx31.161, align 8, !tbaa !5 %call32.162 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx31.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx31.1.1, align 4, !tbaa !5 %call32.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx31.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx31.2.1, align 8, !tbaa !5 %call32.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx31.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx31.3.1, align 4, !tbaa !5 %call32.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx31.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx31.4.1, align 8, !tbaa !5 %call32.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx31.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx31.5.1, align 4, !tbaa !5 %call32.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx31.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx31.6.1, align 8, !tbaa !5 %call32.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx31.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx31.7.1, align 4, !tbaa !5 %call32.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx31.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx31.8.1, align 8, !tbaa !5 %call32.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx31.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx31.9.1, align 4, !tbaa !5 %call32.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx31.263 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx31.263, align 8, !tbaa !5 %call32.264 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx31.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx31.1.2, align 4, !tbaa !5 %call32.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx31.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx31.2.2, align 8, !tbaa !5 %call32.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx31.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx31.3.2, align 4, !tbaa !5 %call32.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx31.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx31.4.2, align 8, !tbaa !5 %call32.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx31.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx31.5.2, align 4, !tbaa !5 %call32.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx31.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx31.6.2, align 8, !tbaa !5 %call32.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx31.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx31.7.2, align 4, !tbaa !5 %call32.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx31.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx31.8.2, align 8, !tbaa !5 %call32.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx31.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx31.9.2, align 4, !tbaa !5 %call32.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp40 = icmp eq i64 %indvars.iv, 3 br i1 %cmp40, label %for.end44, label %if.end if.end: ; preds = %for.cond20.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond20.preheader for.end44: ; preds = %for.cond20.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %heya) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; 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"}
#include <stdio.h> int main (){ int heya[5][4][11]; int j,h,i,k,n,g,f,d; int tou,kai,room,hito; scanf("%d",&n); for(j=1; j<=4; j++){ for(h=1; h<=3; h++){ for(i=1; i<=10; i++){ heya[j][h][i]=0; } } } for(k=1; k<=n; k++){ scanf("%d %d %d %d",&tou,&kai,&room,&hito); heya[tou][kai][room]=heya[tou][kai][room]+hito; } for(g=1; g<=4; g++){ for(f=1; f<=3; f++){ for(d=1; d<=10; d++){ printf(" %d",heya[g][f][d]); } /*if(g==4&&f==3){break;}*/ printf("\n"); }if(g==4){break;}printf("####################\n"); } return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236602/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236602/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %heya = alloca [5 x [4 x [11 x i32]]], align 16 %n = alloca i32, align 4 %tou = alloca i32, align 4 %kai = alloca i32, align 4 %room = alloca i32, align 4 %hito = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 880, ptr nonnull %heya) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tou) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kai) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %room) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hito) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %scevgep = getelementptr inbounds i8, ptr %heya, i64 224 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1 = getelementptr inbounds i8, ptr %heya, i64 268 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2 = getelementptr inbounds i8, ptr %heya, i64 312 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.189 = getelementptr inbounds i8, ptr %heya, i64 400 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.189, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.1 = getelementptr inbounds i8, ptr %heya, i64 444 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.1 = getelementptr inbounds i8, ptr %heya, i64 488 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.291 = getelementptr inbounds i8, ptr %heya, i64 576 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.291, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.2 = getelementptr inbounds i8, ptr %heya, i64 620 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.2 = getelementptr inbounds i8, ptr %heya, i64 664 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.3 = getelementptr inbounds i8, ptr %heya, i64 752 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.3, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.3 = getelementptr inbounds i8, ptr %heya, i64 796 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.3, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.3 = getelementptr inbounds i8, ptr %heya, i64 840 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.3, i8 0, i64 40, i1 false), !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp18.not81 = icmp slt i32 %0, 1 br i1 %cmp18.not81, label %for.cond39.preheader.preheader, label %for.body19 for.body19: ; preds = %entry, %for.body19 %k.082 = phi i32 [ %inc34, %for.body19 ], [ 1, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tou, ptr noundef nonnull %kai, ptr noundef nonnull %room, ptr noundef nonnull %hito) %1 = load i32, ptr %tou, align 4, !tbaa !5 %idxprom21 = sext i32 %1 to i64 %2 = load i32, ptr %kai, align 4, !tbaa !5 %idxprom23 = sext i32 %2 to i64 %3 = load i32, ptr %room, align 4, !tbaa !5 %idxprom25 = sext i32 %3 to i64 %arrayidx26 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %idxprom21, i64 %idxprom23, i64 %idxprom25 %4 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %5 = load i32, ptr %hito, align 4, !tbaa !5 %add = add nsw i32 %5, %4 store i32 %add, ptr %arrayidx26, align 4, !tbaa !5 %inc34 = add nuw nsw i32 %k.082, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp18.not.not = icmp slt i32 %k.082, %6 br i1 %cmp18.not.not, label %for.body19, label %for.cond39.preheader.preheader, !llvm.loop !9 for.cond39.preheader.preheader: ; preds = %for.body19, %entry br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.cond39.preheader.preheader, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %for.cond39.preheader.preheader ] %arrayidx50 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 1 %7 = load i32, ptr %arrayidx50, align 16, !tbaa !5 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx50.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 2 %8 = load i32, ptr %arrayidx50.1, align 4, !tbaa !5 %call51.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx50.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 3 %9 = load i32, ptr %arrayidx50.2, align 8, !tbaa !5 %call51.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx50.3 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 4 %10 = load i32, ptr %arrayidx50.3, align 4, !tbaa !5 %call51.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx50.4 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 5 %11 = load i32, ptr %arrayidx50.4, align 16, !tbaa !5 %call51.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx50.5 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 6 %12 = load i32, ptr %arrayidx50.5, align 4, !tbaa !5 %call51.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx50.6 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 7 %13 = load i32, ptr %arrayidx50.6, align 8, !tbaa !5 %call51.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx50.7 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 8 %14 = load i32, ptr %arrayidx50.7, align 4, !tbaa !5 %call51.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx50.8 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 9 %15 = load i32, ptr %arrayidx50.8, align 16, !tbaa !5 %call51.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx50.9 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 1, i64 10 %16 = load i32, ptr %arrayidx50.9, align 4, !tbaa !5 %call51.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx50.195 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 1 %17 = load i32, ptr %arrayidx50.195, align 4, !tbaa !5 %call51.196 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx50.1.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 2 %18 = load i32, ptr %arrayidx50.1.1, align 16, !tbaa !5 %call51.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx50.2.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 3 %19 = load i32, ptr %arrayidx50.2.1, align 4, !tbaa !5 %call51.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx50.3.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 4 %20 = load i32, ptr %arrayidx50.3.1, align 8, !tbaa !5 %call51.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx50.4.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 5 %21 = load i32, ptr %arrayidx50.4.1, align 4, !tbaa !5 %call51.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx50.5.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 6 %22 = load i32, ptr %arrayidx50.5.1, align 16, !tbaa !5 %call51.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx50.6.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 7 %23 = load i32, ptr %arrayidx50.6.1, align 4, !tbaa !5 %call51.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx50.7.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 8 %24 = load i32, ptr %arrayidx50.7.1, align 8, !tbaa !5 %call51.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx50.8.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 9 %25 = load i32, ptr %arrayidx50.8.1, align 4, !tbaa !5 %call51.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx50.9.1 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 2, i64 10 %26 = load i32, ptr %arrayidx50.9.1, align 16, !tbaa !5 %call51.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx50.297 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 1 %27 = load i32, ptr %arrayidx50.297, align 8, !tbaa !5 %call51.298 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx50.1.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 2 %28 = load i32, ptr %arrayidx50.1.2, align 4, !tbaa !5 %call51.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx50.2.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 3 %29 = load i32, ptr %arrayidx50.2.2, align 16, !tbaa !5 %call51.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx50.3.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 4 %30 = load i32, ptr %arrayidx50.3.2, align 4, !tbaa !5 %call51.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx50.4.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 5 %31 = load i32, ptr %arrayidx50.4.2, align 8, !tbaa !5 %call51.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx50.5.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 6 %32 = load i32, ptr %arrayidx50.5.2, align 4, !tbaa !5 %call51.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx50.6.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 7 %33 = load i32, ptr %arrayidx50.6.2, align 16, !tbaa !5 %call51.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx50.7.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 8 %34 = load i32, ptr %arrayidx50.7.2, align 4, !tbaa !5 %call51.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx50.8.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 9 %35 = load i32, ptr %arrayidx50.8.2, align 8, !tbaa !5 %call51.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx50.9.2 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %heya, i64 0, i64 %indvars.iv, i64 3, i64 10 %36 = load i32, ptr %arrayidx50.9.2, align 4, !tbaa !5 %call51.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp59 = icmp eq i64 %indvars.iv, 4 br i1 %cmp59, label %for.end63, label %if.end if.end: ; preds = %for.cond39.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond39.preheader for.end63: ; preds = %for.cond39.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hito) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %room) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kai) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tou) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 880, ptr nonnull %heya) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ unsigned short usW_D_num; /* 情報量の格納用変数 */ unsigned short usW_D_house[4][3][10]; /* 部屋情報の格納用変数 */ unsigned short usW_D_bil; /* 棟番号の格納用変数 */ unsigned short usW_D_flor; /* 階数の格納用変数 */ unsigned short usW_D_room; /* 部屋番号の格納用変数 */ signed long riside; /* 入居者数の格納用変数 */ unsigned short i, j, k; /* ループ変数 */ /* 配列の初期化 */ for(i = 0;i < 4;i++){ for(j = 0;j < 3;j++){ for(k = 0;k < 10;k++){ usW_D_house[i][j][k] = 0; } } } /* 情報量の入力 */ scanf("%d", &usW_D_num); /* 入居者変更情報の入力 */ for(i = 0;i < usW_D_num;i++){ /* 入居者変更情報の入力 */ scanf("%d %d %d %d", &usW_D_bil, &usW_D_flor, &usW_D_room, &riside); /* 入居者変更情報の加算 */ usW_D_house[usW_D_bil - 1][usW_D_flor - 1][usW_D_room - 1] += riside; } /* 部屋情報の出力 */ for(i = 0;i < 4;i++){ for(j = 0;j < 3;j++){ for(k = 0;k < 10;k++){ /* 各部屋の入居者の出力 */ printf(" %d", usW_D_house[i][j][k]); } /* 階の区切り */ printf("\n"); } /* 第四棟でない場合棟を区切る */ if(i != 3){ /* 棟の区切り */ printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %usW_D_num = alloca i16, align 2 %usW_D_house = alloca [4 x [3 x [10 x i16]]], align 16 %usW_D_bil = alloca i16, align 2 %usW_D_flor = alloca i16, align 2 %usW_D_room = alloca i16, align 2 %riside = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %usW_D_num) #5 call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %usW_D_house) #5 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %usW_D_bil) #5 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %usW_D_flor) #5 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %usW_D_room) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %riside) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %usW_D_house, i8 0, i64 240, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %usW_D_num) %0 = load i16, ptr %usW_D_num, align 2, !tbaa !5 %cmp25103.not = icmp eq i16 %0, 0 br i1 %cmp25103.not, label %for.cond50.preheader.preheader, label %for.body27 for.body27: ; preds = %entry, %for.body27 %i.1104 = phi i16 [ %inc43, %for.body27 ], [ 0, %entry ] %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %usW_D_bil, ptr noundef nonnull %usW_D_flor, ptr noundef nonnull %usW_D_room, ptr noundef nonnull %riside) %1 = load i64, ptr %riside, align 8, !tbaa !9 %2 = load i16, ptr %usW_D_bil, align 2, !tbaa !5 %conv29 = zext i16 %2 to i64 %sub = add nsw i64 %conv29, -1 %3 = load i16, ptr %usW_D_flor, align 2, !tbaa !5 %conv32 = zext i16 %3 to i64 %sub33 = add nsw i64 %conv32, -1 %4 = load i16, ptr %usW_D_room, align 2, !tbaa !5 %conv36 = zext i16 %4 to i64 %sub37 = add nsw i64 %conv36, -1 %arrayidx39 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %sub, i64 %sub33, i64 %sub37 %5 = load i16, ptr %arrayidx39, align 2, !tbaa !5 %6 = trunc i64 %1 to i16 %conv41 = add i16 %5, %6 store i16 %conv41, ptr %arrayidx39, align 2, !tbaa !5 %inc43 = add nuw i16 %i.1104, 1 %7 = load i16, ptr %usW_D_num, align 2, !tbaa !5 %cmp25 = icmp ult i16 %inc43, %7 br i1 %cmp25, label %for.body27, label %for.cond50.preheader.preheader, !llvm.loop !11 for.cond50.preheader.preheader: ; preds = %for.body27, %entry br label %for.cond50.preheader for.cond50.preheader: ; preds = %for.cond50.preheader.preheader, %for.inc79 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc79 ], [ 0, %for.cond50.preheader.preheader ] %arrayidx65 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 0 %8 = load i16, ptr %arrayidx65, align 4, !tbaa !5 %conv66 = zext i16 %8 to i32 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66) %arrayidx65.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 1 %9 = load i16, ptr %arrayidx65.1, align 2, !tbaa !5 %conv66.1 = zext i16 %9 to i32 %call67.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.1) %arrayidx65.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 2 %10 = load i16, ptr %arrayidx65.2, align 4, !tbaa !5 %conv66.2 = zext i16 %10 to i32 %call67.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.2) %arrayidx65.3 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 3 %11 = load i16, ptr %arrayidx65.3, align 2, !tbaa !5 %conv66.3 = zext i16 %11 to i32 %call67.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.3) %arrayidx65.4 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 4 %12 = load i16, ptr %arrayidx65.4, align 4, !tbaa !5 %conv66.4 = zext i16 %12 to i32 %call67.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.4) %arrayidx65.5 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 5 %13 = load i16, ptr %arrayidx65.5, align 2, !tbaa !5 %conv66.5 = zext i16 %13 to i32 %call67.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.5) %arrayidx65.6 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 6 %14 = load i16, ptr %arrayidx65.6, align 4, !tbaa !5 %conv66.6 = zext i16 %14 to i32 %call67.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.6) %arrayidx65.7 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 7 %15 = load i16, ptr %arrayidx65.7, align 2, !tbaa !5 %conv66.7 = zext i16 %15 to i32 %call67.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.7) %arrayidx65.8 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 8 %16 = load i16, ptr %arrayidx65.8, align 4, !tbaa !5 %conv66.8 = zext i16 %16 to i32 %call67.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.8) %arrayidx65.9 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 0, i64 9 %17 = load i16, ptr %arrayidx65.9, align 2, !tbaa !5 %conv66.9 = zext i16 %17 to i32 %call67.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.9) %putchar = call i32 @putchar(i32 10) %arrayidx65.1116 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 0 %18 = load i16, ptr %arrayidx65.1116, align 4, !tbaa !5 %conv66.1117 = zext i16 %18 to i32 %call67.1118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.1117) %arrayidx65.1.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 1 %19 = load i16, ptr %arrayidx65.1.1, align 2, !tbaa !5 %conv66.1.1 = zext i16 %19 to i32 %call67.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.1.1) %arrayidx65.2.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 2 %20 = load i16, ptr %arrayidx65.2.1, align 4, !tbaa !5 %conv66.2.1 = zext i16 %20 to i32 %call67.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.2.1) %arrayidx65.3.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 3 %21 = load i16, ptr %arrayidx65.3.1, align 2, !tbaa !5 %conv66.3.1 = zext i16 %21 to i32 %call67.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.3.1) %arrayidx65.4.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 4 %22 = load i16, ptr %arrayidx65.4.1, align 4, !tbaa !5 %conv66.4.1 = zext i16 %22 to i32 %call67.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.4.1) %arrayidx65.5.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 5 %23 = load i16, ptr %arrayidx65.5.1, align 2, !tbaa !5 %conv66.5.1 = zext i16 %23 to i32 %call67.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.5.1) %arrayidx65.6.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 6 %24 = load i16, ptr %arrayidx65.6.1, align 4, !tbaa !5 %conv66.6.1 = zext i16 %24 to i32 %call67.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.6.1) %arrayidx65.7.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 7 %25 = load i16, ptr %arrayidx65.7.1, align 2, !tbaa !5 %conv66.7.1 = zext i16 %25 to i32 %call67.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.7.1) %arrayidx65.8.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 8 %26 = load i16, ptr %arrayidx65.8.1, align 4, !tbaa !5 %conv66.8.1 = zext i16 %26 to i32 %call67.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.8.1) %arrayidx65.9.1 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 1, i64 9 %27 = load i16, ptr %arrayidx65.9.1, align 2, !tbaa !5 %conv66.9.1 = zext i16 %27 to i32 %call67.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.9.1) %putchar.1 = call i32 @putchar(i32 10) %arrayidx65.2119 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 0 %28 = load i16, ptr %arrayidx65.2119, align 4, !tbaa !5 %conv66.2120 = zext i16 %28 to i32 %call67.2121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.2120) %arrayidx65.1.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 1 %29 = load i16, ptr %arrayidx65.1.2, align 2, !tbaa !5 %conv66.1.2 = zext i16 %29 to i32 %call67.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.1.2) %arrayidx65.2.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 2 %30 = load i16, ptr %arrayidx65.2.2, align 4, !tbaa !5 %conv66.2.2 = zext i16 %30 to i32 %call67.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.2.2) %arrayidx65.3.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 3 %31 = load i16, ptr %arrayidx65.3.2, align 2, !tbaa !5 %conv66.3.2 = zext i16 %31 to i32 %call67.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.3.2) %arrayidx65.4.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 4 %32 = load i16, ptr %arrayidx65.4.2, align 4, !tbaa !5 %conv66.4.2 = zext i16 %32 to i32 %call67.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.4.2) %arrayidx65.5.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 5 %33 = load i16, ptr %arrayidx65.5.2, align 2, !tbaa !5 %conv66.5.2 = zext i16 %33 to i32 %call67.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.5.2) %arrayidx65.6.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 6 %34 = load i16, ptr %arrayidx65.6.2, align 4, !tbaa !5 %conv66.6.2 = zext i16 %34 to i32 %call67.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.6.2) %arrayidx65.7.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 7 %35 = load i16, ptr %arrayidx65.7.2, align 2, !tbaa !5 %conv66.7.2 = zext i16 %35 to i32 %call67.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.7.2) %arrayidx65.8.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 8 %36 = load i16, ptr %arrayidx65.8.2, align 4, !tbaa !5 %conv66.8.2 = zext i16 %36 to i32 %call67.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.8.2) %arrayidx65.9.2 = getelementptr inbounds [4 x [3 x [10 x i16]]], ptr %usW_D_house, i64 0, i64 %indvars.iv, i64 2, i64 9 %37 = load i16, ptr %arrayidx65.9.2, align 2, !tbaa !5 %conv66.9.2 = zext i16 %37 to i32 %call67.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv66.9.2) %putchar.2 = call i32 @putchar(i32 10) %cmp76.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp76.not, label %for.end81, label %for.inc79 for.inc79: ; preds = %for.cond50.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond50.preheader for.end81: ; preds = %for.cond50.preheader call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %riside) #5 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %usW_D_room) #5 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %usW_D_flor) #5 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %usW_D_bil) #5 call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %usW_D_house) #5 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %usW_D_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"short", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int n, b, f, r, v; int i, j, k; int nums[4][3][10] = {{{}}}; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d %d %d %d", &b, &f, &r, &v); nums[b-1][f-1][r-1] += v; } for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 10; k++) { printf(" %d", nums[i][j][k]); } printf("\n"); } if (i < 3) printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236697/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236697/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %nums = alloca [4 x [3 x [10 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %nums) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %nums, i8 0, i64 480, 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 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.046 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.046, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc33 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc33 ], [ 0, %for.cond11.preheader.preheader ] %arrayidx22 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx22, align 8, !tbaa !5 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx22.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5 %call23.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx22.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx22.2, align 8, !tbaa !5 %call23.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx22.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx22.3, align 4, !tbaa !5 %call23.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx22.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx22.4, align 8, !tbaa !5 %call23.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx22.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx22.5, align 4, !tbaa !5 %call23.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx22.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx22.6, align 8, !tbaa !5 %call23.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx22.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx22.7, align 4, !tbaa !5 %call23.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx22.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx22.8, align 8, !tbaa !5 %call23.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx22.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx22.9, align 4, !tbaa !5 %call23.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx22.152 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx22.152, align 8, !tbaa !5 %call23.153 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx22.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx22.1.1, align 4, !tbaa !5 %call23.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx22.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx22.2.1, align 8, !tbaa !5 %call23.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx22.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx22.3.1, align 4, !tbaa !5 %call23.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx22.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx22.4.1, align 8, !tbaa !5 %call23.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx22.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx22.5.1, align 4, !tbaa !5 %call23.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx22.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx22.6.1, align 8, !tbaa !5 %call23.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx22.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx22.7.1, align 4, !tbaa !5 %call23.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx22.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx22.8.1, align 8, !tbaa !5 %call23.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx22.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx22.9.1, align 4, !tbaa !5 %call23.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx22.254 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx22.254, align 8, !tbaa !5 %call23.255 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx22.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx22.1.2, align 4, !tbaa !5 %call23.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx22.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx22.2.2, align 8, !tbaa !5 %call23.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx22.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx22.3.2, align 4, !tbaa !5 %call23.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx22.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx22.4.2, align 8, !tbaa !5 %call23.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx22.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx22.5.2, align 4, !tbaa !5 %call23.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx22.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx22.6.2, align 8, !tbaa !5 %call23.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx22.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx22.7.2, align 4, !tbaa !5 %call23.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx22.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx22.8.2, align 8, !tbaa !5 %call23.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx22.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %nums, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx22.9.2, align 4, !tbaa !5 %call23.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp31 = icmp ult i64 %indvars.iv, 3 br i1 %cmp31, label %if.then, label %for.inc33 if.then: ; preds = %for.cond11.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc33 for.inc33: ; preds = %for.cond11.preheader, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 4 br i1 %exitcond.not, label %for.end35, label %for.cond11.preheader, !llvm.loop !11 for.end35: ; preds = %for.inc33 call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %nums) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; 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}
#include<stdio.h> int main() { int a,b,c,d; while(scanf("%d%d%d%d",&a,&c,&b,&d) != EOF) { int s1,s2; s1 = 3*a/10 > a-(a/250*b) ? 3*a/10 : a-(a/250*b); s2 = 3*c/10 > c-(c/250*d) ? 3*c/10 : c-(c/250*d); if(s1 == s2) printf("Tie\n"); else if(s1 > s2) printf("Misha\n"); else printf("Vasya\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23674/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23674/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"Vasya\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"Misha\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"Tie\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %c, ptr noundef nonnull %b, ptr noundef nonnull %d) %cmp.not37 = icmp eq i32 %call36, -1 br i1 %cmp.not37, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, 3 %div = sdiv i32 %mul, 10 %div1.neg = sdiv i32 %0, -250 %1 = load i32, ptr %b, align 4, !tbaa !5 %mul2.neg = mul i32 %div1.neg, %1 %sub = add i32 %mul2.neg, %0 %div.sub = call i32 @llvm.smax.i32(i32 %div, i32 %sub) %2 = load i32, ptr %c, align 4, !tbaa !5 %mul9 = mul nsw i32 %2, 3 %div10 = sdiv i32 %mul9, 10 %div11.neg = sdiv i32 %2, -250 %3 = load i32, ptr %d, align 4, !tbaa !5 %mul12.neg = mul i32 %div11.neg, %3 %sub13 = add i32 %mul12.neg, %2 %cond23 = call i32 @llvm.smax.i32(i32 %div10, i32 %sub13) %cmp24 = icmp eq i32 %div.sub, %cond23 %cmp26 = icmp sgt i32 %div.sub, %cond23 %str.4.str = select i1 %cmp26, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp24, ptr @str.5, ptr %str.4.str %puts34 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %c, ptr noundef nonnull %b, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 i,n,b,f,r,v; int count[4][3][10]={{},{},{}}; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); count[b-1][f-1][r-1]+=v; } for(b=0;b<4;b++){ for(f=0;f<3;f++){ for(r=0;r<10;r++){ printf(" %d",count[b][f][r]); if(r==9) printf("\n"); } if(f==2 && b!=3) printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236798/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %count = alloca [4 x [3 x [10 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %count) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %count, i8 0, i64 480, 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 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.body, label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body, %entry store i32 0, ptr %b, align 4, !tbaa !5 br label %for.cond11.preheader for.body: ; preds = %entry, %for.body %i.044 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.044, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.cond8.preheader, %for.inc37 store i32 0, ptr %f, align 4, !tbaa !5 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond11.preheader, %for.inc34 store i32 0, ptr %r, align 4, !tbaa !5 br label %for.body16 for.body16: ; preds = %for.cond14.preheader, %for.inc26 %storemerge4245 = phi i32 [ 0, %for.cond14.preheader ], [ %inc27, %for.inc26 ] %7 = load i32, ptr %b, align 4, !tbaa !5 %idxprom17 = sext i32 %7 to i64 %8 = load i32, ptr %f, align 4, !tbaa !5 %idxprom19 = sext i32 %8 to i64 %idxprom21 = sext i32 %storemerge4245 to i64 %arrayidx22 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %idxprom17, i64 %idxprom19, i64 %idxprom21 %9 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %10 = load i32, ptr %r, align 4, !tbaa !5 %cmp24 = icmp eq i32 %10, 9 br i1 %cmp24, label %if.then, label %for.inc26 if.then: ; preds = %for.body16 %putchar = call i32 @putchar(i32 10) %.pre = load i32, ptr %r, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.body16, %if.then %11 = phi i32 [ %10, %for.body16 ], [ %.pre, %if.then ] %inc27 = add nsw i32 %11, 1 store i32 %inc27, ptr %r, align 4, !tbaa !5 %cmp15 = icmp slt i32 %11, 9 br i1 %cmp15, label %for.body16, label %for.end28, !llvm.loop !11 for.end28: ; preds = %for.inc26 %12 = load i32, ptr %f, align 4, !tbaa !5 %cmp29 = icmp eq i32 %12, 2 %13 = load i32, ptr %b, align 4 %cmp30 = icmp ne i32 %13, 3 %or.cond = select i1 %cmp29, i1 %cmp30, i1 false br i1 %or.cond, label %if.then31, label %for.inc34 if.then31: ; preds = %for.end28 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre46 = load i32, ptr %f, align 4, !tbaa !5 br label %for.inc34 for.inc34: ; preds = %for.end28, %if.then31 %14 = phi i32 [ %12, %for.end28 ], [ %.pre46, %if.then31 ] %inc35 = add nsw i32 %14, 1 store i32 %inc35, ptr %f, align 4, !tbaa !5 %cmp12 = icmp slt i32 %14, 2 br i1 %cmp12, label %for.cond14.preheader, label %for.inc37, !llvm.loop !12 for.inc37: ; preds = %for.inc34 %15 = load i32, ptr %b, align 4, !tbaa !5 %inc38 = add nsw i32 %15, 1 store i32 %inc38, ptr %b, align 4, !tbaa !5 %cmp9 = icmp slt i32 %15, 3 br i1 %cmp9, label %for.cond11.preheader, label %for.end39, !llvm.loop !13 for.end39: ; preds = %for.inc37 call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %count) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; 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 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> void print(int[][3][10]); void print(int x[][3][10]){ int o,p,q; char y[21]="####################"; for(o=0;o<4;o++){ for(p=0;p<3;p++){ for(q=0;q<10;q++){ printf(" %d",x[o][p][q]); } printf("\n"); } if(o<3){ printf("%s\n",y); } } return; } int main(void){ int b,f,r,v,i,n; int a[4][3][10]={0}; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); a[b-1][f-1][r-1]+=v; } print(a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236855/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236855/source.c" target datalayout = "e-m:e-p270: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.print.y = private unnamed_addr constant [21 x i8] c"####################\00", align 16 @.str = 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 @.str.4 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %x) local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc17 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc17 ] %arrayidx10 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 0 %0 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %arrayidx10.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 1 %1 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) %arrayidx10.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 2 %2 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2) %arrayidx10.3 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 3 %3 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %arrayidx10.4 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 4 %4 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5 %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %arrayidx10.5 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 5 %5 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5 %call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5) %arrayidx10.6 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 6 %6 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5 %call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %arrayidx10.7 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 7 %7 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5 %call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %arrayidx10.8 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 8 %8 = load i32, ptr %arrayidx10.8, align 4, !tbaa !5 %call.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %arrayidx10.9 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 0, i64 9 %9 = load i32, ptr %arrayidx10.9, align 4, !tbaa !5 %call.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9) %putchar = tail call i32 @putchar(i32 10) %arrayidx10.132 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 0 %10 = load i32, ptr %arrayidx10.132, align 4, !tbaa !5 %call.133 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %arrayidx10.1.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 1 %11 = load i32, ptr %arrayidx10.1.1, align 4, !tbaa !5 %call.1.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11) %arrayidx10.2.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 2 %12 = load i32, ptr %arrayidx10.2.1, align 4, !tbaa !5 %call.2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12) %arrayidx10.3.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 3 %13 = load i32, ptr %arrayidx10.3.1, align 4, !tbaa !5 %call.3.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13) %arrayidx10.4.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 4 %14 = load i32, ptr %arrayidx10.4.1, align 4, !tbaa !5 %call.4.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %arrayidx10.5.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 5 %15 = load i32, ptr %arrayidx10.5.1, align 4, !tbaa !5 %call.5.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15) %arrayidx10.6.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 6 %16 = load i32, ptr %arrayidx10.6.1, align 4, !tbaa !5 %call.6.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16) %arrayidx10.7.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 7 %17 = load i32, ptr %arrayidx10.7.1, align 4, !tbaa !5 %call.7.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17) %arrayidx10.8.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 8 %18 = load i32, ptr %arrayidx10.8.1, align 4, !tbaa !5 %call.8.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18) %arrayidx10.9.1 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 1, i64 9 %19 = load i32, ptr %arrayidx10.9.1, align 4, !tbaa !5 %call.9.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19) %putchar.1 = tail call i32 @putchar(i32 10) %arrayidx10.234 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 0 %20 = load i32, ptr %arrayidx10.234, align 4, !tbaa !5 %call.235 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %arrayidx10.1.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 1 %21 = load i32, ptr %arrayidx10.1.2, align 4, !tbaa !5 %call.1.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21) %arrayidx10.2.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 2 %22 = load i32, ptr %arrayidx10.2.2, align 4, !tbaa !5 %call.2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %arrayidx10.3.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 3 %23 = load i32, ptr %arrayidx10.3.2, align 4, !tbaa !5 %call.3.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23) %arrayidx10.4.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 4 %24 = load i32, ptr %arrayidx10.4.2, align 4, !tbaa !5 %call.4.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24) %arrayidx10.5.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 5 %25 = load i32, ptr %arrayidx10.5.2, align 4, !tbaa !5 %call.5.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %25) %arrayidx10.6.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 6 %26 = load i32, ptr %arrayidx10.6.2, align 4, !tbaa !5 %call.6.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26) %arrayidx10.7.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 7 %27 = load i32, ptr %arrayidx10.7.2, align 4, !tbaa !5 %call.7.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %27) %arrayidx10.8.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 8 %28 = load i32, ptr %arrayidx10.8.2, align 4, !tbaa !5 %call.8.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28) %arrayidx10.9.2 = getelementptr inbounds [3 x [10 x i32]], ptr %x, i64 %indvars.iv, i64 2, i64 9 %29 = load i32, ptr %arrayidx10.9.2, align 4, !tbaa !5 %call.9.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %29) %putchar.2 = tail call i32 @putchar(i32 10) %cmp15 = icmp ult i64 %indvars.iv, 3 br i1 %cmp15, label %if.then, label %for.inc17 if.then: ; preds = %for.cond1.preheader %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @__const.print.y) br label %for.inc17 for.inc17: ; preds = %for.cond1.preheader, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 4 br i1 %exitcond.not, label %for.end19, label %for.cond1.preheader, !llvm.loop !9 for.end19: ; preds = %for.inc17 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: %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %n = alloca i32, align 4 %a = alloca [4 x [3 x [10 x i32]]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %a, i8 0, i64 480, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %a, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.010, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry call void @print(ptr noundef nonnull %a) call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 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) #3 ; 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 #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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}
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define ARR_LIMIT 10000 #define NOT_USE '0' #define RIDGE_BREAK "####################\n" #define RIDGE_LIMIT 4 #define FLOOR_LIMIT 3 #define TH_LIMIT 10 #define PEOPLE_LIMIT 9 #define RidgeCheck(ridge) ( \ (ridge) >= 1 && \ (ridge) <= RIDGE_LIMIT \ ) #define FloorCheck(floor) ( \ (floor) >= 1 && \ (floor) <= FLOOR_LIMIT \ ) #define ThCheck(th) ( \ (th) >= 1 && \ (th) <= TH_LIMIT \ ) #define PeopleCheck(people) ( \ (people) >= -PEOPLE_LIMIT &&\ (people) <= PEOPLE_LIMIT \ ) typedef struct { int th; int people; } Th; typedef struct { int floor; Th ths[TH_LIMIT]; } Floor; typedef struct { int ridge; Floor floors[FLOOR_LIMIT]; } Ridge; typedef struct { int ridge; int floor; int th; int people; } InputRidge; Ridge ridges[RIDGE_LIMIT]; void GetRidges(Ridge* ridges); void InputNumber(int* number, int limitLow, int limitHigh); void InputRidgeVal(InputRidge* input); void Calculation(Ridge* ridges, InputRidge* inputs, int size); void Drawing(Ridge* ridges); short PeopleValid(Ridge* ridges, InputRidge input); int main(void) { int n; int idx; InputRidge inputs[ARR_LIMIT]; GetRidges(ridges); InputNumber(&n, 0, ARR_LIMIT); for (idx = 0; idx < n; idx++) { InputRidgeVal(&inputs[idx]); } Calculation(ridges, inputs, idx); Drawing(ridges); return 0; } void GetRidges(Ridge* ridges) { int idR; int idF; int idT; for (idR = 0; idR < RIDGE_LIMIT; idR++) { Ridge* ridge = (ridges + idR); ridge->ridge = idR + 1; Floor* floors = ridge->floors; for (idF = 0; idF < FLOOR_LIMIT; idF++) { Floor* floor = floors + idF; floor->floor = idF + 1; Th* ths = floor->ths; for (idT = 0; idT < TH_LIMIT; idT++) { Th* th = ths + idT; th->th = idT + 1; th->people = 0; } } } } void InputNumber(int* number, int limitLow, int limitHigh) { int x; do { scanf("%d", &x); } while (x < limitLow || x > limitHigh); *number = x; } void InputRidgeVal(InputRidge* input) { int ridge; int floor; int th; int people; do { scanf("%d %d %d %d", &ridge, &floor, &th, &people); } while (!RidgeCheck(ridge) || !FloorCheck(floor) || !ThCheck(th) || !PeopleCheck(people)); InputRidge inp = { ridge, floor, th, people }; *input = inp; } void Calculation(Ridge* ridges, InputRidge* inputs, int size) { int idi; for (idi = 0; idi < size; idi++) { InputRidge input = inputs[idi]; if (!PeopleValid(ridges, input)) { continue; } else { Ridge* ridge = ridges + input.ridge - 1; Floor* floors = ridge->floors; Floor* floor = floors + input.floor - 1; Th* ths = floor->ths; Th* th = ths + input.th - 1; int* people = &(th->people); *people += input.people; } } } void Drawing(Ridge* ridges) { int idR; int idF; int idT; for (idR = 0; idR < RIDGE_LIMIT; idR++) { Ridge ridge = *(ridges + idR); Floor* floors = ridge.floors; for (idF = 0; idF < FLOOR_LIMIT; idF++) { Floor floor = *(floors + idF); Th* ths = floor.ths; for (idT = 0; idT < TH_LIMIT - 1; idT++) { Th th = *(ths + idT); printf(" %d", th.people); } Th th = *(ths + idT); printf(" %d\n", th.people); } if (idR != RIDGE_LIMIT - 1) { printf(RIDGE_BREAK); } } } short PeopleValid(Ridge* ridges, InputRidge input) { Ridge ridge = ridges[input.ridge - 1]; Floor floor = ridge.floors[input.floor - 1]; Th th = floor.ths[input.th - 1]; int people = th.people; int cal = people + input.people; return cal >= 0 && cal <= PEOPLE_LIMIT; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236899/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236899/source.c" target datalayout = "e-m:e-p270: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.Ridge = type { i32, [3 x %struct.Floor] } %struct.Floor = type { i32, [10 x %struct.Th] } %struct.Th = type { i32, i32 } %struct.InputRidge = type { i32, i32, i32, i32 } @ridges = dso_local global [4 x %struct.Ridge] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c" %d\0A\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ridge.i.i = alloca %struct.Ridge, align 4 %floor.i.i = alloca %struct.Floor, align 4 %ridge.i = alloca i32, align 4 %floor.i = alloca i32, align 4 %th.i = alloca i32, align 4 %people.i = alloca i32, align 4 %x.i = alloca i32, align 4 %inputs = alloca [10000 x %struct.InputRidge], align 16 call void @llvm.lifetime.start.p0(i64 160000, ptr nonnull %inputs) #8 tail call void @GetRidges(ptr noundef nonnull @ridges) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x.i) #8 br label %do.body.i do.body.i: ; preds = %do.body.i, %entry %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x.i) %0 = load i32, ptr %x.i, align 4 %1 = icmp ugt i32 %0, 10000 br i1 %1, label %do.body.i, label %InputNumber.exit, !llvm.loop !5 InputNumber.exit: ; preds = %do.body.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x.i) #8 %cmp10.not = icmp eq i32 %0, 0 br i1 %cmp10.not, label %Calculation.exit, label %for.body.preheader for.body.preheader: ; preds = %InputNumber.exit %wide.trip.count = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %InputRidgeVal.exit %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %InputRidgeVal.exit ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ridge.i) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %floor.i) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %th.i) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %people.i) #8 br label %do.body.i4 do.body.i4: ; preds = %do.body.i4.backedge, %for.body %call.i5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ridge.i, ptr noundef nonnull %floor.i, ptr noundef nonnull %th.i, ptr noundef nonnull %people.i) %2 = load i32, ptr %ridge.i, align 4 %3 = add i32 %2, -1 %or.cond.i = icmp ult i32 %3, 4 %4 = load i32, ptr %floor.i, align 4 %cmp2.i = icmp sgt i32 %4, 0 %or.cond15.i = select i1 %or.cond.i, i1 %cmp2.i, i1 false %cmp4.i = icmp slt i32 %4, 4 %or.cond16.i = select i1 %or.cond15.i, i1 %cmp4.i, i1 false %5 = load i32, ptr %th.i, align 4 %cmp6.i = icmp sgt i32 %5, 0 %or.cond17.i = select i1 %or.cond16.i, i1 %cmp6.i, i1 false %cmp8.i = icmp slt i32 %5, 11 %or.cond18.i = select i1 %or.cond17.i, i1 %cmp8.i, i1 false br i1 %or.cond18.i, label %lor.rhs.i, label %do.body.i4.backedge lor.rhs.i: ; preds = %do.body.i4 %6 = load i32, ptr %people.i, align 4 %7 = add i32 %6, -10 %8 = icmp ult i32 %7, -19 br i1 %8, label %do.body.i4.backedge, label %InputRidgeVal.exit do.body.i4.backedge: ; preds = %lor.rhs.i, %do.body.i4 br label %do.body.i4, !llvm.loop !7 InputRidgeVal.exit: ; preds = %lor.rhs.i %arrayidx = getelementptr inbounds [10000 x %struct.InputRidge], ptr %inputs, i64 0, i64 %indvars.iv store i32 %2, ptr %arrayidx, align 16, !tbaa.struct !8 %inp.sroa.4.0..sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx, i64 4 store i32 %4, ptr %inp.sroa.4.0..sroa_idx.i, align 4, !tbaa.struct !13 %inp.sroa.5.0..sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i32 %5, ptr %inp.sroa.5.0..sroa_idx.i, align 8, !tbaa.struct !14 %inp.sroa.6.0..sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx, i64 12 store i32 %6, ptr %inp.sroa.6.0..sroa_idx.i, align 4, !tbaa.struct !15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %people.i) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %th.i) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %floor.i) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ridge.i) #8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.body.preheader.i, label %for.body, !llvm.loop !16 for.body.preheader.i: ; preds = %InputRidgeVal.exit %wide.trip.count.i = zext i32 %0 to i64 br label %for.body.i for.body.i: ; preds = %cleanup.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %cleanup.i ] %arrayidx.i = getelementptr inbounds %struct.InputRidge, ptr %inputs, i64 %indvars.iv.i %input.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 16, !tbaa.struct !8 %input.sroa.6.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8 %input.sroa.6.0.copyload.i = load i64, ptr %input.sroa.6.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !14 %input.sroa.5.8.extract.shift.i.i = lshr i64 %input.sroa.6.0.copyload.i, 32 %input.sroa.5.8.extract.trunc.i.i = trunc i64 %input.sroa.5.8.extract.shift.i.i to i32 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %ridge.i.i) #8 %sub.i.i = shl i64 %input.sroa.0.0.copyload.i, 32 %sext.i.i = add i64 %sub.i.i, -4294967296 %idxprom.i.i = ashr exact i64 %sext.i.i, 32 %arrayidx.i.i = getelementptr inbounds %struct.Ridge, ptr @ridges, i64 %idxprom.i.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(256) %ridge.i.i, ptr noundef nonnull align 16 dereferenceable(256) %arrayidx.i.i, i64 256, i1 false), !tbaa.struct !17 call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %floor.i.i) #8 %sext14.i.i = add i64 %input.sroa.0.0.copyload.i, -4294967296 %idxprom4.i.i = ashr i64 %sext14.i.i, 32 %arrayidx5.i.i = getelementptr inbounds %struct.Ridge, ptr %ridge.i.i, i64 0, i32 1, i64 %idxprom4.i.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(84) %floor.i.i, ptr noundef nonnull align 4 dereferenceable(84) %arrayidx5.i.i, i64 84, i1 false), !tbaa.struct !19 %sub7.i.i = shl i64 %input.sroa.6.0.copyload.i, 32 %sext15.i.i = add i64 %sub7.i.i, -4294967296 %idxprom8.i.i = ashr exact i64 %sext15.i.i, 32 %th.sroa.3.0.arrayidx9.sroa_idx.i.i = getelementptr inbounds %struct.Floor, ptr %floor.i.i, i64 0, i32 1, i64 %idxprom8.i.i, i32 1 %th.sroa.3.0.copyload.i.i = load i32, ptr %th.sroa.3.0.arrayidx9.sroa_idx.i.i, align 4, !tbaa.struct !15 %add.i.i = add nsw i32 %th.sroa.3.0.copyload.i.i, %input.sroa.5.8.extract.trunc.i.i %9 = icmp ugt i32 %add.i.i, 9 call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %floor.i.i) #8 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %ridge.i.i) #8 br i1 %9, label %cleanup.i, label %if.else.i if.else.i: ; preds = %for.body.i %idx.ext.i = ashr exact i64 %sub.i.i, 32 %gep.i = getelementptr %struct.Ridge, ptr getelementptr ([4 x %struct.Ridge], ptr @ridges, i64 -1, i64 3, i32 1), i64 %idx.ext.i %idx.ext5.i = ashr i64 %input.sroa.0.0.copyload.i, 32 %add.ptr6.i = getelementptr inbounds %struct.Floor, ptr %gep.i, i64 %idx.ext5.i %ths8.i = getelementptr %struct.Floor, ptr %add.ptr6.i, i64 -1, i32 1 %idx.ext11.i = ashr exact i64 %sub7.i.i, 32 %add.ptr12.i = getelementptr inbounds %struct.Th, ptr %ths8.i, i64 %idx.ext11.i %people14.i = getelementptr %struct.Th, ptr %add.ptr12.i, i64 -1, i32 1 %10 = load i32, ptr %people14.i, align 4, !tbaa !9 %add.i = add nsw i32 %10, %input.sroa.5.8.extract.trunc.i.i store i32 %add.i, ptr %people14.i, align 4, !tbaa !9 br label %cleanup.i cleanup.i: ; preds = %if.else.i, %for.body.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %Calculation.exit, label %for.body.i, !llvm.loop !20 Calculation.exit: ; preds = %cleanup.i, %InputNumber.exit call void @Drawing(ptr noundef nonnull @ridges) call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %inputs) #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) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @GetRidges(ptr nocapture noundef writeonly %ridges) local_unnamed_addr #2 { entry: store <4 x i32> <i32 1, i32 1, i32 1, i32 0>, ptr %ridges, align 4, !tbaa !9 %add.ptr16.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 0, i32 1, i64 1 store <4 x i32> <i32 2, i32 0, i32 3, i32 0>, ptr %add.ptr16.1, align 4, !tbaa !9 %add.ptr16.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 0, i32 1, i64 3 store <4 x i32> <i32 4, i32 0, i32 5, i32 0>, ptr %add.ptr16.3, align 4, !tbaa !9 %add.ptr16.5 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 0, i32 1, i64 5 store <4 x i32> <i32 6, i32 0, i32 7, i32 0>, ptr %add.ptr16.5, align 4, !tbaa !9 %add.ptr16.7 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 0, i32 1, i64 7 store <4 x i32> <i32 8, i32 0, i32 9, i32 0>, ptr %add.ptr16.7, align 4, !tbaa !9 %add.ptr16.9 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 0, i32 1, i64 9 store <4 x i32> <i32 10, i32 0, i32 2, i32 1>, ptr %add.ptr16.9, align 4, !tbaa !9 %people.142 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 1, i32 1, i64 0, i32 1 store <4 x i32> <i32 0, i32 2, i32 0, i32 3>, ptr %people.142, align 4, !tbaa !9 %people.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 1, i32 1, i64 2, i32 1 store <4 x i32> <i32 0, i32 4, i32 0, i32 5>, ptr %people.2.1, align 4, !tbaa !9 %people.4.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 1, i32 1, i64 4, i32 1 store <4 x i32> <i32 0, i32 6, i32 0, i32 7>, ptr %people.4.1, align 4, !tbaa !9 %people.6.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 1, i32 1, i64 6, i32 1 store <4 x i32> <i32 0, i32 8, i32 0, i32 9>, ptr %people.6.1, align 4, !tbaa !9 %people.8.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 1, i32 1, i64 8, i32 1 store <4 x i32> <i32 0, i32 10, i32 0, i32 3>, ptr %people.8.1, align 4, !tbaa !9 %ths10.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 2, i32 1 store <4 x i32> <i32 1, i32 0, i32 2, i32 0>, ptr %ths10.2, align 4, !tbaa !9 %add.ptr16.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 2, i32 1, i64 2 store <4 x i32> <i32 3, i32 0, i32 4, i32 0>, ptr %add.ptr16.2.2, align 4, !tbaa !9 %add.ptr16.4.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 2, i32 1, i64 4 store <4 x i32> <i32 5, i32 0, i32 6, i32 0>, ptr %add.ptr16.4.2, align 4, !tbaa !9 %add.ptr16.6.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 2, i32 1, i64 6 store <4 x i32> <i32 7, i32 0, i32 8, i32 0>, ptr %add.ptr16.6.2, align 4, !tbaa !9 %add.ptr16.8.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 0, i32 1, i64 2, i32 1, i64 8 store <4 x i32> <i32 9, i32 0, i32 10, i32 0>, ptr %add.ptr16.8.2, align 4, !tbaa !9 %add.ptr.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1 store <4 x i32> <i32 2, i32 1, i32 1, i32 0>, ptr %add.ptr.1, align 4, !tbaa !9 %add.ptr16.1.147 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 0, i32 1, i64 1 store <4 x i32> <i32 2, i32 0, i32 3, i32 0>, ptr %add.ptr16.1.147, align 4, !tbaa !9 %add.ptr16.3.151 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 0, i32 1, i64 3 store <4 x i32> <i32 4, i32 0, i32 5, i32 0>, ptr %add.ptr16.3.151, align 4, !tbaa !9 %add.ptr16.5.155 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 0, i32 1, i64 5 store <4 x i32> <i32 6, i32 0, i32 7, i32 0>, ptr %add.ptr16.5.155, align 4, !tbaa !9 %add.ptr16.7.159 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 0, i32 1, i64 7 store <4 x i32> <i32 8, i32 0, i32 9, i32 0>, ptr %add.ptr16.7.159, align 4, !tbaa !9 %add.ptr16.9.163 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 0, i32 1, i64 9 store <4 x i32> <i32 10, i32 0, i32 2, i32 1>, ptr %add.ptr16.9.163, align 4, !tbaa !9 %people.142.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 1, i32 1, i64 0, i32 1 store <4 x i32> <i32 0, i32 2, i32 0, i32 3>, ptr %people.142.1, align 4, !tbaa !9 %people.2.1.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 1, i32 1, i64 2, i32 1 store <4 x i32> <i32 0, i32 4, i32 0, i32 5>, ptr %people.2.1.1, align 4, !tbaa !9 %people.4.1.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 1, i32 1, i64 4, i32 1 store <4 x i32> <i32 0, i32 6, i32 0, i32 7>, ptr %people.4.1.1, align 4, !tbaa !9 %people.6.1.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 1, i32 1, i64 6, i32 1 store <4 x i32> <i32 0, i32 8, i32 0, i32 9>, ptr %people.6.1.1, align 4, !tbaa !9 %people.8.1.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 1, i32 1, i64 8, i32 1 store <4 x i32> <i32 0, i32 10, i32 0, i32 3>, ptr %people.8.1.1, align 4, !tbaa !9 %ths10.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 2, i32 1 store <4 x i32> <i32 1, i32 0, i32 2, i32 0>, ptr %ths10.2.1, align 4, !tbaa !9 %add.ptr16.2.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 2, i32 1, i64 2 store <4 x i32> <i32 3, i32 0, i32 4, i32 0>, ptr %add.ptr16.2.2.1, align 4, !tbaa !9 %add.ptr16.4.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 2, i32 1, i64 4 store <4 x i32> <i32 5, i32 0, i32 6, i32 0>, ptr %add.ptr16.4.2.1, align 4, !tbaa !9 %add.ptr16.6.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 2, i32 1, i64 6 store <4 x i32> <i32 7, i32 0, i32 8, i32 0>, ptr %add.ptr16.6.2.1, align 4, !tbaa !9 %add.ptr16.8.2.1 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 1, i32 1, i64 2, i32 1, i64 8 store <4 x i32> <i32 9, i32 0, i32 10, i32 0>, ptr %add.ptr16.8.2.1, align 4, !tbaa !9 %add.ptr.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2 store <4 x i32> <i32 3, i32 1, i32 1, i32 0>, ptr %add.ptr.2, align 4, !tbaa !9 %add.ptr16.1.268 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 0, i32 1, i64 1 store <4 x i32> <i32 2, i32 0, i32 3, i32 0>, ptr %add.ptr16.1.268, align 4, !tbaa !9 %add.ptr16.3.272 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 0, i32 1, i64 3 store <4 x i32> <i32 4, i32 0, i32 5, i32 0>, ptr %add.ptr16.3.272, align 4, !tbaa !9 %add.ptr16.5.276 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 0, i32 1, i64 5 store <4 x i32> <i32 6, i32 0, i32 7, i32 0>, ptr %add.ptr16.5.276, align 4, !tbaa !9 %add.ptr16.7.280 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 0, i32 1, i64 7 store <4 x i32> <i32 8, i32 0, i32 9, i32 0>, ptr %add.ptr16.7.280, align 4, !tbaa !9 %add.ptr16.9.284 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 0, i32 1, i64 9 store <4 x i32> <i32 10, i32 0, i32 2, i32 1>, ptr %add.ptr16.9.284, align 4, !tbaa !9 %people.142.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 1, i32 1, i64 0, i32 1 store <4 x i32> <i32 0, i32 2, i32 0, i32 3>, ptr %people.142.2, align 4, !tbaa !9 %people.2.1.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 1, i32 1, i64 2, i32 1 store <4 x i32> <i32 0, i32 4, i32 0, i32 5>, ptr %people.2.1.2, align 4, !tbaa !9 %people.4.1.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 1, i32 1, i64 4, i32 1 store <4 x i32> <i32 0, i32 6, i32 0, i32 7>, ptr %people.4.1.2, align 4, !tbaa !9 %people.6.1.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 1, i32 1, i64 6, i32 1 store <4 x i32> <i32 0, i32 8, i32 0, i32 9>, ptr %people.6.1.2, align 4, !tbaa !9 %people.8.1.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 1, i32 1, i64 8, i32 1 store <4 x i32> <i32 0, i32 10, i32 0, i32 3>, ptr %people.8.1.2, align 4, !tbaa !9 %ths10.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 2, i32 1 store <4 x i32> <i32 1, i32 0, i32 2, i32 0>, ptr %ths10.2.2, align 4, !tbaa !9 %add.ptr16.2.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 2, i32 1, i64 2 store <4 x i32> <i32 3, i32 0, i32 4, i32 0>, ptr %add.ptr16.2.2.2, align 4, !tbaa !9 %add.ptr16.4.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 2, i32 1, i64 4 store <4 x i32> <i32 5, i32 0, i32 6, i32 0>, ptr %add.ptr16.4.2.2, align 4, !tbaa !9 %add.ptr16.6.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 2, i32 1, i64 6 store <4 x i32> <i32 7, i32 0, i32 8, i32 0>, ptr %add.ptr16.6.2.2, align 4, !tbaa !9 %add.ptr16.8.2.2 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 2, i32 1, i64 2, i32 1, i64 8 store <4 x i32> <i32 9, i32 0, i32 10, i32 0>, ptr %add.ptr16.8.2.2, align 4, !tbaa !9 %add.ptr.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3 store <4 x i32> <i32 4, i32 1, i32 1, i32 0>, ptr %add.ptr.3, align 4, !tbaa !9 %add.ptr16.1.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 0, i32 1, i64 1 store <4 x i32> <i32 2, i32 0, i32 3, i32 0>, ptr %add.ptr16.1.3, align 4, !tbaa !9 %add.ptr16.3.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 0, i32 1, i64 3 store <4 x i32> <i32 4, i32 0, i32 5, i32 0>, ptr %add.ptr16.3.3, align 4, !tbaa !9 %add.ptr16.5.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 0, i32 1, i64 5 store <4 x i32> <i32 6, i32 0, i32 7, i32 0>, ptr %add.ptr16.5.3, align 4, !tbaa !9 %add.ptr16.7.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 0, i32 1, i64 7 store <4 x i32> <i32 8, i32 0, i32 9, i32 0>, ptr %add.ptr16.7.3, align 4, !tbaa !9 %add.ptr16.9.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 0, i32 1, i64 9 store <4 x i32> <i32 10, i32 0, i32 2, i32 1>, ptr %add.ptr16.9.3, align 4, !tbaa !9 %people.142.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 1, i32 1, i64 0, i32 1 store <4 x i32> <i32 0, i32 2, i32 0, i32 3>, ptr %people.142.3, align 4, !tbaa !9 %people.2.1.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 1, i32 1, i64 2, i32 1 store <4 x i32> <i32 0, i32 4, i32 0, i32 5>, ptr %people.2.1.3, align 4, !tbaa !9 %people.4.1.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 1, i32 1, i64 4, i32 1 store <4 x i32> <i32 0, i32 6, i32 0, i32 7>, ptr %people.4.1.3, align 4, !tbaa !9 %people.6.1.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 1, i32 1, i64 6, i32 1 store <4 x i32> <i32 0, i32 8, i32 0, i32 9>, ptr %people.6.1.3, align 4, !tbaa !9 %people.8.1.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 1, i32 1, i64 8, i32 1 store <4 x i32> <i32 0, i32 10, i32 0, i32 3>, ptr %people.8.1.3, align 4, !tbaa !9 %ths10.2.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 2, i32 1 store <4 x i32> <i32 1, i32 0, i32 2, i32 0>, ptr %ths10.2.3, align 4, !tbaa !9 %add.ptr16.2.2.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 2, i32 1, i64 2 store <4 x i32> <i32 3, i32 0, i32 4, i32 0>, ptr %add.ptr16.2.2.3, align 4, !tbaa !9 %add.ptr16.4.2.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 2, i32 1, i64 4 store <4 x i32> <i32 5, i32 0, i32 6, i32 0>, ptr %add.ptr16.4.2.3, align 4, !tbaa !9 %add.ptr16.6.2.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 2, i32 1, i64 6 store <4 x i32> <i32 7, i32 0, i32 8, i32 0>, ptr %add.ptr16.6.2.3, align 4, !tbaa !9 %add.ptr16.8.2.3 = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 3, i32 1, i64 2, i32 1, i64 8 store <4 x i32> <i32 9, i32 0, i32 10, i32 0>, ptr %add.ptr16.8.2.3, align 4, !tbaa !9 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @InputNumber(ptr nocapture noundef writeonly %number, i32 noundef %limitLow, i32 noundef %limitHigh) local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8 br label %do.body do.body: ; preds = %do.body, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4 %cmp = icmp slt i32 %0, %limitLow %cmp1 = icmp sgt i32 %0, %limitHigh %1 = or i1 %cmp, %cmp1 br i1 %1, label %do.body, label %do.end, !llvm.loop !5 do.end: ; preds = %do.body store i32 %0, ptr %number, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @InputRidgeVal(ptr nocapture noundef writeonly %input) local_unnamed_addr #0 { entry: %ridge = alloca i32, align 4 %floor = alloca i32, align 4 %th = alloca i32, align 4 %people = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ridge) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %floor) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %th) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %people) #8 br label %do.body do.body: ; preds = %do.body.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ridge, ptr noundef nonnull %floor, ptr noundef nonnull %th, ptr noundef nonnull %people) %0 = load i32, ptr %ridge, align 4 %1 = add i32 %0, -1 %or.cond = icmp ult i32 %1, 4 %2 = load i32, ptr %floor, align 4 %cmp2 = icmp sgt i32 %2, 0 %or.cond15 = select i1 %or.cond, i1 %cmp2, i1 false %cmp4 = icmp slt i32 %2, 4 %or.cond16 = select i1 %or.cond15, i1 %cmp4, i1 false %3 = load i32, ptr %th, align 4 %cmp6 = icmp sgt i32 %3, 0 %or.cond17 = select i1 %or.cond16, i1 %cmp6, i1 false %cmp8 = icmp slt i32 %3, 11 %or.cond18 = select i1 %or.cond17, i1 %cmp8, i1 false br i1 %or.cond18, label %lor.rhs, label %do.body.backedge lor.rhs: ; preds = %do.body %4 = load i32, ptr %people, align 4 %5 = add i32 %4, -10 %6 = icmp ult i32 %5, -19 br i1 %6, label %do.body.backedge, label %do.end do.body.backedge: ; preds = %lor.rhs, %do.body br label %do.body, !llvm.loop !7 do.end: ; preds = %lor.rhs store i32 %0, ptr %input, align 4, !tbaa.struct !8 %inp.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %input, i64 4 store i32 %2, ptr %inp.sroa.4.0..sroa_idx, align 4, !tbaa.struct !13 %inp.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %input, i64 8 store i32 %3, ptr %inp.sroa.5.0..sroa_idx, align 4, !tbaa.struct !14 %inp.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %input, i64 12 store i32 %4, ptr %inp.sroa.6.0..sroa_idx, align 4, !tbaa.struct !15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %people) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %th) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %floor) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ridge) #8 ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @Calculation(ptr nocapture noundef %ridges, ptr nocapture noundef readonly %inputs, i32 noundef %size) local_unnamed_addr #3 { entry: %ridge.i = alloca %struct.Ridge, align 4 %floor.i = alloca %struct.Floor, align 4 %invariant.gep = getelementptr %struct.Ridge, ptr %ridges, i64 -1, i32 1 %cmp23 = icmp sgt i32 %size, 0 br i1 %cmp23, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size to i64 br label %for.body for.body: ; preds = %for.body.preheader, %cleanup %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %cleanup ] %arrayidx = getelementptr inbounds %struct.InputRidge, ptr %inputs, i64 %indvars.iv %input.sroa.0.0.copyload = load i64, ptr %arrayidx, align 4, !tbaa.struct !8 %input.sroa.6.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 %input.sroa.6.0.copyload = load i64, ptr %input.sroa.6.0.arrayidx.sroa_idx, align 4, !tbaa.struct !14 %input.sroa.5.8.extract.shift.i = lshr i64 %input.sroa.6.0.copyload, 32 %input.sroa.5.8.extract.trunc.i = trunc i64 %input.sroa.5.8.extract.shift.i to i32 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %ridge.i) #8 %sub.i = shl i64 %input.sroa.0.0.copyload, 32 %sext.i = add i64 %sub.i, -4294967296 %idxprom.i = ashr exact i64 %sext.i, 32 %arrayidx.i = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(256) %ridge.i, ptr noundef nonnull align 4 dereferenceable(256) %arrayidx.i, i64 256, i1 false), !tbaa.struct !17 call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %floor.i) #8 %sext14.i = add i64 %input.sroa.0.0.copyload, -4294967296 %idxprom4.i = ashr i64 %sext14.i, 32 %arrayidx5.i = getelementptr inbounds %struct.Ridge, ptr %ridge.i, i64 0, i32 1, i64 %idxprom4.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(84) %floor.i, ptr noundef nonnull align 4 dereferenceable(84) %arrayidx5.i, i64 84, i1 false), !tbaa.struct !19 %sub7.i = shl i64 %input.sroa.6.0.copyload, 32 %sext15.i = add i64 %sub7.i, -4294967296 %idxprom8.i = ashr exact i64 %sext15.i, 32 %th.sroa.3.0.arrayidx9.sroa_idx.i = getelementptr inbounds %struct.Floor, ptr %floor.i, i64 0, i32 1, i64 %idxprom8.i, i32 1 %th.sroa.3.0.copyload.i = load i32, ptr %th.sroa.3.0.arrayidx9.sroa_idx.i, align 4, !tbaa.struct !15 %add.i = add nsw i32 %th.sroa.3.0.copyload.i, %input.sroa.5.8.extract.trunc.i %0 = icmp ugt i32 %add.i, 9 call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %floor.i) #8 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %ridge.i) #8 br i1 %0, label %cleanup, label %if.else if.else: ; preds = %for.body %idx.ext = ashr exact i64 %sub.i, 32 %gep = getelementptr %struct.Ridge, ptr %invariant.gep, i64 %idx.ext %idx.ext5 = ashr i64 %input.sroa.0.0.copyload, 32 %add.ptr6 = getelementptr inbounds %struct.Floor, ptr %gep, i64 %idx.ext5 %ths8 = getelementptr %struct.Floor, ptr %add.ptr6, i64 -1, i32 1 %idx.ext11 = ashr exact i64 %sub7.i, 32 %add.ptr12 = getelementptr inbounds %struct.Th, ptr %ths8, i64 %idx.ext11 %people14 = getelementptr %struct.Th, ptr %add.ptr12, i64 -1, i32 1 %1 = load i32, ptr %people14, align 4, !tbaa !9 %add = add nsw i32 %1, %input.sroa.5.8.extract.trunc.i store i32 %add, ptr %people14, align 4, !tbaa !9 br label %cleanup cleanup: ; preds = %for.body, %if.else %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 = %cleanup, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @Drawing(ptr nocapture noundef readonly %ridges) local_unnamed_addr #0 { entry: br label %for.body for.body: ; preds = %if.end, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end ] %add.ptr = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 %indvars.iv %ridge.sroa.4.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 12 %ridge.sroa.4.0.copyload = load i32, ptr %ridge.sroa.4.0.add.ptr.sroa_idx, align 4, !tbaa.struct !21 %ridge.sroa.6.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 20 %ridge.sroa.6.0.copyload = load i32, ptr %ridge.sroa.6.0.add.ptr.sroa_idx, align 4, !tbaa.struct !22 %ridge.sroa.8.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 28 %ridge.sroa.8.0.copyload = load i32, ptr %ridge.sroa.8.0.add.ptr.sroa_idx, align 4, !tbaa.struct !23 %ridge.sroa.10.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 36 %ridge.sroa.10.0.copyload = load i32, ptr %ridge.sroa.10.0.add.ptr.sroa_idx, align 4, !tbaa.struct !24 %ridge.sroa.12.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 44 %ridge.sroa.12.0.copyload = load i32, ptr %ridge.sroa.12.0.add.ptr.sroa_idx, align 4, !tbaa.struct !25 %ridge.sroa.14.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 52 %ridge.sroa.14.0.copyload = load i32, ptr %ridge.sroa.14.0.add.ptr.sroa_idx, align 4, !tbaa.struct !26 %ridge.sroa.16.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 60 %ridge.sroa.16.0.copyload = load i32, ptr %ridge.sroa.16.0.add.ptr.sroa_idx, align 4, !tbaa.struct !27 %ridge.sroa.18.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 68 %ridge.sroa.18.0.copyload = load i32, ptr %ridge.sroa.18.0.add.ptr.sroa_idx, align 4, !tbaa.struct !28 %ridge.sroa.20.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 76 %ridge.sroa.20.0.copyload = load i32, ptr %ridge.sroa.20.0.add.ptr.sroa_idx, align 4, !tbaa.struct !29 %ridge.sroa.22.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 84 %ridge.sroa.22.0.copyload = load i32, ptr %ridge.sroa.22.0.add.ptr.sroa_idx, align 4, !tbaa.struct !30 %ridge.sroa.24.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 96 %ridge.sroa.24.0.copyload = load i32, ptr %ridge.sroa.24.0.add.ptr.sroa_idx, align 4, !tbaa.struct !31 %ridge.sroa.26.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 104 %ridge.sroa.26.0.copyload = load i32, ptr %ridge.sroa.26.0.add.ptr.sroa_idx, align 4, !tbaa.struct !32 %ridge.sroa.28.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 112 %ridge.sroa.28.0.copyload = load i32, ptr %ridge.sroa.28.0.add.ptr.sroa_idx, align 4, !tbaa.struct !33 %ridge.sroa.30.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 120 %ridge.sroa.30.0.copyload = load i32, ptr %ridge.sroa.30.0.add.ptr.sroa_idx, align 4, !tbaa.struct !34 %ridge.sroa.32.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 128 %ridge.sroa.32.0.copyload = load i32, ptr %ridge.sroa.32.0.add.ptr.sroa_idx, align 4, !tbaa.struct !35 %ridge.sroa.34.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 136 %ridge.sroa.34.0.copyload = load i32, ptr %ridge.sroa.34.0.add.ptr.sroa_idx, align 4, !tbaa.struct !36 %ridge.sroa.36.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 144 %ridge.sroa.36.0.copyload = load i32, ptr %ridge.sroa.36.0.add.ptr.sroa_idx, align 4, !tbaa.struct !37 %ridge.sroa.38.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 152 %ridge.sroa.38.0.copyload = load i32, ptr %ridge.sroa.38.0.add.ptr.sroa_idx, align 4, !tbaa.struct !38 %ridge.sroa.40.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 160 %ridge.sroa.40.0.copyload = load i32, ptr %ridge.sroa.40.0.add.ptr.sroa_idx, align 4, !tbaa.struct !39 %ridge.sroa.42.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 168 %ridge.sroa.42.0.copyload = load i32, ptr %ridge.sroa.42.0.add.ptr.sroa_idx, align 4, !tbaa.struct !40 %ridge.sroa.44.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 180 %ridge.sroa.44.0.copyload = load i32, ptr %ridge.sroa.44.0.add.ptr.sroa_idx, align 4, !tbaa.struct !41 %ridge.sroa.46.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 188 %ridge.sroa.46.0.copyload = load i32, ptr %ridge.sroa.46.0.add.ptr.sroa_idx, align 4, !tbaa.struct !42 %ridge.sroa.48.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 196 %ridge.sroa.48.0.copyload = load i32, ptr %ridge.sroa.48.0.add.ptr.sroa_idx, align 4, !tbaa.struct !43 %ridge.sroa.50.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 204 %ridge.sroa.50.0.copyload = load i32, ptr %ridge.sroa.50.0.add.ptr.sroa_idx, align 4, !tbaa.struct !44 %ridge.sroa.52.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 212 %ridge.sroa.52.0.copyload = load i32, ptr %ridge.sroa.52.0.add.ptr.sroa_idx, align 4, !tbaa.struct !45 %ridge.sroa.54.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 220 %ridge.sroa.54.0.copyload = load i32, ptr %ridge.sroa.54.0.add.ptr.sroa_idx, align 4, !tbaa.struct !46 %ridge.sroa.56.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 228 %ridge.sroa.56.0.copyload = load i32, ptr %ridge.sroa.56.0.add.ptr.sroa_idx, align 4, !tbaa.struct !47 %ridge.sroa.58.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 236 %ridge.sroa.58.0.copyload = load i32, ptr %ridge.sroa.58.0.add.ptr.sroa_idx, align 4, !tbaa.struct !48 %ridge.sroa.60.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 244 %ridge.sroa.60.0.copyload = load i32, ptr %ridge.sroa.60.0.add.ptr.sroa_idx, align 4, !tbaa.struct !49 %ridge.sroa.62.0.add.ptr.sroa_idx = getelementptr inbounds i8, ptr %add.ptr, i64 252 %ridge.sroa.62.0.copyload = load i32, ptr %ridge.sroa.62.0.add.ptr.sroa_idx, align 4, !tbaa.struct !50 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.4.0.copyload) %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.6.0.copyload) %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.8.0.copyload) %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.10.0.copyload) %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.12.0.copyload) %call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.14.0.copyload) %call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.16.0.copyload) %call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.18.0.copyload) %call.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.20.0.copyload) %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ridge.sroa.22.0.copyload) %call.142 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.24.0.copyload) %call.1.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.26.0.copyload) %call.2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.28.0.copyload) %call.3.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.30.0.copyload) %call.4.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.32.0.copyload) %call.5.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.34.0.copyload) %call.6.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.36.0.copyload) %call.7.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.38.0.copyload) %call.8.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.40.0.copyload) %call18.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ridge.sroa.42.0.copyload) %call.244 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.44.0.copyload) %call.1.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.46.0.copyload) %call.2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.48.0.copyload) %call.3.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.50.0.copyload) %call.4.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.52.0.copyload) %call.5.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.54.0.copyload) %call.6.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.56.0.copyload) %call.7.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.58.0.copyload) %call.8.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ridge.sroa.60.0.copyload) %call18.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ridge.sroa.62.0.copyload) %cmp22.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp22.not, label %for.end26, label %if.end if.end: ; preds = %for.body %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.body for.end26: ; preds = %for.body ret void } ; 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local signext i16 @PeopleValid(ptr nocapture noundef readonly %ridges, i64 %input.coerce0, i64 %input.coerce1) local_unnamed_addr #6 { entry: %ridge = alloca %struct.Ridge, align 4 %floor = alloca %struct.Floor, align 4 %input.sroa.5.8.extract.shift = lshr i64 %input.coerce1, 32 %input.sroa.5.8.extract.trunc = trunc i64 %input.sroa.5.8.extract.shift to i32 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %ridge) #8 %sub = shl i64 %input.coerce0, 32 %sext = add i64 %sub, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds %struct.Ridge, ptr %ridges, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(256) %ridge, ptr noundef nonnull align 4 dereferenceable(256) %arrayidx, i64 256, i1 false), !tbaa.struct !17 call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %floor) #8 %sext14 = add i64 %input.coerce0, -4294967296 %idxprom4 = ashr i64 %sext14, 32 %arrayidx5 = getelementptr inbounds %struct.Ridge, ptr %ridge, i64 0, i32 1, i64 %idxprom4 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(84) %floor, ptr noundef nonnull align 4 dereferenceable(84) %arrayidx5, i64 84, i1 false), !tbaa.struct !19 %sub7 = shl i64 %input.coerce1, 32 %sext15 = add i64 %sub7, -4294967296 %idxprom8 = ashr exact i64 %sext15, 32 %th.sroa.3.0.arrayidx9.sroa_idx = getelementptr inbounds %struct.Floor, ptr %floor, i64 0, i32 1, i64 %idxprom8, i32 1 %th.sroa.3.0.copyload = load i32, ptr %th.sroa.3.0.arrayidx9.sroa_idx, align 4, !tbaa.struct !15 %add = add nsw i32 %th.sroa.3.0.copyload, %input.sroa.5.8.extract.trunc %0 = icmp ult i32 %add, 10 %conv = zext i1 %0 to i16 call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %floor) #8 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %ridge) #8 ret i16 %conv } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind } 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9} !9 = !{!10, !10, i64 0} !10 = !{!"int", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"} !13 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9} !14 = !{i64 0, i64 4, !9, i64 4, i64 4, !9} !15 = !{i64 0, i64 4, !9} !16 = distinct !{!16, !6} !17 = !{i64 0, i64 4, !9, i64 4, i64 252, !18} !18 = !{!11, !11, i64 0} !19 = !{i64 0, i64 4, !9, i64 4, i64 80, !18} !20 = distinct !{!20, !6} !21 = !{i64 0, i64 244, !18} !22 = !{i64 0, i64 236, !18} !23 = !{i64 0, i64 228, !18} !24 = !{i64 0, i64 220, !18} !25 = !{i64 0, i64 212, !18} !26 = !{i64 0, i64 204, !18} !27 = !{i64 0, i64 196, !18} !28 = !{i64 0, i64 188, !18} !29 = !{i64 0, i64 180, !18} !30 = !{i64 0, i64 172, !18} !31 = !{i64 0, i64 160, !18} !32 = !{i64 0, i64 152, !18} !33 = !{i64 0, i64 144, !18} !34 = !{i64 0, i64 136, !18} !35 = !{i64 0, i64 128, !18} !36 = !{i64 0, i64 120, !18} !37 = !{i64 0, i64 112, !18} !38 = !{i64 0, i64 104, !18} !39 = !{i64 0, i64 96, !18} !40 = !{i64 0, i64 88, !18} !41 = !{i64 0, i64 76, !18} !42 = !{i64 0, i64 68, !18} !43 = !{i64 0, i64 60, !18} !44 = !{i64 0, i64 52, !18} !45 = !{i64 0, i64 44, !18} !46 = !{i64 0, i64 36, !18} !47 = !{i64 0, i64 28, !18} !48 = !{i64 0, i64 20, !18} !49 = !{i64 0, i64 12, !18} !50 = !{i64 0, i64 4, !18}
#include <stdio.h> int main() { int n; int p[4][3][10] = {0}; scanf("%d", &n); for (int i = 0; i < n; i++) { int b, f, r, v; scanf("%d %d %d %d", &b, &f, &r, &v); p[b - 1][f - 1][r - 1] += v; } for (int b = 0; b < 4; b++) { for (int f = 0; f < 3; f++) { for (int r = 0; r < 10; r++) { printf(" %d", p[b][f][r]); } printf("\n"); } if (b != 3) { printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236941/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %p = alloca [4 x [3 x [10 x i32]]], align 16 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %p) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %p, i8 0, i64 480, 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 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.cond14.preheader.preheader for.body: ; preds = %entry, %for.body %i.051 = phi i32 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 %inc = add nuw nsw i32 %i.051, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond14.preheader.preheader, !llvm.loop !9 for.cond14.preheader.preheader: ; preds = %for.body, %entry br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond14.preheader.preheader, %for.inc39 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc39 ], [ 0, %for.cond14.preheader.preheader ] %arrayidx28 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx28, align 8, !tbaa !5 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx28.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5 %call29.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx28.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx28.2, align 8, !tbaa !5 %call29.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx28.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx28.3, align 4, !tbaa !5 %call29.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx28.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx28.4, align 8, !tbaa !5 %call29.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx28.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx28.5, align 4, !tbaa !5 %call29.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx28.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx28.6, align 8, !tbaa !5 %call29.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx28.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx28.7, align 4, !tbaa !5 %call29.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx28.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx28.8, align 8, !tbaa !5 %call29.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx28.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx28.9, align 4, !tbaa !5 %call29.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx28.157 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx28.157, align 8, !tbaa !5 %call29.158 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx28.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx28.1.1, align 4, !tbaa !5 %call29.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx28.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx28.2.1, align 8, !tbaa !5 %call29.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx28.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx28.3.1, align 4, !tbaa !5 %call29.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx28.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx28.4.1, align 8, !tbaa !5 %call29.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx28.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx28.5.1, align 4, !tbaa !5 %call29.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx28.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx28.6.1, align 8, !tbaa !5 %call29.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx28.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx28.7.1, align 4, !tbaa !5 %call29.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx28.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx28.8.1, align 8, !tbaa !5 %call29.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx28.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx28.9.1, align 4, !tbaa !5 %call29.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx28.259 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx28.259, align 8, !tbaa !5 %call29.260 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx28.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx28.1.2, align 4, !tbaa !5 %call29.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx28.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx28.2.2, align 8, !tbaa !5 %call29.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx28.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx28.3.2, align 4, !tbaa !5 %call29.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx28.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx28.4.2, align 8, !tbaa !5 %call29.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx28.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx28.5.2, align 4, !tbaa !5 %call29.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx28.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx28.6.2, align 8, !tbaa !5 %call29.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx28.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx28.7.2, align 4, !tbaa !5 %call29.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx28.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx28.8.2, align 8, !tbaa !5 %call29.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx28.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %p, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx28.9.2, align 4, !tbaa !5 %call29.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp37.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp37.not, label %for.cond.cleanup11, label %for.inc39 for.cond.cleanup11: ; preds = %for.cond14.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.inc39: ; preds = %for.cond14.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond14.preheader } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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"}
#include<stdio.h> int main(void){ int b,f,r,v,n; int A[4][3][10]={0}; int i,j,k; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&b,&f,&r,&v); A[b-1][f-1][r-1]+=v; } for(i=0;i<4;i++){ for(j=0;j<3;j++){ for(k=0;k<10;k++){ printf(" %d",A[i][j][k]); if(k==9){ printf("\n"); if(j==2&&i<3){ printf("####################\n"); } } } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236985/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 x i8] c"####################\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %n = alloca i32, align 4 %A = alloca [4 x [3 x [10 x i32]]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %A) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %A, i8 0, i64 480, 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 %cmp51 = icmp sgt i32 %0, 0 br i1 %cmp51, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.052 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.052, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc34.2 %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.inc34.2 ], [ 0, %for.cond11.preheader.preheader ] %cmp27 = icmp ult i64 %indvars.iv60, 3 %arrayidx22.us = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 0 %7 = load i32, ptr %arrayidx22.us, align 8, !tbaa !5 %call23.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx22.us.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 1 %8 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5 %call23.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx22.us.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 2 %9 = load i32, ptr %arrayidx22.us.2, align 8, !tbaa !5 %call23.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx22.us.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 3 %10 = load i32, ptr %arrayidx22.us.3, align 4, !tbaa !5 %call23.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx22.us.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 4 %11 = load i32, ptr %arrayidx22.us.4, align 8, !tbaa !5 %call23.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx22.us.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 5 %12 = load i32, ptr %arrayidx22.us.5, align 4, !tbaa !5 %call23.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx22.us.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 6 %13 = load i32, ptr %arrayidx22.us.6, align 8, !tbaa !5 %call23.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx22.us.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 7 %14 = load i32, ptr %arrayidx22.us.7, align 4, !tbaa !5 %call23.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx22.us.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 8 %15 = load i32, ptr %arrayidx22.us.8, align 8, !tbaa !5 %call23.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx22.us.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 0, i64 9 %16 = load i32, ptr %arrayidx22.us.9, align 4, !tbaa !5 %call23.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar.us.9 = call i32 @putchar(i32 10) %arrayidx22.us.164 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 0 %17 = load i32, ptr %arrayidx22.us.164, align 8, !tbaa !5 %call23.us.165 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx22.us.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 1 %18 = load i32, ptr %arrayidx22.us.1.1, align 4, !tbaa !5 %call23.us.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx22.us.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 2 %19 = load i32, ptr %arrayidx22.us.2.1, align 8, !tbaa !5 %call23.us.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx22.us.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 3 %20 = load i32, ptr %arrayidx22.us.3.1, align 4, !tbaa !5 %call23.us.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx22.us.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 4 %21 = load i32, ptr %arrayidx22.us.4.1, align 8, !tbaa !5 %call23.us.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx22.us.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 5 %22 = load i32, ptr %arrayidx22.us.5.1, align 4, !tbaa !5 %call23.us.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx22.us.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 6 %23 = load i32, ptr %arrayidx22.us.6.1, align 8, !tbaa !5 %call23.us.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx22.us.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 7 %24 = load i32, ptr %arrayidx22.us.7.1, align 4, !tbaa !5 %call23.us.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx22.us.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 8 %25 = load i32, ptr %arrayidx22.us.8.1, align 8, !tbaa !5 %call23.us.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx22.us.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 1, i64 9 %26 = load i32, ptr %arrayidx22.us.9.1, align 4, !tbaa !5 %call23.us.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.us.9.1 = call i32 @putchar(i32 10) %arrayidx22.us.266 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 0 %27 = load i32, ptr %arrayidx22.us.266, align 8, !tbaa !5 %call23.us.267 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx22.us.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 1 %28 = load i32, ptr %arrayidx22.us.1.2, align 4, !tbaa !5 %call23.us.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx22.us.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 2 %29 = load i32, ptr %arrayidx22.us.2.2, align 8, !tbaa !5 %call23.us.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx22.us.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 3 %30 = load i32, ptr %arrayidx22.us.3.2, align 4, !tbaa !5 %call23.us.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx22.us.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 4 %31 = load i32, ptr %arrayidx22.us.4.2, align 8, !tbaa !5 %call23.us.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx22.us.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 5 %32 = load i32, ptr %arrayidx22.us.5.2, align 4, !tbaa !5 %call23.us.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx22.us.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 6 %33 = load i32, ptr %arrayidx22.us.6.2, align 8, !tbaa !5 %call23.us.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx22.us.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 7 %34 = load i32, ptr %arrayidx22.us.7.2, align 4, !tbaa !5 %call23.us.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx22.us.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 8 %35 = load i32, ptr %arrayidx22.us.8.2, align 8, !tbaa !5 %call23.us.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx22.us.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv60, i64 2, i64 9 %36 = load i32, ptr %arrayidx22.us.9.2, align 4, !tbaa !5 %call23.us.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.us.9.2 = call i32 @putchar(i32 10) br i1 %cmp27, label %for.inc31.us.9.2, label %for.inc34.2 for.inc31.us.9.2: ; preds = %for.cond11.preheader %puts.us.9.2 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc34.2 for.inc34.2: ; preds = %for.inc31.us.9.2, %for.cond11.preheader %indvars.iv.next61 = add i64 %indvars.iv60, 1 %exitcond63.not = icmp eq i64 %indvars.iv.next61, 4 br i1 %exitcond63.not, label %for.end39, label %for.cond11.preheader, !llvm.loop !11 for.end39: ; preds = %for.inc34.2 call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #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 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <ctype.h> #include <stdlib.h> int main() { int b, f, r, v;; int house[5][4][11]; int i, n; for (b = 1; b <= 4; b++) { for (f = 1; f <= 3; f++) { for (r = 1; r <= 10; r++) house[b][f][r] = 0; } } scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d%d%d%d", &b, &f, &r, &v); house[b][f][r] += v; } for (b = 1; b <= 4; b++) { for (f = 1; f <= 3; f++) { for (r = 1; r <= 10; r++) printf(" %d", house[b][f][r]); putchar('\n'); } if (b < 4) puts("####################"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237027/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.3 = private unnamed_addr constant [21 x i8] c"####################\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: %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %house = alloca [5 x [4 x [11 x i32]]], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 880, ptr nonnull %house) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %scevgep = getelementptr inbounds i8, ptr %house, i64 224 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1 = getelementptr inbounds i8, ptr %house, i64 268 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2 = getelementptr inbounds i8, ptr %house, i64 312 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.177 = getelementptr inbounds i8, ptr %house, i64 400 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.177, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.1 = getelementptr inbounds i8, ptr %house, i64 444 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.1 = getelementptr inbounds i8, ptr %house, i64 488 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.1, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.279 = getelementptr inbounds i8, ptr %house, i64 576 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.279, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.2 = getelementptr inbounds i8, ptr %house, i64 620 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.2 = getelementptr inbounds i8, ptr %house, i64 664 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.2, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.3 = getelementptr inbounds i8, ptr %house, i64 752 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep.3, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.1.3 = getelementptr inbounds i8, ptr %house, i64 796 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep.1.3, i8 0, i64 40, i1 false), !tbaa !5 %scevgep.2.3 = getelementptr inbounds i8, ptr %house, i64 840 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep.2.3, i8 0, i64 40, i1 false), !tbaa !5 store i32 5, ptr %b, align 4, !tbaa !5 store i32 4, ptr %f, align 4, !tbaa !5 store i32 11, ptr %r, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1871 = icmp sgt i32 %0, 0 br i1 %cmp1871, label %for.body19, label %for.cond30.preheader for.cond30.preheader: ; preds = %for.body19, %entry store i32 1, ptr %b, align 4, !tbaa !5 br label %for.cond33.preheader for.body19: ; preds = %entry, %for.body19 %i.072 = phi i32 [ %inc28, %for.body19 ], [ 0, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %idxprom21 = sext i32 %2 to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %idxprom23 = sext i32 %3 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %idxprom25 = sext i32 %4 to i64 %arrayidx26 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %house, i64 0, i64 %idxprom21, i64 %idxprom23, i64 %idxprom25 %5 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx26, align 4, !tbaa !5 %inc28 = add nuw nsw i32 %i.072, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc28, %6 br i1 %cmp18, label %for.body19, label %for.cond30.preheader, !llvm.loop !9 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.inc55 store i32 1, ptr %f, align 4, !tbaa !5 br label %for.cond36.preheader for.cond36.preheader: ; preds = %for.cond33.preheader, %for.end48 store i32 1, ptr %r, align 4, !tbaa !5 br label %for.body38 for.body38: ; preds = %for.cond36.preheader, %for.body38 %storemerge6273 = phi i32 [ 1, %for.cond36.preheader ], [ %inc47, %for.body38 ] %7 = load i32, ptr %b, align 4, !tbaa !5 %idxprom39 = sext i32 %7 to i64 %8 = load i32, ptr %f, align 4, !tbaa !5 %idxprom41 = sext i32 %8 to i64 %idxprom43 = sext i32 %storemerge6273 to i64 %arrayidx44 = getelementptr inbounds [5 x [4 x [11 x i32]]], ptr %house, i64 0, i64 %idxprom39, i64 %idxprom41, i64 %idxprom43 %9 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %10 = load i32, ptr %r, align 4, !tbaa !5 %inc47 = add nsw i32 %10, 1 store i32 %inc47, ptr %r, align 4, !tbaa !5 %cmp37 = icmp slt i32 %10, 10 br i1 %cmp37, label %for.body38, label %for.end48, !llvm.loop !11 for.end48: ; preds = %for.body38 %11 = load ptr, ptr @stdout, align 8, !tbaa !12 %call.i = call i32 @putc(i32 noundef 10, ptr noundef %11) %12 = load i32, ptr %f, align 4, !tbaa !5 %inc51 = add nsw i32 %12, 1 store i32 %inc51, ptr %f, align 4, !tbaa !5 %cmp34 = icmp slt i32 %12, 3 br i1 %cmp34, label %for.cond36.preheader, label %for.end52, !llvm.loop !14 for.end52: ; preds = %for.end48 %13 = load i32, ptr %b, align 4, !tbaa !5 %cmp53 = icmp slt i32 %13, 4 br i1 %cmp53, label %for.inc55, label %for.end57 for.inc55: ; preds = %for.end52 %call54 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3) %.pre = load i32, ptr %b, align 4, !tbaa !5 %inc56 = add nsw i32 %.pre, 1 store i32 %inc56, ptr %b, align 4, !tbaa !5 %cmp31 = icmp slt i32 %.pre, 4 br i1 %cmp31, label %for.cond33.preheader, label %for.end57, !llvm.loop !15 for.end57: ; preds = %for.inc55, %for.end52 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 880, ptr nonnull %house) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { int n; int built[4][3][10] = { 0 }; int b, f, r, v; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d %d %d %d", &b, &f, &r, &v); built[b - 1][f - 1][r - 1] += v; } for (i = 0; i < 4; i++) { for (int j = 0; j < 3; j++) { for (int l = 0; l < 10; l++) { printf(" %d", built[i][j][l]); } printf("\n"); } if (i != 3) printf("####################\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237070/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %built = alloca [4 x [3 x [10 x i32]]], align 16 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %built) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %built, i8 0, i64 480, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp46 = icmp sgt i32 %0, 0 br i1 %cmp46, label %for.body, label %for.cond11.preheader.preheader for.body: ; preds = %entry, %for.body %i.047 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub2 = add nsw i32 %3, -1 %idxprom3 = sext i32 %sub2 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub5 = add nsw i32 %4, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.047, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9 for.cond11.preheader.preheader: ; preds = %for.body, %entry br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc34 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc34 ], [ 0, %for.cond11.preheader.preheader ] %arrayidx23 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx23, align 8, !tbaa !5 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx23.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %call24.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx23.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx23.2, align 8, !tbaa !5 %call24.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx23.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 %call24.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx23.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx23.4, align 8, !tbaa !5 %call24.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx23.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx23.5, align 4, !tbaa !5 %call24.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx23.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx23.6, align 8, !tbaa !5 %call24.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx23.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx23.7, align 4, !tbaa !5 %call24.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx23.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx23.8, align 8, !tbaa !5 %call24.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx23.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx23.9, align 4, !tbaa !5 %call24.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx23.153 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx23.153, align 8, !tbaa !5 %call24.154 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx23.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx23.1.1, align 4, !tbaa !5 %call24.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx23.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx23.2.1, align 8, !tbaa !5 %call24.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx23.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx23.3.1, align 4, !tbaa !5 %call24.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx23.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx23.4.1, align 8, !tbaa !5 %call24.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx23.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx23.5.1, align 4, !tbaa !5 %call24.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx23.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx23.6.1, align 8, !tbaa !5 %call24.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx23.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx23.7.1, align 4, !tbaa !5 %call24.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx23.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx23.8.1, align 8, !tbaa !5 %call24.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx23.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx23.9.1, align 4, !tbaa !5 %call24.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx23.255 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx23.255, align 8, !tbaa !5 %call24.256 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx23.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx23.1.2, align 4, !tbaa !5 %call24.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx23.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx23.2.2, align 8, !tbaa !5 %call24.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx23.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx23.3.2, align 4, !tbaa !5 %call24.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx23.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx23.4.2, align 8, !tbaa !5 %call24.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx23.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx23.5.2, align 4, !tbaa !5 %call24.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx23.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx23.6.2, align 8, !tbaa !5 %call24.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx23.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx23.7.2, align 4, !tbaa !5 %call24.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx23.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx23.8.2, align 8, !tbaa !5 %call24.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx23.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %built, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx23.9.2, align 4, !tbaa !5 %call24.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp32.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp32.not, label %for.end36, label %for.inc34 for.inc34: ; preds = %for.cond11.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond11.preheader for.end36: ; preds = %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %built) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; 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"}
#include<stdio.h> int main(){ int n; int i, j, k; int b, f, r, v; int box[4][3][10]; for(i = 0; i < 4; i++){ for(j = 0; j < 3; j++){ for(k = 0; k < 10; k++){ box[i][j][k] = 0; } } } scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d %d %d %d", &b, &f, &r, &v); box[b - 1][f - 1][r - 1] += v; } for(i = 0; i < 4; i++){ for(j = 0; j < 3; j++){ for(k = 0; k < 10; k++){ printf(" %d", box[i][j][k]); } printf("\n"); } if(i != 3){ printf("####################\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @str = private unnamed_addr constant [21 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 %b = alloca i32, align 4 %f = alloca i32, align 4 %r = alloca i32, align 4 %v = alloca i32, align 4 %box = alloca [4 x [3 x [10 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 %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %box) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %box, i8 0, i64 480, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1881 = icmp sgt i32 %0, 0 br i1 %cmp1881, label %for.body19, label %for.cond35.preheader.preheader for.body19: ; preds = %entry, %for.body19 %i.182 = phi i32 [ %inc30, %for.body19 ], [ 0, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v) %1 = load i32, ptr %v, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom21 = sext i32 %sub to i64 %3 = load i32, ptr %f, align 4, !tbaa !5 %sub23 = add nsw i32 %3, -1 %idxprom24 = sext i32 %sub23 to i64 %4 = load i32, ptr %r, align 4, !tbaa !5 %sub26 = add nsw i32 %4, -1 %idxprom27 = sext i32 %sub26 to i64 %arrayidx28 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %idxprom21, i64 %idxprom24, i64 %idxprom27 %5 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %add = add nsw i32 %5, %1 store i32 %add, ptr %arrayidx28, align 4, !tbaa !5 %inc30 = add nuw nsw i32 %i.182, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc30, %6 br i1 %cmp18, label %for.body19, label %for.cond35.preheader.preheader, !llvm.loop !9 for.cond35.preheader.preheader: ; preds = %for.body19, %entry br label %for.cond35.preheader for.cond35.preheader: ; preds = %for.cond35.preheader.preheader, %for.inc57 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc57 ], [ 0, %for.cond35.preheader.preheader ] %arrayidx46 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 0 %7 = load i32, ptr %arrayidx46, align 8, !tbaa !5 %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %arrayidx46.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 1 %8 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5 %call47.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %arrayidx46.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 2 %9 = load i32, ptr %arrayidx46.2, align 8, !tbaa !5 %call47.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx46.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 3 %10 = load i32, ptr %arrayidx46.3, align 4, !tbaa !5 %call47.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %arrayidx46.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 4 %11 = load i32, ptr %arrayidx46.4, align 8, !tbaa !5 %call47.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %arrayidx46.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 5 %12 = load i32, ptr %arrayidx46.5, align 4, !tbaa !5 %call47.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %arrayidx46.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 6 %13 = load i32, ptr %arrayidx46.6, align 8, !tbaa !5 %call47.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %arrayidx46.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 7 %14 = load i32, ptr %arrayidx46.7, align 4, !tbaa !5 %call47.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %arrayidx46.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 8 %15 = load i32, ptr %arrayidx46.8, align 8, !tbaa !5 %call47.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %arrayidx46.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 0, i64 9 %16 = load i32, ptr %arrayidx46.9, align 4, !tbaa !5 %call47.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %putchar = call i32 @putchar(i32 10) %arrayidx46.194 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 0 %17 = load i32, ptr %arrayidx46.194, align 8, !tbaa !5 %call47.195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) %arrayidx46.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 1 %18 = load i32, ptr %arrayidx46.1.1, align 4, !tbaa !5 %call47.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %arrayidx46.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 2 %19 = load i32, ptr %arrayidx46.2.1, align 8, !tbaa !5 %call47.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %arrayidx46.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 3 %20 = load i32, ptr %arrayidx46.3.1, align 4, !tbaa !5 %call47.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %arrayidx46.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 4 %21 = load i32, ptr %arrayidx46.4.1, align 8, !tbaa !5 %call47.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21) %arrayidx46.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 5 %22 = load i32, ptr %arrayidx46.5.1, align 4, !tbaa !5 %call47.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %arrayidx46.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 6 %23 = load i32, ptr %arrayidx46.6.1, align 8, !tbaa !5 %call47.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23) %arrayidx46.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 7 %24 = load i32, ptr %arrayidx46.7.1, align 4, !tbaa !5 %call47.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) %arrayidx46.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 8 %25 = load i32, ptr %arrayidx46.8.1, align 8, !tbaa !5 %call47.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) %arrayidx46.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 1, i64 9 %26 = load i32, ptr %arrayidx46.9.1, align 4, !tbaa !5 %call47.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %putchar.1 = call i32 @putchar(i32 10) %arrayidx46.296 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 0 %27 = load i32, ptr %arrayidx46.296, align 8, !tbaa !5 %call47.297 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) %arrayidx46.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 1 %28 = load i32, ptr %arrayidx46.1.2, align 4, !tbaa !5 %call47.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28) %arrayidx46.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 2 %29 = load i32, ptr %arrayidx46.2.2, align 8, !tbaa !5 %call47.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29) %arrayidx46.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 3 %30 = load i32, ptr %arrayidx46.3.2, align 4, !tbaa !5 %call47.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30) %arrayidx46.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 4 %31 = load i32, ptr %arrayidx46.4.2, align 8, !tbaa !5 %call47.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31) %arrayidx46.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 5 %32 = load i32, ptr %arrayidx46.5.2, align 4, !tbaa !5 %call47.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) %arrayidx46.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 6 %33 = load i32, ptr %arrayidx46.6.2, align 8, !tbaa !5 %call47.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33) %arrayidx46.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 7 %34 = load i32, ptr %arrayidx46.7.2, align 4, !tbaa !5 %call47.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34) %arrayidx46.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 8 %35 = load i32, ptr %arrayidx46.8.2, align 8, !tbaa !5 %call47.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35) %arrayidx46.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %box, i64 0, i64 %indvars.iv, i64 2, i64 9 %36 = load i32, ptr %arrayidx46.9.2, align 4, !tbaa !5 %call47.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) %putchar.2 = call i32 @putchar(i32 10) %cmp55.not = icmp eq i64 %indvars.iv, 3 br i1 %cmp55.not, label %for.end59, label %for.inc57 for.inc57: ; preds = %for.cond35.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 br label %for.cond35.preheader for.end59: ; preds = %for.cond35.preheader call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %box) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void){ long long int x; scanf("%lld", &x); long long int ans = 0; long long int syo = 0, amari = 0; syo = x / 11; amari = x % 11; ans = syo * 2 + 1; if(amari == 0){ printf("%lld\n", ans - 1); return 0; }else if(0 < amari && amari < 7){ printf("%lld\n", ans); return 0; }else{ printf("%lld\n", ans + 1); return 0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i64, ptr %x, align 8, !tbaa !5 %div = sdiv i64 %0, 11 %rem = srem i64 %0, 11 %mul = shl nsw i64 %div, 1 %add = or i64 %mul, 1 %cmp = icmp eq i64 %rem, 0 %or.cond = icmp ult i64 %rem, 7 %add7 = add nsw i64 %mul, 2 %spec.select = select i1 %or.cond, i64 %add, i64 %add7 %add7.sink = select i1 %cmp, i64 %mul, i64 %spec.select %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add7.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int i; for ( ; ; ) { int res = 0; int n; scanf ( "%d", &n ); if ( !( n ) ) break ; for ( i = 0; i < n * ( n - 1 ) / 2; ++i ) { int d; scanf ( "%d", &d ); res += d; } printf ( "%d\n", res / ( n - 1 ) ); } return ( 0 ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237221/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237221/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not21 = icmp eq i32 %0, 0 br i1 %tobool.not21, label %for.end7, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %4, %cleanup ], [ %0, %entry ] %sub13 = add nsw i32 %1, -1 %mul14 = mul nsw i32 %sub13, %1 %cmp16 = icmp sgt i32 %mul14, 1 br i1 %cmp16, label %for.body, label %cleanup for.body: ; preds = %for.cond1.preheader, %for.body %res.018 = phi i32 [ %add, %for.body ], [ 0, %for.cond1.preheader ] %i.017 = phi i32 [ %inc, %for.body ], [ 0, %for.cond1.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %2 = load i32, ptr %d, align 4, !tbaa !5 %add = add nsw i32 %2, %res.018 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 %inc = add nuw nsw i32 %i.017, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %3, -1 %mul = mul nsw i32 %sub, %3 %div = sdiv i32 %mul, 2 %cmp = icmp slt i32 %inc, %div br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9 cleanup: ; preds = %for.body, %for.cond1.preheader %res.0.lcssa = phi i32 [ 0, %for.cond1.preheader ], [ %add, %for.body ] %sub.lcssa = phi i32 [ %sub13, %for.cond1.preheader ], [ %sub, %for.body ] %div4 = sdiv i32 %res.0.lcssa, %sub.lcssa %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %for.end7, label %for.cond1.preheader for.end7: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char s[16]; int a,b; scanf("%d",&a); while(scanf("%s",s) , s[0] != '='){ scanf("%d",&b); if(s[0] == '+'){ a+=b; } if(s[0] == '-'){ a-=b; } if(s[0] == '*'){ a*=b; } if(s[0] == '/'){ a/=b; } } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237272/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237272/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\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 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call130 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not31 = icmp eq i8 %0, 61 br i1 %cmp.not31, label %while.end, label %while.body while.body: ; preds = %entry, %if.end25 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %1 = load i8, ptr %s, align 16, !tbaa !5 switch i8 %1, label %if.end25 [ i8 43, label %if.end.thread i8 45, label %if.then12 i8 42, label %if.then18 i8 47, label %if.then24 ] if.end.thread: ; preds = %while.body %2 = load i32, ptr %b, align 4, !tbaa !8 %3 = load i32, ptr %a, align 4, !tbaa !8 %add = add nsw i32 %3, %2 store i32 %add, ptr %a, align 4, !tbaa !8 br label %if.end25 if.then12: ; preds = %while.body %4 = load i32, ptr %b, align 4, !tbaa !8 %5 = load i32, ptr %a, align 4, !tbaa !8 %sub = sub nsw i32 %5, %4 store i32 %sub, ptr %a, align 4, !tbaa !8 br label %if.end25 if.then18: ; preds = %while.body %6 = load i32, ptr %b, align 4, !tbaa !8 %7 = load i32, ptr %a, align 4, !tbaa !8 %mul = mul nsw i32 %7, %6 store i32 %mul, ptr %a, align 4, !tbaa !8 br label %if.end25 if.then24: ; preds = %while.body %8 = load i32, ptr %b, align 4, !tbaa !8 %9 = load i32, ptr %a, align 4, !tbaa !8 %div = sdiv i32 %9, %8 store i32 %div, ptr %a, align 4, !tbaa !8 br label %if.end25 if.end25: ; preds = %while.body, %if.then12, %if.end.thread, %if.then18, %if.then24 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %10 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not = icmp eq i8 %10, 61 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %if.end25, %entry %11 = load i32, ptr %a, align 4, !tbaa !8 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define N 40 #define NILL -1 typedef struct{ int p; int l; int r; }Node; Node A[N]; int n,B[N],C[N]; int rec(int x,int y){ B[x] = y; if(A[x].r != NILL) rec(A[x].r,y + 1); if(A[x].l != NILL) rec(A[x].l,y + 1); } int Getb(int x){ if(A[x].p== NILL) return NILL; if(A[A[x].p].l!=x&&A[A[x].p].l!=NILL) return A[A[x].p].l; if(A[A[x].p].r!=x&&A[A[x].p].r!=NILL) return A[A[x].p].r; return -1; } int Geth(int x){ int a=0,b=0; if(A[x].l != NILL) a=Geth(A[x].l)+1; if(A[x].r != NILL) b=Geth(A[x].r)+1; return C[x]=(a>b ? a : b); } int main(){ int i,j,d,v,c,l,r,n,op; scanf("%d",&n); for(i=0;i<n;i++){ A[i].p = A[i].l = A[i].r = NILL; } for(i=0;i<n;i++){ scanf("%d%d%d",&v,&d,&op); A[v].l = d; A[v].r = op; if(d != -1) A[d].p=v; if(op != -1) A[op].p=v; } for(i=0;i<n;i++){ if(A[i].p == -1) r=i; } rec(r,0); for(i=0;i<n;i++){ int deg=0; if(A[i].l!=-1) deg++; if(A[i].r!=-1) deg++; Geth(i); printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,A[i].p,Getb(i),deg,B[i],C[i]); if(A[i].p == -1) printf("root\n"); else if(A[i].l == -1 && A[i].r == -1 ) printf("leaf\n"); else printf("internal node\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237322/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237322/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @B = dso_local local_unnamed_addr global [40 x i32] zeroinitializer, align 16 @A = dso_local local_unnamed_addr global [40 x %struct.Node] zeroinitializer, align 16 @C = dso_local local_unnamed_addr global [40 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @n = dso_local local_unnamed_addr global i32 0, align 4 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @rec(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end, %entry %x.tr = phi i32 [ %x, %entry ], [ %1, %if.end ] %y.tr = phi i32 [ %y, %entry ], [ %add13, %if.end ] %idxprom = sext i32 %x.tr to i64 %arrayidx = getelementptr inbounds [40 x i32], ptr @B, i64 0, i64 %idxprom store i32 %y.tr, ptr %arrayidx, align 4, !tbaa !5 %r = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %r, align 4, !tbaa !9 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %tailrecurse %add = add nsw i32 %y.tr, 1 %call = tail call i32 @rec(i32 noundef %0, i32 noundef %add) br label %if.end if.end: ; preds = %if.then, %tailrecurse %l = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !11 %cmp8.not = icmp eq i32 %1, -1 %add13 = add nsw i32 %y.tr, 1 br i1 %cmp8.not, label %if.end15, label %tailrecurse if.end15: ; preds = %if.end ret i32 undef } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Getb(i32 noundef %x) local_unnamed_addr #1 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %l = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !11 %cmp6.not = icmp eq i32 %1, %x %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %r = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %r, align 4, !tbaa !9 %cmp27.not = icmp eq i32 %2, %x %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Geth(i32 noundef %x) local_unnamed_addr #0 { entry: %idxprom = sext i32 %x to i64 %l = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %l, align 4, !tbaa !11 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @Geth(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %a.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %r = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %r, align 4, !tbaa !9 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @Geth(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %b.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %cond = tail call i32 @llvm.smax.i32(i32 %a.0, i32 %b.0) %arrayidx16 = getelementptr inbounds [40 x i32], ptr @C, i64 0, i64 %idxprom store i32 %cond, ptr %arrayidx16, align 4, !tbaa !5 ret i32 %cond } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %d = alloca i32, align 4 %v = alloca i32, align 4 %n = alloca i32, align 4 %op = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %op) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp122 = icmp sgt i32 %0, 0 br i1 %cmp122, label %for.body9.preheader, label %for.cond30.preheader for.body9.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = mul nuw nsw i64 %1, 12 call void @llvm.memset.p0.i64(ptr nonnull align 16 @A, i8 -1, i64 %2, i1 false), !tbaa !5 br label %for.body9 for.cond30.preheader: ; preds = %for.inc27, %entry %.lcssa = phi i32 [ %0, %entry ], [ %7, %for.inc27 ] %cmp31126 = icmp sgt i32 %.lcssa, 0 call void @llvm.assume(i1 %cmp31126) %wide.trip.count = zext i32 %.lcssa to i64 %xtraiter = and i64 %wide.trip.count, 3 %3 = icmp ult i32 %.lcssa, 4 br i1 %3, label %for.end41.unr-lcssa, label %for.cond30.preheader.new for.cond30.preheader.new: ; preds = %for.cond30.preheader %unroll_iter = and i64 %wide.trip.count, 2147483644 br label %for.body32 for.body9: ; preds = %for.body9.preheader, %for.inc27 %i.1125 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.body9.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %d, ptr noundef nonnull %op) %4 = load i32, ptr %d, align 4, !tbaa !5 %5 = load i32, ptr %v, align 4, !tbaa !5 %idxprom11 = sext i32 %5 to i64 %l13 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom11, i32 1 store i32 %4, ptr %l13, align 4, !tbaa !11 %6 = load i32, ptr %op, align 4, !tbaa !5 %r16 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom11, i32 2 store i32 %6, ptr %r16, align 4, !tbaa !9 %cmp17.not = icmp eq i32 %4, -1 br i1 %cmp17.not, label %if.end, label %if.then if.then: ; preds = %for.body9 %idxprom18 = sext i32 %4 to i64 %arrayidx19 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom18 store i32 %5, ptr %arrayidx19, align 4, !tbaa !12 br label %if.end if.end: ; preds = %if.then, %for.body9 %cmp21.not = icmp eq i32 %6, -1 br i1 %cmp21.not, label %for.inc27, label %if.then22 if.then22: ; preds = %if.end %idxprom23 = sext i32 %6 to i64 %arrayidx24 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom23 store i32 %5, ptr %arrayidx24, align 4, !tbaa !12 br label %for.inc27 for.inc27: ; preds = %if.end, %if.then22 %inc28 = add nuw nsw i32 %i.1125, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp slt i32 %inc28, %7 br i1 %cmp8, label %for.body9, label %for.cond30.preheader, !llvm.loop !13 for.body32: ; preds = %for.body32, %for.cond30.preheader.new %indvars.iv = phi i64 [ 0, %for.cond30.preheader.new ], [ %indvars.iv.next.3, %for.body32 ] %r.0128 = phi i32 [ undef, %for.cond30.preheader.new ], [ %spec.select.3, %for.body32 ] %niter = phi i64 [ 0, %for.cond30.preheader.new ], [ %niter.next.3, %for.body32 ] %arrayidx34 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx34, align 16, !tbaa !12 %cmp36 = icmp eq i32 %8, -1 %9 = trunc i64 %indvars.iv to i32 %spec.select = select i1 %cmp36, i32 %9, i32 %r.0128 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx34.1 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv.next %10 = load i32, ptr %arrayidx34.1, align 4, !tbaa !12 %cmp36.1 = icmp eq i32 %10, -1 %11 = trunc i64 %indvars.iv.next to i32 %spec.select.1 = select i1 %cmp36.1, i32 %11, i32 %spec.select %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx34.2 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv.next.1 %12 = load i32, ptr %arrayidx34.2, align 8, !tbaa !12 %cmp36.2 = icmp eq i32 %12, -1 %13 = trunc i64 %indvars.iv.next.1 to i32 %spec.select.2 = select i1 %cmp36.2, i32 %13, i32 %spec.select.1 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx34.3 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv.next.2 %14 = load i32, ptr %arrayidx34.3, align 4, !tbaa !12 %cmp36.3 = icmp eq i32 %14, -1 %15 = trunc i64 %indvars.iv.next.2 to i32 %spec.select.3 = select i1 %cmp36.3, i32 %15, i32 %spec.select.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.end41.unr-lcssa, label %for.body32, !llvm.loop !15 for.end41.unr-lcssa: ; preds = %for.body32, %for.cond30.preheader %indvars.iv.unr = phi i64 [ 0, %for.cond30.preheader ], [ %indvars.iv.next.3, %for.body32 ] %r.0128.unr = phi i32 [ undef, %for.cond30.preheader ], [ %spec.select.3, %for.body32 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end41, label %for.body32.epil for.body32.epil: ; preds = %for.end41.unr-lcssa, %for.body32.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body32.epil ], [ %indvars.iv.unr, %for.end41.unr-lcssa ] %r.0128.epil = phi i32 [ %spec.select.epil, %for.body32.epil ], [ %r.0128.unr, %for.end41.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body32.epil ], [ 0, %for.end41.unr-lcssa ] %arrayidx34.epil = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv.epil %16 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !12 %cmp36.epil = icmp eq i32 %16, -1 %17 = trunc i64 %indvars.iv.epil to i32 %spec.select.epil = select i1 %cmp36.epil, i32 %17, i32 %r.0128.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.end41, label %for.body32.epil, !llvm.loop !16 for.end41: ; preds = %for.body32.epil, %for.end41.unr-lcssa %spec.select.lcssa = phi i32 [ %r.0128.unr, %for.end41.unr-lcssa ], [ %spec.select.epil, %for.body32.epil ] %call42 = call i32 @rec(i32 noundef %spec.select.lcssa, i32 noundef 0) %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp44130 = icmp sgt i32 %18, 0 br i1 %cmp44130, label %for.body45, label %for.end92 for.body45: ; preds = %for.end41, %if.end89 %indvars.iv135 = phi i64 [ %indvars.iv.next136, %if.end89 ], [ 0, %for.end41 ] %arrayidx47 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv135 %l48 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv135, i32 1 %19 = load i32, ptr %l48, align 4, !tbaa !11 %cmp49.not = icmp ne i32 %19, -1 %spec.select121 = zext i1 %cmp49.not to i32 %r55 = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %indvars.iv135, i32 2 %20 = load i32, ptr %r55, align 4, !tbaa !9 %cmp56.not = icmp eq i32 %20, -1 %inc58 = select i1 %cmp49.not, i32 2, i32 1 %deg.1 = select i1 %cmp56.not, i32 %spec.select121, i32 %inc58 %21 = trunc i64 %indvars.iv135 to i32 %call60 = call i32 @Geth(i32 noundef %21) %22 = load i32, ptr %arrayidx47, align 4, !tbaa !12 %cmp.i = icmp eq i32 %22, -1 br i1 %cmp.i, label %Getb.exit, label %if.end.i if.end.i: ; preds = %for.body45 %idxprom4.i = sext i32 %22 to i64 %l.i = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom4.i, i32 1 %23 = load i32, ptr %l.i, align 4, !tbaa !11 %24 = zext i32 %23 to i64 %cmp6.not.i = icmp eq i64 %indvars.iv135, %24 %cmp13.not.i = icmp eq i32 %23, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %Getb.exit if.end21.i: ; preds = %if.end.i %r.i = getelementptr inbounds [40 x %struct.Node], ptr @A, i64 0, i64 %idxprom4.i, i32 2 %25 = load i32, ptr %r.i, align 4, !tbaa !9 %26 = zext i32 %25 to i64 %cmp27.not.i = icmp eq i64 %indvars.iv135, %26 %cmp35.not.i = icmp eq i32 %25, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %25 br label %Getb.exit Getb.exit: ; preds = %for.body45, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %for.body45 ], [ %23, %if.end.i ], [ %spec.select.i, %if.end21.i ] %arrayidx66 = getelementptr inbounds [40 x i32], ptr @B, i64 0, i64 %indvars.iv135 %27 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %arrayidx68 = getelementptr inbounds [40 x i32], ptr @C, i64 0, i64 %indvars.iv135 %28 = load i32, ptr %arrayidx68, align 4, !tbaa !5 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21, i32 noundef %22, i32 noundef %retval.0.i, i32 noundef %deg.1, i32 noundef %27, i32 noundef %28) %29 = load i32, ptr %arrayidx47, align 4, !tbaa !12 %cmp73 = icmp eq i32 %29, -1 br i1 %cmp73, label %if.end89, label %if.else if.else: ; preds = %Getb.exit %30 = load i32, ptr %l48, align 4, !tbaa !11 %cmp79 = icmp eq i32 %30, -1 br i1 %cmp79, label %land.lhs.true, label %if.else86 land.lhs.true: ; preds = %if.else %31 = load i32, ptr %r55, align 4, !tbaa !9 %cmp83 = icmp eq i32 %31, -1 br i1 %cmp83, label %if.end89, label %if.else86 if.else86: ; preds = %land.lhs.true, %if.else br label %if.end89 if.end89: ; preds = %land.lhs.true, %Getb.exit, %if.else86 %str.6.sink = phi ptr [ @str, %if.else86 ], [ @str.7, %Getb.exit ], [ @str.6, %land.lhs.true ] %puts119 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %32 = load i32, ptr %n, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp44 = icmp slt i64 %indvars.iv.next136, %33 br i1 %cmp44, label %for.body45, label %for.end92, !llvm.loop !18 for.end92: ; preds = %if.end89, %for.end41 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %op) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #9 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nofree nounwind } attributes #7 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 4} !12 = !{!10, !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !14}
#include <stdio.h> #include <stdlib.h> #define N 10000 #define NIL -1 typedef struct node{ int parent; int right; int left; }Node; Node T[N]; int n,D[N],H[N]; void setDepth(int,int); void print(int); int setHeight(int); int getSibling(int); int main(){ int i,v,l,r,root=0; scanf("%d",&n); for(i=0;i<n;i++){ T[i].parent = NIL; } for(i=0;i<n;i++){ scanf("%d%d%d",&v,&l,&r); T[v].left = l; T[v].right = r; if(l!=NIL) T[l].parent = v; if(r!=NIL) T[r].parent = v; } for(i=0;i<n;i++){ if(T[i].parent == NIL){ root=i; } } setDepth(root,0); setHeight(root); for(i=0;i<n;i++){ print(i); } return 0; } void setDepth(int u,int d){ if(u==NIL){ return; } D[u]=d; setDepth(T[u].left,d+1); setDepth(T[u].right,d+1); } int setHeight(int u){ int h1=0,h2=0; if(T[u].left != NIL){ h1 = setHeight(T[u].left)+1; } if(T[u].right != NIL){ h2 = setHeight(T[u].right)+1; } return H[u] = (h1 > h2 ? h1 : h2); } int getSibling(int u){ if(T[u].parent == NIL) return NIL; if(T[T[u].parent].left != u && T[T[u].parent].left != NIL){ return T[T[u].parent].left; } if(T[T[u].parent].right != u && T[T[u].parent].right != NIL){ return T[T[u].parent].right; } return NIL; } void print(int a){ int deg=0; printf("node %d: ",a); printf("parent = %d, ",T[a].parent); printf("sibling = %d, ",getSibling(a)); if(T[a].left != NIL) deg++; if(T[a].right != NIL) deg++; printf("degree = %d, ",deg); printf("depth = %d, ",D[a]); printf("height = %d, ",H[a]); if(T[a].parent== NIL){ printf("root\n"); } else if(T[a].left == NIL && T[a].right == NIL){ printf("leaf\n"); } else printf("internal node\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237366/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237366/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @T = dso_local local_unnamed_addr global [10000 x %struct.node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @D = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @H = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"node %d: \00", align 1 @.str.3 = private unnamed_addr constant [14 x i8] c"parent = %d, \00", align 1 @.str.4 = private unnamed_addr constant [15 x i8] c"sibling = %d, \00", align 1 @.str.5 = private unnamed_addr constant [14 x i8] c"degree = %d, \00", align 1 @.str.6 = private unnamed_addr constant [13 x i8] c"depth = %d, \00", align 1 @.str.7 = private unnamed_addr constant [14 x i8] c"height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.11 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.12 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %v = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body.preheader, label %for.end33 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond1.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond1.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond1.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond1.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond1.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond1.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.epil store i32 -1, ptr %arrayidx.epil, align 4, !tbaa !9 %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.cond1.preheader, label %for.body.epil, !llvm.loop !11 for.cond1.preheader: ; preds = %for.body.epil, %for.cond1.preheader.unr-lcssa br i1 %cmp54, label %for.body3, label %for.end33 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv store i32 -1, ptr %arrayidx, align 16, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next store i32 -1, ptr %arrayidx.1, align 4, !tbaa !9 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next.1 store i32 -1, ptr %arrayidx.2, align 8, !tbaa !9 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next.2 store i32 -1, ptr %arrayidx.3, align 4, !tbaa !9 %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.cond1.preheader.unr-lcssa, label %for.body, !llvm.loop !13 for.cond22.preheader: ; preds = %for.inc19 %cmp2358 = icmp sgt i32 %6, 0 br i1 %cmp2358, label %for.body24.preheader, label %for.end33 for.body24.preheader: ; preds = %for.cond22.preheader %wide.trip.count69 = zext i32 %6 to i64 %xtraiter73 = and i64 %wide.trip.count69, 3 %2 = icmp ult i32 %6, 4 br i1 %2, label %for.end33.loopexit.unr-lcssa, label %for.body24.preheader.new for.body24.preheader.new: ; preds = %for.body24.preheader %unroll_iter77 = and i64 %wide.trip.count69, 4294967292 br label %for.body24 for.body3: ; preds = %for.cond1.preheader, %for.inc19 %i.157 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !5 %4 = load i32, ptr %v, align 4, !tbaa !5 %idxprom5 = sext i32 %4 to i64 %left = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom5, i32 2 store i32 %3, ptr %left, align 4, !tbaa !15 %5 = load i32, ptr %r, align 4, !tbaa !5 %right = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom5, i32 1 store i32 %5, ptr %right, align 4, !tbaa !16 %cmp9.not = icmp eq i32 %3, -1 br i1 %cmp9.not, label %if.end, label %if.then if.then: ; preds = %for.body3 %idxprom10 = sext i32 %3 to i64 %arrayidx11 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom10 store i32 %4, ptr %arrayidx11, align 4, !tbaa !9 br label %if.end if.end: ; preds = %if.then, %for.body3 %cmp13.not = icmp eq i32 %5, -1 br i1 %cmp13.not, label %for.inc19, label %if.then14 if.then14: ; preds = %if.end %idxprom15 = sext i32 %5 to i64 %arrayidx16 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom15 store i32 %4, ptr %arrayidx16, align 4, !tbaa !9 br label %for.inc19 for.inc19: ; preds = %if.end, %if.then14 %inc20 = add nuw nsw i32 %i.157, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc20, %6 br i1 %cmp2, label %for.body3, label %for.cond22.preheader, !llvm.loop !17 for.body24: ; preds = %for.body24, %for.body24.preheader.new %indvars.iv66 = phi i64 [ 0, %for.body24.preheader.new ], [ %indvars.iv.next67.3, %for.body24 ] %root.060 = phi i32 [ 0, %for.body24.preheader.new ], [ %spec.select.3, %for.body24 ] %niter78 = phi i64 [ 0, %for.body24.preheader.new ], [ %niter78.next.3, %for.body24 ] %arrayidx26 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv66 %7 = load i32, ptr %arrayidx26, align 16, !tbaa !9 %cmp28 = icmp eq i32 %7, -1 %8 = trunc i64 %indvars.iv66 to i32 %spec.select = select i1 %cmp28, i32 %8, i32 %root.060 %indvars.iv.next67 = or i64 %indvars.iv66, 1 %arrayidx26.1 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next67 %9 = load i32, ptr %arrayidx26.1, align 4, !tbaa !9 %cmp28.1 = icmp eq i32 %9, -1 %10 = trunc i64 %indvars.iv.next67 to i32 %spec.select.1 = select i1 %cmp28.1, i32 %10, i32 %spec.select %indvars.iv.next67.1 = or i64 %indvars.iv66, 2 %arrayidx26.2 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next67.1 %11 = load i32, ptr %arrayidx26.2, align 8, !tbaa !9 %cmp28.2 = icmp eq i32 %11, -1 %12 = trunc i64 %indvars.iv.next67.1 to i32 %spec.select.2 = select i1 %cmp28.2, i32 %12, i32 %spec.select.1 %indvars.iv.next67.2 = or i64 %indvars.iv66, 3 %arrayidx26.3 = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv.next67.2 %13 = load i32, ptr %arrayidx26.3, align 4, !tbaa !9 %cmp28.3 = icmp eq i32 %13, -1 %14 = trunc i64 %indvars.iv.next67.2 to i32 %spec.select.3 = select i1 %cmp28.3, i32 %14, i32 %spec.select.2 %indvars.iv.next67.3 = add nuw nsw i64 %indvars.iv66, 4 %niter78.next.3 = add i64 %niter78, 4 %niter78.ncmp.3 = icmp eq i64 %niter78.next.3, %unroll_iter77 br i1 %niter78.ncmp.3, label %for.end33.loopexit.unr-lcssa, label %for.body24, !llvm.loop !18 for.end33.loopexit.unr-lcssa: ; preds = %for.body24, %for.body24.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body24.preheader ], [ %spec.select.3, %for.body24 ] %indvars.iv66.unr = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next67.3, %for.body24 ] %root.060.unr = phi i32 [ 0, %for.body24.preheader ], [ %spec.select.3, %for.body24 ] %lcmp.mod75.not = icmp eq i64 %xtraiter73, 0 br i1 %lcmp.mod75.not, label %for.end33, label %for.body24.epil for.body24.epil: ; preds = %for.end33.loopexit.unr-lcssa, %for.body24.epil %indvars.iv66.epil = phi i64 [ %indvars.iv.next67.epil, %for.body24.epil ], [ %indvars.iv66.unr, %for.end33.loopexit.unr-lcssa ] %root.060.epil = phi i32 [ %spec.select.epil, %for.body24.epil ], [ %root.060.unr, %for.end33.loopexit.unr-lcssa ] %epil.iter74 = phi i64 [ %epil.iter74.next, %for.body24.epil ], [ 0, %for.end33.loopexit.unr-lcssa ] %arrayidx26.epil = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %indvars.iv66.epil %15 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !9 %cmp28.epil = icmp eq i32 %15, -1 %16 = trunc i64 %indvars.iv66.epil to i32 %spec.select.epil = select i1 %cmp28.epil, i32 %16, i32 %root.060.epil %indvars.iv.next67.epil = add nuw nsw i64 %indvars.iv66.epil, 1 %epil.iter74.next = add i64 %epil.iter74, 1 %epil.iter74.cmp.not = icmp eq i64 %epil.iter74.next, %xtraiter73 br i1 %epil.iter74.cmp.not, label %for.end33, label %for.body24.epil, !llvm.loop !19 for.end33: ; preds = %for.end33.loopexit.unr-lcssa, %for.body24.epil, %entry, %for.cond1.preheader, %for.cond22.preheader %root.0.lcssa = phi i32 [ 0, %for.cond22.preheader ], [ 0, %for.cond1.preheader ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end33.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body24.epil ] call void @setDepth(i32 noundef %root.0.lcssa, i32 noundef 0) %call34 = call i32 @setHeight(i32 noundef %root.0.lcssa) %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp3662 = icmp sgt i32 %17, 0 br i1 %cmp3662, label %for.body37, label %for.end40 for.body37: ; preds = %for.end33, %for.body37 %i.363 = phi i32 [ %inc39, %for.body37 ], [ 0, %for.end33 ] call void @print(i32 noundef %i.363) %inc39 = add nuw nsw i32 %i.363, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp36 = icmp slt i32 %inc39, %18 br i1 %cmp36, label %for.body37, label %for.end40, !llvm.loop !20 for.end40: ; preds = %for.body37, %for.end33 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @setDepth(i32 noundef %u, i32 noundef %d) local_unnamed_addr #3 { entry: %cmp11 = icmp eq i32 %u, -1 br i1 %cmp11, label %return, label %if.end if.end: ; preds = %entry, %if.end %d.tr13 = phi i32 [ %add, %if.end ], [ %d, %entry ] %u.tr12 = phi i32 [ %1, %if.end ], [ %u, %entry ] %idxprom = sext i32 %u.tr12 to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom store i32 %d.tr13, ptr %arrayidx, align 4, !tbaa !5 %left = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %left, align 4, !tbaa !15 %add = add nsw i32 %d.tr13, 1 tail call void @setDepth(i32 noundef %0, i32 noundef %add) %right = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %right, align 4, !tbaa !16 %cmp = icmp eq i32 %1, -1 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @setHeight(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %left = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %left, align 4, !tbaa !15 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @setHeight(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %right, align 4, !tbaa !16 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @setHeight(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %h2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %cond = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %arrayidx16 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom store i32 %cond, ptr %arrayidx16, align 4, !tbaa !5 ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a) %idxprom = sext i32 %a to i64 %arrayidx = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %0) %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp.i = icmp eq i32 %1, -1 br i1 %cmp.i, label %getSibling.exit, label %if.end.i if.end.i: ; preds = %entry %idxprom4.i = sext i32 %1 to i64 %left.i = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %2 = load i32, ptr %left.i, align 4, !tbaa !15 %cmp6.not.i = icmp eq i32 %2, %a %cmp13.not.i = icmp eq i32 %2, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %getSibling.exit if.end21.i: ; preds = %if.end.i %right.i = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %3 = load i32, ptr %right.i, align 4, !tbaa !16 %cmp27.not.i = icmp eq i32 %3, %a %cmp35.not.i = icmp eq i32 %3, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %3 br label %getSibling.exit getSibling.exit: ; preds = %entry, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %entry ], [ %2, %if.end.i ], [ %spec.select.i, %if.end21.i ] %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %retval.0.i) %left = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 2 %4 = load i32, ptr %left, align 4, !tbaa !15 %cmp.not = icmp ne i32 %4, -1 %spec.select = zext i1 %cmp.not to i32 %right = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom, i32 1 %5 = load i32, ptr %right, align 4, !tbaa !16 %cmp8.not = icmp eq i32 %5, -1 %inc10 = select i1 %cmp.not, i32 2, i32 1 %deg.1 = select i1 %cmp8.not, i32 %spec.select, i32 %inc10 %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %deg.1) %arrayidx14 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %6) %arrayidx17 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom %7 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %7) %8 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp22 = icmp eq i32 %8, -1 br i1 %cmp22, label %if.end38, label %if.else if.else: ; preds = %getSibling.exit %9 = load i32, ptr %left, align 4, !tbaa !15 %cmp28 = icmp eq i32 %9, -1 br i1 %cmp28, label %land.lhs.true, label %if.else35 land.lhs.true: ; preds = %if.else %10 = load i32, ptr %right, align 4, !tbaa !16 %cmp32 = icmp eq i32 %10, -1 br i1 %cmp32, label %if.end38, label %if.else35 if.else35: ; preds = %land.lhs.true, %if.else br label %if.end38 if.end38: ; preds = %land.lhs.true, %getSibling.exit, %if.else35 %str.11.sink = phi ptr [ @str, %if.else35 ], [ @str.12, %getSibling.exit ], [ @str.11, %land.lhs.true ] %puts50 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.11.sink) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getSibling(i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %left = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom4, i32 2 %1 = load i32, ptr %left, align 4, !tbaa !15 %cmp6.not = icmp eq i32 %1, %u %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %right = getelementptr inbounds [10000 x %struct.node], ptr @T, i64 0, i64 %idxprom4, i32 1 %2 = load i32, ptr %right, align 4, !tbaa !16 %cmp27.not = icmp eq i32 %2, %u %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; 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) #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!10, !6, i64 0} !10 = !{!"node", !6, i64 0, !6, i64 4, !6, i64 8} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!10, !6, i64 8} !16 = !{!10, !6, i64 4} !17 = distinct !{!17, !14} !18 = distinct !{!18, !14} !19 = distinct !{!19, !12} !20 = distinct !{!20, !14}
#include<stdio.h> #define MAX 10000 #define NIL -1 struct Node{ int p, l, r; }; struct Node T[MAX]; int n; int D[MAX], H[MAX]; int getDepth(int u){ int d = 0; while(1){ u = T[u].p; if ( u == NIL ) break; d++; } return d; } int getSibling(int u){ if ( T[u].p == NIL ) return NIL; if ( T[T[u].p].l != u && T[T[u].p].l != NIL ) return T[T[u].p].l; if ( T[T[u].p].r != u && T[T[u].p].r != NIL ) return T[T[u].p].r; return NIL; } void print(int u){ printf("node %d: ", u); printf("parent = %d, ", T[u].p); printf("sibling = %d, ", getSibling(u)); int deg = 0; if ( T[u].l != NIL ) deg++; if ( T[u].r != NIL ) deg++; printf("degree = %d, ", deg); printf("depth = %d, ", D[u]); printf("height = %d, ", H[u]); if ( T[u].p == NIL ){ printf("root\n"); } else if ( T[u].l == NIL && T[u].r == NIL ){ printf("leaf\n"); } else { printf("internal node\n"); } } int main(){ int i, v, l, r; scanf("%d", &n); for ( i = 0; i < n; i++ ) { T[i].p = NIL; } for ( i = 0; i < n; i++ ){ scanf("%d %d %d", &v, &l, &r); T[v].l = l; T[v].r = r; if ( l != NIL ) T[l].p = v; if ( r != NIL ) T[r].p = v; } for ( i = 0; i < n; i++ ){ D[i] = getDepth(i); H[i] = 0; } for ( i = 0; i < n; i++ ){ if ( T[i].l == NIL && T[i].r == NIL ) { // is leaf H[i] = 0; int p = T[i].p; int c = 1; while(1){ if ( p == NIL ) break; if ( H[p] < c ) H[p] = c; c++; p = T[p].p; } } } for ( i = 0; i < n; i++ ) print(i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237416/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237416/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @T = dso_local local_unnamed_addr global [10000 x %struct.Node] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"node %d: \00", align 1 @.str.1 = private unnamed_addr constant [14 x i8] c"parent = %d, \00", align 1 @.str.2 = private unnamed_addr constant [15 x i8] c"sibling = %d, \00", align 1 @.str.3 = private unnamed_addr constant [14 x i8] c"degree = %d, \00", align 1 @.str.4 = private unnamed_addr constant [13 x i8] c"depth = %d, \00", align 1 @D = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @.str.5 = private unnamed_addr constant [14 x i8] c"height = %d, \00", align 1 @H = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @.str.9 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.10 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.11 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.12 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getDepth(i32 noundef %u) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %u.addr.0 = phi i32 [ %u, %entry ], [ %0, %while.cond ] %d.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %idxprom = sext i32 %u.addr.0 to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, -1 %inc = add nuw nsw i32 %d.0, 1 br i1 %cmp, label %while.end, label %while.cond while.end: ; preds = %while.cond ret i32 %d.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getSibling(i32 noundef %u) local_unnamed_addr #2 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !10 %cmp6.not = icmp eq i32 %1, %u %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %r, align 4, !tbaa !11 %cmp27.not = icmp eq i32 %2, %u %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %u) local_unnamed_addr #3 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %u) %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.i = icmp eq i32 %1, -1 br i1 %cmp.i, label %getSibling.exit, label %if.end.i if.end.i: ; preds = %entry %idxprom4.i = sext i32 %1 to i64 %l.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %2 = load i32, ptr %l.i, align 4, !tbaa !10 %cmp6.not.i = icmp eq i32 %2, %u %cmp13.not.i = icmp eq i32 %2, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %getSibling.exit if.end21.i: ; preds = %if.end.i %r.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %3 = load i32, ptr %r.i, align 4, !tbaa !11 %cmp27.not.i = icmp eq i32 %3, %u %cmp35.not.i = icmp eq i32 %3, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %3 br label %getSibling.exit getSibling.exit: ; preds = %entry, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %entry ], [ %2, %if.end.i ], [ %spec.select.i, %if.end21.i ] %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %retval.0.i) %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %4 = load i32, ptr %l, align 4, !tbaa !10 %cmp.not = icmp ne i32 %4, -1 %spec.select = zext i1 %cmp.not to i32 %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %5 = load i32, ptr %r, align 4, !tbaa !11 %cmp8.not = icmp eq i32 %5, -1 %inc10 = select i1 %cmp.not, i32 2, i32 1 %deg.1 = select i1 %cmp8.not, i32 %spec.select, i32 %inc10 %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %deg.1) %arrayidx14 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx14, align 4, !tbaa !12 %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %6) %arrayidx17 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom %7 = load i32, ptr %arrayidx17, align 4, !tbaa !12 %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %7) %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp22 = icmp eq i32 %8, -1 br i1 %cmp22, label %if.end38, label %if.else if.else: ; preds = %getSibling.exit %9 = load i32, ptr %l, align 4, !tbaa !10 %cmp28 = icmp eq i32 %9, -1 br i1 %cmp28, label %land.lhs.true, label %if.else35 land.lhs.true: ; preds = %if.else %10 = load i32, ptr %r, align 4, !tbaa !11 %cmp32 = icmp eq i32 %10, -1 br i1 %cmp32, label %if.end38, label %if.else35 if.else35: ; preds = %land.lhs.true, %if.else br label %if.end38 if.end38: ; preds = %land.lhs.true, %getSibling.exit, %if.else35 %str.11.sink = phi ptr [ @str, %if.else35 ], [ @str.12, %getSibling.exit ], [ @str.11, %land.lhs.true ] %puts50 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.11.sink) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %v = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !12 %cmp101 = icmp sgt i32 %0, 0 br i1 %cmp101, label %for.body.preheader, label %for.end76 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond1.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond1.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond1.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond1.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond1.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond1.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.epil store i32 -1, ptr %arrayidx.epil, align 4, !tbaa !5 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond1.preheader, label %for.body.epil, !llvm.loop !13 for.cond1.preheader: ; preds = %for.body.epil, %for.cond1.preheader.unr-lcssa br i1 %cmp101, label %for.body3, label %for.end76 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv store i32 -1, ptr %arrayidx, align 16, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next store i32 -1, ptr %arrayidx.1, align 4, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.1 store i32 -1, ptr %arrayidx.2, align 8, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.2 store i32 -1, ptr %arrayidx.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond1.preheader.unr-lcssa, label %for.body, !llvm.loop !15 for.cond24.preheader: ; preds = %for.inc21 %cmp25105 = icmp sgt i32 %8, 0 br i1 %cmp25105, label %while.cond.i.preheader.preheader, label %for.end76 while.cond.i.preheader.preheader: ; preds = %for.cond24.preheader %2 = zext i32 %8 to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @H, i8 0, i64 %3, i1 false), !tbaa !12 %xtraiter134 = and i64 %2, 1 %4 = icmp eq i32 %8, 1 br i1 %4, label %for.cond35.preheader.unr-lcssa, label %while.cond.i.preheader.preheader.new while.cond.i.preheader.preheader.new: ; preds = %while.cond.i.preheader.preheader %unroll_iter137 = and i64 %2, 4294967294 br label %while.cond.i.preheader for.body3: ; preds = %for.cond1.preheader, %for.inc21 %i.1104 = phi i32 [ %inc22, %for.inc21 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %v, ptr noundef nonnull %l, ptr noundef nonnull %r) %5 = load i32, ptr %l, align 4, !tbaa !12 %6 = load i32, ptr %v, align 4, !tbaa !12 %idxprom5 = sext i32 %6 to i64 %l7 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 1 store i32 %5, ptr %l7, align 4, !tbaa !10 %7 = load i32, ptr %r, align 4, !tbaa !12 %r10 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 2 store i32 %7, ptr %r10, align 4, !tbaa !11 %cmp11.not = icmp eq i32 %5, -1 br i1 %cmp11.not, label %if.end, label %if.then if.then: ; preds = %for.body3 %idxprom12 = sext i32 %5 to i64 %arrayidx13 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom12 store i32 %6, ptr %arrayidx13, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body3 %cmp15.not = icmp eq i32 %7, -1 br i1 %cmp15.not, label %for.inc21, label %if.then16 if.then16: ; preds = %if.end %idxprom17 = sext i32 %7 to i64 %arrayidx18 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom17 store i32 %6, ptr %arrayidx18, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %if.end, %if.then16 %inc22 = add nuw nsw i32 %i.1104, 1 %8 = load i32, ptr @n, align 4, !tbaa !12 %cmp2 = icmp slt i32 %inc22, %8 br i1 %cmp2, label %for.body3, label %for.cond24.preheader, !llvm.loop !17 while.cond.i.preheader: ; preds = %getDepth.exit.1, %while.cond.i.preheader.preheader.new %indvars.iv118 = phi i64 [ 0, %while.cond.i.preheader.preheader.new ], [ %indvars.iv.next119.1, %getDepth.exit.1 ] %niter138 = phi i64 [ 0, %while.cond.i.preheader.preheader.new ], [ %niter138.next.1, %getDepth.exit.1 ] %9 = trunc i64 %indvars.iv118 to i32 br label %while.cond.i for.cond35.preheader.unr-lcssa: ; preds = %getDepth.exit.1, %while.cond.i.preheader.preheader %indvars.iv118.unr = phi i64 [ 0, %while.cond.i.preheader.preheader ], [ %indvars.iv.next119.1, %getDepth.exit.1 ] %lcmp.mod136.not = icmp eq i64 %xtraiter134, 0 br i1 %lcmp.mod136.not, label %for.cond35.preheader, label %while.cond.i.preheader.epil while.cond.i.preheader.epil: ; preds = %for.cond35.preheader.unr-lcssa %10 = trunc i64 %indvars.iv118.unr to i32 br label %while.cond.i.epil while.cond.i.epil: ; preds = %while.cond.i.epil, %while.cond.i.preheader.epil %u.addr.0.i.epil = phi i32 [ %11, %while.cond.i.epil ], [ %10, %while.cond.i.preheader.epil ] %d.0.i.epil = phi i32 [ %inc.i.epil, %while.cond.i.epil ], [ 0, %while.cond.i.preheader.epil ] %idxprom.i.epil = sext i32 %u.addr.0.i.epil to i64 %arrayidx.i.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom.i.epil %11 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5 %cmp.i.epil = icmp eq i32 %11, -1 %inc.i.epil = add nuw nsw i32 %d.0.i.epil, 1 br i1 %cmp.i.epil, label %getDepth.exit.epil, label %while.cond.i.epil getDepth.exit.epil: ; preds = %while.cond.i.epil %arrayidx29.epil = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %indvars.iv118.unr store i32 %d.0.i.epil, ptr %arrayidx29.epil, align 4, !tbaa !12 br label %for.cond35.preheader for.cond35.preheader: ; preds = %for.cond35.preheader.unr-lcssa, %getDepth.exit.epil br i1 %cmp25105, label %for.body37.preheader, label %for.end76 for.body37.preheader: ; preds = %for.cond35.preheader %wide.trip.count126 = zext i32 %8 to i64 br label %for.body37 while.cond.i: ; preds = %while.cond.i.preheader, %while.cond.i %u.addr.0.i = phi i32 [ %12, %while.cond.i ], [ %9, %while.cond.i.preheader ] %d.0.i = phi i32 [ %inc.i, %while.cond.i ], [ 0, %while.cond.i.preheader ] %idxprom.i = sext i32 %u.addr.0.i to i64 %arrayidx.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom.i %12 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.i = icmp eq i32 %12, -1 %inc.i = add nuw nsw i32 %d.0.i, 1 br i1 %cmp.i, label %getDepth.exit, label %while.cond.i getDepth.exit: ; preds = %while.cond.i %arrayidx29 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %indvars.iv118 store i32 %d.0.i, ptr %arrayidx29, align 8, !tbaa !12 %indvars.iv.next119 = or i64 %indvars.iv118, 1 %13 = trunc i64 %indvars.iv.next119 to i32 br label %while.cond.i.1 while.cond.i.1: ; preds = %while.cond.i.1, %getDepth.exit %u.addr.0.i.1 = phi i32 [ %14, %while.cond.i.1 ], [ %13, %getDepth.exit ] %d.0.i.1 = phi i32 [ %inc.i.1, %while.cond.i.1 ], [ 0, %getDepth.exit ] %idxprom.i.1 = sext i32 %u.addr.0.i.1 to i64 %arrayidx.i.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom.i.1 %14 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5 %cmp.i.1 = icmp eq i32 %14, -1 %inc.i.1 = add nuw nsw i32 %d.0.i.1, 1 br i1 %cmp.i.1, label %getDepth.exit.1, label %while.cond.i.1 getDepth.exit.1: ; preds = %while.cond.i.1 %arrayidx29.1 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %indvars.iv.next119 store i32 %d.0.i.1, ptr %arrayidx29.1, align 4, !tbaa !12 %indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2 %niter138.next.1 = add i64 %niter138, 2 %niter138.ncmp.1 = icmp eq i64 %niter138.next.1, %unroll_iter137 br i1 %niter138.ncmp.1, label %for.cond35.preheader.unr-lcssa, label %while.cond.i.preheader, !llvm.loop !18 for.cond71.preheader: ; preds = %for.inc68 br i1 %cmp25105, label %for.body73, label %for.end76 for.body37: ; preds = %for.body37.preheader, %for.inc68 %indvars.iv123 = phi i64 [ 0, %for.body37.preheader ], [ %indvars.iv.next124, %for.inc68 ] %l40 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv123, i32 1 %15 = load i32, ptr %l40, align 4, !tbaa !10 %cmp41 = icmp eq i32 %15, -1 br i1 %cmp41, label %land.lhs.true, label %for.inc68 land.lhs.true: ; preds = %for.body37 %r44 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv123, i32 2 %16 = load i32, ptr %r44, align 4, !tbaa !11 %cmp45 = icmp eq i32 %16, -1 br i1 %cmp45, label %if.then46, label %for.inc68 if.then46: ; preds = %land.lhs.true %arrayidx48 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %indvars.iv123 store i32 0, ptr %arrayidx48, align 4, !tbaa !12 %p49.0.in107 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv123 %p49.0108 = load i32, ptr %p49.0.in107, align 4, !tbaa !5 %cmp53109 = icmp eq i32 %p49.0108, -1 br i1 %cmp53109, label %for.inc68, label %if.end55 if.end55: ; preds = %if.then46, %if.end62 %p49.0111 = phi i32 [ %p49.0, %if.end62 ], [ %p49.0108, %if.then46 ] %c.0110 = phi i32 [ %inc63, %if.end62 ], [ 1, %if.then46 ] %idxprom56 = sext i32 %p49.0111 to i64 %arrayidx57 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom56 %17 = load i32, ptr %arrayidx57, align 4, !tbaa !12 %cmp58 = icmp slt i32 %17, %c.0110 br i1 %cmp58, label %if.then59, label %if.end62 if.then59: ; preds = %if.end55 store i32 %c.0110, ptr %arrayidx57, align 4, !tbaa !12 br label %if.end62 if.end62: ; preds = %if.then59, %if.end55 %inc63 = add nuw nsw i32 %c.0110, 1 %p49.0.in = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom56 %p49.0 = load i32, ptr %p49.0.in, align 4, !tbaa !5 %cmp53 = icmp eq i32 %p49.0, -1 br i1 %cmp53, label %for.inc68, label %if.end55 for.inc68: ; preds = %if.end62, %if.then46, %for.body37, %land.lhs.true %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126 br i1 %exitcond127.not, label %for.cond71.preheader, label %for.body37, !llvm.loop !19 for.body73: ; preds = %for.cond71.preheader, %for.body73 %i.4115 = phi i32 [ %inc75, %for.body73 ], [ 0, %for.cond71.preheader ] call void @print(i32 noundef %i.4115) %inc75 = add nuw nsw i32 %i.4115, 1 %18 = load i32, ptr @n, align 4, !tbaa !12 %cmp72 = icmp slt i32 %inc75, %18 br i1 %cmp72, label %for.body73, label %for.end76, !llvm.loop !20 for.end76: ; preds = %for.body73, %for.cond24.preheader, %entry, %for.cond1.preheader, %for.cond35.preheader, %for.cond71.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"Node", !7, i64 0, !7, i64 4, !7, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 4} !11 = !{!6, !7, i64 8} !12 = !{!7, !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16} !18 = distinct !{!18, !16} !19 = distinct !{!19, !16} !20 = distinct !{!20, !16}
#include<stdio.h> #define N 25 #define NIL -1 struct Node { int parent; int left; int right; }; struct Node T[N]; int cnt,x,y; int depth(int nodeid) { if(T[nodeid].parent == NIL) { return 0; } else { cnt++; depth(T[nodeid].parent); } return cnt; } int height(int nodeid) { int x=0,y=0; if(T[nodeid].left != NIL) x = height(T[nodeid].left) + 1; if(T[nodeid].right != NIL) y = height(T[nodeid].right) + 1; if(x < y) return y; else return x; } int sibling(int nodeid) { if(T[nodeid].parent == NIL) return NIL; else if(T[T[nodeid].parent].left == nodeid) return T[T[nodeid].parent].right; else return T[T[nodeid].parent].left; } int degree(int nodeid) { if(T[nodeid].left == NIL && T[nodeid].right == NIL) return 0; else if(T[nodeid].left != NIL && T[nodeid].right != NIL) return 2; else return 1; } int main(void) { int i,j,n,m,l,newnode,left,right; scanf("%d",&n); for(i=0;i<n;i++) T[i].parent = T[i].left = T[i].right = NIL; for(i=0;i<n;i++) { scanf("%d%d%d",&newnode,&m,&l); T[m].parent = newnode; T[l].parent = newnode; T[newnode].left = m; T[newnode].right = l; } for(i=0;i<n;i++) { cnt = 0; printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d,",i,T[i].parent,sibling(i),degree(i),depth(i),height(i)); if(T[i].parent == NIL) { printf(" root\n"); } else if (T[i].left == NIL && T[i].right == NIL) { printf(" leaf\n"); } else { printf(" internal node\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237474/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237474/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @T = dso_local local_unnamed_addr global [25 x %struct.Node] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [74 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d,\00", align 1 @x = dso_local local_unnamed_addr global i32 0, align 4 @y = dso_local local_unnamed_addr global i32 0, align 4 @str = private unnamed_addr constant [15 x i8] c" internal node\00", align 1 @str.6 = private unnamed_addr constant [6 x i8] c" leaf\00", align 1 @str.7 = private unnamed_addr constant [6 x i8] c" root\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %nodeid) local_unnamed_addr #0 { entry: %idxprom = sext i32 %nodeid to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %common.ret5, label %if.else common.ret5: ; preds = %entry, %if.else %common.ret5.op = phi i32 [ %2, %if.else ], [ 0, %entry ] ret i32 %common.ret5.op if.else: ; preds = %entry %1 = load i32, ptr @cnt, align 4, !tbaa !10 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !10 %call = tail call i32 @depth(i32 noundef %0) %2 = load i32, ptr @cnt, align 4, !tbaa !10 br label %common.ret5 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @height(i32 noundef %nodeid) local_unnamed_addr #1 { entry: %idxprom = sext i32 %nodeid to i64 %left = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !11 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @height(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %x.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !12 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @height(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %y.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %y.0.x.0 = tail call i32 @llvm.smax.i32(i32 %x.0, i32 %y.0) ret i32 %y.0.x.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @sibling(i32 noundef %nodeid) local_unnamed_addr #3 { entry: %idxprom = sext i32 %nodeid to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.else if.else: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %left = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %left, align 4, !tbaa !11 %cmp6 = icmp eq i32 %1, %nodeid br i1 %cmp6, label %if.then7, label %return if.then7: ; preds = %if.else %right = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %right, align 4, !tbaa !12 br label %return return: ; preds = %if.else, %entry, %if.then7 %retval.0 = phi i32 [ %2, %if.then7 ], [ -1, %entry ], [ %1, %if.else ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @degree(i32 noundef %nodeid) local_unnamed_addr #3 { entry: %idxprom = sext i32 %nodeid to i64 %left = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !11 %cmp = icmp eq i32 %0, -1 %right = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !12 %cmp3 = icmp eq i32 %1, -1 br i1 %cmp, label %land.lhs.true, label %land.lhs.true8 land.lhs.true: ; preds = %entry br i1 %cmp3, label %return, label %if.else14 land.lhs.true8: ; preds = %entry br i1 %cmp3, label %if.else14, label %return if.else14: ; preds = %land.lhs.true, %land.lhs.true8 br label %return return: ; preds = %land.lhs.true8, %land.lhs.true, %if.else14 %retval.0 = phi i32 [ 1, %if.else14 ], [ 0, %land.lhs.true ], [ 2, %land.lhs.true8 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %newnode = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %newnode) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp82 = icmp sgt i32 %0, 0 br i1 %cmp82, label %for.body9.preheader, label %for.end57 for.body9.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = mul nuw nsw i64 %1, 12 call void @llvm.memset.p0.i64(ptr nonnull align 16 @T, i8 -1, i64 %2, i1 false), !tbaa !10 br label %for.body9 for.cond26.preheader: ; preds = %for.body9 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body28, label %for.end57 for.body9: ; preds = %for.body9.preheader, %for.body9 %i.185 = phi i32 [ %inc24, %for.body9 ], [ 0, %for.body9.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %newnode, ptr noundef nonnull %m, ptr noundef nonnull %l) %4 = load i32, ptr %newnode, align 4, !tbaa !10 %5 = load i32, ptr %m, align 4, !tbaa !10 %idxprom11 = sext i32 %5 to i64 %arrayidx12 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom11 store i32 %4, ptr %arrayidx12, align 4, !tbaa !5 %6 = load i32, ptr %l, align 4, !tbaa !10 %idxprom14 = sext i32 %6 to i64 %arrayidx15 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom14 store i32 %4, ptr %arrayidx15, align 4, !tbaa !5 %idxprom17 = sext i32 %4 to i64 %left19 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom17, i32 1 store i32 %5, ptr %left19, align 4, !tbaa !11 %right22 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom17, i32 2 store i32 %6, ptr %right22, align 4, !tbaa !12 %inc24 = add nuw nsw i32 %i.185, 1 %7 = load i32, ptr %n, align 4, !tbaa !10 %cmp8 = icmp slt i32 %inc24, %7 br i1 %cmp8, label %for.body9, label %for.cond26.preheader, !llvm.loop !13 for.body28: ; preds = %for.cond26.preheader, %for.inc55 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc55 ], [ 0, %for.cond26.preheader ] store i32 0, ptr @cnt, align 4, !tbaa !10 %arrayidx30 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp.i = icmp eq i32 %8, -1 br i1 %cmp.i, label %sibling.exit, label %if.else.i if.else.i: ; preds = %for.body28 %idxprom4.i = sext i32 %8 to i64 %left.i = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %9 = load i32, ptr %left.i, align 4, !tbaa !11 %10 = zext i32 %9 to i64 %cmp6.i = icmp eq i64 %indvars.iv, %10 br i1 %cmp6.i, label %if.then7.i, label %sibling.exit if.then7.i: ; preds = %if.else.i %right.i = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %11 = load i32, ptr %right.i, align 4, !tbaa !12 br label %sibling.exit sibling.exit: ; preds = %for.body28, %if.else.i, %if.then7.i %retval.0.i = phi i32 [ %11, %if.then7.i ], [ -1, %for.body28 ], [ %9, %if.else.i ] %left.i78 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv, i32 1 %12 = load i32, ptr %left.i78, align 4, !tbaa !11 %cmp.i79 = icmp eq i32 %12, -1 %right.i80 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv, i32 2 %13 = load i32, ptr %right.i80, align 4, !tbaa !12 %cmp3.i = icmp eq i32 %13, -1 br i1 %cmp.i79, label %land.lhs.true.i, label %land.lhs.true8.i land.lhs.true.i: ; preds = %sibling.exit br i1 %cmp3.i, label %degree.exit, label %if.else14.i land.lhs.true8.i: ; preds = %sibling.exit br i1 %cmp3.i, label %if.else14.i, label %degree.exit if.else14.i: ; preds = %land.lhs.true8.i, %land.lhs.true.i br label %degree.exit degree.exit: ; preds = %land.lhs.true.i, %land.lhs.true8.i, %if.else14.i %retval.0.i81 = phi i32 [ 1, %if.else14.i ], [ 0, %land.lhs.true.i ], [ 2, %land.lhs.true8.i ] %14 = trunc i64 %indvars.iv to i32 %call34 = call i32 @depth(i32 noundef %14) %call35 = call i32 @height(i32 noundef %14) %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14, i32 noundef %8, i32 noundef %retval.0.i, i32 noundef %retval.0.i81, i32 noundef %call34, i32 noundef %call35) %15 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp40 = icmp eq i32 %15, -1 br i1 %cmp40, label %for.inc55, label %if.else if.else: ; preds = %degree.exit %16 = load i32, ptr %left.i78, align 4, !tbaa !11 %cmp45 = icmp eq i32 %16, -1 br i1 %cmp45, label %land.lhs.true, label %if.else52 land.lhs.true: ; preds = %if.else %17 = load i32, ptr %right.i80, align 4, !tbaa !12 %cmp49 = icmp eq i32 %17, -1 br i1 %cmp49, label %for.inc55, label %if.else52 if.else52: ; preds = %land.lhs.true, %if.else br label %for.inc55 for.inc55: ; preds = %land.lhs.true, %degree.exit, %if.else52 %str.7.sink = phi ptr [ @str, %if.else52 ], [ @str.7, %degree.exit ], [ @str.6, %land.lhs.true ] %puts76 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %18 = load i32, ptr %n, align 4, !tbaa !10 %19 = sext i32 %18 to i64 %cmp27 = icmp slt i64 %indvars.iv.next, %19 br i1 %cmp27, label %for.body28, label %for.end57, !llvm.loop !15 for.end57: ; preds = %for.inc55, %entry, %for.cond26.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %newnode) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nofree nounwind } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"Node", !7, i64 0, !7, i64 4, !7, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!7, !7, i64 0} !11 = !{!6, !7, i64 4} !12 = !{!6, !7, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
#include<stdio.h> #define MAX 10000 #define NIL -1 typedef struct{ int p,l,r; }Node; Node T[MAX]; int n,D[MAX],H[MAX]; void setDepth(int,int); int setHeight(int); int getSibling(int); void print(int); int main(){ int i,v,l,r,root = 0; scanf("%d",&n); for(i=0;i<n;i++) T[i].p = NIL; for(i=0;i<n;i++){ scanf("%d %d %d",&v,&l,&r); T[v].l = l; T[v].r = r; if(l != NIL)T[l].p = v; if(r != NIL)T[r].p = v; } for(i=0;i<n;i++) if(T[i].p == NIL)root = i; setDepth(root,0); setHeight(root); for(i=0;i<n;i++) print(i); return 0; } void setDepth(int u, int d){ if(u == NIL)return; D[u] = d; setDepth(T[u].l,d+1); setDepth(T[u].r,d+1); } int setHeight(int u){ int h1,h2; h1 = h2 = 0; if(T[u].l != NIL)h1 = setHeight(T[u].l) + 1; if(T[u].r != NIL)h2 = setHeight(T[u].r) + 1; return H[u] = (h1 > h2 ? h1 : h2); } int getSibling(int u){ if(T[u].p == NIL)return NIL; if(T[T[u].p].l != u && T[T[u].p].l != NIL) return T[T[u].p].l; if(T[T[u].p].r != u && T[T[u].p].r != NIL) return T[T[u].p].r; return NIL; } void print(int u){ int deg; printf("node %d: parent = %d, sibling = %d, ",u,T[u].p,getSibling(u)); deg = 0; if(T[u].l != NIL)deg++; if(T[u].r != NIL)deg++; printf("degree = %d, depth = %d, height = %d, ",deg,D[u],H[u]); if(T[u].p == NIL)printf("root\n"); else if(T[u].l == NIL && T[u].r == NIL)printf("leaf\n"); else printf("internal node\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237517/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237517/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @T = dso_local local_unnamed_addr global [10000 x %struct.Node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @D = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @H = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [37 x i8] c"node %d: parent = %d, sibling = %d, \00", align 1 @.str.3 = private unnamed_addr constant [39 x i8] c"degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.8 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %v = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %call = tail 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.preheader, label %for.end35 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond1.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond1.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond1.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond1.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond1.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond1.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.epil store i32 -1, ptr %arrayidx.epil, align 4, !tbaa !9 %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.cond1.preheader, label %for.body.epil, !llvm.loop !11 for.cond1.preheader: ; preds = %for.body.epil, %for.cond1.preheader.unr-lcssa br i1 %cmp56, label %for.body3, label %for.end35 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv store i32 -1, ptr %arrayidx, align 16, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next store i32 -1, ptr %arrayidx.1, align 4, !tbaa !9 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.1 store i32 -1, ptr %arrayidx.2, align 8, !tbaa !9 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.2 store i32 -1, ptr %arrayidx.3, align 4, !tbaa !9 %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.cond1.preheader.unr-lcssa, label %for.body, !llvm.loop !13 for.cond24.preheader: ; preds = %for.inc21 %cmp2560 = icmp sgt i32 %6, 0 br i1 %cmp2560, label %for.body26.preheader, label %for.end35 for.body26.preheader: ; preds = %for.cond24.preheader %wide.trip.count71 = zext i32 %6 to i64 %xtraiter75 = and i64 %wide.trip.count71, 3 %2 = icmp ult i32 %6, 4 br i1 %2, label %for.end35.loopexit.unr-lcssa, label %for.body26.preheader.new for.body26.preheader.new: ; preds = %for.body26.preheader %unroll_iter79 = and i64 %wide.trip.count71, 4294967292 br label %for.body26 for.body3: ; preds = %for.cond1.preheader, %for.inc21 %i.159 = phi i32 [ %inc22, %for.inc21 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !5 %4 = load i32, ptr %v, align 4, !tbaa !5 %idxprom5 = sext i32 %4 to i64 %l7 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 1 store i32 %3, ptr %l7, align 4, !tbaa !15 %5 = load i32, ptr %r, align 4, !tbaa !5 %r10 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 2 store i32 %5, ptr %r10, align 4, !tbaa !16 %cmp11.not = icmp eq i32 %3, -1 br i1 %cmp11.not, label %if.end, label %if.then if.then: ; preds = %for.body3 %idxprom12 = sext i32 %3 to i64 %arrayidx13 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom12 store i32 %4, ptr %arrayidx13, align 4, !tbaa !9 br label %if.end if.end: ; preds = %if.then, %for.body3 %cmp15.not = icmp eq i32 %5, -1 br i1 %cmp15.not, label %for.inc21, label %if.then16 if.then16: ; preds = %if.end %idxprom17 = sext i32 %5 to i64 %arrayidx18 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom17 store i32 %4, ptr %arrayidx18, align 4, !tbaa !9 br label %for.inc21 for.inc21: ; preds = %if.end, %if.then16 %inc22 = add nuw nsw i32 %i.159, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc22, %6 br i1 %cmp2, label %for.body3, label %for.cond24.preheader, !llvm.loop !17 for.body26: ; preds = %for.body26, %for.body26.preheader.new %indvars.iv68 = phi i64 [ 0, %for.body26.preheader.new ], [ %indvars.iv.next69.3, %for.body26 ] %root.062 = phi i32 [ 0, %for.body26.preheader.new ], [ %spec.select.3, %for.body26 ] %niter80 = phi i64 [ 0, %for.body26.preheader.new ], [ %niter80.next.3, %for.body26 ] %arrayidx28 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv68 %7 = load i32, ptr %arrayidx28, align 16, !tbaa !9 %cmp30 = icmp eq i32 %7, -1 %8 = trunc i64 %indvars.iv68 to i32 %spec.select = select i1 %cmp30, i32 %8, i32 %root.062 %indvars.iv.next69 = or i64 %indvars.iv68, 1 %arrayidx28.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next69 %9 = load i32, ptr %arrayidx28.1, align 4, !tbaa !9 %cmp30.1 = icmp eq i32 %9, -1 %10 = trunc i64 %indvars.iv.next69 to i32 %spec.select.1 = select i1 %cmp30.1, i32 %10, i32 %spec.select %indvars.iv.next69.1 = or i64 %indvars.iv68, 2 %arrayidx28.2 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next69.1 %11 = load i32, ptr %arrayidx28.2, align 8, !tbaa !9 %cmp30.2 = icmp eq i32 %11, -1 %12 = trunc i64 %indvars.iv.next69.1 to i32 %spec.select.2 = select i1 %cmp30.2, i32 %12, i32 %spec.select.1 %indvars.iv.next69.2 = or i64 %indvars.iv68, 3 %arrayidx28.3 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next69.2 %13 = load i32, ptr %arrayidx28.3, align 4, !tbaa !9 %cmp30.3 = icmp eq i32 %13, -1 %14 = trunc i64 %indvars.iv.next69.2 to i32 %spec.select.3 = select i1 %cmp30.3, i32 %14, i32 %spec.select.2 %indvars.iv.next69.3 = add nuw nsw i64 %indvars.iv68, 4 %niter80.next.3 = add i64 %niter80, 4 %niter80.ncmp.3 = icmp eq i64 %niter80.next.3, %unroll_iter79 br i1 %niter80.ncmp.3, label %for.end35.loopexit.unr-lcssa, label %for.body26, !llvm.loop !18 for.end35.loopexit.unr-lcssa: ; preds = %for.body26, %for.body26.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %spec.select.3, %for.body26 ] %indvars.iv68.unr = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next69.3, %for.body26 ] %root.062.unr = phi i32 [ 0, %for.body26.preheader ], [ %spec.select.3, %for.body26 ] %lcmp.mod77.not = icmp eq i64 %xtraiter75, 0 br i1 %lcmp.mod77.not, label %for.end35, label %for.body26.epil for.body26.epil: ; preds = %for.end35.loopexit.unr-lcssa, %for.body26.epil %indvars.iv68.epil = phi i64 [ %indvars.iv.next69.epil, %for.body26.epil ], [ %indvars.iv68.unr, %for.end35.loopexit.unr-lcssa ] %root.062.epil = phi i32 [ %spec.select.epil, %for.body26.epil ], [ %root.062.unr, %for.end35.loopexit.unr-lcssa ] %epil.iter76 = phi i64 [ %epil.iter76.next, %for.body26.epil ], [ 0, %for.end35.loopexit.unr-lcssa ] %arrayidx28.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv68.epil %15 = load i32, ptr %arrayidx28.epil, align 4, !tbaa !9 %cmp30.epil = icmp eq i32 %15, -1 %16 = trunc i64 %indvars.iv68.epil to i32 %spec.select.epil = select i1 %cmp30.epil, i32 %16, i32 %root.062.epil %indvars.iv.next69.epil = add nuw nsw i64 %indvars.iv68.epil, 1 %epil.iter76.next = add i64 %epil.iter76, 1 %epil.iter76.cmp.not = icmp eq i64 %epil.iter76.next, %xtraiter75 br i1 %epil.iter76.cmp.not, label %for.end35, label %for.body26.epil, !llvm.loop !19 for.end35: ; preds = %for.end35.loopexit.unr-lcssa, %for.body26.epil, %entry, %for.cond1.preheader, %for.cond24.preheader %root.0.lcssa = phi i32 [ 0, %for.cond24.preheader ], [ 0, %for.cond1.preheader ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end35.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body26.epil ] call void @setDepth(i32 noundef %root.0.lcssa, i32 noundef 0) %call36 = call i32 @setHeight(i32 noundef %root.0.lcssa) %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp3864 = icmp sgt i32 %17, 0 br i1 %cmp3864, label %for.body39, label %for.end42 for.body39: ; preds = %for.end35, %for.body39 %i.365 = phi i32 [ %inc41, %for.body39 ], [ 0, %for.end35 ] call void @print(i32 noundef %i.365) %inc41 = add nuw nsw i32 %i.365, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp38 = icmp slt i32 %inc41, %18 br i1 %cmp38, label %for.body39, label %for.end42, !llvm.loop !20 for.end42: ; preds = %for.body39, %for.end35 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @setDepth(i32 noundef %u, i32 noundef %d) local_unnamed_addr #3 { entry: %cmp11 = icmp eq i32 %u, -1 br i1 %cmp11, label %return, label %if.end if.end: ; preds = %entry, %if.end %d.tr13 = phi i32 [ %add, %if.end ], [ %d, %entry ] %u.tr12 = phi i32 [ %1, %if.end ], [ %u, %entry ] %idxprom = sext i32 %u.tr12 to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom store i32 %d.tr13, ptr %arrayidx, align 4, !tbaa !5 %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %l, align 4, !tbaa !15 %add = add nsw i32 %d.tr13, 1 tail call void @setDepth(i32 noundef %0, i32 noundef %add) %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %r, align 4, !tbaa !16 %cmp = icmp eq i32 %1, -1 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @setHeight(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %l, align 4, !tbaa !15 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @setHeight(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %r, align 4, !tbaa !16 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @setHeight(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %h2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %cond = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %arrayidx16 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom store i32 %cond, ptr %arrayidx16, align 4, !tbaa !5 ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp.i = icmp eq i32 %0, -1 br i1 %cmp.i, label %getSibling.exit, label %if.end.i if.end.i: ; preds = %entry %idxprom4.i = sext i32 %0 to i64 %l.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %1 = load i32, ptr %l.i, align 4, !tbaa !15 %cmp6.not.i = icmp eq i32 %1, %u %cmp13.not.i = icmp eq i32 %1, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %getSibling.exit if.end21.i: ; preds = %if.end.i %r.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %2 = load i32, ptr %r.i, align 4, !tbaa !16 %cmp27.not.i = icmp eq i32 %2, %u %cmp35.not.i = icmp eq i32 %2, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %2 br label %getSibling.exit getSibling.exit: ; preds = %entry, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %entry ], [ %1, %if.end.i ], [ %spec.select.i, %if.end21.i ] %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %u, i32 noundef %0, i32 noundef %retval.0.i) %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %3 = load i32, ptr %l, align 4, !tbaa !15 %cmp.not = icmp ne i32 %3, -1 %spec.select = zext i1 %cmp.not to i32 %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %4 = load i32, ptr %r, align 4, !tbaa !16 %cmp6.not = icmp eq i32 %4, -1 %inc8 = select i1 %cmp.not, i32 2, i32 1 %deg.1 = select i1 %cmp6.not, i32 %spec.select, i32 %inc8 %arrayidx11 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %deg.1, i32 noundef %5, i32 noundef %6) %7 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp18 = icmp eq i32 %7, -1 br i1 %cmp18, label %if.end34, label %if.else if.else: ; preds = %getSibling.exit %8 = load i32, ptr %l, align 4, !tbaa !15 %cmp24 = icmp eq i32 %8, -1 br i1 %cmp24, label %land.lhs.true, label %if.else31 land.lhs.true: ; preds = %if.else %9 = load i32, ptr %r, align 4, !tbaa !16 %cmp28 = icmp eq i32 %9, -1 br i1 %cmp28, label %if.end34, label %if.else31 if.else31: ; preds = %land.lhs.true, %if.else br label %if.end34 if.end34: ; preds = %land.lhs.true, %getSibling.exit, %if.else31 %str.7.sink = phi ptr [ @str, %if.else31 ], [ @str.8, %getSibling.exit ], [ @str.7, %land.lhs.true ] %puts46 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getSibling(i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %l = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !15 %cmp6.not = icmp eq i32 %1, %u %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %r = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %r, align 4, !tbaa !16 %cmp27.not = icmp eq i32 %2, %u %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; 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) #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!10, !6, i64 4} !16 = !{!10, !6, i64 8} !17 = distinct !{!17, !14} !18 = distinct !{!18, !14} !19 = distinct !{!19, !12} !20 = distinct !{!20, !14}
#include<stdio.h> #include<stdlib.h> #define MAX 26 typedef struct node{ int p; int l; int r; } Tree; int Height(int); int n; Tree T[MAX]; int main(){ int i,j,id,left,right; int s[MAX],deg[MAX],dep[MAX],h[MAX]; scanf("%d",&n); for(i=0;i<n;i++){ T[i].p=-1; T[i].l=-1; T[i].r=-1; s[i]=-1; deg[i]=0; dep[i]=0; h[i]=0; } for(i=0;i<n;i++){ scanf("%d%d%d",&id,&left,&right); if(left!=-1){ T[left].p=id; deg[id]++; } if(right!=-1){ T[right].p=id; deg[id]++; } T[id].l=left; T[id].r=right; s[left]=right; s[right]=left; } for(i=0;i<n;i++){ j=i; while(T[j].p!=-1){ j=T[j].p; dep[i]++; } h[i]=Height(i); } for(i=0;i<n;i++){ printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, " ,i,T[i].p,s[i],deg[i],dep[i],h[i]); if(T[i].p==-1){ printf("root\n"); }else if(T[i].l==-1 && T[i].r==-1){ printf("leaf\n"); }else{ printf("internal node\n"); } } return 0; } int Height(int i){ int j,count=0,max=0; for(j=0;j<n;j++){ if(T[j].p==i){ count=Height(j)+1; if(count>max){ max=count; } } } return max; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237575/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237575/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @T = dso_local local_unnamed_addr global [26 x %struct.node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %id = alloca i32, align 4 %left = alloca i32, align 4 %right = alloca i32, align 4 %s = alloca [26 x i32], align 16 %deg = alloca [26 x i32], align 16 %dep = alloca [26 x i32], align 16 %h = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %left) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %right) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %deg) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %dep) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %h) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp135 = icmp sgt i32 %0, 0 br i1 %cmp135, label %for.body15.preheader, label %for.end102 for.body15.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = mul nuw nsw i64 %1, 12 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @T, i8 -1, i64 %2, i1 false), !tbaa !5 %3 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 -1, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %deg, i8 0, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %dep, i8 0, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %h, i8 0, i64 %3, i1 false), !tbaa !5 br label %for.body15 for.cond46.preheader: ; preds = %if.end32 %cmp47143 = icmp sgt i32 %8, 0 br i1 %cmp47143, label %while.cond.preheader.preheader, label %for.end102 while.cond.preheader.preheader: ; preds = %for.cond46.preheader %wide.trip.count = zext i32 %8 to i64 br label %while.cond.preheader for.body15: ; preds = %for.body15.preheader, %if.end32 %i.1138 = phi i32 [ %inc44, %if.end32 ], [ 0, %for.body15.preheader ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %left, ptr noundef nonnull %right) %4 = load i32, ptr %left, align 4, !tbaa !5 %cmp17.not = icmp eq i32 %4, -1 %.pre.pre = load i32, ptr %id, align 4, !tbaa !5 br i1 %cmp17.not, label %if.end, label %if.then if.then: ; preds = %for.body15 %idxprom18 = sext i32 %4 to i64 %arrayidx19 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %idxprom18 store i32 %.pre.pre, ptr %arrayidx19, align 4, !tbaa !9 %idxprom21 = sext i32 %.pre.pre to i64 %arrayidx22 = getelementptr inbounds [26 x i32], ptr %deg, i64 0, i64 %idxprom21 %5 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %inc23 = add nsw i32 %5, 1 store i32 %inc23, ptr %arrayidx22, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body15 %6 = load i32, ptr %right, align 4, !tbaa !5 %cmp24.not = icmp eq i32 %6, -1 br i1 %cmp24.not, label %if.end.if.end32_crit_edge, label %if.then25 if.end.if.end32_crit_edge: ; preds = %if.end %.pre = sext i32 %.pre.pre to i64 br label %if.end32 if.then25: ; preds = %if.end %idxprom26 = sext i32 %6 to i64 %arrayidx27 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %idxprom26 store i32 %.pre.pre, ptr %arrayidx27, align 4, !tbaa !9 %idxprom29 = sext i32 %.pre.pre to i64 %arrayidx30 = getelementptr inbounds [26 x i32], ptr %deg, i64 0, i64 %idxprom29 %7 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %inc31 = add nsw i32 %7, 1 store i32 %inc31, ptr %arrayidx30, align 4, !tbaa !5 br label %if.end32 if.end32: ; preds = %if.end.if.end32_crit_edge, %if.then25 %idxprom41.pre-phi = phi i64 [ -1, %if.end.if.end32_crit_edge ], [ %idxprom26, %if.then25 ] %idxprom33.pre-phi = phi i64 [ %.pre, %if.end.if.end32_crit_edge ], [ %idxprom29, %if.then25 ] %l35 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %idxprom33.pre-phi, i32 1 store i32 %4, ptr %l35, align 4, !tbaa !11 %r38 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %idxprom33.pre-phi, i32 2 store i32 %6, ptr %r38, align 4, !tbaa !12 %idxprom39 = sext i32 %4 to i64 %arrayidx40 = getelementptr inbounds [26 x i32], ptr %s, i64 0, i64 %idxprom39 store i32 %6, ptr %arrayidx40, align 4, !tbaa !5 %arrayidx42 = getelementptr inbounds [26 x i32], ptr %s, i64 0, i64 %idxprom41.pre-phi store i32 %4, ptr %arrayidx42, align 4, !tbaa !5 %inc44 = add nuw nsw i32 %i.1138, 1 %8 = load i32, ptr @n, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc44, %8 br i1 %cmp14, label %for.body15, label %for.cond46.preheader, !llvm.loop !13 while.cond.preheader: ; preds = %while.cond.preheader.preheader, %while.end %indvars.iv = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx50140 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %indvars.iv %9 = load i32, ptr %arrayidx50140, align 4, !tbaa !9 %cmp52.not141 = icmp eq i32 %9, -1 br i1 %cmp52.not141, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader %arrayidx57 = getelementptr inbounds [26 x i32], ptr %dep, i64 0, i64 %indvars.iv %arrayidx57.promoted = load i32, ptr %arrayidx57, align 4, !tbaa !5 br label %while.body for.cond65.preheader: ; preds = %while.end br i1 %cmp47143, label %for.body67, label %for.end102 while.body: ; preds = %while.body.lr.ph, %while.body %inc58142 = phi i32 [ %arrayidx57.promoted, %while.body.lr.ph ], [ %inc58, %while.body ] %10 = phi i32 [ %9, %while.body.lr.ph ], [ %11, %while.body ] %inc58 = add nsw i32 %inc58142, 1 %idxprom49 = sext i32 %10 to i64 %arrayidx50 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %idxprom49 %11 = load i32, ptr %arrayidx50, align 4, !tbaa !9 %cmp52.not = icmp eq i32 %11, -1 br i1 %cmp52.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !15 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %inc58, ptr %arrayidx57, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %12 = trunc i64 %indvars.iv to i32 %call59 = call i32 @Height(i32 noundef %12) %arrayidx61 = getelementptr inbounds [26 x i32], ptr %h, i64 0, i64 %indvars.iv store i32 %call59, ptr %arrayidx61, align 4, !tbaa !5 %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.cond65.preheader, label %while.cond.preheader, !llvm.loop !16 for.body67: ; preds = %for.cond65.preheader, %for.inc100 %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc100 ], [ 0, %for.cond65.preheader ] %arrayidx69 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %indvars.iv150 %13 = load i32, ptr %arrayidx69, align 4, !tbaa !9 %arrayidx72 = getelementptr inbounds [26 x i32], ptr %s, i64 0, i64 %indvars.iv150 %14 = load i32, ptr %arrayidx72, align 4, !tbaa !5 %arrayidx74 = getelementptr inbounds [26 x i32], ptr %deg, i64 0, i64 %indvars.iv150 %15 = load i32, ptr %arrayidx74, align 4, !tbaa !5 %arrayidx76 = getelementptr inbounds [26 x i32], ptr %dep, i64 0, i64 %indvars.iv150 %16 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %arrayidx78 = getelementptr inbounds [26 x i32], ptr %h, i64 0, i64 %indvars.iv150 %17 = load i32, ptr %arrayidx78, align 4, !tbaa !5 %18 = trunc i64 %indvars.iv150 to i32 %call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18, i32 noundef %13, i32 noundef %14, i32 noundef %15, i32 noundef %16, i32 noundef %17) %19 = load i32, ptr %arrayidx69, align 4, !tbaa !9 %cmp83 = icmp eq i32 %19, -1 br i1 %cmp83, label %for.inc100, label %if.else if.else: ; preds = %for.body67 %l88 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %indvars.iv150, i32 1 %20 = load i32, ptr %l88, align 4, !tbaa !11 %cmp89 = icmp eq i32 %20, -1 br i1 %cmp89, label %land.lhs.true, label %if.else96 land.lhs.true: ; preds = %if.else %r92 = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %indvars.iv150, i32 2 %21 = load i32, ptr %r92, align 4, !tbaa !12 %cmp93 = icmp eq i32 %21, -1 br i1 %cmp93, label %for.inc100, label %if.else96 if.else96: ; preds = %land.lhs.true, %if.else br label %for.inc100 for.inc100: ; preds = %land.lhs.true, %for.body67, %if.else96 %str.7.sink = phi ptr [ @str, %if.else96 ], [ @str.7, %for.body67 ], [ @str.6, %land.lhs.true ] %puts134 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %22 = load i32, ptr @n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp66 = icmp slt i64 %indvars.iv.next151, %23 br i1 %cmp66, label %for.body67, label %for.end102, !llvm.loop !17 for.end102: ; preds = %for.inc100, %entry, %for.cond46.preheader, %for.cond65.preheader call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %h) #6 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %dep) #6 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %deg) #6 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %right) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %left) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #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: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Height(i32 noundef %i) local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 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 ] %max.012 = phi i32 [ 0, %for.body.preheader ], [ %max.1, %for.inc ] %arrayidx = getelementptr inbounds [26 x %struct.node], ptr @T, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp1 = icmp eq i32 %1, %i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %2 = trunc i64 %indvars.iv to i32 %call = tail call i32 @Height(i32 noundef %2) %cmp2.not = icmp slt i32 %call, %max.012 %add = add nsw i32 %call, 1 %spec.select = select i1 %cmp2.not, i32 %max.012, i32 %add br label %for.inc for.inc: ; preds = %if.then, %for.body %max.1 = phi i32 [ %max.012, %for.body ], [ %spec.select, %if.then ] %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 !18 for.end: ; preds = %for.inc, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %max.1, %for.inc ] ret i32 %max.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"node", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 4} !12 = !{!10, !6, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14} !17 = distinct !{!17, !14} !18 = distinct !{!18, !14}
#include<stdio.h> #include<stdlib.h> typedef struct{ int parent; int l,r; // child }node; int sibling(int); int degree(int); int depth(int); int height(int); node *T; int h_count; int main(){ int n, x, y, z, a, i, j; scanf("%d",&n); T = (node *)malloc(sizeof(node) * n); for(i=0; i<n; i++) T[i].parent = -1; for(i=0; i<n; i++){ scanf("%d",&x); scanf("%d%d",&T[x].l,&T[x].r); T[T[x].l].parent = x; T[T[x].r].parent = x; } for(i=0; i<n; i++){ h_count = 0; printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ", i,T[i].parent,sibling(i),degree(i),depth(i),height(i)); if(T[i].parent == -1) printf("root\n"); else if(T[i].l == -1 && T[i].r == -1) printf("leaf\n"); else printf("internal node\n"); } free(T); return 0; } int sibling(int x){ if(T[x].parent == -1) return -1; if(T[T[x].parent].l == x) return (T[T[x].parent].r); else return (T[T[x].parent].l); } int degree(int x){ int count=2; if(T[x].l == -1) count--; if(T[x].r == -1) count--; return count; } int depth(int x){ int d_count = 0; while(T[x].parent != -1){ x = T[x].parent; d_count++; } return d_count; } int height(int x){ int y,z; if(T[x].l != -1) y = height(T[x].l) + 1; else y = 0; if(T[x].r != -1) z = height(T[x].r) + 1; else z = 0; if(y < z) return z; else return y; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237625/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237625/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @T = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @h_count = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: 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) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = mul nsw i64 %conv, 12 %call1 = call noalias ptr @malloc(i64 noundef %mul) #11 store ptr %call1, ptr @T, align 8, !tbaa !9 %cmp87 = icmp sgt i32 %0, 0 br i1 %cmp87, label %for.body.preheader, label %for.end63 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond3.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond3.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond3.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond3.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond3.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond3.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds %struct.node, ptr %call1, i64 %indvars.iv.epil store i32 -1, ptr %arrayidx.epil, align 4, !tbaa !11 %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.cond3.preheader, label %for.body.epil, !llvm.loop !13 for.cond3.preheader: ; preds = %for.body.epil, %for.cond3.preheader.unr-lcssa br i1 %cmp87, label %for.body6, label %for.end63 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds %struct.node, ptr %call1, i64 %indvars.iv store i32 -1, ptr %arrayidx, align 4, !tbaa !11 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds %struct.node, ptr %call1, i64 %indvars.iv.next store i32 -1, ptr %arrayidx.1, align 4, !tbaa !11 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds %struct.node, ptr %call1, i64 %indvars.iv.next.1 store i32 -1, ptr %arrayidx.2, align 4, !tbaa !11 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds %struct.node, ptr %call1, i64 %indvars.iv.next.2 store i32 -1, ptr %arrayidx.3, align 4, !tbaa !11 %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.cond3.preheader.unr-lcssa, label %for.body, !llvm.loop !15 for.cond28.preheader: ; preds = %for.body6 %2 = icmp sgt i32 %10, 0 br i1 %2, label %for.body31, label %for.end63 for.body6: ; preds = %for.cond3.preheader, %for.body6 %i.190 = phi i32 [ %inc26, %for.body6 ], [ 0, %for.cond3.preheader ] %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %3 = load ptr, ptr @T, align 8, !tbaa !9 %4 = load i32, ptr %x, align 4, !tbaa !5 %idxprom8 = sext i32 %4 to i64 %l = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom8, i32 1 %r = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom8, i32 2 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r) %5 = load i32, ptr %x, align 4, !tbaa !5 %6 = load ptr, ptr @T, align 8, !tbaa !9 %idxprom13 = sext i32 %5 to i64 %l15 = getelementptr inbounds %struct.node, ptr %6, i64 %idxprom13, i32 1 %7 = load i32, ptr %l15, align 4, !tbaa !17 %idxprom16 = sext i32 %7 to i64 %arrayidx17 = getelementptr inbounds %struct.node, ptr %6, i64 %idxprom16 store i32 %5, ptr %arrayidx17, align 4, !tbaa !11 %8 = load i32, ptr %x, align 4, !tbaa !5 %idxprom19 = sext i32 %8 to i64 %r21 = getelementptr inbounds %struct.node, ptr %6, i64 %idxprom19, i32 2 %9 = load i32, ptr %r21, align 4, !tbaa !18 %idxprom22 = sext i32 %9 to i64 %arrayidx23 = getelementptr inbounds %struct.node, ptr %6, i64 %idxprom22 store i32 %8, ptr %arrayidx23, align 4, !tbaa !11 %inc26 = add nuw nsw i32 %i.190, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc26, %10 br i1 %cmp4, label %for.body6, label %for.cond28.preheader, !llvm.loop !19 for.body31: ; preds = %for.cond28.preheader, %for.inc61 %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.inc61 ], [ 0, %for.cond28.preheader ] store i32 0, ptr @h_count, align 4, !tbaa !5 %11 = load ptr, ptr @T, align 8, !tbaa !9 %arrayidx33 = getelementptr inbounds %struct.node, ptr %11, i64 %indvars.iv94 %12 = load i32, ptr %arrayidx33, align 4, !tbaa !11 %cmp.i = icmp eq i32 %12, -1 br i1 %cmp.i, label %sibling.exit, label %if.end.i if.end.i: ; preds = %for.body31 %idxprom4.i = sext i32 %12 to i64 %l.i = getelementptr inbounds %struct.node, ptr %11, i64 %idxprom4.i, i32 1 %13 = load i32, ptr %l.i, align 4, !tbaa !17 %14 = zext i32 %13 to i64 %cmp6.i = icmp eq i64 %indvars.iv94, %14 br i1 %cmp6.i, label %if.then7.i, label %sibling.exit if.then7.i: ; preds = %if.end.i %r.i = getelementptr inbounds %struct.node, ptr %11, i64 %idxprom4.i, i32 2 %15 = load i32, ptr %r.i, align 4, !tbaa !18 br label %sibling.exit sibling.exit: ; preds = %for.body31, %if.end.i, %if.then7.i %retval.0.i = phi i32 [ %15, %if.then7.i ], [ -1, %for.body31 ], [ %13, %if.end.i ] %l.i82 = getelementptr inbounds %struct.node, ptr %11, i64 %indvars.iv94, i32 1 %16 = load i32, ptr %l.i82, align 4, !tbaa !17 %cmp.i83 = icmp eq i32 %16, -1 %r.i84 = getelementptr inbounds %struct.node, ptr %11, i64 %indvars.iv94, i32 2 %17 = load i32, ptr %r.i84, align 4, !tbaa !18 %cmp3.i = icmp eq i32 %17, -1 %dec5.i = sext i1 %cmp3.i to i32 %18 = trunc i64 %indvars.iv94 to i32 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %sibling.exit %x.addr.0.i = phi i32 [ %18, %sibling.exit ], [ %19, %while.cond.i ] %d_count.0.i = phi i32 [ 0, %sibling.exit ], [ %inc.i, %while.cond.i ] %idxprom.i85 = sext i32 %x.addr.0.i to i64 %arrayidx.i86 = getelementptr inbounds %struct.node, ptr %11, i64 %idxprom.i85 %19 = load i32, ptr %arrayidx.i86, align 4, !tbaa !11 %cmp.not.i = icmp eq i32 %19, -1 %inc.i = add nuw nsw i32 %d_count.0.i, 1 br i1 %cmp.not.i, label %depth.exit, label %while.cond.i, !llvm.loop !20 depth.exit: ; preds = %while.cond.i %spec.select.i = select i1 %cmp.i83, i32 1, i32 2 %count.1.i = add nsw i32 %spec.select.i, %dec5.i %call38 = call i32 @height(i32 noundef %18) %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18, i32 noundef %12, i32 noundef %retval.0.i, i32 noundef %count.1.i, i32 noundef %d_count.0.i, i32 noundef %call38) %20 = load ptr, ptr @T, align 8, !tbaa !9 %arrayidx41 = getelementptr inbounds %struct.node, ptr %20, i64 %indvars.iv94 %21 = load i32, ptr %arrayidx41, align 4, !tbaa !11 %cmp43 = icmp eq i32 %21, -1 br i1 %cmp43, label %for.inc61, label %if.else if.else: ; preds = %depth.exit %l48 = getelementptr inbounds %struct.node, ptr %20, i64 %indvars.iv94, i32 1 %22 = load i32, ptr %l48, align 4, !tbaa !17 %cmp49 = icmp eq i32 %22, -1 br i1 %cmp49, label %land.lhs.true, label %if.else58 land.lhs.true: ; preds = %if.else %r53 = getelementptr inbounds %struct.node, ptr %20, i64 %indvars.iv94, i32 2 %23 = load i32, ptr %r53, align 4, !tbaa !18 %cmp54 = icmp eq i32 %23, -1 br i1 %cmp54, label %for.inc61, label %if.else58 if.else58: ; preds = %land.lhs.true, %if.else br label %for.inc61 for.inc61: ; preds = %land.lhs.true, %depth.exit, %if.else58 %str.7.sink = phi ptr [ @str, %if.else58 ], [ @str.7, %depth.exit ], [ @str.6, %land.lhs.true ] %puts80 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp29 = icmp slt i64 %indvars.iv.next95, %25 br i1 %cmp29, label %for.body31, label %for.end63.loopexit, !llvm.loop !21 for.end63.loopexit: ; preds = %for.inc61 %.pre = load ptr, ptr @T, align 8, !tbaa !9 br label %for.end63 for.end63: ; preds = %entry, %for.cond3.preheader, %for.end63.loopexit, %for.cond28.preheader %26 = phi ptr [ %.pre, %for.end63.loopexit ], [ %6, %for.cond28.preheader ], [ %call1, %for.cond3.preheader ], [ %call1, %entry ] call void @free(ptr noundef %26) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @sibling(i32 noundef %x) local_unnamed_addr #4 { entry: %0 = load ptr, ptr @T, align 8, !tbaa !9 %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp = icmp eq i32 %1, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %1 to i64 %l = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom4, i32 1 %2 = load i32, ptr %l, align 4, !tbaa !17 %cmp6 = icmp eq i32 %2, %x br i1 %cmp6, label %if.then7, label %return if.then7: ; preds = %if.end %r = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom4, i32 2 %3 = load i32, ptr %r, align 4, !tbaa !18 br label %return return: ; preds = %if.end, %entry, %if.then7 %retval.0 = phi i32 [ %3, %if.then7 ], [ -1, %entry ], [ %2, %if.end ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @degree(i32 noundef %x) local_unnamed_addr #4 { entry: %0 = load ptr, ptr @T, align 8, !tbaa !9 %idxprom = sext i32 %x to i64 %l = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !17 %cmp = icmp eq i32 %1, -1 %spec.select = select i1 %cmp, i32 1, i32 2 %r = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom, i32 2 %2 = load i32, ptr %r, align 4, !tbaa !18 %cmp3 = icmp eq i32 %2, -1 %dec5 = sext i1 %cmp3 to i32 %count.1 = add nsw i32 %spec.select, %dec5 ret i32 %count.1 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %x) local_unnamed_addr #5 { entry: %0 = load ptr, ptr @T, align 8, !tbaa !9 br label %while.cond while.cond: ; preds = %while.cond, %entry %x.addr.0 = phi i32 [ %x, %entry ], [ %1, %while.cond ] %d_count.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %idxprom = sext i32 %x.addr.0 to i64 %arrayidx = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp.not = icmp eq i32 %1, -1 %inc = add nuw nsw i32 %d_count.0, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !20 while.end: ; preds = %while.cond ret i32 %d_count.0 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @height(i32 noundef %x) local_unnamed_addr #6 { entry: %0 = load ptr, ptr @T, align 8, !tbaa !9 %idxprom = sext i32 %x to i64 %l = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom, i32 1 %1 = load i32, ptr %l, align 4, !tbaa !17 %cmp.not = icmp eq i32 %1, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @height(i32 noundef %1) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %entry, %if.then %y.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %r = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom, i32 2 %2 = load i32, ptr %r, align 4, !tbaa !18 %cmp6.not = icmp eq i32 %2, -1 br i1 %cmp6.not, label %if.end14, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @height(i32 noundef %2) %add12 = add nsw i32 %call11, 1 br label %if.end14 if.end14: ; preds = %if.end, %if.then7 %z.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %z.0.y.0 = tail call i32 @llvm.smax.i32(i32 %y.0, i32 %z.0) ret i32 %z.0.y.0 } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress 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 #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } attributes #11 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!12, !6, i64 0} !12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = !{!12, !6, i64 4} !18 = !{!12, !6, i64 8} !19 = distinct !{!19, !16} !20 = distinct !{!20, !16} !21 = distinct !{!21, !16}
#include<stdio.h> #define NIL -1 int depth(int); int height(int); int sibling(int); struct Node{ int parent; int left; int right; }; struct Node T[25]; int main(){ int n,id,left,right,i,de,deg,sib,hei; scanf("%d",&n); for(i=0;i<n;i++){ T[i].parent=NIL; T[i].right=NIL; T[i].left=NIL; } for(i=0;i<n;i++){ scanf("%d%d%d",&id,&left,&right); T[id].left=left; T[id].right=right; T[left].parent=id; T[right].parent=id; } // printf("wa-i2\n"); for(i=0;i<n;i++){ if(T[i].left==NIL&&T[i].right==NIL){ deg=0; } else if(T[i].left==-1||T[i].right==-1){ deg=1; } else{ deg=2; } de=depth(i); //printf("wa-i1\n"); sib=sibling(i); // printf("wa-i4\n"); hei=height(i); // printf("hei:%d\n",hei); // printf("wa-i3\n"); printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,T[i].parent,sib,deg,de,hei); if(T[i].parent==-1) printf("root\n"); else if(T[i].right==NIL&&T[i].left==NIL) printf("leaf\n"); else printf("internal node\n"); } return 0; } int depth(int num){ if(T[num].parent==NIL)return 0; return depth(T[num].parent)+1; } int sibling(int num){ if(T[num].parent==NIL)return -1; if(num==T[T[num].parent].right) return T[T[num].parent].left; else return T[T[num].parent].right; } int height(int num){ // printf("wa-i10\n"); if(T[num].right==-1&&T[num].left==-1) return 0; else{ if(T[num].left==-1){ return height(T[num].right)+1; } else if(T[num].right==-1){ return height(T[num].left)+1; } else if(height(T[num].right)<=height(T[num].left)){ return height(T[num].left)+1; } else { return height(T[num].right)+1; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237669/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237669/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @T = dso_local local_unnamed_addr global [25 x %struct.Node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %id = alloca i32, align 4 %left = alloca i32, align 4 %right = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %left) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %right) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp106 = icmp sgt i32 %0, 0 br i1 %cmp106, label %for.body9.preheader, label %for.end79 for.body9.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = mul nuw nsw i64 %1, 12 call void @llvm.memset.p0.i64(ptr nonnull align 16 @T, i8 -1, i64 %2, i1 false), !tbaa !5 br label %for.body9 for.cond26.preheader: ; preds = %for.body9 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body28, label %for.end79 for.body9: ; preds = %for.body9.preheader, %for.body9 %i.1109 = phi i32 [ %inc24, %for.body9 ], [ 0, %for.body9.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %left, ptr noundef nonnull %right) %4 = load i32, ptr %left, align 4, !tbaa !5 %5 = load i32, ptr %id, align 4, !tbaa !5 %idxprom11 = sext i32 %5 to i64 %left13 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom11, i32 1 store i32 %4, ptr %left13, align 4, !tbaa !9 %6 = load i32, ptr %right, align 4, !tbaa !5 %right16 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom11, i32 2 store i32 %6, ptr %right16, align 4, !tbaa !11 %idxprom17 = sext i32 %4 to i64 %arrayidx18 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom17 store i32 %5, ptr %arrayidx18, align 4, !tbaa !12 %idxprom20 = sext i32 %6 to i64 %arrayidx21 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom20 store i32 %5, ptr %arrayidx21, align 4, !tbaa !12 %inc24 = add nuw nsw i32 %i.1109, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp slt i32 %inc24, %7 br i1 %cmp8, label %for.body9, label %for.cond26.preheader, !llvm.loop !13 for.body28: ; preds = %for.cond26.preheader, %for.inc77 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc77 ], [ 0, %for.cond26.preheader ] %arrayidx30 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv %left31 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv, i32 1 %8 = load i32, ptr %left31, align 4, !tbaa !9 %cmp32 = icmp eq i32 %8, -1 %right35 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv, i32 2 %9 = load i32, ptr %right35, align 4, !tbaa !11 %cmp44 = icmp eq i32 %9, -1 %spec.select = select i1 %cmp44, i32 1, i32 2 %cmp36 = icmp ne i32 %9, -1 %spec.select105 = zext i1 %cmp36 to i32 %deg.0 = select i1 %cmp32, i32 %spec.select105, i32 %spec.select %10 = trunc i64 %indvars.iv to i32 br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %for.body28 %accumulator.tr.i = phi i32 [ 0, %for.body28 ], [ %add.i, %tailrecurse.i ] %num.tr.i = phi i32 [ %10, %for.body28 ], [ %11, %tailrecurse.i ] %idxprom.i = sext i32 %num.tr.i to i64 %arrayidx.i = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !12 %cmp.i = icmp eq i32 %11, -1 %add.i = add nuw nsw i32 %accumulator.tr.i, 1 br i1 %cmp.i, label %depth.exit, label %tailrecurse.i depth.exit: ; preds = %tailrecurse.i %12 = load i32, ptr %arrayidx30, align 4, !tbaa !12 %cmp.i104 = icmp eq i32 %12, -1 br i1 %cmp.i104, label %sibling.exit, label %if.end.i if.end.i: ; preds = %depth.exit %idxprom4.i = sext i32 %12 to i64 %right.i = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %13 = load i32, ptr %right.i, align 4, !tbaa !11 %14 = zext i32 %13 to i64 %cmp6.i = icmp eq i64 %indvars.iv, %14 br i1 %cmp6.i, label %if.then7.i, label %sibling.exit if.then7.i: ; preds = %if.end.i %left.i = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %15 = load i32, ptr %left.i, align 4, !tbaa !9 br label %sibling.exit sibling.exit: ; preds = %depth.exit, %if.end.i, %if.then7.i %retval.0.i = phi i32 [ %15, %if.then7.i ], [ -1, %depth.exit ], [ %13, %if.end.i ] %call50 = call i32 @height(i32 noundef %10) %call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %12, i32 noundef %retval.0.i, i32 noundef %deg.0, i32 noundef %accumulator.tr.i, i32 noundef %call50) %16 = load i32, ptr %arrayidx30, align 4, !tbaa !12 %cmp58 = icmp eq i32 %16, -1 br i1 %cmp58, label %for.inc77, label %if.else61 if.else61: ; preds = %sibling.exit %right64 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv, i32 2 %17 = load i32, ptr %right64, align 4, !tbaa !11 %cmp65 = icmp eq i32 %17, -1 br i1 %cmp65, label %land.lhs.true66, label %if.else73 land.lhs.true66: ; preds = %if.else61 %18 = load i32, ptr %left31, align 4, !tbaa !9 %cmp70 = icmp eq i32 %18, -1 br i1 %cmp70, label %for.inc77, label %if.else73 if.else73: ; preds = %land.lhs.true66, %if.else61 br label %for.inc77 for.inc77: ; preds = %land.lhs.true66, %sibling.exit, %if.else73 %str.7.sink = phi ptr [ @str, %if.else73 ], [ @str.7, %sibling.exit ], [ @str.6, %land.lhs.true66 ] %puts101 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp27 = icmp slt i64 %indvars.iv.next, %20 br i1 %cmp27, label %for.body28, label %for.end79, !llvm.loop !15 for.end79: ; preds = %for.inc77, %entry, %for.cond26.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %right) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %left) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %num) local_unnamed_addr #3 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i32 [ 0, %entry ], [ %add, %tailrecurse ] %num.tr = phi i32 [ %num, %entry ], [ %0, %tailrecurse ] %idxprom = sext i32 %num.tr to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp = icmp eq i32 %0, -1 %add = add nuw nsw i32 %accumulator.tr, 1 br i1 %cmp, label %return, label %tailrecurse return: ; preds = %tailrecurse ret i32 %accumulator.tr } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @sibling(i32 noundef %num) local_unnamed_addr #4 { entry: %idxprom = sext i32 %num to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %right = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !11 %cmp6 = icmp eq i32 %1, %num br i1 %cmp6, label %if.then7, label %return if.then7: ; preds = %if.end %left = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 1 %2 = load i32, ptr %left, align 4, !tbaa !9 br label %return return: ; preds = %if.end, %entry, %if.then7 %retval.0 = phi i32 [ %2, %if.then7 ], [ -1, %entry ], [ %1, %if.end ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @height(i32 noundef %num) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %if.then17, %entry %accumulator.tr = phi i32 [ 0, %entry ], [ %accumulator.ret.tr, %if.then17 ] %num.tr = phi i32 [ %num, %entry ], [ %1, %if.then17 ] %idxprom82 = sext i32 %num.tr to i64 %right83 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom82, i32 2 %0 = load i32, ptr %right83, align 4, !tbaa !11 %cmp84 = icmp eq i32 %0, -1 br i1 %cmp84, label %land.lhs.true, label %if.else.thread land.lhs.true: ; preds = %if.then8, %tailrecurse %accumulator.tr.lcssa = phi i32 [ 0, %tailrecurse ], [ %add, %if.then8 ] %idxprom.lcssa = phi i64 [ %idxprom82, %tailrecurse ], [ %idxprom, %if.then8 ] %left = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom.lcssa, i32 1 %1 = load i32, ptr %left, align 4, !tbaa !9 %cmp3 = icmp eq i32 %1, -1 br i1 %cmp3, label %return, label %if.then17 if.else.thread: ; preds = %tailrecurse, %if.then8 %2 = phi i32 [ %4, %if.then8 ], [ %0, %tailrecurse ] %idxprom86 = phi i64 [ %idxprom, %if.then8 ], [ %idxprom82, %tailrecurse ] %accumulator.tr85 = phi i32 [ %add, %if.then8 ], [ 0, %tailrecurse ] %left655 = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom86, i32 1 %3 = load i32, ptr %left655, align 4, !tbaa !9 %cmp756 = icmp eq i32 %3, -1 br i1 %cmp756, label %if.then8, label %if.else23 if.then8: ; preds = %if.else.thread %add = add nuw nsw i32 %accumulator.tr85, 1 %idxprom = sext i32 %2 to i64 %right = getelementptr inbounds [25 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %4 = load i32, ptr %right, align 4, !tbaa !11 %cmp = icmp eq i32 %4, -1 br i1 %cmp, label %land.lhs.true, label %if.else.thread if.then17: ; preds = %land.lhs.true %add22 = add nuw i32 %accumulator.tr.lcssa, 1 %accumulator.ret.tr = add i32 %add22, %accumulator.tr br label %tailrecurse if.else23: ; preds = %if.else.thread %call27 = tail call i32 @height(i32 noundef %2) %call31 = tail call i32 @height(i32 noundef %3) %cmp32.not = icmp sgt i32 %call27, %call31 br i1 %cmp32.not, label %if.else39, label %if.then33 if.then33: ; preds = %if.else23 %add38 = add nsw i32 %call31, 1 br label %return if.else39: ; preds = %if.else23 %add44 = add nsw i32 %call27, 1 br label %return return: ; preds = %land.lhs.true, %if.else39, %if.then33 %accumulator.tr80 = phi i32 [ %accumulator.tr85, %if.then33 ], [ %accumulator.tr85, %if.else39 ], [ %accumulator.tr.lcssa, %land.lhs.true ] %retval.0 = phi i32 [ %add38, %if.then33 ], [ %add44, %if.else39 ], [ 0, %land.lhs.true ] %accumulator.ret.tr57 = add nsw i32 %retval.0, %accumulator.tr80 %accumulator.ret.tr98 = add i32 %accumulator.ret.tr57, %accumulator.tr ret i32 %accumulator.ret.tr98 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(read, 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 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 #5 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!10, !6, i64 4} !10 = !{!"Node", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 8} !12 = !{!10, !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
#include <stdio.h> #define MAX 25 struct Node{ int parent; int right; int left; int degree; }; int n; struct Node u[MAX]; int s(int); int d(int); int h(int); int s(int x){ if(u[x].right!=-1) return u[x].right; else if(u[u[x].parent].left!=x) return u[u[x].parent].left; else return -1; } int d(int x){ int d=0,p; p=u[x].parent; while(p!=-1){ p=u[p].parent; d++; } return d; } int h(int x) { int i,a=0,y; for(i=0;i<n;i++) { if(u[i].parent==x) { y=h(i)+1; if(y>a) a=y; } } return a; } int main(){ int i,id,r,l; scanf("%d",&n); for(i=0;i<n;i++){ u[i].parent=-1; u[i].right=-1; u[i].left=-1; u[i].degree=0; } for(i=0;i<n;i++){ scanf("%d%d%d",&id,&l,&r); u[id].left=l; u[u[id].left].right=r; if(u[id].left!=-1){ u[u[id].left].parent=id; u[id].degree++; } if(u[u[id].left].right!=-1){ u[u[u[id].left].right].parent=id; u[id].degree++; } } for(i=0;i<n;i++){ if(u[i].parent==-1) printf("node %d: parent = -1, sibling = -1, degree = %d, depth = 0, height = %d, root\n",i,u[i].degree,h(i)); else if(u[i].degree==0) printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, leaf\n",i,u[i].parent,s(i),u[i].degree,d(i),h(i)); else printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, internal node\n",i,u[i].parent,s(i),u[i].degree,d(i),h(i)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237711/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32, i32 } @u = dso_local local_unnamed_addr global [25 x %struct.Node] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [79 x i8] c"node %d: parent = -1, sibling = -1, degree = %d, depth = 0, height = %d, root\0A\00", align 1 @.str.3 = private unnamed_addr constant [80 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, leaf\0A\00", align 1 @.str.4 = private unnamed_addr constant [89 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, internal node\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @s(i32 noundef %x) local_unnamed_addr #0 { entry: %idxprom = sext i32 %x to i64 %right = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %right, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.else, label %return if.else: ; preds = %entry %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 16, !tbaa !10 %idxprom6 = sext i32 %1 to i64 %left = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom6, i32 2 %2 = load i32, ptr %left, align 8, !tbaa !11 %cmp8.not = icmp eq i32 %2, %x %. = select i1 %cmp8.not, i32 -1, i32 %2 br label %return return: ; preds = %if.else, %entry %retval.0 = phi i32 [ %0, %entry ], [ %., %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @d(i32 noundef %x) local_unnamed_addr #1 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %d.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %idxprom.pn.in = phi i32 [ %x, %entry ], [ %p.0, %while.cond ] %idxprom.pn = sext i32 %idxprom.pn.in to i64 %p.0.in = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom.pn %p.0 = load i32, ptr %p.0.in, align 16, !tbaa !10 %cmp.not = icmp eq i32 %p.0, -1 %inc = add nuw nsw i32 %d.0, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12 while.end: ; preds = %while.cond ret i32 %d.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @h(i32 noundef %x) local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !14 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 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 ] %a.011 = phi i32 [ 0, %for.body.preheader ], [ %a.1, %for.inc ] %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 16, !tbaa !10 %cmp1 = icmp eq i32 %1, %x br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %2 = trunc i64 %indvars.iv to i32 %call = tail call i32 @h(i32 noundef %2) %cmp2.not = icmp slt i32 %call, %a.011 %add = add nsw i32 %call, 1 %spec.select = select i1 %cmp2.not, i32 %a.011, i32 %add br label %for.inc for.inc: ; preds = %if.then, %for.body %a.1 = phi i32 [ %a.011, %for.body ], [ %spec.select, %if.then ] %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 !15 for.end: ; preds = %for.inc, %entry %a.0.lcssa = phi i32 [ 0, %entry ], [ %a.1, %for.inc ] ret i32 %a.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %id = alloca i32, align 4 %r = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !14 %cmp152 = icmp sgt i32 %0, 0 br i1 %cmp152, label %for.body.preheader, label %for.end102 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond7.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond7.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond7.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond7.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond7.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond7.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv.epil store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %arrayidx.epil, align 16, !tbaa !14 %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.cond7.preheader, label %for.body.epil, !llvm.loop !16 for.cond7.preheader: ; preds = %for.body.epil, %for.cond7.preheader.unr-lcssa br i1 %cmp152, label %for.body9, label %for.end102 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %arrayidx, align 16, !tbaa !14 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv.next store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %arrayidx.1, align 16, !tbaa !14 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv.next.1 store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %arrayidx.2, align 16, !tbaa !14 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv.next.2 store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %arrayidx.3, align 16, !tbaa !14 %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.cond7.preheader.unr-lcssa, label %for.body, !llvm.loop !18 for.cond59.preheader: ; preds = %for.inc56 %2 = icmp sgt i32 %8, 0 br i1 %2, label %for.body61, label %for.end102 for.body9: ; preds = %for.cond7.preheader, %for.inc56 %i.1155 = phi i32 [ %inc57, %for.inc56 ], [ 0, %for.cond7.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !14 %4 = load i32, ptr %id, align 4, !tbaa !14 %idxprom11 = sext i32 %4 to i64 %left13 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom11, i32 2 store i32 %3, ptr %left13, align 8, !tbaa !11 %5 = load i32, ptr %r, align 4, !tbaa !14 %idxprom17 = sext i32 %3 to i64 %right19 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom17, i32 1 store i32 %5, ptr %right19, align 4, !tbaa !5 %cmp23.not = icmp eq i32 %3, -1 br i1 %cmp23.not, label %if.end, label %if.then if.then: ; preds = %for.body9 %arrayidx28 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom17 store i32 %4, ptr %arrayidx28, align 16, !tbaa !10 %degree32 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom11, i32 3 %6 = load i32, ptr %degree32, align 4, !tbaa !19 %inc33 = add nsw i32 %6, 1 store i32 %inc33, ptr %degree32, align 4, !tbaa !19 br label %if.end if.end: ; preds = %if.then, %for.body9 %cmp40.not = icmp eq i32 %5, -1 br i1 %cmp40.not, label %for.inc56, label %if.then41 if.then41: ; preds = %if.end %idxprom48 = sext i32 %5 to i64 %arrayidx49 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom48 store i32 %4, ptr %arrayidx49, align 16, !tbaa !10 %degree53 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom11, i32 3 %7 = load i32, ptr %degree53, align 4, !tbaa !19 %inc54 = add nsw i32 %7, 1 store i32 %inc54, ptr %degree53, align 4, !tbaa !19 br label %for.inc56 for.inc56: ; preds = %if.end, %if.then41 %inc57 = add nuw nsw i32 %i.1155, 1 %8 = load i32, ptr @n, align 4, !tbaa !14 %cmp8 = icmp slt i32 %inc57, %8 br i1 %cmp8, label %for.body9, label %for.cond59.preheader, !llvm.loop !20 for.body61: ; preds = %for.cond59.preheader, %for.inc100 %indvars.iv159 = phi i64 [ %indvars.iv.next160, %for.inc100 ], [ 0, %for.cond59.preheader ] %arrayidx63 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv159 %9 = load i32, ptr %arrayidx63, align 16, !tbaa !10 %cmp65 = icmp eq i32 %9, -1 %degree69 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv159, i32 3 %10 = load i32, ptr %degree69, align 4, !tbaa !19 br i1 %cmp65, label %if.then66, label %if.else if.then66: ; preds = %for.body61 %11 = trunc i64 %indvars.iv159 to i32 %call70 = call i32 @h(i32 noundef %11) %call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11, i32 noundef %10, i32 noundef %call70) br label %for.inc100 if.else: ; preds = %for.body61 %cmp75 = icmp eq i32 %10, 0 %right.i = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %indvars.iv159, i32 1 %12 = load i32, ptr %right.i, align 4, !tbaa !5 %cmp.not.i = icmp eq i32 %12, -1 br i1 %cmp75, label %if.then76, label %if.else87 if.then76: ; preds = %if.else br i1 %cmp.not.i, label %if.else.i, label %s.exit if.else.i: ; preds = %if.then76 %idxprom6.i = sext i32 %9 to i64 %left.i = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom6.i, i32 2 %13 = load i32, ptr %left.i, align 8, !tbaa !11 %14 = zext i32 %13 to i64 %cmp8.not.i = icmp eq i64 %indvars.iv159, %14 %..i = select i1 %cmp8.not.i, i32 -1, i32 %13 br label %s.exit s.exit: ; preds = %if.then76, %if.else.i %retval.0.i = phi i32 [ %12, %if.then76 ], [ %..i, %if.else.i ] %15 = trunc i64 %indvars.iv159 to i32 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %s.exit %d.0.i = phi i32 [ 0, %s.exit ], [ %inc.i, %while.cond.i ] %idxprom.pn.in.i = phi i32 [ %15, %s.exit ], [ %p.0.i, %while.cond.i ] %idxprom.pn.i = sext i32 %idxprom.pn.in.i to i64 %p.0.in.i = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom.pn.i %p.0.i = load i32, ptr %p.0.in.i, align 16, !tbaa !10 %cmp.not.i131 = icmp eq i32 %p.0.i, -1 %inc.i = add nuw nsw i32 %d.0.i, 1 br i1 %cmp.not.i131, label %d.exit, label %while.cond.i, !llvm.loop !12 d.exit: ; preds = %while.cond.i %call85 = call i32 @h(i32 noundef %15) %call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %15, i32 noundef %9, i32 noundef %retval.0.i, i32 noundef 0, i32 noundef %d.0.i, i32 noundef %call85) br label %for.inc100 if.else87: ; preds = %if.else br i1 %cmp.not.i, label %if.else.i136, label %s.exit142 if.else.i136: ; preds = %if.else87 %idxprom6.i138 = sext i32 %9 to i64 %left.i139 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom6.i138, i32 2 %16 = load i32, ptr %left.i139, align 8, !tbaa !11 %17 = zext i32 %16 to i64 %cmp8.not.i140 = icmp eq i64 %indvars.iv159, %17 %..i141 = select i1 %cmp8.not.i140, i32 -1, i32 %16 br label %s.exit142 s.exit142: ; preds = %if.else87, %if.else.i136 %retval.0.i135 = phi i32 [ %12, %if.else87 ], [ %..i141, %if.else.i136 ] %18 = trunc i64 %indvars.iv159 to i32 br label %while.cond.i143 while.cond.i143: ; preds = %while.cond.i143, %s.exit142 %d.0.i144 = phi i32 [ 0, %s.exit142 ], [ %inc.i150, %while.cond.i143 ] %idxprom.pn.in.i145 = phi i32 [ %18, %s.exit142 ], [ %p.0.i148, %while.cond.i143 ] %idxprom.pn.i146 = sext i32 %idxprom.pn.in.i145 to i64 %p.0.in.i147 = getelementptr inbounds [25 x %struct.Node], ptr @u, i64 0, i64 %idxprom.pn.i146 %p.0.i148 = load i32, ptr %p.0.in.i147, align 16, !tbaa !10 %cmp.not.i149 = icmp eq i32 %p.0.i148, -1 %inc.i150 = add nuw nsw i32 %d.0.i144, 1 br i1 %cmp.not.i149, label %d.exit151, label %while.cond.i143, !llvm.loop !12 d.exit151: ; preds = %while.cond.i143 %call96 = call i32 @h(i32 noundef %18) %call97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %18, i32 noundef %9, i32 noundef %retval.0.i135, i32 noundef %10, i32 noundef %d.0.i144, i32 noundef %call96) br label %for.inc100 for.inc100: ; preds = %if.then66, %d.exit151, %d.exit %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1 %19 = load i32, ptr @n, align 4, !tbaa !14 %20 = sext i32 %19 to i64 %cmp60 = icmp slt i64 %indvars.iv.next160, %20 br i1 %cmp60, label %for.body61, label %for.end102, !llvm.loop !21 for.end102: ; preds = %for.inc100, %entry, %for.cond7.preheader, %for.cond59.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 attributes #0 = { 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 #1 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 4} !6 = !{!"Node", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 0} !11 = !{!6, !7, i64 8} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !13} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !13} !19 = !{!6, !7, i64 12} !20 = distinct !{!20, !13} !21 = distinct !{!21, !13}
#include <stdio.h> #define MAX 10000 #define NIL -1 typedef struct { int parent, left, right;} Node; Node T[MAX]; int n, D[MAX], H[MAX]; void setDepth(int u,int d) { if(u == NIL) return; D[u] = d; setDepth(T[u].left, d+1); setDepth(T[u].right,d+1); } int setHeight(int u) { int h1 = 0, h2 = 0; if(T[u].left != NIL) h1 = setHeight(T[u].left) + 1; if(T[u].right != NIL) h2 = setHeight(T[u].right) + 1; return H[u] = (h1 > h2 ? h1 : h2); } // 接点 u の兄弟を返す int getSibling(int u) { if(T[u].parent == NIL) return NIL; if(T[T[u].parent].left != u && T[T[u].parent].left != NIL ) return T[T[u].parent].left; if(T[T[u].parent].right != u && T[T[u].parent].right != NIL ) return T[T[u].parent].right; return NIL; } void print(int u) { int deg = 0; printf("node %d: ",u); printf("parent = %d, ",T[u].parent); printf("sibling = %d, ",getSibling(u)); if(T[u].left != NIL) deg++; if(T[u].right != NIL) deg++; printf("degree = %d, ",deg); printf("depth = %d, ",D[u]); printf("height = %d, ",H[u]); if(T[u].parent == NIL) { printf("root\n"); } else if(T[u].left == NIL && T[u].right == NIL) { printf("leaf\n"); } else { printf("internal node\n"); } } int main(void) { int i, v, l, r, root = 0; scanf("%d",&n); for(i=0;i<n;i++) T[i].parent = NIL; for(i=0;i<n;i++) { scanf("%d %d %d",&v,&l,&r); T[v].left = l; T[v].right = r; if(l != NIL) T[l].parent = v; if(r != NIL) T[r].parent = v; } for(i=0; i<n; i++) if(T[i].parent == NIL) root = i; setDepth(root,0); setHeight(root); for(i=0;i<n;i++) print(i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237755/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @D = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @T = dso_local local_unnamed_addr global [10000 x %struct.Node] zeroinitializer, align 16 @H = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"node %d: \00", align 1 @.str.1 = private unnamed_addr constant [14 x i8] c"parent = %d, \00", align 1 @.str.2 = private unnamed_addr constant [15 x i8] c"sibling = %d, \00", align 1 @.str.3 = private unnamed_addr constant [14 x i8] c"degree = %d, \00", align 1 @.str.4 = private unnamed_addr constant [13 x i8] c"depth = %d, \00", align 1 @.str.5 = private unnamed_addr constant [14 x i8] c"height = %d, \00", align 1 @.str.9 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.10 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.11 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.12 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @setDepth(i32 noundef %u, i32 noundef %d) local_unnamed_addr #0 { entry: %cmp11 = icmp eq i32 %u, -1 br i1 %cmp11, label %return, label %if.end if.end: ; preds = %entry, %if.end %d.tr13 = phi i32 [ %add, %if.end ], [ %d, %entry ] %u.tr12 = phi i32 [ %1, %if.end ], [ %u, %entry ] %idxprom = sext i32 %u.tr12 to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom store i32 %d.tr13, ptr %arrayidx, align 4, !tbaa !5 %left = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !9 %add = add nsw i32 %d.tr13, 1 tail call void @setDepth(i32 noundef %0, i32 noundef %add) %right = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !11 %cmp = icmp eq i32 %1, -1 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @setHeight(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %left = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !9 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @setHeight(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !11 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @setHeight(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %h2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %cond = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %arrayidx16 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom store i32 %cond, ptr %arrayidx16, align 4, !tbaa !5 ret i32 %cond } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getSibling(i32 noundef %u) local_unnamed_addr #2 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %left = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %left, align 4, !tbaa !9 %cmp6.not = icmp eq i32 %1, %u %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %right = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %right, align 4, !tbaa !11 %cmp27.not = icmp eq i32 %2, %u %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %u) local_unnamed_addr #3 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %u) %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !12 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %1 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp.i = icmp eq i32 %1, -1 br i1 %cmp.i, label %getSibling.exit, label %if.end.i if.end.i: ; preds = %entry %idxprom4.i = sext i32 %1 to i64 %left.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %2 = load i32, ptr %left.i, align 4, !tbaa !9 %cmp6.not.i = icmp eq i32 %2, %u %cmp13.not.i = icmp eq i32 %2, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %getSibling.exit if.end21.i: ; preds = %if.end.i %right.i = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %3 = load i32, ptr %right.i, align 4, !tbaa !11 %cmp27.not.i = icmp eq i32 %3, %u %cmp35.not.i = icmp eq i32 %3, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %3 br label %getSibling.exit getSibling.exit: ; preds = %entry, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %entry ], [ %2, %if.end.i ], [ %spec.select.i, %if.end21.i ] %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %retval.0.i) %left = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 1 %4 = load i32, ptr %left, align 4, !tbaa !9 %cmp.not = icmp ne i32 %4, -1 %spec.select = zext i1 %cmp.not to i32 %right = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom, i32 2 %5 = load i32, ptr %right, align 4, !tbaa !11 %cmp8.not = icmp eq i32 %5, -1 %inc10 = select i1 %cmp.not, i32 2, i32 1 %deg.1 = select i1 %cmp8.not, i32 %spec.select, i32 %inc10 %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %deg.1) %arrayidx14 = getelementptr inbounds [10000 x i32], ptr @D, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %6) %arrayidx17 = getelementptr inbounds [10000 x i32], ptr @H, i64 0, i64 %idxprom %7 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %7) %8 = load i32, ptr %arrayidx, align 4, !tbaa !12 %cmp22 = icmp eq i32 %8, -1 br i1 %cmp22, label %if.end38, label %if.else if.else: ; preds = %getSibling.exit %9 = load i32, ptr %left, align 4, !tbaa !9 %cmp28 = icmp eq i32 %9, -1 br i1 %cmp28, label %land.lhs.true, label %if.else35 land.lhs.true: ; preds = %if.else %10 = load i32, ptr %right, align 4, !tbaa !11 %cmp32 = icmp eq i32 %10, -1 br i1 %cmp32, label %if.end38, label %if.else35 if.else35: ; preds = %land.lhs.true, %if.else br label %if.end38 if.end38: ; preds = %land.lhs.true, %getSibling.exit, %if.else35 %str.11.sink = phi ptr [ @str, %if.else35 ], [ @str.12, %getSibling.exit ], [ @str.11, %land.lhs.true ] %puts50 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.11.sink) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %v = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body.preheader, label %for.end33 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond1.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond1.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond1.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond1.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond1.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond1.preheader.unr-lcssa ] %arrayidx.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.epil store i32 -1, ptr %arrayidx.epil, align 4, !tbaa !12 %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.cond1.preheader, label %for.body.epil, !llvm.loop !13 for.cond1.preheader: ; preds = %for.body.epil, %for.cond1.preheader.unr-lcssa br i1 %cmp54, label %for.body3, label %for.end33 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv store i32 -1, ptr %arrayidx, align 16, !tbaa !12 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next store i32 -1, ptr %arrayidx.1, align 4, !tbaa !12 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.1 store i32 -1, ptr %arrayidx.2, align 8, !tbaa !12 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next.2 store i32 -1, ptr %arrayidx.3, align 4, !tbaa !12 %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.cond1.preheader.unr-lcssa, label %for.body, !llvm.loop !15 for.cond22.preheader: ; preds = %for.inc19 %cmp2358 = icmp sgt i32 %6, 0 br i1 %cmp2358, label %for.body24.preheader, label %for.end33 for.body24.preheader: ; preds = %for.cond22.preheader %wide.trip.count69 = zext i32 %6 to i64 %xtraiter73 = and i64 %wide.trip.count69, 3 %2 = icmp ult i32 %6, 4 br i1 %2, label %for.end33.loopexit.unr-lcssa, label %for.body24.preheader.new for.body24.preheader.new: ; preds = %for.body24.preheader %unroll_iter77 = and i64 %wide.trip.count69, 4294967292 br label %for.body24 for.body3: ; preds = %for.cond1.preheader, %for.inc19 %i.157 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %v, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !5 %4 = load i32, ptr %v, align 4, !tbaa !5 %idxprom5 = sext i32 %4 to i64 %left = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 1 store i32 %3, ptr %left, align 4, !tbaa !9 %5 = load i32, ptr %r, align 4, !tbaa !5 %right = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom5, i32 2 store i32 %5, ptr %right, align 4, !tbaa !11 %cmp9.not = icmp eq i32 %3, -1 br i1 %cmp9.not, label %if.end, label %if.then if.then: ; preds = %for.body3 %idxprom10 = sext i32 %3 to i64 %arrayidx11 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom10 store i32 %4, ptr %arrayidx11, align 4, !tbaa !12 br label %if.end if.end: ; preds = %if.then, %for.body3 %cmp13.not = icmp eq i32 %5, -1 br i1 %cmp13.not, label %for.inc19, label %if.then14 if.then14: ; preds = %if.end %idxprom15 = sext i32 %5 to i64 %arrayidx16 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %idxprom15 store i32 %4, ptr %arrayidx16, align 4, !tbaa !12 br label %for.inc19 for.inc19: ; preds = %if.end, %if.then14 %inc20 = add nuw nsw i32 %i.157, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc20, %6 br i1 %cmp2, label %for.body3, label %for.cond22.preheader, !llvm.loop !17 for.body24: ; preds = %for.body24, %for.body24.preheader.new %indvars.iv66 = phi i64 [ 0, %for.body24.preheader.new ], [ %indvars.iv.next67.3, %for.body24 ] %root.060 = phi i32 [ 0, %for.body24.preheader.new ], [ %spec.select.3, %for.body24 ] %niter78 = phi i64 [ 0, %for.body24.preheader.new ], [ %niter78.next.3, %for.body24 ] %arrayidx26 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv66 %7 = load i32, ptr %arrayidx26, align 16, !tbaa !12 %cmp28 = icmp eq i32 %7, -1 %8 = trunc i64 %indvars.iv66 to i32 %spec.select = select i1 %cmp28, i32 %8, i32 %root.060 %indvars.iv.next67 = or i64 %indvars.iv66, 1 %arrayidx26.1 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next67 %9 = load i32, ptr %arrayidx26.1, align 4, !tbaa !12 %cmp28.1 = icmp eq i32 %9, -1 %10 = trunc i64 %indvars.iv.next67 to i32 %spec.select.1 = select i1 %cmp28.1, i32 %10, i32 %spec.select %indvars.iv.next67.1 = or i64 %indvars.iv66, 2 %arrayidx26.2 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next67.1 %11 = load i32, ptr %arrayidx26.2, align 8, !tbaa !12 %cmp28.2 = icmp eq i32 %11, -1 %12 = trunc i64 %indvars.iv.next67.1 to i32 %spec.select.2 = select i1 %cmp28.2, i32 %12, i32 %spec.select.1 %indvars.iv.next67.2 = or i64 %indvars.iv66, 3 %arrayidx26.3 = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv.next67.2 %13 = load i32, ptr %arrayidx26.3, align 4, !tbaa !12 %cmp28.3 = icmp eq i32 %13, -1 %14 = trunc i64 %indvars.iv.next67.2 to i32 %spec.select.3 = select i1 %cmp28.3, i32 %14, i32 %spec.select.2 %indvars.iv.next67.3 = add nuw nsw i64 %indvars.iv66, 4 %niter78.next.3 = add i64 %niter78, 4 %niter78.ncmp.3 = icmp eq i64 %niter78.next.3, %unroll_iter77 br i1 %niter78.ncmp.3, label %for.end33.loopexit.unr-lcssa, label %for.body24, !llvm.loop !18 for.end33.loopexit.unr-lcssa: ; preds = %for.body24, %for.body24.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body24.preheader ], [ %spec.select.3, %for.body24 ] %indvars.iv66.unr = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next67.3, %for.body24 ] %root.060.unr = phi i32 [ 0, %for.body24.preheader ], [ %spec.select.3, %for.body24 ] %lcmp.mod75.not = icmp eq i64 %xtraiter73, 0 br i1 %lcmp.mod75.not, label %for.end33, label %for.body24.epil for.body24.epil: ; preds = %for.end33.loopexit.unr-lcssa, %for.body24.epil %indvars.iv66.epil = phi i64 [ %indvars.iv.next67.epil, %for.body24.epil ], [ %indvars.iv66.unr, %for.end33.loopexit.unr-lcssa ] %root.060.epil = phi i32 [ %spec.select.epil, %for.body24.epil ], [ %root.060.unr, %for.end33.loopexit.unr-lcssa ] %epil.iter74 = phi i64 [ %epil.iter74.next, %for.body24.epil ], [ 0, %for.end33.loopexit.unr-lcssa ] %arrayidx26.epil = getelementptr inbounds [10000 x %struct.Node], ptr @T, i64 0, i64 %indvars.iv66.epil %15 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !12 %cmp28.epil = icmp eq i32 %15, -1 %16 = trunc i64 %indvars.iv66.epil to i32 %spec.select.epil = select i1 %cmp28.epil, i32 %16, i32 %root.060.epil %indvars.iv.next67.epil = add nuw nsw i64 %indvars.iv66.epil, 1 %epil.iter74.next = add i64 %epil.iter74, 1 %epil.iter74.cmp.not = icmp eq i64 %epil.iter74.next, %xtraiter73 br i1 %epil.iter74.cmp.not, label %for.end33, label %for.body24.epil, !llvm.loop !19 for.end33: ; preds = %for.end33.loopexit.unr-lcssa, %for.body24.epil, %entry, %for.cond1.preheader, %for.cond22.preheader %root.0.lcssa = phi i32 [ 0, %for.cond22.preheader ], [ 0, %for.cond1.preheader ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end33.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body24.epil ] call void @setDepth(i32 noundef %root.0.lcssa, i32 noundef 0) %call34 = call i32 @setHeight(i32 noundef %root.0.lcssa) %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp3662 = icmp sgt i32 %17, 0 br i1 %cmp3662, label %for.body37, label %for.end40 for.body37: ; preds = %for.end33, %for.body37 %i.363 = phi i32 [ %inc39, %for.body37 ], [ 0, %for.end33 ] call void @print(i32 noundef %i.363) %inc39 = add nuw nsw i32 %i.363, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp36 = icmp slt i32 %inc39, %18 br i1 %cmp36, label %for.body37, label %for.end40, !llvm.loop !20 for.end40: ; preds = %for.body37, %for.end33 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { 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 = !{!10, !6, i64 4} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 8} !12 = !{!10, !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16} !18 = distinct !{!18, !16} !19 = distinct !{!19, !14} !20 = distinct !{!20, !16}
#include<stdio.h> struct p{ char str[10]; int i; int j; }; int main(){ int n; scanf("%d",&n); int a; struct p x[n]; for(a=0;a<n;a++){ scanf("%s%d%d",x[a].str,&x[a].i,&x[a].j); } for(a=0;a<n;a++){ if(x[a].i>=2400&&x[a].i<x[a].j) { printf("YES"); return 0; } } printf("NO"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23782/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23782/source.c" target datalayout = "e-m:e-p270: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.p = type { [10 x i8], i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%s%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %struct.p, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %3, 0 br i1 %cmp36, label %for.body, label %cleanup for.cond6.preheader: ; preds = %for.body %cmp738 = icmp sgt i32 %4, 0 br i1 %cmp738, label %for.body8.preheader, label %cleanup for.body8.preheader: ; preds = %for.cond6.preheader %wide.trip.count = zext i32 %4 to i64 br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds %struct.p, ptr %vla, i64 %indvars.iv %i = getelementptr inbounds %struct.p, ptr %vla, i64 %indvars.iv, i32 1 %j = getelementptr inbounds %struct.p, ptr %vla, i64 %indvars.iv, i32 2 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %i, ptr noundef nonnull %j) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.body8: ; preds = %for.body8.preheader, %for.inc21 %indvars.iv42 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next43, %for.inc21 ] %i11 = getelementptr inbounds %struct.p, ptr %vla, i64 %indvars.iv42, i32 1 %6 = load i32, ptr %i11, align 4, !tbaa !11 %cmp12 = icmp sgt i32 %6, 2399 br i1 %cmp12, label %land.lhs.true, label %for.inc21 land.lhs.true: ; preds = %for.body8 %j18 = getelementptr inbounds %struct.p, ptr %vla, i64 %indvars.iv42, i32 2 %7 = load i32, ptr %j18, align 4, !tbaa !13 %cmp19 = icmp slt i32 %6, %7 br i1 %cmp19, label %cleanup, label %for.inc21 for.inc21: ; preds = %for.body8, %land.lhs.true %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 %cleanup, label %for.body8, !llvm.loop !14 cleanup: ; preds = %for.inc21, %land.lhs.true, %for.cond6.preheader, %entry %.str.3.sink = phi ptr [ @.str.3, %entry ], [ @.str.3, %for.cond6.preheader ], [ @.str.2, %land.lhs.true ], [ @.str.3, %for.inc21 ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) 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 = !{!12, !6, i64 12} !12 = !{!"p", !7, i64 0, !6, i64 12, !6, i64 16} !13 = !{!12, !6, i64 16} !14 = distinct !{!14, !10}
#include <stdio.h> typedef struct{ int son[2]; int par; int sib; int deg; int dep; int hei; } Tree; Tree t[25]; int hei(int u) { int h1 = 0, h2 = 0; if(t[u].son[0] != -1) h1 = hei(t[u].son[0])+1; if(t[u].son[1] != -1) h2 = hei(t[u].son[1])+1; if(h1 >= h2) return t[u].hei = h1; if(h2 > h1)return t[u].hei = h2; } int main() { int i,n,id,j,max,root; scanf("%d",&n); for ( i = 0; i < n; i++) { t[i].par=-1; t[i].sib=-1; t[i].deg=0; t[i].dep=0; } for ( i = 0; i < n; i++) { scanf("%d",&id); scanf("%d%d",&t[id].son[0],&t[id].son[1]); if (t[id].son[0]==-1&&t[id].son[1]==-1) { t[id].deg=0; } else if (t[id].son[0]!=-1&&t[id].son[1]!=-1) { t[id].deg=2; t[t[id].son[0]].sib=t[id].son[1]; t[t[id].son[1]].sib=t[id].son[0]; t[t[id].son[0]].par=id; t[t[id].son[1]].par=id; } else { t[id].deg=1; if(t[id].son[0]!=-1){ t[t[id].son[0]].sib=t[id].son[1]; t[t[id].son[0]].par=id; } else { t[t[id].son[1]].sib=t[id].son[0]; t[t[id].son[1]].par=id; } } } for ( i = 0; i < n; i++) { for ( j = t[i].par; j !=-1; j=t[j].par) { t[i].dep++; } if (t[i].dep==-1) root=i; hei(i); } for ( i = 0; i < n; i++) { printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, " ,i,t[i].par,t[i].sib,t[i].deg,t[i].dep,t[i].hei); if (t[i].deg==0) { if (t[i].dep==0) { printf("root\n"); } else printf("leaf\n"); } else { if (t[i].dep==0) { printf("root\n"); } else { printf("internal node\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237870/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237870/source.c" target datalayout = "e-m:e-p270: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.Tree = type { [2 x i32], i32, i32, i32, i32, i32 } @t = dso_local global [25 x %struct.Tree] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.8 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @hei(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @hei(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %arrayidx9 = getelementptr inbounds [2 x i32], ptr %arrayidx, i64 0, i64 1 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10.not = icmp eq i32 %1, -1 br i1 %cmp10.not, label %if.end18, label %if.then11 if.then11: ; preds = %if.end %call16 = tail call i32 @hei(i32 noundef %1) %add17 = add nsw i32 %call16, 1 br label %if.end18 if.end18: ; preds = %if.then11, %if.end %h2.0 = phi i32 [ %add17, %if.then11 ], [ 0, %if.end ] %spec.select = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %2 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom, i32 5 store i32 %spec.select, ptr %2, align 4 ret i32 %spec.select } ; 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 %id = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp239 = icmp sgt i32 %0, 0 br i1 %cmp239, label %for.body.preheader, label %for.end208 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %0, 4 br i1 %1, label %for.cond7.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond7.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond7.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond7.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond7.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond7.preheader.unr-lcssa ] %par.epil = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv.epil, i32 1 store <4 x i32> <i32 -1, i32 -1, i32 0, i32 0>, ptr %par.epil, align 4, !tbaa !5 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond7.preheader, label %for.body.epil, !llvm.loop !9 for.cond7.preheader: ; preds = %for.body.epil, %for.cond7.preheader.unr-lcssa br i1 %cmp239, label %for.body9, label %for.end208 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %par = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv, i32 1 store <4 x i32> <i32 -1, i32 -1, i32 0, i32 0>, ptr %par, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %par.1 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv.next, i32 1 store <4 x i32> <i32 -1, i32 -1, i32 0, i32 0>, ptr %par.1, align 4, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %par.2 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv.next.1, i32 1 store <4 x i32> <i32 -1, i32 -1, i32 0, i32 0>, ptr %par.2, align 16, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %par.3 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv.next.2, i32 1 store <4 x i32> <i32 -1, i32 -1, i32 0, i32 0>, ptr %par.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond7.preheader.unr-lcssa, label %for.body, !llvm.loop !11 for.cond135.preheader: ; preds = %for.inc132 %2 = icmp sgt i32 %7, 0 br i1 %2, label %for.body137, label %for.end208 for.body9: ; preds = %for.cond7.preheader, %for.inc132 %i.1242 = phi i32 [ %inc133, %for.inc132 ], [ 0, %for.cond7.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %id) %3 = load i32, ptr %id, align 4, !tbaa !5 %idxprom11 = sext i32 %3 to i64 %arrayidx12 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom11 %arrayidx17 = getelementptr inbounds [2 x i32], ptr %arrayidx12, i64 0, i64 1 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx12, ptr noundef nonnull %arrayidx17) %4 = load i32, ptr %id, align 4, !tbaa !5 %idxprom19 = sext i32 %4 to i64 %arrayidx20 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom19 %5 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp23 = icmp eq i32 %5, -1 %arrayidx27 = getelementptr inbounds [2 x i32], ptr %arrayidx20, i64 0, i64 1 %6 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp eq i32 %6, -1 %deg31 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom19, i32 3 br i1 %cmp23, label %land.lhs.true, label %land.lhs.true37 land.lhs.true: ; preds = %for.body9 br i1 %cmp28, label %if.then, label %if.else111 if.then: ; preds = %land.lhs.true store i32 0, ptr %deg31, align 4, !tbaa !13 br label %for.inc132 land.lhs.true37: ; preds = %for.body9 %idxprom101 = sext i32 %5 to i64 %sib103 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom101, i32 2 br i1 %cmp28, label %if.then92, label %if.then43 if.then43: ; preds = %land.lhs.true37 store i32 2, ptr %deg31, align 4, !tbaa !13 store i32 %6, ptr %sib103, align 4, !tbaa !15 %idxprom66 = sext i32 %6 to i64 %sib68 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom66, i32 2 store i32 %5, ptr %sib68, align 4, !tbaa !15 %par75 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom101, i32 1 store i32 %4, ptr %par75, align 4, !tbaa !16 %par82 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom66, i32 1 store i32 %4, ptr %par82, align 4, !tbaa !16 br label %for.inc132 if.then92: ; preds = %land.lhs.true37 store i32 1, ptr %deg31, align 4, !tbaa !13 store i32 -1, ptr %sib103, align 4, !tbaa !15 %par110 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom101, i32 1 store i32 %4, ptr %par110, align 4, !tbaa !16 br label %for.inc132 if.else111: ; preds = %land.lhs.true store i32 1, ptr %deg31, align 4, !tbaa !13 %idxprom120 = sext i32 %6 to i64 %sib122 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom120, i32 2 store i32 -1, ptr %sib122, align 4, !tbaa !15 %par129 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom120, i32 1 store i32 %4, ptr %par129, align 4, !tbaa !16 br label %for.inc132 for.inc132: ; preds = %if.then, %if.then92, %if.else111, %if.then43 %inc133 = add nuw nsw i32 %i.1242, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp slt i32 %inc133, %7 br i1 %cmp8, label %for.body9, label %for.cond135.preheader, !llvm.loop !17 for.cond163.preheader: ; preds = %for.end152 %8 = icmp sgt i32 %11, 0 br i1 %8, label %for.body165, label %for.end208 for.body137: ; preds = %for.cond135.preheader, %for.end152 %indvars.iv252 = phi i64 [ %indvars.iv.next253, %for.end152 ], [ 0, %for.cond135.preheader ] %j.0.in243 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv252, i32 1 %j.0244 = load i32, ptr %j.0.in243, align 4, !tbaa !16 %cmp142.not245 = icmp eq i32 %j.0244, -1 br i1 %cmp142.not245, label %for.end152, label %for.body143.lr.ph for.body143.lr.ph: ; preds = %for.body137 %dep146 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv252, i32 4 %dep146.promoted = load i32, ptr %dep146, align 4, !tbaa !18 br label %for.body143 for.body143: ; preds = %for.body143.lr.ph, %for.body143 %9 = phi i32 [ %dep146.promoted, %for.body143.lr.ph ], [ %inc147, %for.body143 ] %j.0246 = phi i32 [ %j.0244, %for.body143.lr.ph ], [ %j.0, %for.body143 ] %inc147 = add nsw i32 %9, 1 %idxprom149 = sext i32 %j.0246 to i64 %j.0.in = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %idxprom149, i32 1 %j.0 = load i32, ptr %j.0.in, align 4, !tbaa !16 %cmp142.not = icmp eq i32 %j.0, -1 br i1 %cmp142.not, label %for.cond141.for.end152_crit_edge, label %for.body143, !llvm.loop !19 for.cond141.for.end152_crit_edge: ; preds = %for.body143 store i32 %inc147, ptr %dep146, align 4, !tbaa !18 br label %for.end152 for.end152: ; preds = %for.cond141.for.end152_crit_edge, %for.body137 %10 = trunc i64 %indvars.iv252 to i32 %call159 = call i32 @hei(i32 noundef %10) %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp136 = icmp slt i64 %indvars.iv.next253, %12 br i1 %cmp136, label %for.body137, label %for.cond163.preheader, !llvm.loop !20 for.body165: ; preds = %for.cond163.preheader, %for.body165 %indvars.iv255 = phi i64 [ %indvars.iv.next256, %for.body165 ], [ 0, %for.cond163.preheader ] %par168 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv255, i32 1 %13 = load i32, ptr %par168, align 4, !tbaa !16 %sib171 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv255, i32 2 %14 = load i32, ptr %sib171, align 4, !tbaa !15 %deg174 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv255, i32 3 %15 = load i32, ptr %deg174, align 4, !tbaa !13 %dep177 = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv255, i32 4 %16 = load i32, ptr %dep177, align 4, !tbaa !18 %hei = getelementptr inbounds [25 x %struct.Tree], ptr @t, i64 0, i64 %indvars.iv255, i32 5 %17 = load i32, ptr %hei, align 4, !tbaa !21 %18 = trunc i64 %indvars.iv255 to i32 %call180 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18, i32 noundef %13, i32 noundef %14, i32 noundef %15, i32 noundef %16, i32 noundef %17) %19 = load i32, ptr %deg174, align 4, !tbaa !13 %cmp184 = icmp eq i32 %19, 0 %20 = load i32, ptr %dep177, align 4, !tbaa !18 %cmp189 = icmp eq i32 %20, 0 %str.8.str.7 = select i1 %cmp189, ptr @str.8, ptr @str.7 %str.6.str = select i1 %cmp189, ptr @str.8, ptr @str %str.7.sink = select i1 %cmp184, ptr %str.8.str.7, ptr %str.6.str %puts236 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) %indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp164 = icmp slt i64 %indvars.iv.next256, %22 br i1 %cmp164, label %for.body165, label %for.end208, !llvm.loop !22 for.end208: ; preds = %for.body165, %entry, %for.cond7.preheader, %for.cond135.preheader, %for.cond163.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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.unroll.disable"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14, !6, i64 16} !14 = !{!"", !7, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24} !15 = !{!14, !6, i64 12} !16 = !{!14, !6, i64 8} !17 = distinct !{!17, !12} !18 = !{!14, !6, i64 20} !19 = distinct !{!19, !12} !20 = distinct !{!20, !12} !21 = !{!14, !6, i64 24} !22 = distinct !{!22, !12}
#include<stdio.h> #define NIL -1 #define MAX 25 typedef struct { int parent; int le; int ri; }Node; Node t[MAX]; int h,max; void calc(int); int main() { int i,j,n,id,left,right; int depth[MAX],height[MAX],sibling[MAX],degree[MAX]; scanf("%d",&n); for(i=0; i<n; i++) { t[i].parent=t[i].le=t[i].ri=sibling[i]=NIL; degree[i]=0; } for(i=0; i<n; i++) { scanf("%d%d%d",&id,&left,&right); if(left!=NIL) { t[left].parent=id; degree[id]++; } if(right!=NIL){ t[right].parent=id; degree[id]++; } t[id].le = left; t[id].ri = right; sibling[left]=right; sibling[right]=left; } for(i=0; i<n; i++) { depth[i]=height[i]=0; j=i; while(t[j].parent!=NIL) { j=t[j].parent; depth[i]++; } max=h=0; calc(i); height[i] = max; } for(i=0; i<n; i++) { printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,t[i].parent,sibling[i],degree[i],depth[i],height[i]); if(t[i].parent==-1) printf("root"); else if(t[i].le!=-1 || t[i].ri!=-1) printf("internal node"); else printf("leaf"); printf("\n"); } return 0; } void calc(int n) { if(t[n].le==NIL || t[n].ri==NIL) max = h>max ? h:max; if(t[n].le!=NIL) { h++; calc(t[n].le); } if(t[n].ri!=NIL) { h++; calc(t[n].ri); } h-=1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237920/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237920/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @t = dso_local local_unnamed_addr global [25 x %struct.Node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @h = dso_local local_unnamed_addr global i32 0, align 4 @max = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"root\00", align 1 @.str.4 = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @.str.5 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %id = alloca i32, align 4 %left = alloca i32, align 4 %right = alloca i32, align 4 %depth = alloca [25 x i32], align 16 %height = alloca [25 x i32], align 16 %sibling = alloca [25 x i32], align 16 %degree = alloca [25 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %left) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %right) #7 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %depth) #7 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %height) #7 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %sibling) #7 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %degree) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp133 = icmp sgt i32 %0, 0 br i1 %cmp133, label %for.body11.preheader, label %for.end102 for.body11.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %sibling, i8 -1, i64 %2, i1 false), !tbaa !5 %3 = mul nuw nsw i64 %1, 12 call void @llvm.memset.p0.i64(ptr nonnull align 16 @t, i8 -1, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %degree, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body11 for.cond42.preheader: ; preds = %if.end28 %4 = icmp sgt i32 %9, 0 br i1 %4, label %for.body44, label %for.end102 for.body11: ; preds = %for.body11.preheader, %if.end28 %i.1136 = phi i32 [ %inc40, %if.end28 ], [ 0, %for.body11.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %left, ptr noundef nonnull %right) %5 = load i32, ptr %left, align 4, !tbaa !5 %cmp13.not = icmp eq i32 %5, -1 %.pre.pre = load i32, ptr %id, align 4, !tbaa !5 br i1 %cmp13.not, label %if.end, label %if.then if.then: ; preds = %for.body11 %idxprom14 = sext i32 %5 to i64 %arrayidx15 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom14 store i32 %.pre.pre, ptr %arrayidx15, align 4, !tbaa !9 %idxprom17 = sext i32 %.pre.pre to i64 %arrayidx18 = getelementptr inbounds [25 x i32], ptr %degree, i64 0, i64 %idxprom17 %6 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %inc19 = add nsw i32 %6, 1 store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body11 %7 = load i32, ptr %right, align 4, !tbaa !5 %cmp20.not = icmp eq i32 %7, -1 br i1 %cmp20.not, label %if.end.if.end28_crit_edge, label %if.then21 if.end.if.end28_crit_edge: ; preds = %if.end %.pre = sext i32 %.pre.pre to i64 br label %if.end28 if.then21: ; preds = %if.end %idxprom22 = sext i32 %7 to i64 %arrayidx23 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom22 store i32 %.pre.pre, ptr %arrayidx23, align 4, !tbaa !9 %idxprom25 = sext i32 %.pre.pre to i64 %arrayidx26 = getelementptr inbounds [25 x i32], ptr %degree, i64 0, i64 %idxprom25 %8 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %inc27 = add nsw i32 %8, 1 store i32 %inc27, ptr %arrayidx26, align 4, !tbaa !5 br label %if.end28 if.end28: ; preds = %if.end.if.end28_crit_edge, %if.then21 %idxprom37.pre-phi = phi i64 [ -1, %if.end.if.end28_crit_edge ], [ %idxprom22, %if.then21 ] %idxprom29.pre-phi = phi i64 [ %.pre, %if.end.if.end28_crit_edge ], [ %idxprom25, %if.then21 ] %le31 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom29.pre-phi, i32 1 store i32 %5, ptr %le31, align 4, !tbaa !11 %ri34 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom29.pre-phi, i32 2 store i32 %7, ptr %ri34, align 4, !tbaa !12 %idxprom35 = sext i32 %5 to i64 %arrayidx36 = getelementptr inbounds [25 x i32], ptr %sibling, i64 0, i64 %idxprom35 store i32 %7, ptr %arrayidx36, align 4, !tbaa !5 %arrayidx38 = getelementptr inbounds [25 x i32], ptr %sibling, i64 0, i64 %idxprom37.pre-phi store i32 %5, ptr %arrayidx38, align 4, !tbaa !5 %inc40 = add nuw nsw i32 %i.1136, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc40, %9 br i1 %cmp10, label %for.body11, label %for.cond42.preheader, !llvm.loop !13 for.cond64.preheader: ; preds = %while.end %10 = icmp sgt i32 %14, 0 br i1 %10, label %for.body66, label %for.end102 for.body44: ; preds = %for.cond42.preheader, %while.end %indvars.iv = phi i64 [ %indvars.iv.next, %while.end ], [ 0, %for.cond42.preheader ] %arrayidx46 = getelementptr inbounds [25 x i32], ptr %height, i64 0, i64 %indvars.iv %11 = trunc i64 %indvars.iv to i32 br label %while.cond while.cond: ; preds = %while.cond, %for.body44 %storemerge = phi i32 [ 0, %for.body44 ], [ %inc58, %while.cond ] %j.0 = phi i32 [ %11, %for.body44 ], [ %12, %while.cond ] %idxprom49 = sext i32 %j.0 to i64 %arrayidx50 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom49 %12 = load i32, ptr %arrayidx50, align 4, !tbaa !9 %cmp52.not = icmp eq i32 %12, -1 %inc58 = add nuw nsw i32 %storemerge, 1 br i1 %cmp52.not, label %while.end, label %while.cond, !llvm.loop !15 while.end: ; preds = %while.cond %arrayidx48 = getelementptr inbounds [25 x i32], ptr %depth, i64 0, i64 %indvars.iv store i32 %storemerge, ptr %arrayidx48, align 4, !tbaa !5 store i32 0, ptr @h, align 4, !tbaa !5 store i32 0, ptr @max, align 4, !tbaa !5 call void @calc(i32 noundef %11) %13 = load i32, ptr @max, align 4, !tbaa !5 store i32 %13, ptr %arrayidx46, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp43 = icmp slt i64 %indvars.iv.next, %15 br i1 %cmp43, label %for.body44, label %for.cond64.preheader, !llvm.loop !16 for.body66: ; preds = %for.cond64.preheader, %if.end98 %indvars.iv143 = phi i64 [ %indvars.iv.next144, %if.end98 ], [ 0, %for.cond64.preheader ] %arrayidx68 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %indvars.iv143 %16 = load i32, ptr %arrayidx68, align 4, !tbaa !9 %arrayidx71 = getelementptr inbounds [25 x i32], ptr %sibling, i64 0, i64 %indvars.iv143 %17 = load i32, ptr %arrayidx71, align 4, !tbaa !5 %arrayidx73 = getelementptr inbounds [25 x i32], ptr %degree, i64 0, i64 %indvars.iv143 %18 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %arrayidx75 = getelementptr inbounds [25 x i32], ptr %depth, i64 0, i64 %indvars.iv143 %19 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %arrayidx77 = getelementptr inbounds [25 x i32], ptr %height, i64 0, i64 %indvars.iv143 %20 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %21 = trunc i64 %indvars.iv143 to i32 %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21, i32 noundef %16, i32 noundef %17, i32 noundef %18, i32 noundef %19, i32 noundef %20) %22 = load i32, ptr %arrayidx68, align 4, !tbaa !9 %cmp82 = icmp eq i32 %22, -1 br i1 %cmp82, label %if.end98, label %if.else if.else: ; preds = %for.body66 %le87 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %indvars.iv143, i32 1 %23 = load i32, ptr %le87, align 4, !tbaa !11 %cmp88.not = icmp eq i32 %23, -1 br i1 %cmp88.not, label %lor.lhs.false, label %if.end98 lor.lhs.false: ; preds = %if.else %ri91 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %indvars.iv143, i32 2 %24 = load i32, ptr %ri91, align 4, !tbaa !12 %cmp92.not = icmp eq i32 %24, -1 %spec.select = select i1 %cmp92.not, ptr @.str.5, ptr @.str.4 br label %if.end98 if.end98: ; preds = %lor.lhs.false, %if.else, %for.body66 %.str.4.sink = phi ptr [ @.str.3, %for.body66 ], [ @.str.4, %if.else ], [ %spec.select, %lor.lhs.false ] %call94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink) %putchar = call i32 @putchar(i32 10) %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp65 = icmp slt i64 %indvars.iv.next144, %26 br i1 %cmp65, label %for.body66, label %for.end102, !llvm.loop !17 for.end102: ; preds = %if.end98, %entry, %for.cond42.preheader, %for.cond64.preheader call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %degree) #7 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %sibling) #7 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %height) #7 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %depth) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %right) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %left) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @calc(i32 noundef %n) local_unnamed_addr #3 { entry: %idxprom = sext i32 %n to i64 %le = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %le, align 4, !tbaa !11 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %if.end.thread29, label %lor.lhs.false if.end.thread29: ; preds = %entry %1 = load i32, ptr @h, align 4 %2 = load i32, ptr @max, align 4 %cond30 = tail call i32 @llvm.smax.i32(i32 %1, i32 %2) store i32 %cond30, ptr @max, align 4, !tbaa !5 br label %if.end13 lor.lhs.false: ; preds = %entry %ri = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom, i32 2 %3 = load i32, ptr %ri, align 4, !tbaa !12 %cmp3 = icmp eq i32 %3, -1 %.pre = load i32, ptr @h, align 4 br i1 %cmp3, label %if.end, label %if.then9 if.end: ; preds = %lor.lhs.false %4 = load i32, ptr @max, align 4 %cond = tail call i32 @llvm.smax.i32(i32 %.pre, i32 %4) store i32 %cond, ptr @max, align 4, !tbaa !5 br label %if.then9 if.then9: ; preds = %lor.lhs.false, %if.end %inc = add nsw i32 %.pre, 1 store i32 %inc, ptr @h, align 4, !tbaa !5 tail call void @calc(i32 noundef %0) %.pre32.pre = load i32, ptr @h, align 4, !tbaa !5 br label %if.end13 if.end13: ; preds = %if.end.thread29, %if.then9 %.pre32 = phi i32 [ %1, %if.end.thread29 ], [ %.pre32.pre, %if.then9 ] %ri16 = getelementptr inbounds [25 x %struct.Node], ptr @t, i64 0, i64 %idxprom, i32 2 %5 = load i32, ptr %ri16, align 4, !tbaa !12 %cmp17.not = icmp eq i32 %5, -1 br i1 %cmp17.not, label %if.end23, label %if.then18 if.then18: ; preds = %if.end13 %inc19 = add nsw i32 %.pre32, 1 store i32 %inc19, ptr @h, align 4, !tbaa !5 tail call void @calc(i32 noundef %5) %.pre31 = load i32, ptr @h, align 4, !tbaa !5 br label %if.end23 if.end23: ; preds = %if.then18, %if.end13 %6 = phi i32 [ %.pre31, %if.then18 ], [ %.pre32, %if.end13 ] %sub = add nsw i32 %6, -1 store i32 %sub, ptr @h, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(readwrite, 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 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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 0} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 4} !12 = !{!10, !6, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14} !17 = distinct !{!17, !14}
#include<stdio.h> #define N 26 typedef struct { int par; //親 int left; int right; int sib; }Binary; int n,dep[N],hei[N]; Binary B[N]; void Depth(void); void Print(void); int Height(int); int main() { int i,id,l,r,root; scanf("%d",&n); for(i=0;i<n;i++) B[i].par = B[i].left = B[i].right = B[i].sib = -1; //初期化 for(i=0;i<n;i++) //n回ループ { scanf("%d%d%d",&id,&l,&r); //id:節点,left:左の子の番号,right:右の子 B[id].left = l; B[id].right = r; if(l!=-1)B[l].par = id; if(r!=-1)B[r].par = id; if(l!=-1)B[l].sib = B[id].right; //deg if(r!=-1)B[r].sib = B[id].left; //deg*/ } for(i=0;i<n;i++) if(B[i].par == -1) hei[i] = Height(i); Depth(); Print(); return 0; } void Depth(void) { int i,j; for(i=0;i<n;i++) { j=i; while(B[j].par != -1) { dep[i]++; j = B[j].par; } } } void Print(void) { int i,deg=0; for(i=0;i<n;i++) { deg=0; printf("node %d: ",i); printf("parent = %d, ",B[i].par); printf("sibling = %d, ",B[i].sib); if(B[i].left != -1)deg++; if(B[i].right != -1)deg++; printf("degree = %d, ",deg); printf("depth = %d, ",dep[i]); printf("height = %d, ",hei[i]); if(B[i].par == -1)printf("root\n"); else if(hei[i] == 0)printf("leaf\n"); else printf("internal node\n"); } } int Height(int i) { int hei1 = 0, hei2 = 0; if(B[i].left != -1) hei1= Height(B[i].left)+1; if(B[i].right != -1)hei2 = Height(B[i].right)+1; return hei[i] = hei1 > hei2 ? hei1 : hei2; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_237964/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_237964/source.c" target datalayout = "e-m:e-p270: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.Binary = type { i32, i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @B = dso_local local_unnamed_addr global [26 x %struct.Binary] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @hei = dso_local local_unnamed_addr global [26 x i32] zeroinitializer, align 16 @dep = dso_local local_unnamed_addr global [26 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"node %d: \00", align 1 @.str.3 = private unnamed_addr constant [14 x i8] c"parent = %d, \00", align 1 @.str.4 = private unnamed_addr constant [15 x i8] c"sibling = %d, \00", align 1 @.str.5 = private unnamed_addr constant [14 x i8] c"degree = %d, \00", align 1 @.str.6 = private unnamed_addr constant [13 x i8] c"depth = %d, \00", align 1 @.str.7 = private unnamed_addr constant [14 x i8] c"height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.11 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.12 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %id = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp79 = icmp sgt i32 %0, 0 br i1 %cmp79, label %for.body9.preheader, label %Depth.exit for.body9.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 4 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @B, i8 -1, i64 %2, i1 false), !tbaa !5 br label %for.body9 for.cond48.preheader: ; preds = %for.inc45 %cmp4983 = icmp sgt i32 %6, 0 br i1 %cmp4983, label %for.body50, label %Depth.exit for.body9: ; preds = %for.body9.preheader, %for.inc45 %i.182 = phi i32 [ %inc46, %for.inc45 ], [ 0, %for.body9.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !5 %4 = load i32, ptr %id, align 4, !tbaa !5 %idxprom11 = sext i32 %4 to i64 %left13 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom11, i32 1 store i32 %3, ptr %left13, align 4, !tbaa !9 %5 = load i32, ptr %r, align 4, !tbaa !5 %right16 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom11, i32 2 store i32 %5, ptr %right16, align 8, !tbaa !11 %cmp17.not = icmp eq i32 %3, -1 br i1 %cmp17.not, label %if.end, label %if.then if.then: ; preds = %for.body9 %idxprom18 = sext i32 %3 to i64 %arrayidx19 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom18 store i32 %4, ptr %arrayidx19, align 16, !tbaa !12 br label %if.end if.end: ; preds = %if.then, %for.body9 %cmp21.not = icmp eq i32 %5, -1 br i1 %cmp21.not, label %if.end26, label %if.then22 if.then22: ; preds = %if.end %idxprom23 = sext i32 %5 to i64 %arrayidx24 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom23 store i32 %4, ptr %arrayidx24, align 16, !tbaa !12 br label %if.end26 if.end26: ; preds = %if.then22, %if.end br i1 %cmp17.not, label %if.end35, label %if.then28 if.then28: ; preds = %if.end26 %idxprom32 = sext i32 %3 to i64 %sib34 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom32, i32 3 store i32 %5, ptr %sib34, align 4, !tbaa !13 br label %if.end35 if.end35: ; preds = %if.then28, %if.end26 br i1 %cmp21.not, label %for.inc45, label %if.then37 if.then37: ; preds = %if.end35 %idxprom41 = sext i32 %5 to i64 %sib43 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom41, i32 3 store i32 %3, ptr %sib43, align 4, !tbaa !13 br label %for.inc45 for.inc45: ; preds = %if.end35, %if.then37 %inc46 = add nuw nsw i32 %i.182, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp8 = icmp slt i32 %inc46, %6 br i1 %cmp8, label %for.body9, label %for.cond48.preheader, !llvm.loop !14 for.body50: ; preds = %for.cond48.preheader, %for.inc60 %.pr89 = phi i32 [ %.pr, %for.inc60 ], [ %6, %for.cond48.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc60 ], [ 0, %for.cond48.preheader ] %arrayidx52 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx52, align 16, !tbaa !12 %cmp54 = icmp eq i32 %7, -1 br i1 %cmp54, label %if.then55, label %for.inc60 if.then55: ; preds = %for.body50 %8 = trunc i64 %indvars.iv to i32 %call56 = call i32 @Height(i32 noundef %8) %arrayidx58 = getelementptr inbounds [26 x i32], ptr @hei, i64 0, i64 %indvars.iv store i32 %call56, ptr %arrayidx58, align 4, !tbaa !5 %.pr.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc60 for.inc60: ; preds = %for.body50, %if.then55 %.pr = phi i32 [ %.pr89, %for.body50 ], [ %.pr.pre, %if.then55 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = sext i32 %.pr to i64 %cmp49 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp49, label %for.body50, label %for.end62, !llvm.loop !16 for.end62: ; preds = %for.inc60 %cmp16.i = icmp sgt i32 %.pr, 0 br i1 %cmp16.i, label %while.cond.preheader.preheader.i, label %Depth.exit while.cond.preheader.preheader.i: ; preds = %for.end62 %wide.trip.count.i = zext i32 %.pr to i64 br label %while.cond.preheader.i while.cond.preheader.i: ; preds = %for.inc.i, %while.cond.preheader.preheader.i %indvars.iv.i = phi i64 [ 0, %while.cond.preheader.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %arrayidx13.i = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx13.i, align 16, !tbaa !12 %cmp1.not14.i = icmp eq i32 %10, -1 br i1 %cmp1.not14.i, label %for.inc.i, label %while.body.lr.ph.i while.body.lr.ph.i: ; preds = %while.cond.preheader.i %arrayidx3.i = getelementptr inbounds [26 x i32], ptr @dep, i64 0, i64 %indvars.iv.i %arrayidx3.promoted.i = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 br label %while.body.i while.body.i: ; preds = %while.body.i, %while.body.lr.ph.i %inc15.i = phi i32 [ %arrayidx3.promoted.i, %while.body.lr.ph.i ], [ %inc.i, %while.body.i ] %11 = phi i32 [ %10, %while.body.lr.ph.i ], [ %12, %while.body.i ] %inc.i = add nsw i32 %inc15.i, 1 %idxprom.i = sext i32 %11 to i64 %arrayidx.i = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom.i %12 = load i32, ptr %arrayidx.i, align 16, !tbaa !12 %cmp1.not.i = icmp eq i32 %12, -1 br i1 %cmp1.not.i, label %while.cond.for.inc_crit_edge.i, label %while.body.i, !llvm.loop !17 while.cond.for.inc_crit_edge.i: ; preds = %while.body.i store i32 %inc.i, ptr %arrayidx3.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 %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 %Depth.exit, label %while.cond.preheader.i, !llvm.loop !18 Depth.exit: ; preds = %for.inc.i, %entry, %for.cond48.preheader, %for.end62 call void @Print() call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Height(i32 noundef %i) local_unnamed_addr #3 { entry: %idxprom = sext i32 %i to i64 %left = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !9 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @Height(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %hei1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 8, !tbaa !11 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @Height(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %hei2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %cond = tail call i32 @llvm.smax.i32(i32 %hei1.0, i32 %hei2.0) %arrayidx16 = getelementptr inbounds [26 x i32], ptr @hei, i64 0, i64 %idxprom store i32 %cond, ptr %arrayidx16, align 4, !tbaa !5 ret i32 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Depth() local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %while.cond.preheader.preheader, label %for.end while.cond.preheader.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.preheader, %for.inc %indvars.iv = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx13 = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx13, align 16, !tbaa !12 %cmp1.not14 = icmp eq i32 %1, -1 br i1 %cmp1.not14, label %for.inc, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader %arrayidx3 = getelementptr inbounds [26 x i32], ptr @dep, i64 0, i64 %indvars.iv %arrayidx3.promoted = load i32, ptr %arrayidx3, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %inc15 = phi i32 [ %arrayidx3.promoted, %while.body.lr.ph ], [ %inc, %while.body ] %2 = phi i32 [ %1, %while.body.lr.ph ], [ %3, %while.body ] %inc = add nsw i32 %inc15, 1 %idxprom = sext i32 %2 to i64 %arrayidx = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %idxprom %3 = load i32, ptr %arrayidx, align 16, !tbaa !12 %cmp1.not = icmp eq i32 %3, -1 br i1 %cmp1.not, label %while.cond.for.inc_crit_edge, label %while.body, !llvm.loop !17 while.cond.for.inc_crit_edge: ; preds = %while.body store i32 %inc, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %while.cond.for.inc_crit_edge, %while.cond.preheader %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 %while.cond.preheader, !llvm.loop !18 for.end: ; preds = %for.inc, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @Print() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp51 = icmp sgt i32 %0, 0 br i1 %cmp51, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %1 = trunc i64 %indvars.iv to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) %arrayidx = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 16, !tbaa !12 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %2) %sib = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv, i32 3 %3 = load i32, ptr %sib, align 4, !tbaa !13 %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %3) %left = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv, i32 1 %4 = load i32, ptr %left, align 4, !tbaa !9 %cmp7.not = icmp ne i32 %4, -1 %spec.select = zext i1 %cmp7.not to i32 %right = getelementptr inbounds [26 x %struct.Binary], ptr @B, i64 0, i64 %indvars.iv, i32 2 %5 = load i32, ptr %right, align 8, !tbaa !11 %cmp10.not = icmp eq i32 %5, -1 %inc12 = select i1 %cmp7.not, i32 2, i32 1 %deg.1 = select i1 %cmp10.not, i32 %spec.select, i32 %inc12 %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %deg.1) %arrayidx16 = getelementptr inbounds [26 x i32], ptr @dep, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %call17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %6) %arrayidx19 = getelementptr inbounds [26 x i32], ptr @hei, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %7) %8 = load i32, ptr %arrayidx, align 16, !tbaa !12 %cmp24 = icmp eq i32 %8, -1 br i1 %cmp24, label %for.inc, label %if.else if.else: ; preds = %for.body %9 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp29 = icmp eq i32 %9, 0 %str.11.str = select i1 %cmp29, ptr @str.11, ptr @str br label %for.inc for.inc: ; preds = %if.else, %for.body %str.12.sink = phi ptr [ @str.12, %for.body ], [ %str.11.str, %if.else ] %puts50 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.12.sink) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr @n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !19 for.end: ; preds = %for.inc, %entry ret void } ; 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) #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(readwrite, 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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nofree nounwind } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!10, !6, i64 4} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12} !11 = !{!10, !6, i64 8} !12 = !{!10, !6, i64 0} !13 = !{!10, !6, i64 12} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = distinct !{!16, !15} !17 = distinct !{!17, !15} !18 = distinct !{!18, !15} !19 = distinct !{!19, !15}
#include<stdio.h> typedef struct{ int num; //割り当て番号 int par; //親の番号 int p_fl; //親の有無 int sib; //兄弟の番号 int dep; //深さ int deg; //子供の数 int deg_n[2]; //子供の数字 int hei; //高さ int RorL; //leftなら0、rightなら1 } Nibun; int main(){ Nibun data[25]; int n, i, j, k, cnt, num, degnum, max_dep = 0, h_cnt, temp, flag; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%d",&num); data[num].num = num; data[num].deg = 0, data[num].dep = 0; scanf("%d",&degnum); temp = degnum; if(degnum == -1)data[num].hei = 0; else { data[degnum].par = num; data[num].deg++; data[degnum].RorL = 0; data[degnum].p_fl = 1; } scanf("%d",&degnum); if(degnum == -1)data[num].hei = 0; else { data[degnum].par = num; data[num].deg++; data[degnum].RorL = 1; data[degnum].p_fl = 1; } data[degnum].sib = temp; data[temp].sib = degnum; } for(i = 0; i < n; i++) //par = -1となるdata[x]を探す処理 { if(data[i].p_fl != 1) { data[i].par = -1; data[i].sib = -1; break; } } for(i = 0; i < n; i++) //depthの処理 { j = i; cnt = 0; while(1) { if(data[j].par == -1) { data[i].dep = cnt; if(max_dep < cnt)max_dep = cnt; break; } j = data[j].par; cnt++; } } for(i = 0; i < n; i++) //heightの処理 { data[i].hei = 0 , cnt = 0 , flag = 0; if(data[i].deg == 0)continue; while(2) { for(j = 0; j < n; j++) { if(flag == 1)break; if(data[j].dep == max_dep - cnt) { h_cnt = 1; k = j; while(3) { if(data[k].par != data[i].num) { if(data[k].par == -1)break; k = data[k].par; h_cnt++; } else { data[i].hei = h_cnt; flag = 1; break; } } } } if(flag == 1)break; cnt++; } } for(i = 0; i < n; i++) { printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ", i, data[i].par, data[i].sib, data[i].deg, data[i].dep, data[i].hei); if(data[i].deg == 0 && data[i].par != -1)printf("leaf\n"); else if(data[i].par == -1)printf("root\n"); else printf("internal node\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238006/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238006/source.c" target datalayout = "e-m:e-p270: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.Nibun = type { i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.5 = private unnamed_addr constant [5 x i8] c"root\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %data = alloca [25 x %struct.Nibun], align 16 %n = alloca i32, align 4 %num = alloca i32, align 4 %degnum = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %data) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %degnum) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp243 = icmp sgt i32 %0, 0 br i1 %cmp243, label %for.body, label %for.end192 for.cond47.preheader: ; preds = %if.end40 %cmp48245 = icmp sgt i32 %8, 0 br i1 %cmp48245, label %for.body49.preheader, label %for.end192 for.body49.preheader: ; preds = %for.cond47.preheader %wide.trip.count = zext i32 %8 to i64 br label %for.body49 for.body: ; preds = %entry, %if.end40 %i.0244 = phi i32 [ %inc46, %if.end40 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %1 = load i32, ptr %num, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom store i32 %1, ptr %arrayidx, align 8, !tbaa !9 %deg = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom, i32 5 store i32 0, ptr %deg, align 4, !tbaa !11 %dep = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom, i32 4 store i32 0, ptr %dep, align 8, !tbaa !12 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %degnum) %2 = load i32, ptr %degnum, align 4, !tbaa !5 %cmp8 = icmp eq i32 %2, -1 %3 = load i32, ptr %num, align 4, !tbaa !5 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body %idxprom9 = sext i32 %3 to i64 %hei = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom9, i32 7 store i32 0, ptr %hei, align 8, !tbaa !13 br label %if.end if.else: ; preds = %for.body %idxprom11 = sext i32 %2 to i64 %par = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom11, i32 1 store i32 %3, ptr %par, align 4, !tbaa !14 %idxprom13 = sext i32 %3 to i64 %deg15 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom13, i32 5 %4 = load i32, ptr %deg15, align 4, !tbaa !11 %inc = add nsw i32 %4, 1 store i32 %inc, ptr %deg15, align 4, !tbaa !11 %RorL = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom11, i32 8 store i32 0, ptr %RorL, align 4, !tbaa !15 %p_fl = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom11, i32 2 store i32 1, ptr %p_fl, align 8, !tbaa !16 br label %if.end if.end: ; preds = %if.else, %if.then %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %degnum) %5 = load i32, ptr %degnum, align 4, !tbaa !5 %cmp21 = icmp eq i32 %5, -1 %6 = load i32, ptr %num, align 4, !tbaa !5 br i1 %cmp21, label %if.then22, label %if.else26 if.then22: ; preds = %if.end %idxprom23 = sext i32 %6 to i64 %hei25 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom23, i32 7 store i32 0, ptr %hei25, align 8, !tbaa !13 br label %if.end40 if.else26: ; preds = %if.end %idxprom27 = sext i32 %5 to i64 %par29 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom27, i32 1 store i32 %6, ptr %par29, align 4, !tbaa !14 %idxprom30 = sext i32 %6 to i64 %deg32 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom30, i32 5 %7 = load i32, ptr %deg32, align 4, !tbaa !11 %inc33 = add nsw i32 %7, 1 store i32 %inc33, ptr %deg32, align 4, !tbaa !11 %RorL36 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom27, i32 8 store i32 1, ptr %RorL36, align 4, !tbaa !15 %p_fl39 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom27, i32 2 store i32 1, ptr %p_fl39, align 8, !tbaa !16 br label %if.end40 if.end40: ; preds = %if.else26, %if.then22 %idxprom41.pre-phi = phi i64 [ %idxprom27, %if.else26 ], [ -1, %if.then22 ] %sib = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom41.pre-phi, i32 3 store i32 %2, ptr %sib, align 4, !tbaa !17 %idxprom43 = sext i32 %2 to i64 %sib45 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom43, i32 3 store i32 %5, ptr %sib45, align 4, !tbaa !17 %inc46 = add nuw nsw i32 %i.0244, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc46, %8 br i1 %cmp, label %for.body, label %for.cond47.preheader, !llvm.loop !18 for.cond47: ; preds = %for.body49 %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.end64, label %for.body49, !llvm.loop !20 for.body49: ; preds = %for.body49.preheader, %for.cond47 %indvars.iv = phi i64 [ 0, %for.body49.preheader ], [ %indvars.iv.next, %for.cond47 ] %p_fl52 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv, i32 2 %9 = load i32, ptr %p_fl52, align 8, !tbaa !16 %cmp53.not = icmp eq i32 %9, 1 br i1 %cmp53.not, label %for.cond47, label %if.then54 if.then54: ; preds = %for.body49 %par57 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv, i32 1 store i32 -1, ptr %par57, align 4, !tbaa !14 %sib60 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv, i32 3 store i32 -1, ptr %sib60, align 4, !tbaa !17 br i1 %cmp48245, label %while.cond.preheader.preheader, label %for.end192 for.end64: ; preds = %for.cond47 br i1 %cmp48245, label %while.cond.preheader.preheader, label %for.end192 while.cond.preheader.preheader: ; preds = %if.then54, %for.end64 %wide.trip.count270 = zext i32 %8 to i64 %xtraiter = and i64 %wide.trip.count270, 1 %10 = icmp eq i32 %8, 1 br i1 %10, label %for.body89.preheader.unr-lcssa, label %while.cond.preheader.preheader.new while.cond.preheader.preheader.new: ; preds = %while.cond.preheader.preheader %unroll_iter = and i64 %wide.trip.count270, 4294967294 br label %while.cond.preheader while.cond.preheader: ; preds = %if.then72.1, %while.cond.preheader.preheader.new %indvars.iv267 = phi i64 [ 0, %while.cond.preheader.preheader.new ], [ %indvars.iv.next268.1, %if.then72.1 ] %max_dep.0248 = phi i32 [ 0, %while.cond.preheader.preheader.new ], [ %spec.select.1, %if.then72.1 ] %niter = phi i64 [ 0, %while.cond.preheader.preheader.new ], [ %niter.next.1, %if.then72.1 ] %11 = trunc i64 %indvars.iv267 to i32 br label %while.cond for.body89.preheader.unr-lcssa: ; preds = %if.then72.1, %while.cond.preheader.preheader %spec.select.lcssa.ph = phi i32 [ undef, %while.cond.preheader.preheader ], [ %spec.select.1, %if.then72.1 ] %indvars.iv267.unr = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next268.1, %if.then72.1 ] %max_dep.0248.unr = phi i32 [ 0, %while.cond.preheader.preheader ], [ %spec.select.1, %if.then72.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body89.preheader, label %while.cond.preheader.epil while.cond.preheader.epil: ; preds = %for.body89.preheader.unr-lcssa %12 = trunc i64 %indvars.iv267.unr to i32 br label %while.cond.epil while.cond.epil: ; preds = %while.cond.epil, %while.cond.preheader.epil %j.0.epil = phi i32 [ %13, %while.cond.epil ], [ %12, %while.cond.preheader.epil ] %cnt.0.epil = phi i32 [ %inc83.epil, %while.cond.epil ], [ 0, %while.cond.preheader.epil ] %idxprom68.epil = sext i32 %j.0.epil to i64 %par70.epil = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom68.epil, i32 1 %13 = load i32, ptr %par70.epil, align 4, !tbaa !14 %cmp71.epil = icmp eq i32 %13, -1 %inc83.epil = add nuw nsw i32 %cnt.0.epil, 1 br i1 %cmp71.epil, label %if.then72.epil, label %while.cond.epil if.then72.epil: ; preds = %while.cond.epil %dep75.epil = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv267.unr, i32 4 store i32 %cnt.0.epil, ptr %dep75.epil, align 8, !tbaa !12 %spec.select.epil = call i32 @llvm.smax.i32(i32 %max_dep.0248.unr, i32 %cnt.0.epil) br label %for.body89.preheader for.body89.preheader: ; preds = %for.body89.preheader.unr-lcssa, %if.then72.epil %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.body89.preheader.unr-lcssa ], [ %spec.select.epil, %if.then72.epil ] %14 = sext i32 %8 to i64 %wide.trip.count278 = zext i32 %8 to i64 br label %for.body89 while.cond: ; preds = %while.cond, %while.cond.preheader %j.0 = phi i32 [ %15, %while.cond ], [ %11, %while.cond.preheader ] %cnt.0 = phi i32 [ %inc83, %while.cond ], [ 0, %while.cond.preheader ] %idxprom68 = sext i32 %j.0 to i64 %par70 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom68, i32 1 %15 = load i32, ptr %par70, align 4, !tbaa !14 %cmp71 = icmp eq i32 %15, -1 %inc83 = add nuw nsw i32 %cnt.0, 1 br i1 %cmp71, label %if.then72, label %while.cond if.then72: ; preds = %while.cond %dep75 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv267, i32 4 store i32 %cnt.0, ptr %dep75, align 16, !tbaa !12 %spec.select = call i32 @llvm.smax.i32(i32 %max_dep.0248, i32 %cnt.0) %indvars.iv.next268 = or i64 %indvars.iv267, 1 %16 = trunc i64 %indvars.iv.next268 to i32 br label %while.cond.1 while.cond.1: ; preds = %while.cond.1, %if.then72 %j.0.1 = phi i32 [ %17, %while.cond.1 ], [ %16, %if.then72 ] %cnt.0.1 = phi i32 [ %inc83.1, %while.cond.1 ], [ 0, %if.then72 ] %idxprom68.1 = sext i32 %j.0.1 to i64 %par70.1 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom68.1, i32 1 %17 = load i32, ptr %par70.1, align 4, !tbaa !14 %cmp71.1 = icmp eq i32 %17, -1 %inc83.1 = add nuw nsw i32 %cnt.0.1, 1 br i1 %cmp71.1, label %if.then72.1, label %while.cond.1 if.then72.1: ; preds = %while.cond.1 %dep75.1 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv.next268, i32 4 store i32 %cnt.0.1, ptr %dep75.1, align 8, !tbaa !12 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %cnt.0.1) %indvars.iv.next268.1 = add nuw nsw i64 %indvars.iv267, 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.body89.preheader.unr-lcssa, label %while.cond.preheader, !llvm.loop !21 for.body89: ; preds = %for.body89.preheader, %for.inc147 %indvars.iv275 = phi i64 [ 0, %for.body89.preheader ], [ %indvars.iv.next276, %for.inc147 ] %arrayidx91 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv275 %hei92 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv275, i32 7 store i32 0, ptr %hei92, align 8, !tbaa !13 %deg95 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv275, i32 5 %18 = load i32, ptr %deg95, align 4, !tbaa !11 %cmp96 = icmp eq i32 %18, 0 br i1 %cmp96, label %for.inc147, label %while.cond99 while.cond99: ; preds = %for.body89, %for.cond101.for.end141_crit_edge %cnt.1 = phi i32 [ %inc145, %for.cond101.for.end141_crit_edge ], [ 0, %for.body89 ] %sub = sub nsw i32 %spec.select.lcssa, %cnt.1 br label %if.end106 if.end106: ; preds = %while.cond99, %for.inc139 %indvars.iv272 = phi i64 [ 0, %while.cond99 ], [ %indvars.iv.next273, %for.inc139 ] %dep109 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv272, i32 4 %19 = load i32, ptr %dep109, align 8, !tbaa !12 %cmp110 = icmp eq i32 %19, %sub br i1 %cmp110, label %while.cond112.preheader, label %for.inc139 while.cond112.preheader: ; preds = %if.end106 %20 = load i32, ptr %arrayidx91, align 8, !tbaa !9 %par116252 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv272, i32 1 %21 = load i32, ptr %par116252, align 4, !tbaa !14 %cmp120.not253 = icmp eq i32 %21, %20 br i1 %cmp120.not253, label %for.inc147.loopexit, label %if.then121 if.then121: ; preds = %while.cond112.preheader, %if.end127 %22 = phi i32 [ %23, %if.end127 ], [ %21, %while.cond112.preheader ] %h_cnt.0254 = phi i32 [ %inc131, %if.end127 ], [ 1, %while.cond112.preheader ] %cmp125 = icmp eq i32 %22, -1 br i1 %cmp125, label %for.inc139, label %if.end127 if.end127: ; preds = %if.then121 %inc131 = add nuw nsw i32 %h_cnt.0254, 1 %idxprom114 = sext i32 %22 to i64 %par116 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %idxprom114, i32 1 %23 = load i32, ptr %par116, align 4, !tbaa !14 %cmp120.not = icmp eq i32 %23, %20 br i1 %cmp120.not, label %for.inc147.loopexit, label %if.then121 for.inc139: ; preds = %if.then121, %if.end106 %indvars.iv.next273 = add nuw nsw i64 %indvars.iv272, 1 %cmp102.not = icmp slt i64 %indvars.iv.next273, %14 br i1 %cmp102.not, label %if.end106, label %for.cond101.for.end141_crit_edge, !llvm.loop !22 for.cond101.for.end141_crit_edge: ; preds = %for.inc139 %inc145 = add nuw nsw i32 %cnt.1, 1 br label %while.cond99 for.inc147.loopexit: ; preds = %while.cond112.preheader, %if.end127 %h_cnt.0.lcssa = phi i32 [ %inc131, %if.end127 ], [ 1, %while.cond112.preheader ] store i32 %h_cnt.0.lcssa, ptr %hei92, align 8, !tbaa !13 br label %for.inc147 for.inc147: ; preds = %for.inc147.loopexit, %for.body89 %indvars.iv.next276 = add nuw nsw i64 %indvars.iv275, 1 %exitcond279.not = icmp eq i64 %indvars.iv.next276, %wide.trip.count278 br i1 %exitcond279.not, label %for.body152, label %for.body89, !llvm.loop !23 for.body152: ; preds = %for.inc147, %for.body152 %indvars.iv280 = phi i64 [ %indvars.iv.next281, %for.body152 ], [ 0, %for.inc147 ] %par155 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv280, i32 1 %24 = load i32, ptr %par155, align 4, !tbaa !14 %sib158 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv280, i32 3 %25 = load i32, ptr %sib158, align 4, !tbaa !17 %deg161 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv280, i32 5 %26 = load i32, ptr %deg161, align 4, !tbaa !11 %dep164 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv280, i32 4 %27 = load i32, ptr %dep164, align 8, !tbaa !12 %hei167 = getelementptr inbounds [25 x %struct.Nibun], ptr %data, i64 0, i64 %indvars.iv280, i32 7 %28 = load i32, ptr %hei167, align 8, !tbaa !13 %29 = trunc i64 %indvars.iv280 to i32 %call168 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %29, i32 noundef %24, i32 noundef %25, i32 noundef %26, i32 noundef %27, i32 noundef %28) %cmp172 = icmp eq i32 %26, 0 %cmp176.not = icmp eq i32 %24, -1 %str.6.str = select i1 %cmp172, ptr @str.6, ptr @str %str.6.sink = select i1 %cmp176.not, ptr @str.5, ptr %str.6.str %puts240 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %indvars.iv.next281 = add nuw nsw i64 %indvars.iv280, 1 %30 = load i32, ptr %n, align 4, !tbaa !5 %31 = sext i32 %30 to i64 %cmp151 = icmp slt i64 %indvars.iv.next281, %31 br i1 %cmp151, label %for.body152, label %for.end192, !llvm.loop !24 for.end192: ; preds = %for.body152, %entry, %for.cond47.preheader, %if.then54, %for.end64 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %degnum) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %data) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !7, i64 24, !6, i64 32, !6, i64 36} !11 = !{!10, !6, i64 20} !12 = !{!10, !6, i64 16} !13 = !{!10, !6, i64 32} !14 = !{!10, !6, i64 4} !15 = !{!10, !6, i64 36} !16 = !{!10, !6, i64 8} !17 = !{!10, !6, i64 12} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.mustprogress"} !20 = distinct !{!20, !19} !21 = distinct !{!21, !19} !22 = distinct !{!22, !19} !23 = distinct !{!23, !19} !24 = distinct !{!24, !19}
#include<stdio.h> #include<string.h> #define max 100000 typedef long long ll; char arr[max]; int main(){ ll n,b,i,a,flag; scanf("%I64d",&n); flag=0; for(i=0;i<n;i++){ scanf("%10s",arr); scanf("%I64d%*c%I64d",&b,&a); if(b>=2400){ if(a>b){ flag=1; } } } if(flag==1){ printf("YES\n"); } else{ printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23805/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23805/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%10s\00", align 1 @arr = dso_local global [100000 x i8] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [14 x i8] c"%I64d%*c%I64d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %b = alloca i64, align 8 %a = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp14 = icmp sgt i64 %0, 0 br i1 %cmp14, label %for.body, label %if.else for.body: ; preds = %entry, %for.body %flag.016 = phi i64 [ %flag.1, %for.body ], [ 0, %entry ] %i.015 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @arr) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %b, ptr noundef nonnull %a) %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp3 = icmp sgt i64 %1, 2399 %2 = load i64, ptr %a, align 8 %cmp4 = icmp sgt i64 %2, %1 %or.cond = select i1 %cmp3, i1 %cmp4, i1 false %flag.1 = select i1 %or.cond, i64 1, i64 %flag.016 %inc = add nuw nsw i64 %i.015, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %4 = icmp eq i64 %flag.1, 1 br i1 %4, label %if.end11, label %if.else if.else: ; preds = %entry, %for.end br label %if.end11 if.end11: ; preds = %for.end, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.5, %for.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define null -1 int sibling(int); int degree(int); int Height(int); int depth(int); void print(int); typedef struct{ int parent,left,right; }node; node tree[25]; int height[25]; int main(){ int i,j; int n; int id; scanf("%d",&n); for(i=0;i<n;i++){ tree[i].parent=tree[i].right=tree[i].left=null; } for(i=0;i<n;i++) { scanf("%d",&id); scanf("%d%d",&tree[id].left,&tree[id].right); tree[tree[id].left].parent=id; tree[tree[id].right].parent=id; } for(i=0;i<n;i++) print(i); return 0; } int degree(int i){ int count=0; if(tree[i].left!=null) count++; if(tree[i].right!=null) count++; return count; } int sibling(int i){ if(tree[i].parent==null) return null; else { if(tree[tree[i].parent].left==i) return tree[tree[i].parent].right; if(tree[tree[i].parent].right==i) return tree[tree[i].parent].left; } } int depth(int i){ int dep=0; while(tree[i].parent!=null){ i=tree[i].parent; dep++; } return dep; } int Height(int i){ int h1=0; int h2=0; if(tree[i].left!=null) h1=Height(tree[i].left)+1; if(tree[i].right!=null) h2=Height(tree[i].right)+1; if(h1>h2)height[i]=h1; else height[i]=h2; return height[i]; } void print(int i){ printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,tree[i].parent,sibling(i),degree(i),depth(i),Height(i)); if(tree[i].parent==null) printf("root\n"); else if(tree[i].left==null&&tree[i].right==null) printf("leaf\n"); else printf("internal node\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238093/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node = type { i32, i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @tree = dso_local global [25 x %struct.node] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @height = dso_local local_unnamed_addr global [25 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %id = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp46 = icmp sgt i32 %0, 0 br i1 %cmp46, label %for.body7.preheader, label %for.end36 for.body7.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = mul nuw nsw i64 %1, 12 call void @llvm.memset.p0.i64(ptr nonnull align 16 @tree, i8 -1, i64 %2, i1 false), !tbaa !5 br label %for.body7 for.cond31.preheader: ; preds = %for.body7 %3 = icmp sgt i32 %8, 0 br i1 %3, label %for.body33, label %for.end36 for.body7: ; preds = %for.body7.preheader, %for.body7 %i.149 = phi i32 [ %inc29, %for.body7 ], [ 0, %for.body7.preheader ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %id) %4 = load i32, ptr %id, align 4, !tbaa !5 %idxprom9 = sext i32 %4 to i64 %left11 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom9, i32 1 %right14 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom9, i32 2 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %left11, ptr noundef nonnull %right14) %5 = load i32, ptr %id, align 4, !tbaa !5 %idxprom16 = sext i32 %5 to i64 %left18 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom16, i32 1 %6 = load i32, ptr %left18, align 4, !tbaa !9 %idxprom19 = sext i32 %6 to i64 %arrayidx20 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom19 store i32 %5, ptr %arrayidx20, align 4, !tbaa !11 %right24 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom16, i32 2 %7 = load i32, ptr %right24, align 4, !tbaa !12 %idxprom25 = sext i32 %7 to i64 %arrayidx26 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom25 store i32 %5, ptr %arrayidx26, align 4, !tbaa !11 %inc29 = add nuw nsw i32 %i.149, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc29, %8 br i1 %cmp6, label %for.body7, label %for.cond31.preheader, !llvm.loop !13 for.body33: ; preds = %for.cond31.preheader, %for.body33 %i.251 = phi i32 [ %inc35, %for.body33 ], [ 0, %for.cond31.preheader ] call void @print(i32 noundef %i.251) %inc35 = add nuw nsw i32 %i.251, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp slt i32 %inc35, %9 br i1 %cmp32, label %for.body33, label %for.end36, !llvm.loop !15 for.end36: ; preds = %for.body33, %entry, %for.cond31.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %i) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp.i = icmp eq i32 %0, -1 br i1 %cmp.i, label %sibling.exit, label %if.else.i if.else.i: ; preds = %entry %idxprom4.i = sext i32 %0 to i64 %left.i = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom4.i, i32 1 %1 = load i32, ptr %left.i, align 4, !tbaa !9 %cmp6.i = icmp eq i32 %1, %i br i1 %cmp6.i, label %if.then7.i, label %sibling.exit if.then7.i: ; preds = %if.else.i %right.i = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom4.i, i32 2 %2 = load i32, ptr %right.i, align 4, !tbaa !12 br label %sibling.exit sibling.exit: ; preds = %entry, %if.else.i, %if.then7.i %retval.0.i = phi i32 [ %2, %if.then7.i ], [ -1, %entry ], [ %1, %if.else.i ] %left.i31 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 1 %3 = load i32, ptr %left.i31, align 4, !tbaa !9 %cmp.not.i = icmp ne i32 %3, -1 %right.i32 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 2 %4 = load i32, ptr %right.i32, align 4, !tbaa !12 %inc5.i = select i1 %cmp.not.i, i32 2, i32 1 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %sibling.exit %i.addr.0.i = phi i32 [ %i, %sibling.exit ], [ %5, %while.cond.i ] %dep.0.i = phi i32 [ 0, %sibling.exit ], [ %inc.i, %while.cond.i ] %idxprom.i33 = sext i32 %i.addr.0.i to i64 %arrayidx.i34 = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom.i33 %5 = load i32, ptr %arrayidx.i34, align 4, !tbaa !11 %cmp.not.i35 = icmp eq i32 %5, -1 %inc.i = add nuw nsw i32 %dep.0.i, 1 br i1 %cmp.not.i35, label %depth.exit, label %while.cond.i, !llvm.loop !16 depth.exit: ; preds = %while.cond.i %spec.select.i = zext i1 %cmp.not.i to i32 %cmp3.not.i = icmp eq i32 %4, -1 %count.1.i = select i1 %cmp3.not.i, i32 %spec.select.i, i32 %inc5.i %call3 = tail call i32 @Height(i32 noundef %i) %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i, i32 noundef %0, i32 noundef %retval.0.i, i32 noundef %count.1.i, i32 noundef %dep.0.i, i32 noundef %call3) %6 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp = icmp eq i32 %6, -1 br i1 %cmp, label %if.end19, label %if.else if.else: ; preds = %depth.exit %7 = load i32, ptr %left.i31, align 4, !tbaa !9 %cmp11 = icmp eq i32 %7, -1 br i1 %cmp11, label %land.lhs.true, label %if.else17 land.lhs.true: ; preds = %if.else %8 = load i32, ptr %right.i32, align 4, !tbaa !12 %cmp14 = icmp eq i32 %8, -1 br i1 %cmp14, label %if.end19, label %if.else17 if.else17: ; preds = %land.lhs.true, %if.else br label %if.end19 if.end19: ; preds = %land.lhs.true, %depth.exit, %if.else17 %str.6.sink = phi ptr [ @str, %if.else17 ], [ @str.7, %depth.exit ], [ @str.6, %land.lhs.true ] %puts28 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @degree(i32 noundef %i) local_unnamed_addr #3 { entry: %idxprom = sext i32 %i to i64 %left = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !9 %cmp.not = icmp ne i32 %0, -1 %spec.select = zext i1 %cmp.not to i32 %right = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !12 %cmp3.not = icmp eq i32 %1, -1 %inc5 = select i1 %cmp.not, i32 2, i32 1 %count.1 = select i1 %cmp3.not, i32 %spec.select, i32 %inc5 ret i32 %count.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @sibling(i32 noundef %i) local_unnamed_addr #3 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %if.end28, label %if.else if.else: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %left = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom4, i32 1 %1 = load i32, ptr %left, align 4, !tbaa !9 %cmp6 = icmp eq i32 %1, %i br i1 %cmp6, label %if.then7, label %if.end28 if.then7: ; preds = %if.else %right = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom4, i32 2 %2 = load i32, ptr %right, align 4, !tbaa !12 br label %if.end28 if.end28: ; preds = %if.else, %entry, %if.then7 %retval.0 = phi i32 [ %2, %if.then7 ], [ -1, %entry ], [ %1, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %i) local_unnamed_addr #4 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %i.addr.0 = phi i32 [ %i, %entry ], [ %0, %while.cond ] %dep.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %idxprom = sext i32 %i.addr.0 to i64 %arrayidx = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp.not = icmp eq i32 %0, -1 %inc = add nuw nsw i32 %dep.0, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !16 while.end: ; preds = %while.cond ret i32 %dep.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Height(i32 noundef %i) local_unnamed_addr #5 { entry: %idxprom = sext i32 %i to i64 %left = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 1 %0 = load i32, ptr %left, align 4, !tbaa !9 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @Height(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [25 x %struct.node], ptr @tree, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %right, align 4, !tbaa !12 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @Height(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %h2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %spec.select = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %2 = getelementptr inbounds [25 x i32], ptr @height, i64 0, i64 %idxprom store i32 %spec.select, ptr %2, align 4 ret i32 %spec.select } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 nounwind } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!10, !6, i64 0} !12 = !{!10, !6, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14}
#include <stdio.h> #define MAX 100001 #define max(a,b) ((a) < (b) ? (b) : (a)) int par[MAX],sib[MAX],deg[MAX]; int height[MAX],dep[MAX]; void init(int); int depth(int,int); int main(){ int n,i,id,l,r; scanf("%d" ,&n); init(n); for(i = 0 ; i < n ; i++){ scanf("%d%d%d" ,&id ,&l ,&r); if(l != -1){ par[l] = id; deg[id]++; } if(r != -1){ par[r] = id; deg[id]++; } if(l != -1 && r != -1){ sib[l] = r; sib[r] = l; } } for(i = 0 ; i < n ; i++){ dep[i] = depth(i,0); } for(i = 0 ; i < n ; i++){ printf("node %d: parent = %d, sibling = %d, " ,i, par[i], sib[i]); printf("degree = %d, depth = %d, height = %d, " , deg[i], dep[i], height[i]); if(par[i] == -1){ printf("root\n"); }else if(deg[i] != 0){ printf("internal node\n"); }else{ printf("leaf\n"); } } return 0; } void init(int n){ int i; for(i = 0 ; i < n ; i++){ par[i] = sib[i] = -1; deg[i] = height[i] = 0; } } int depth(int x,int dep){ height[x] = max(height[x],dep); if(par[x] == -1){ return dep; }else{ return depth(par[x],dep+1); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238136/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238136/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @par = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @deg = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @sib = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @dep = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [37 x i8] c"node %d: parent = %d, sibling = %d, \00", align 1 @.str.3 = private unnamed_addr constant [39 x i8] c"degree = %d, depth = %d, height = %d, \00", align 1 @height = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @str = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.8 = private unnamed_addr constant [5 x i8] c"root\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %id = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp12.i = icmp sgt i32 %0, 0 br i1 %cmp12.i, label %for.body.preheader, label %for.end62 for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @sib, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 @par, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 @height, i8 0, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 @deg, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body for.cond22.preheader: ; preds = %for.inc %cmp2388 = icmp sgt i32 %9, 0 br i1 %cmp2388, label %tailrecurse.i.preheader.preheader, label %for.end62 tailrecurse.i.preheader.preheader: ; preds = %for.cond22.preheader %wide.trip.count = zext i32 %9 to i64 br label %tailrecurse.i.preheader for.body: ; preds = %for.body.preheader, %for.inc %i.087 = phi i32 [ %inc21, %for.inc ], [ 0, %for.body.preheader ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %l, ptr noundef nonnull %r) %3 = load i32, ptr %l, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %3, -1 br i1 %cmp2.not, label %if.end, label %if.then if.then: ; preds = %for.body %4 = load i32, ptr %id, align 4, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom store i32 %4, ptr %arrayidx, align 4, !tbaa !5 %idxprom3 = sext i32 %4 to i64 %arrayidx4 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %idxprom3 %5 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %inc = add nsw i32 %5, 1 store i32 %inc, ptr %arrayidx4, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body %6 = load i32, ptr %r, align 4 %cmp5.not = icmp eq i32 %6, -1 br i1 %cmp5.not, label %for.inc, label %if.end12 if.end12: ; preds = %if.end %7 = load i32, ptr %id, align 4, !tbaa !5 %idxprom7 = sext i32 %6 to i64 %arrayidx8 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom7 store i32 %7, ptr %arrayidx8, align 4, !tbaa !5 %idxprom9 = sext i32 %7 to i64 %arrayidx10 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %idxprom9 %8 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %inc11 = add nsw i32 %8, 1 store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5 br i1 %cmp2.not, label %for.inc, label %if.then15 if.then15: ; preds = %if.end12 %idxprom16 = sext i32 %3 to i64 %arrayidx17 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %idxprom16 store i32 %6, ptr %arrayidx17, align 4, !tbaa !5 %arrayidx19 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %idxprom7 store i32 %3, ptr %arrayidx19, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.end12, %if.then15 %inc21 = add nuw nsw i32 %i.087, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc21, %9 br i1 %cmp, label %for.body, label %for.cond22.preheader, !llvm.loop !9 tailrecurse.i.preheader: ; preds = %tailrecurse.i.preheader.preheader, %depth.exit %indvars.iv = phi i64 [ 0, %tailrecurse.i.preheader.preheader ], [ %indvars.iv.next, %depth.exit ] %10 = trunc i64 %indvars.iv to i32 br label %tailrecurse.i for.cond31.preheader: ; preds = %depth.exit br i1 %cmp2388, label %for.body33, label %for.end62 tailrecurse.i: ; preds = %tailrecurse.i.preheader, %tailrecurse.i %x.tr.i = phi i32 [ %12, %tailrecurse.i ], [ %10, %tailrecurse.i.preheader ] %dep.tr.i = phi i32 [ %add.i, %tailrecurse.i ], [ 0, %tailrecurse.i.preheader ] %idxprom.i = sext i32 %x.tr.i to i64 %arrayidx.i = getelementptr inbounds [100001 x i32], ptr @height, i64 0, i64 %idxprom.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %dep..i = call i32 @llvm.smax.i32(i32 %11, i32 %dep.tr.i) store i32 %dep..i, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx6.i = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom.i %12 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %cmp7.i = icmp eq i32 %12, -1 %add.i = add nuw nsw i32 %dep.tr.i, 1 br i1 %cmp7.i, label %depth.exit, label %tailrecurse.i depth.exit: ; preds = %tailrecurse.i %arrayidx27 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %indvars.iv store i32 %dep.tr.i, ptr %arrayidx27, align 4, !tbaa !5 %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.cond31.preheader, label %tailrecurse.i.preheader, !llvm.loop !11 for.body33: ; preds = %for.cond31.preheader, %for.inc60 %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.inc60 ], [ 0, %for.cond31.preheader ] %arrayidx35 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %indvars.iv94 %13 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %arrayidx37 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %indvars.iv94 %14 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %15 = trunc i64 %indvars.iv94 to i32 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15, i32 noundef %13, i32 noundef %14) %arrayidx40 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %indvars.iv94 %16 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %arrayidx42 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %indvars.iv94 %17 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %arrayidx44 = getelementptr inbounds [100001 x i32], ptr @height, i64 0, i64 %indvars.iv94 %18 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %16, i32 noundef %17, i32 noundef %18) %19 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %cmp48 = icmp eq i32 %19, -1 br i1 %cmp48, label %for.inc60, label %if.else if.else: ; preds = %for.body33 %20 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp53.not = icmp eq i32 %20, 0 %str.str.7 = select i1 %cmp53.not, ptr @str, ptr @str.7 br label %for.inc60 for.inc60: ; preds = %if.else, %for.body33 %str.8.sink = phi ptr [ @str.8, %for.body33 ], [ %str.str.7, %if.else ] %puts82 = call i32 @puts(ptr nonnull dereferenceable(1) %str.8.sink) %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp32 = icmp slt i64 %indvars.iv.next95, %22 br i1 %cmp32, label %for.body33, label %for.end62, !llvm.loop !12 for.end62: ; preds = %for.inc60, %entry, %for.cond22.preheader, %for.cond31.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @init(i32 noundef %n) local_unnamed_addr #3 { entry: %cmp12 = icmp sgt i32 %n, 0 br i1 %cmp12, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = zext i32 %n to i64 %1 = shl nuw nsw i64 %0, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @sib, i8 -1, i64 %1, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @par, i8 -1, i64 %1, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @height, i8 0, i64 %1, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @deg, i8 0, i64 %1, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %x, i32 noundef %dep) local_unnamed_addr #4 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %x.tr = phi i32 [ %x, %entry ], [ %1, %tailrecurse ] %dep.tr = phi i32 [ %dep, %entry ], [ %add, %tailrecurse ] %idxprom = sext i32 %x.tr to i64 %arrayidx = getelementptr inbounds [100001 x i32], ptr @height, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %dep. = tail call i32 @llvm.smax.i32(i32 %0, i32 %dep.tr) store i32 %dep., ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %1, -1 %add = add nsw i32 %dep.tr, 1 br i1 %cmp7, label %return, label %tailrecurse return: ; preds = %tailrecurse ret i32 %dep.tr } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(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 #4 = { 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 #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<stdlib.h> #define MAX 25 #define NIL -1 struct Node_struct{int p,right,left,s;}; typedef struct Node_struct Node; Node T[MAX]; int D[MAX],H[MAX]; int getSibling(int u){ if(T[u].p == NIL){ return NIL; } if(T[T[u].p].left != u && T[T[u].p].left != NIL){ return T[T[u].p].left; } if(T[T[u].p].right != u && T[T[u].p].right != NIL){ return T[T[u].p].right; } return NIL; } int setHeight(int u){ int h1=0,h2=0; if(T[u].left != NIL){ h1 = setHeight(T[u].left) + 1; } if(T[u].right != NIL){ h2 = setHeight(T[u].right) +1; } if(h1>h2){ H[u]=h1; }else{ H[u]=h2; } return H[u]; } void calcDepth(int u, int p){ D[u] = p; if(T[u].left!=NIL) calcDepth(T[u].left,p+1); if(T[u].right!=NIL) calcDepth(T[u].right,p+1); } void print(int u){ int deg=0; printf("node %d: parent = %d, ", u, T[u].p); printf("sibling = %d, ",getSibling(u)); if(T[u].left != NIL){ deg++; } if(T[u].right != NIL){ deg++; } printf("degree = %d, ",deg); printf("depth = %d, ",D[u]); printf("height = %d, ",setHeight(u)); if(T[u].p==NIL) printf("root"); else if(T[u].left==T[u].right && T[u].left==NIL) printf("leaf"); else printf("internal node"); printf("\n"); } int main(){ int i; int n; int id; int root = NIL; scanf("%d", &n); for(i=0; i<n; i++) T[i].p = T[i].right = T[i].left = NIL; for(i=0; i<n; i++){ if(i==0){ T[0].p=NIL; } scanf("%d", &id); scanf("%d %d", &T[id].left,&T[id].right); T[T[id].right].p = T[T[id].left].p = id; T[T[id].right].s = T[id].right; T[T[id].left].s = T[id].left; } //根を求める (find the root) for(i=0; i<n; i++){ if(T[i].p == -1) root = i; } //それぞれのノードの深さを求める (find depth of each node) calcDepth(root, 0); //出力 (output) for(i=0; i<n; i++) print(i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238187/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238187/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Node_struct = type { i32, i32, i32, i32 } @T = dso_local global [25 x %struct.Node_struct] zeroinitializer, align 16 @H = dso_local local_unnamed_addr global [25 x i32] zeroinitializer, align 16 @D = dso_local local_unnamed_addr global [25 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [23 x i8] c"node %d: parent = %d, \00", align 1 @.str.1 = private unnamed_addr constant [15 x i8] c"sibling = %d, \00", align 1 @.str.2 = private unnamed_addr constant [14 x i8] c"degree = %d, \00", align 1 @.str.3 = private unnamed_addr constant [13 x i8] c"depth = %d, \00", align 1 @.str.4 = private unnamed_addr constant [14 x i8] c"height = %d, \00", align 1 @.str.5 = private unnamed_addr constant [5 x i8] c"root\00", align 1 @.str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @.str.7 = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @.str.9 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.10 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getSibling(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 16, !tbaa !5 %cmp = icmp eq i32 %0, -1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom4 = sext i32 %0 to i64 %left = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom4, i32 2 %1 = load i32, ptr %left, align 8, !tbaa !10 %cmp6.not = icmp eq i32 %1, %u %cmp13.not = icmp eq i32 %1, -1 %or.cond = or i1 %cmp6.not, %cmp13.not br i1 %or.cond, label %if.end21, label %return if.end21: ; preds = %if.end %right = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom4, i32 1 %2 = load i32, ptr %right, align 4, !tbaa !11 %cmp27.not = icmp eq i32 %2, %u %cmp35.not = icmp eq i32 %2, -1 %or.cond54 = or i1 %cmp27.not, %cmp35.not %spec.select = select i1 %or.cond54, i32 -1, i32 %2 br label %return return: ; preds = %if.end21, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %1, %if.end ], [ %spec.select, %if.end21 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @setHeight(i32 noundef %u) local_unnamed_addr #1 { entry: %idxprom = sext i32 %u to i64 %left = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %left, align 8, !tbaa !10 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %call = tail call i32 @setHeight(i32 noundef %0) %add = add nsw i32 %call, 1 br label %if.end if.end: ; preds = %if.then, %entry %h1.0 = phi i32 [ %add, %if.then ], [ 0, %entry ] %right = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %right, align 4, !tbaa !11 %cmp6.not = icmp eq i32 %1, -1 br i1 %cmp6.not, label %if.end13, label %if.then7 if.then7: ; preds = %if.end %call11 = tail call i32 @setHeight(i32 noundef %1) %add12 = add nsw i32 %call11, 1 br label %if.end13 if.end13: ; preds = %if.then7, %if.end %h2.0 = phi i32 [ %add12, %if.then7 ], [ 0, %if.end ] %spec.select = tail call i32 @llvm.smax.i32(i32 %h1.0, i32 %h2.0) %2 = getelementptr inbounds [25 x i32], ptr @H, i64 0, i64 %idxprom store i32 %spec.select, ptr %2, align 4 ret i32 %spec.select } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @calcDepth(i32 noundef %u, i32 noundef %p) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end, %entry %u.tr = phi i32 [ %u, %entry ], [ %1, %if.end ] %p.tr = phi i32 [ %p, %entry ], [ %.pre, %if.end ] %idxprom = sext i32 %u.tr to i64 %arrayidx = getelementptr inbounds [25 x i32], ptr @D, i64 0, i64 %idxprom store i32 %p.tr, ptr %arrayidx, align 4, !tbaa !12 %left = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %left, align 8, !tbaa !10 %cmp.not = icmp eq i32 %0, -1 %.pre = add nsw i32 %p.tr, 1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %tailrecurse tail call void @calcDepth(i32 noundef %0, i32 noundef %.pre) br label %if.end if.end: ; preds = %tailrecurse, %if.then %right = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %right, align 4, !tbaa !11 %cmp8.not = icmp eq i32 %1, -1 br i1 %cmp8.not, label %if.end14, label %tailrecurse if.end14: ; preds = %if.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 16, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %u, i32 noundef %0) %1 = load i32, ptr %arrayidx, align 16, !tbaa !5 %cmp.i = icmp eq i32 %1, -1 br i1 %cmp.i, label %getSibling.exit, label %if.end.i if.end.i: ; preds = %entry %idxprom4.i = sext i32 %1 to i64 %left.i = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom4.i, i32 2 %2 = load i32, ptr %left.i, align 8, !tbaa !10 %cmp6.not.i = icmp eq i32 %2, %u %cmp13.not.i = icmp eq i32 %2, -1 %or.cond.i = or i1 %cmp6.not.i, %cmp13.not.i br i1 %or.cond.i, label %if.end21.i, label %getSibling.exit if.end21.i: ; preds = %if.end.i %right.i = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom4.i, i32 1 %3 = load i32, ptr %right.i, align 4, !tbaa !11 %cmp27.not.i = icmp eq i32 %3, %u %cmp35.not.i = icmp eq i32 %3, -1 %or.cond54.i = or i1 %cmp27.not.i, %cmp35.not.i %spec.select.i = select i1 %or.cond54.i, i32 -1, i32 %3 br label %getSibling.exit getSibling.exit: ; preds = %entry, %if.end.i, %if.end21.i %retval.0.i = phi i32 [ -1, %entry ], [ %2, %if.end.i ], [ %spec.select.i, %if.end21.i ] %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i) %left = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 2 %4 = load i32, ptr %left, align 8, !tbaa !10 %cmp.not = icmp ne i32 %4, -1 %spec.select = zext i1 %cmp.not to i32 %right = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom, i32 1 %5 = load i32, ptr %right, align 4, !tbaa !11 %cmp7.not = icmp eq i32 %5, -1 %inc9 = select i1 %cmp.not, i32 2, i32 1 %deg.1 = select i1 %cmp7.not, i32 %spec.select, i32 %inc9 %call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %deg.1) %arrayidx13 = getelementptr inbounds [25 x i32], ptr @D, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx13, align 4, !tbaa !12 %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %6) %call15 = tail call i32 @setHeight(i32 noundef %u) %call16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %call15) %7 = load i32, ptr %arrayidx, align 16, !tbaa !5 %cmp20 = icmp eq i32 %7, -1 br i1 %cmp20, label %if.end39, label %if.else if.else: ; preds = %getSibling.exit %8 = load i32, ptr %left, align 8, !tbaa !10 %9 = load i32, ptr %right, align 4, !tbaa !11 %10 = and i32 %9, %8 %or.cond = icmp eq i32 %10, -1 %.str.6..str.7 = select i1 %or.cond, ptr @.str.6, ptr @.str.7 br label %if.end39 if.end39: ; preds = %if.else, %getSibling.exit %.str.6.sink = phi ptr [ @.str.5, %getSibling.exit ], [ %.str.6..str.7, %if.else ] %call35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.6.sink) %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %id = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !12 %cmp81 = icmp sgt i32 %0, 0 br i1 %cmp81, label %for.body.preheader, label %for.end60 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.cond5.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond5.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond5.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond5.preheader.unr-lcssa %arrayidx.epil = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.unr %left.epil = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.unr, i32 2 store i32 -1, ptr %left.epil, align 8, !tbaa !10 %right.epil = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.unr, i32 1 store i32 -1, ptr %right.epil, align 4, !tbaa !11 store i32 -1, ptr %arrayidx.epil, align 16, !tbaa !5 br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond5.preheader.unr-lcssa, %for.body.epil br i1 %cmp81, label %if.end.peel, label %for.end60 if.end.peel: ; preds = %for.cond5.preheader store i32 -1, ptr @T, align 16, !tbaa !5 %call9.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %id) %2 = load i32, ptr %id, align 4, !tbaa !12 %idxprom10.peel = sext i32 %2 to i64 %left12.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom10.peel, i32 2 %right15.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom10.peel, i32 1 %call16.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %left12.peel, ptr noundef nonnull %right15.peel) %3 = load i32, ptr %id, align 4, !tbaa !12 %idxprom17.peel = sext i32 %3 to i64 %left19.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom17.peel, i32 2 %4 = load i32, ptr %left19.peel, align 8, !tbaa !10 %idxprom20.peel = sext i32 %4 to i64 %arrayidx21.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom20.peel store i32 %3, ptr %arrayidx21.peel, align 16, !tbaa !5 %right25.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom17.peel, i32 1 %5 = load i32, ptr %right25.peel, align 4, !tbaa !11 %idxprom26.peel = sext i32 %5 to i64 %arrayidx27.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom26.peel store i32 %3, ptr %arrayidx27.peel, align 16, !tbaa !5 %s.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom26.peel, i32 3 store i32 %5, ptr %s.peel, align 4, !tbaa !13 %s45.peel = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom20.peel, i32 3 store i32 %4, ptr %s45.peel, align 4, !tbaa !13 %6 = load i32, ptr %n, align 4, !tbaa !12 %cmp6.peel = icmp sgt i32 %6, 1 br i1 %cmp6.peel, label %if.end, label %for.cond49.preheader for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv %left = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv, i32 2 store i32 -1, ptr %left, align 8, !tbaa !10 %right = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv, i32 1 store i32 -1, ptr %right, align 4, !tbaa !11 store i32 -1, ptr %arrayidx, align 16, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next %left.1 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next, i32 2 store i32 -1, ptr %left.1, align 8, !tbaa !10 %right.1 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next, i32 1 store i32 -1, ptr %right.1, align 4, !tbaa !11 store i32 -1, ptr %arrayidx.1, align 16, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond5.preheader.unr-lcssa, label %for.body, !llvm.loop !14 for.cond49.preheader: ; preds = %if.end, %if.end.peel %.lcssa = phi i32 [ %6, %if.end.peel ], [ %12, %if.end ] %cmp5085 = icmp sgt i32 %.lcssa, 0 br i1 %cmp5085, label %for.body51.preheader, label %for.end60 for.body51.preheader: ; preds = %for.cond49.preheader %wide.trip.count97 = zext i32 %.lcssa to i64 %xtraiter104 = and i64 %wide.trip.count97, 3 %7 = icmp ult i32 %.lcssa, 4 br i1 %7, label %for.end60.loopexit.unr-lcssa, label %for.body51.preheader.new for.body51.preheader.new: ; preds = %for.body51.preheader %unroll_iter107 = and i64 %wide.trip.count97, 4294967292 br label %for.body51 if.end: ; preds = %if.end.peel, %if.end %i.184 = phi i32 [ %inc47, %if.end ], [ 1, %if.end.peel ] %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %id) %8 = load i32, ptr %id, align 4, !tbaa !12 %idxprom10 = sext i32 %8 to i64 %left12 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom10, i32 2 %right15 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom10, i32 1 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %left12, ptr noundef nonnull %right15) %9 = load i32, ptr %id, align 4, !tbaa !12 %idxprom17 = sext i32 %9 to i64 %left19 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom17, i32 2 %10 = load i32, ptr %left19, align 8, !tbaa !10 %idxprom20 = sext i32 %10 to i64 %arrayidx21 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom20 store i32 %9, ptr %arrayidx21, align 16, !tbaa !5 %right25 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom17, i32 1 %11 = load i32, ptr %right25, align 4, !tbaa !11 %idxprom26 = sext i32 %11 to i64 %arrayidx27 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom26 store i32 %9, ptr %arrayidx27, align 16, !tbaa !5 %s = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom26, i32 3 store i32 %11, ptr %s, align 4, !tbaa !13 %s45 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %idxprom20, i32 3 store i32 %10, ptr %s45, align 4, !tbaa !13 %inc47 = add nuw nsw i32 %i.184, 1 %12 = load i32, ptr %n, align 4, !tbaa !12 %cmp6 = icmp slt i32 %inc47, %12 br i1 %cmp6, label %if.end, label %for.cond49.preheader, !llvm.loop !16 for.body51: ; preds = %for.body51, %for.body51.preheader.new %indvars.iv94 = phi i64 [ 0, %for.body51.preheader.new ], [ %indvars.iv.next95.3, %for.body51 ] %root.087 = phi i32 [ -1, %for.body51.preheader.new ], [ %spec.select.3, %for.body51 ] %niter108 = phi i64 [ 0, %for.body51.preheader.new ], [ %niter108.next.3, %for.body51 ] %arrayidx53 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv94 %13 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %cmp55 = icmp eq i32 %13, -1 %14 = trunc i64 %indvars.iv94 to i32 %spec.select = select i1 %cmp55, i32 %14, i32 %root.087 %indvars.iv.next95 = or i64 %indvars.iv94, 1 %arrayidx53.1 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next95 %15 = load i32, ptr %arrayidx53.1, align 16, !tbaa !5 %cmp55.1 = icmp eq i32 %15, -1 %16 = trunc i64 %indvars.iv.next95 to i32 %spec.select.1 = select i1 %cmp55.1, i32 %16, i32 %spec.select %indvars.iv.next95.1 = or i64 %indvars.iv94, 2 %arrayidx53.2 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next95.1 %17 = load i32, ptr %arrayidx53.2, align 16, !tbaa !5 %cmp55.2 = icmp eq i32 %17, -1 %18 = trunc i64 %indvars.iv.next95.1 to i32 %spec.select.2 = select i1 %cmp55.2, i32 %18, i32 %spec.select.1 %indvars.iv.next95.2 = or i64 %indvars.iv94, 3 %arrayidx53.3 = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv.next95.2 %19 = load i32, ptr %arrayidx53.3, align 16, !tbaa !5 %cmp55.3 = icmp eq i32 %19, -1 %20 = trunc i64 %indvars.iv.next95.2 to i32 %spec.select.3 = select i1 %cmp55.3, i32 %20, i32 %spec.select.2 %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94, 4 %niter108.next.3 = add i64 %niter108, 4 %niter108.ncmp.3 = icmp eq i64 %niter108.next.3, %unroll_iter107 br i1 %niter108.ncmp.3, label %for.end60.loopexit.unr-lcssa, label %for.body51, !llvm.loop !18 for.end60.loopexit.unr-lcssa: ; preds = %for.body51, %for.body51.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body51.preheader ], [ %spec.select.3, %for.body51 ] %indvars.iv94.unr = phi i64 [ 0, %for.body51.preheader ], [ %indvars.iv.next95.3, %for.body51 ] %root.087.unr = phi i32 [ -1, %for.body51.preheader ], [ %spec.select.3, %for.body51 ] %lcmp.mod105.not = icmp eq i64 %xtraiter104, 0 br i1 %lcmp.mod105.not, label %for.end60, label %for.body51.epil for.body51.epil: ; preds = %for.end60.loopexit.unr-lcssa, %for.body51.epil %indvars.iv94.epil = phi i64 [ %indvars.iv.next95.epil, %for.body51.epil ], [ %indvars.iv94.unr, %for.end60.loopexit.unr-lcssa ] %root.087.epil = phi i32 [ %spec.select.epil, %for.body51.epil ], [ %root.087.unr, %for.end60.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body51.epil ], [ 0, %for.end60.loopexit.unr-lcssa ] %arrayidx53.epil = getelementptr inbounds [25 x %struct.Node_struct], ptr @T, i64 0, i64 %indvars.iv94.epil %21 = load i32, ptr %arrayidx53.epil, align 16, !tbaa !5 %cmp55.epil = icmp eq i32 %21, -1 %22 = trunc i64 %indvars.iv94.epil to i32 %spec.select.epil = select i1 %cmp55.epil, i32 %22, i32 %root.087.epil %indvars.iv.next95.epil = add nuw nsw i64 %indvars.iv94.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter104 br i1 %epil.iter.cmp.not, label %for.end60, label %for.body51.epil, !llvm.loop !19 for.end60: ; preds = %for.end60.loopexit.unr-lcssa, %for.body51.epil, %entry, %for.cond5.preheader, %for.cond49.preheader %root.0.lcssa = phi i32 [ -1, %for.cond49.preheader ], [ -1, %for.cond5.preheader ], [ -1, %entry ], [ %spec.select.lcssa.ph, %for.end60.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body51.epil ] call void @calcDepth(i32 noundef %root.0.lcssa, i32 noundef 0) %23 = load i32, ptr %n, align 4, !tbaa !12 %cmp6289 = icmp sgt i32 %23, 0 br i1 %cmp6289, label %for.body63, label %for.end66 for.body63: ; preds = %for.end60, %for.body63 %i.390 = phi i32 [ %inc65, %for.body63 ], [ 0, %for.end60 ] call void @print(i32 noundef %i.390) %inc65 = add nuw nsw i32 %i.390, 1 %24 = load i32, ptr %n, align 4, !tbaa !12 %cmp62 = icmp slt i32 %inc65, %24 br i1 %cmp62, label %for.body63, label %for.end66, !llvm.loop !21 for.end66: ; preds = %for.body63, %for.end60 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: 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(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree 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 nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } 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, !7, i64 0} !6 = !{!"Node_struct", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 8} !11 = !{!6, !7, i64 4} !12 = !{!7, !7, i64 0} !13 = !{!6, !7, i64 12} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = distinct !{!16, !15, !17} !17 = !{!"llvm.loop.peeled.count", i32 1} !18 = distinct !{!18, !15} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !15}
#include<stdio.h> int par[100001]; int sib[100001]; int deg[100001]; int n; int depth(int); int height(int); int main(int argc,char *argv[]) { int i,j; scanf("%d", &n); for(i = 0; i < n; ++i) { par[i] = -1; sib[i] = -1; deg[i] = 0; } for(i = 0; i < n; ++i) { int id, left, right; scanf("%d %d %d", &id, &left, &right); if(left != -1) { par[left] = id; sib[left] = right; deg[id]++; } if(right != -1) { par[right] = id; sib[right] = left; deg[id]++; } } for(i = 0; i < n; ++i) { int dep = depth(i); printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ", i, par[i], sib[i], deg[i], dep, height(i)); if(dep == 0) { printf("root\n"); } else if(deg[i] == 0) { printf("leaf\n"); } else { printf("internal node\n"); } } return 0; } int depth(int i) { if(par[i] == -1) return 0; return depth(par[i]) + 1; } int height(int i) { int j, h = 0;; for(j = 0; j < n; ++j) { if(par[j] == i) { int tmp = height(j) + 1; if(tmp > h) h = tmp; } } return h; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238237/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @par = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @sib = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @deg = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [75 x i8] c"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, \00", align 1 @str = private unnamed_addr constant [14 x i8] c"internal node\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"leaf\00", align 1 @str.7 = private unnamed_addr constant [5 x i8] c"root\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: %id = alloca i32, align 4 %left = alloca i32, align 4 %right = alloca i32, align 4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp76 = icmp sgt i32 %0, 0 br i1 %cmp76, label %for.body7.preheader, label %for.end56 for.body7.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @par, i8 -1, i64 %2, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @sib, i8 -1, i64 %2, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @deg, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body7 for.cond30.preheader: ; preds = %if.end26 %3 = icmp sgt i32 %9, 0 br i1 %3, label %tailrecurse.i.preheader, label %for.end56 for.body7: ; preds = %for.body7.preheader, %if.end26 %i.179 = phi i32 [ %inc28, %if.end26 ], [ 0, %for.body7.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %left) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %right) #7 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %id, ptr noundef nonnull %left, ptr noundef nonnull %right) %4 = load i32, ptr %left, align 4, !tbaa !5 %cmp9.not = icmp eq i32 %4, -1 %.pre = load i32, ptr %right, align 4, !tbaa !5 br i1 %cmp9.not, label %if.end, label %if.then if.then: ; preds = %for.body7 %5 = load i32, ptr %id, align 4, !tbaa !5 %idxprom10 = sext i32 %4 to i64 %arrayidx11 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom10 store i32 %5, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %idxprom10 store i32 %.pre, ptr %arrayidx13, align 4, !tbaa !5 %idxprom14 = sext i32 %5 to i64 %arrayidx15 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %idxprom14 %6 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %inc16 = add nsw i32 %6, 1 store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body7 %cmp17.not = icmp eq i32 %.pre, -1 br i1 %cmp17.not, label %if.end26, label %if.then18 if.then18: ; preds = %if.end %7 = load i32, ptr %id, align 4, !tbaa !5 %idxprom19 = sext i32 %.pre to i64 %arrayidx20 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom19 store i32 %7, ptr %arrayidx20, align 4, !tbaa !5 %arrayidx22 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %idxprom19 store i32 %4, ptr %arrayidx22, align 4, !tbaa !5 %idxprom23 = sext i32 %7 to i64 %arrayidx24 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %idxprom23 %8 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %inc25 = add nsw i32 %8, 1 store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !5 br label %if.end26 if.end26: ; preds = %if.then18, %if.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %right) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %left) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #7 %inc28 = add nuw nsw i32 %i.179, 1 %9 = load i32, ptr @n, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc28, %9 br i1 %cmp6, label %for.body7, label %for.cond30.preheader, !llvm.loop !9 tailrecurse.i.preheader: ; preds = %for.cond30.preheader, %if.end53 %indvars.iv = phi i64 [ %indvars.iv.next, %if.end53 ], [ 0, %for.cond30.preheader ] %10 = trunc i64 %indvars.iv to i32 br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i.preheader, %tailrecurse.i %accumulator.tr.i = phi i32 [ %add.i, %tailrecurse.i ], [ 0, %tailrecurse.i.preheader ] %i.tr.i = phi i32 [ %11, %tailrecurse.i ], [ %10, %tailrecurse.i.preheader ] %idxprom.i = sext i32 %i.tr.i to i64 %arrayidx.i = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.i = icmp eq i32 %11, -1 %add.i = add nuw nsw i32 %accumulator.tr.i, 1 br i1 %cmp.i, label %depth.exit, label %tailrecurse.i depth.exit: ; preds = %tailrecurse.i %arrayidx35 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %indvars.iv %12 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %arrayidx37 = getelementptr inbounds [100001 x i32], ptr @sib, i64 0, i64 %indvars.iv %13 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %arrayidx39 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %indvars.iv %14 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 @height(i32 noundef %10) %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %12, i32 noundef %13, i32 noundef %14, i32 noundef %accumulator.tr.i, i32 noundef %call40) %cmp42 = icmp eq i32 %accumulator.tr.i, 0 br i1 %cmp42, label %if.end53, label %if.else if.else: ; preds = %depth.exit %15 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %cmp47 = icmp eq i32 %15, 0 %str.6.str = select i1 %cmp47, ptr @str.6, ptr @str br label %if.end53 if.end53: ; preds = %if.else, %depth.exit %str.6.sink = phi ptr [ @str.7, %depth.exit ], [ %str.6.str, %if.else ] %puts74 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %16 = load i32, ptr @n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp31 = icmp slt i64 %indvars.iv.next, %17 br i1 %cmp31, label %tailrecurse.i.preheader, label %for.end56, !llvm.loop !11 for.end56: ; preds = %if.end53, %entry, %for.cond30.preheader ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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 norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @depth(i32 noundef %i) local_unnamed_addr #3 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i32 [ 0, %entry ], [ %add, %tailrecurse ] %i.tr = phi i32 [ %i, %entry ], [ %0, %tailrecurse ] %idxprom = sext i32 %i.tr to i64 %arrayidx = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, -1 %add = add nuw nsw i32 %accumulator.tr, 1 br i1 %cmp, label %return, label %tailrecurse return: ; preds = %tailrecurse ret i32 %accumulator.tr } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @height(i32 noundef %i) local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 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 ] %h.011 = phi i32 [ 0, %for.body.preheader ], [ %h.2, %for.inc ] %arrayidx = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %1, %i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %2 = trunc i64 %indvars.iv to i32 %call = tail call i32 @height(i32 noundef %2) %cmp2.not = icmp slt i32 %call, %h.011 %add = add nsw i32 %call, 1 %spec.select = select i1 %cmp2.not, i32 %h.011, i32 %add br label %for.inc for.inc: ; preds = %for.body, %if.then %h.2 = phi i32 [ %spec.select, %if.then ], [ %h.011, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.inc, %entry %h.0.lcssa = phi i32 [ 0, %entry ], [ %h.2, %for.inc ] ret i32 %h.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(read, 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 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define FOR(n) for(int i=0;i<n;i++) #define FORJ(n) for(int j=0;j<n;j++) #define PRN(n) printf("%d\n",n) #define PRF(n) printf("%lf\n",n) #define PRL(n) printf("%lld\n",n) #define PRS(s) printf("%s\n",s) #define PRC(c) printf("%c",c) #define mod 1000000007 typedef long long int ll; int u(const void *a, const void *b){ return *(ll*)a-*(ll*)b; } int d(const void *a, const void *b){ return *(ll*)b-*(ll*)a; } int z(int a){ if(a<1)a*=-1; return a; } int min(int a,int b){ if(a>b)return b; return a; } int max(int a,int b){ if(a>b)return a; return b; } int gcd(int a,int b){ if(!b)return a; return gcd(b,a%b); } int main(void){ int h,a,b,ans=0; scanf("%d %d %d",&h,&a,&b); for(int i=a;i<=b;i++)ans+=(h%i<1); PRN(ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238323/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @u(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @d(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @z(i32 noundef %a) local_unnamed_addr #1 { entry: %spec.select = tail call i32 @llvm.abs.i32(i32 %a, i1 true) ret i32 %spec.select } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(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: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %b, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %h = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !9 %1 = load i32, ptr %b, align 4, !tbaa !9 %cmp.not6 = icmp sgt i32 %0, %1 br i1 %cmp.not6, label %for.cond.cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %h, align 4, !tbaa !9 %3 = add i32 %1, 1 %4 = sub i32 %3, %0 %xtraiter = and i32 %4, 1 %5 = icmp eq i32 %1, %0 br i1 %5, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %4, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %add.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %add.1, %for.body ] %i.08.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc.1, %for.body ] %ans.07.unr = phi i32 [ 0, %for.body.lr.ph ], [ %add.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %rem.epil = srem i32 %2, %i.08.unr %cmp1.epil = icmp slt i32 %rem.epil, 1 %conv.epil = zext i1 %cmp1.epil to i32 %add.epil = add nuw nsw i32 %ans.07.unr, %conv.epil br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #7 ret i32 0 for.body: ; preds = %for.body, %for.body.lr.ph.new %i.08 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %ans.07 = phi i32 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %rem = srem i32 %2, %i.08 %cmp1 = icmp slt i32 %rem, 1 %conv = zext i1 %cmp1 to i32 %add = add nuw nsw i32 %ans.07, %conv %inc = add i32 %i.08, 1 %rem.1 = srem i32 %2, %inc %cmp1.1 = icmp slt i32 %rem.1, 1 %conv.1 = zext i1 %cmp1.1 to i32 %add.1 = add nuw nsw i32 %add, %conv.1 %inc.1 = add i32 %i.08, 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.cond.cleanup.loopexit.unr-lcssa, label %for.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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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: 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.smin.i32(i32, i32) #6 ; 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 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int n[1000],tmp,i,j; for(i = 1; i<=5; i++){ scanf("%d",&n[i]); } for(i=1;i<=5;i++){ for(j=i;j<=5;j++){ if(n[i]<n[j]){ tmp=n[i]; n[i]=n[j]; n[j]=tmp; } } } for(i = 1; i<=4; i++){ printf("%d ",n[i]); } printf("%d\n",n[5]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238367/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238367/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 { for.inc20: %n = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %n) #3 %arrayidx = getelementptr inbounds [1000 x i32], ptr %n, i64 0, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx.1 = getelementptr inbounds [1000 x i32], ptr %n, i64 0, i64 2 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [1000 x i32], ptr %n, i64 0, i64 3 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [1000 x i32], ptr %n, i64 0, i64 4 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [1000 x i32], ptr %n, i64 0, i64 5 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 8, !tbaa !5 %cmp11.164 = icmp slt i32 %0, %1 br i1 %cmp11.164, label %if.then.166, label %for.inc20.167 if.then.166: ; preds = %for.inc20 store i32 %1, ptr %arrayidx, align 4, !tbaa !5 store i32 %0, ptr %arrayidx.1, align 8, !tbaa !5 br label %for.inc20.167 for.inc20.167: ; preds = %if.then.166, %for.inc20 %2 = phi i32 [ %0, %if.then.166 ], [ %1, %for.inc20 ] %3 = phi i32 [ %1, %if.then.166 ], [ %0, %for.inc20 ] %4 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %cmp11.269 = icmp slt i32 %3, %4 br i1 %cmp11.269, label %if.then.271, label %for.inc20.272 if.then.271: ; preds = %for.inc20.167 store i32 %4, ptr %arrayidx, align 4, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 4, !tbaa !5 br label %for.inc20.272 for.inc20.272: ; preds = %if.then.271, %for.inc20.167 %5 = phi i32 [ %3, %if.then.271 ], [ %4, %for.inc20.167 ] %6 = phi i32 [ %4, %if.then.271 ], [ %3, %for.inc20.167 ] %7 = load i32, ptr %arrayidx.3, align 16, !tbaa !5 %cmp11.374 = icmp slt i32 %6, %7 br i1 %cmp11.374, label %if.then.376, label %for.inc20.377 if.then.376: ; preds = %for.inc20.272 store i32 %7, ptr %arrayidx, align 4, !tbaa !5 store i32 %6, ptr %arrayidx.3, align 16, !tbaa !5 br label %for.inc20.377 for.inc20.377: ; preds = %if.then.376, %for.inc20.272 %8 = phi i32 [ %6, %if.then.376 ], [ %7, %for.inc20.272 ] %9 = phi i32 [ %7, %if.then.376 ], [ %6, %for.inc20.272 ] %10 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 %cmp11.479 = icmp slt i32 %9, %10 br i1 %cmp11.479, label %if.then.481, label %for.inc20.1 if.then.481: ; preds = %for.inc20.377 store i32 %10, ptr %arrayidx, align 4, !tbaa !5 store i32 %9, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc20.1 for.inc20.1: ; preds = %for.inc20.377, %if.then.481 %11 = phi i32 [ %10, %if.then.481 ], [ %9, %for.inc20.377 ] %12 = phi i32 [ %9, %if.then.481 ], [ %10, %for.inc20.377 ] %cmp11.1.1 = icmp slt i32 %2, %5 br i1 %cmp11.1.1, label %if.then.1.1, label %for.inc20.1.1 if.then.1.1: ; preds = %for.inc20.1 store i32 %5, ptr %arrayidx.1, align 8, !tbaa !5 store i32 %2, ptr %arrayidx.2, align 4, !tbaa !5 br label %for.inc20.1.1 for.inc20.1.1: ; preds = %if.then.1.1, %for.inc20.1 %13 = phi i32 [ %2, %if.then.1.1 ], [ %5, %for.inc20.1 ] %14 = phi i32 [ %5, %if.then.1.1 ], [ %2, %for.inc20.1 ] %cmp11.1.2 = icmp slt i32 %14, %8 br i1 %cmp11.1.2, label %if.then.1.2, label %for.inc20.1.2 if.then.1.2: ; preds = %for.inc20.1.1 store i32 %8, ptr %arrayidx.1, align 8, !tbaa !5 store i32 %14, ptr %arrayidx.3, align 16, !tbaa !5 br label %for.inc20.1.2 for.inc20.1.2: ; preds = %if.then.1.2, %for.inc20.1.1 %15 = phi i32 [ %14, %if.then.1.2 ], [ %8, %for.inc20.1.1 ] %16 = phi i32 [ %8, %if.then.1.2 ], [ %14, %for.inc20.1.1 ] %cmp11.1.3 = icmp slt i32 %16, %12 br i1 %cmp11.1.3, label %if.then.1.3, label %for.inc20.2 if.then.1.3: ; preds = %for.inc20.1.2 store i32 %12, ptr %arrayidx.1, align 8, !tbaa !5 store i32 %16, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc20.2 for.inc20.2: ; preds = %for.inc20.1.2, %if.then.1.3 %17 = phi i32 [ %16, %if.then.1.3 ], [ %12, %for.inc20.1.2 ] %cmp11.2.1 = icmp slt i32 %13, %15 br i1 %cmp11.2.1, label %if.then.2.1, label %for.inc20.2.1 if.then.2.1: ; preds = %for.inc20.2 store i32 %15, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %13, ptr %arrayidx.3, align 16, !tbaa !5 br label %for.inc20.2.1 for.inc20.2.1: ; preds = %if.then.2.1, %for.inc20.2 %18 = phi i32 [ %13, %if.then.2.1 ], [ %15, %for.inc20.2 ] %19 = phi i32 [ %15, %if.then.2.1 ], [ %13, %for.inc20.2 ] %cmp11.2.2 = icmp slt i32 %19, %17 br i1 %cmp11.2.2, label %if.then.2.2, label %for.inc20.3 if.then.2.2: ; preds = %for.inc20.2.1 store i32 %17, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %19, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc20.3 for.inc20.3: ; preds = %for.inc20.2.1, %if.then.2.2 %20 = phi i32 [ %19, %if.then.2.2 ], [ %17, %for.inc20.2.1 ] %cmp11.3.1 = icmp slt i32 %18, %20 br i1 %cmp11.3.1, label %if.then.3.1, label %for.inc20.4 if.then.3.1: ; preds = %for.inc20.3 store i32 %20, ptr %arrayidx.3, align 16, !tbaa !5 store i32 %18, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc20.4 for.inc20.4: ; preds = %for.inc20.3, %if.then.3.1 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %21 = load i32, ptr %arrayidx.1, align 8, !tbaa !5 %call31.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %21) %22 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %call31.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22) %23 = load i32, ptr %arrayidx.3, align 16, !tbaa !5 %call31.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23) %24 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a[10]; int i, j, swap; scanf("%d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &a[4]); for(i = 0; i < 5; i++){ for(j = 0; j < 4 -i; j++){ if(a[j]<a[j+1]){ swap = a[j]; a[j] = a[j+1]; a[j+1] = swap; } } } printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238424/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [16 x i8] c"%d %d %d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.body7.preheader: %a = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a) #3 %arrayidx1 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 3 %arrayidx4 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) %0 = load i32, ptr %a, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp11 = icmp slt i32 %0, %1 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body7.preheader store i32 %1, ptr %a, align 16, !tbaa !5 store i32 %0, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body7.preheader, %if.then %2 = phi i32 [ %1, %for.body7.preheader ], [ %0, %if.then ] %3 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %cmp11.150 = icmp slt i32 %2, %3 br i1 %cmp11.150, label %if.then.152, label %for.inc.153 if.then.152: ; preds = %for.inc store i32 %3, ptr %arrayidx1, align 4, !tbaa !5 store i32 %2, ptr %arrayidx2, align 8, !tbaa !5 br label %for.inc.153 for.inc.153: ; preds = %if.then.152, %for.inc %4 = phi i32 [ %2, %if.then.152 ], [ %3, %for.inc ] %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp11.255 = icmp slt i32 %4, %5 br i1 %cmp11.255, label %if.then.257, label %for.inc.258 if.then.257: ; preds = %for.inc.153 store i32 %5, ptr %arrayidx2, align 8, !tbaa !5 store i32 %4, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.258 for.inc.258: ; preds = %if.then.257, %for.inc.153 %6 = phi i32 [ %4, %if.then.257 ], [ %5, %for.inc.153 ] %7 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.360 = icmp slt i32 %6, %7 br i1 %cmp11.360, label %if.then.362, label %for.body7.preheader.1 if.then.362: ; preds = %for.inc.258 store i32 %7, ptr %arrayidx3, align 4, !tbaa !5 store i32 %6, ptr %arrayidx4, align 16, !tbaa !5 br label %for.body7.preheader.1 for.body7.preheader.1: ; preds = %if.then.362, %for.inc.258 %8 = load i32, ptr %a, align 16, !tbaa !5 %9 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp11.1 = icmp slt i32 %8, %9 br i1 %cmp11.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.body7.preheader.1 store i32 %9, ptr %a, align 16, !tbaa !5 store i32 %8, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.body7.preheader.1 %10 = phi i32 [ %8, %if.then.1 ], [ %9, %for.body7.preheader.1 ] %11 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %cmp11.1.1 = icmp slt i32 %10, %11 br i1 %cmp11.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.1 store i32 %11, ptr %arrayidx1, align 4, !tbaa !5 store i32 %10, ptr %arrayidx2, align 8, !tbaa !5 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.1 %12 = phi i32 [ %10, %if.then.1.1 ], [ %11, %for.inc.1 ] %13 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp11.1.2 = icmp slt i32 %12, %13 br i1 %cmp11.1.2, label %if.then.1.2, label %for.body7.preheader.2 if.then.1.2: ; preds = %for.inc.1.1 store i32 %13, ptr %arrayidx2, align 8, !tbaa !5 store i32 %12, ptr %arrayidx3, align 4, !tbaa !5 br label %for.body7.preheader.2 for.body7.preheader.2: ; preds = %if.then.1.2, %for.inc.1.1 %14 = load i32, ptr %a, align 16, !tbaa !5 %15 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp11.2 = icmp slt i32 %14, %15 br i1 %cmp11.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.body7.preheader.2 store i32 %15, ptr %a, align 16, !tbaa !5 store i32 %14, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.body7.preheader.2 %16 = phi i32 [ %14, %if.then.2 ], [ %15, %for.body7.preheader.2 ] %17 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %cmp11.2.1 = icmp slt i32 %16, %17 br i1 %cmp11.2.1, label %if.then.2.1, label %for.body7.preheader.3 if.then.2.1: ; preds = %for.inc.2 store i32 %17, ptr %arrayidx1, align 4, !tbaa !5 store i32 %16, ptr %arrayidx2, align 8, !tbaa !5 br label %for.body7.preheader.3 for.body7.preheader.3: ; preds = %if.then.2.1, %for.inc.2 %18 = load i32, ptr %a, align 16, !tbaa !5 %19 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp11.3 = icmp slt i32 %18, %19 br i1 %cmp11.3, label %if.then.3, label %for.inc22.4 if.then.3: ; preds = %for.body7.preheader.3 store i32 %19, ptr %a, align 16, !tbaa !5 store i32 %18, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc22.4 for.inc22.4: ; preds = %if.then.3, %for.body7.preheader.3 %20 = load i32, ptr %a, align 16, !tbaa !5 %21 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %22 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %23 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %24 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20, i32 noundef %21, i32 noundef %22, i32 noundef %23, i32 noundef %24) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int i,j,max,max_j,buf; int io[5]; scanf("%d %d %d %d %d",&io[0],&io[1],&io[2],&io[3],&io[4]); for(i=0;i<5;i++){ max=io[i]; max_j=i; for(j=i+1;j<5;j++){ if(max<io[j]){ max=io[j]; max_j=j; } } buf=io[i]; io[i]=io[max_j]; io[max_j]=buf; i<4?printf("%d ",io[i]):printf("%d\n",io[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238468/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238468/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \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 { for.inc29.4: %io = alloca [5 x i32], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %io) #4 %arrayidx1 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 3 %arrayidx4 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %io, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) %0 = load i32, ptr %io, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %spec.select.161 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2) %3 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %spec.select.266 = call i32 @llvm.smax.i32(i32 %spec.select.161, i32 %3) %4 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.370 = icmp slt i32 %spec.select.266, %4 %cmp11.265 = icmp slt i32 %spec.select.161, %3 %cmp11.160 = icmp slt i32 %spec.select, %2 %cmp11 = icmp slt i32 %0, %1 %spec.select46 = zext i1 %cmp11 to i64 %spec.select46.162 = select i1 %cmp11.160, i64 2, i64 %spec.select46 %spec.select46.267 = select i1 %cmp11.265, i64 3, i64 %spec.select46.162 %spec.select46.371 = select i1 %cmp11.370, i64 4, i64 %spec.select46.267 %arrayidx17 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 %spec.select46.371 %5 = load i32, ptr %arrayidx17, align 4, !tbaa !5 store i32 %5, ptr %io, align 16, !tbaa !5 store i32 %0, ptr %arrayidx17, align 4, !tbaa !5 %6 = load i32, ptr %io, align 16, !tbaa !5 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %.pre = load i32, ptr %arrayidx1, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %spec.select.1 = call i32 @llvm.smax.i32(i32 %.pre, i32 %7) %8 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %spec.select.1.1 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %8) %9 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.1.2 = icmp slt i32 %spec.select.1.1, %9 %cmp11.1.1 = icmp slt i32 %spec.select.1, %8 %cmp11.1 = icmp slt i32 %.pre, %7 %spec.select46.1 = select i1 %cmp11.1, i64 2, i64 1 %spec.select46.1.1 = select i1 %cmp11.1.1, i64 3, i64 %spec.select46.1 %spec.select46.1.2 = select i1 %cmp11.1.2, i64 4, i64 %spec.select46.1.1 %arrayidx17.1 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 %spec.select46.1.2 %10 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 store i32 %10, ptr %arrayidx1, align 4, !tbaa !5 store i32 %.pre, ptr %arrayidx17.1, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %.pre73 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %12 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %spec.select.2 = call i32 @llvm.smax.i32(i32 %.pre73, i32 %12) %13 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.2.1 = icmp slt i32 %spec.select.2, %13 %cmp11.2 = icmp slt i32 %.pre73, %12 %spec.select46.2 = select i1 %cmp11.2, i64 3, i64 2 %spec.select46.2.1 = select i1 %cmp11.2.1, i64 4, i64 %spec.select46.2 %arrayidx17.2 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 %spec.select46.2.1 %14 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 store i32 %14, ptr %arrayidx2, align 8, !tbaa !5 store i32 %.pre73, ptr %arrayidx17.2, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15) %.pre74 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.3 = icmp slt i32 %.pre74, %16 %spec.select46.3 = select i1 %cmp11.3, i64 4, i64 3 %arrayidx17.3 = getelementptr inbounds [5 x i32], ptr %io, i64 0, i64 %spec.select46.3 %17 = load i32, ptr %arrayidx17.3, align 4, !tbaa !5 store i32 %17, ptr %arrayidx3, align 4, !tbaa !5 store i32 %.pre74, ptr %arrayidx17.3, align 4, !tbaa !5 %18 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18) %.pre75 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %call28.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre75) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %io) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ long long int i,j,k,x=0,l,n=5,a[6]; scanf("%lld%lld%lld%lld%lld",&a[0],&a[1],&a[2],&a[3],&a[4]); for(j=0;j<=5;j++){ for(k=0;k<n-1;k++){ if(a[k]<a[k+1]){ x=a[k]; a[k]=a[k+1]; a[k+1]=x; } } } printf("%lld %lld %lld %lld %lld\n",a[0],a[1],a[2],a[3],a[4]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238633/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238633/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [21 x i8] c"%lld%lld%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [26 x i8] c"%lld %lld %lld %lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [6 x i64], align 16 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %a) #3 %arrayidx1 = getelementptr inbounds [6 x i64], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [6 x i64], ptr %a, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [6 x i64], ptr %a, i64 0, i64 3 %arrayidx4 = getelementptr inbounds [6 x i64], ptr %a, i64 0, i64 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) %0 = load i64, ptr %a, align 16, !tbaa !5 %1 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp10 = icmp slt i64 %0, %1 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %entry store i64 %1, ptr %a, align 16, !tbaa !5 store i64 %0, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %2 = phi i64 [ %0, %entry ], [ %1, %if.then ] %3 = phi i64 [ %1, %entry ], [ %0, %if.then ] %4 = load i64, ptr %arrayidx2, align 16, !tbaa !5 %cmp10.1 = icmp slt i64 %3, %4 br i1 %cmp10.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc store i64 %4, ptr %arrayidx1, align 8, !tbaa !5 store i64 %3, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %5 = phi i64 [ %4, %if.then.1 ], [ %3, %for.inc ] %6 = phi i64 [ %3, %if.then.1 ], [ %4, %for.inc ] %7 = load i64, ptr %arrayidx3, align 8, !tbaa !5 %cmp10.2 = icmp slt i64 %6, %7 br i1 %cmp10.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 store i64 %7, ptr %arrayidx2, align 16, !tbaa !5 store i64 %6, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %8 = phi i64 [ %7, %if.then.2 ], [ %6, %for.inc.1 ] %9 = phi i64 [ %6, %if.then.2 ], [ %7, %for.inc.1 ] %10 = load i64, ptr %arrayidx4, align 16, !tbaa !5 %cmp10.3 = icmp slt i64 %9, %10 br i1 %cmp10.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 store i64 %10, ptr %arrayidx3, align 8, !tbaa !5 store i64 %9, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %11 = phi i64 [ %9, %if.then.3 ], [ %10, %for.inc.2 ] %12 = phi i64 [ %10, %if.then.3 ], [ %9, %for.inc.2 ] %cmp10.138 = icmp slt i64 %2, %5 br i1 %cmp10.138, label %if.then.139, label %for.inc.140 if.then.139: ; preds = %for.inc.3 store i64 %5, ptr %a, align 16, !tbaa !5 store i64 %2, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc.140 for.inc.140: ; preds = %if.then.139, %for.inc.3 %13 = phi i64 [ %5, %if.then.139 ], [ %2, %for.inc.3 ] %14 = phi i64 [ %2, %if.then.139 ], [ %5, %for.inc.3 ] %cmp10.1.1 = icmp slt i64 %14, %8 br i1 %cmp10.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.140 store i64 %8, ptr %arrayidx1, align 8, !tbaa !5 store i64 %14, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.140 %15 = phi i64 [ %8, %if.then.1.1 ], [ %14, %for.inc.140 ] %16 = phi i64 [ %14, %if.then.1.1 ], [ %8, %for.inc.140 ] %cmp10.2.1 = icmp slt i64 %16, %12 br i1 %cmp10.2.1, label %if.then.2.1, label %for.inc.2.1 if.then.2.1: ; preds = %for.inc.1.1 store i64 %12, ptr %arrayidx2, align 16, !tbaa !5 store i64 %16, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2.1 for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1 %17 = phi i64 [ %12, %if.then.2.1 ], [ %16, %for.inc.1.1 ] %18 = phi i64 [ %16, %if.then.2.1 ], [ %12, %for.inc.1.1 ] %cmp10.3.1 = icmp slt i64 %18, %11 br i1 %cmp10.3.1, label %if.then.3.1, label %for.inc.3.1 if.then.3.1: ; preds = %for.inc.2.1 store i64 %11, ptr %arrayidx3, align 8, !tbaa !5 store i64 %18, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3.1 for.inc.3.1: ; preds = %if.then.3.1, %for.inc.2.1 %19 = phi i64 [ %18, %if.then.3.1 ], [ %11, %for.inc.2.1 ] %20 = phi i64 [ %11, %if.then.3.1 ], [ %18, %for.inc.2.1 ] %cmp10.242 = icmp slt i64 %13, %15 br i1 %cmp10.242, label %if.then.243, label %for.inc.244 if.then.243: ; preds = %for.inc.3.1 store i64 %15, ptr %a, align 16, !tbaa !5 store i64 %13, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc.244 for.inc.244: ; preds = %if.then.243, %for.inc.3.1 %21 = phi i64 [ %15, %if.then.243 ], [ %13, %for.inc.3.1 ] %22 = phi i64 [ %13, %if.then.243 ], [ %15, %for.inc.3.1 ] %cmp10.1.2 = icmp slt i64 %22, %17 br i1 %cmp10.1.2, label %if.then.1.2, label %for.inc.1.2 if.then.1.2: ; preds = %for.inc.244 store i64 %17, ptr %arrayidx1, align 8, !tbaa !5 store i64 %22, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1.2 for.inc.1.2: ; preds = %if.then.1.2, %for.inc.244 %23 = phi i64 [ %17, %if.then.1.2 ], [ %22, %for.inc.244 ] %24 = phi i64 [ %22, %if.then.1.2 ], [ %17, %for.inc.244 ] %cmp10.2.2 = icmp slt i64 %24, %20 br i1 %cmp10.2.2, label %if.then.2.2, label %for.inc.2.2 if.then.2.2: ; preds = %for.inc.1.2 store i64 %20, ptr %arrayidx2, align 16, !tbaa !5 store i64 %24, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2.2 for.inc.2.2: ; preds = %if.then.2.2, %for.inc.1.2 %25 = phi i64 [ %20, %if.then.2.2 ], [ %24, %for.inc.1.2 ] %26 = phi i64 [ %24, %if.then.2.2 ], [ %20, %for.inc.1.2 ] %cmp10.3.2 = icmp slt i64 %26, %19 br i1 %cmp10.3.2, label %if.then.3.2, label %for.inc.3.2 if.then.3.2: ; preds = %for.inc.2.2 store i64 %19, ptr %arrayidx3, align 8, !tbaa !5 store i64 %26, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3.2 for.inc.3.2: ; preds = %if.then.3.2, %for.inc.2.2 %27 = phi i64 [ %26, %if.then.3.2 ], [ %19, %for.inc.2.2 ] %28 = phi i64 [ %19, %if.then.3.2 ], [ %26, %for.inc.2.2 ] %cmp10.346 = icmp slt i64 %21, %23 br i1 %cmp10.346, label %if.then.347, label %for.inc.348 if.then.347: ; preds = %for.inc.3.2 store i64 %23, ptr %a, align 16, !tbaa !5 store i64 %21, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc.348 for.inc.348: ; preds = %if.then.347, %for.inc.3.2 %29 = phi i64 [ %23, %if.then.347 ], [ %21, %for.inc.3.2 ] %30 = phi i64 [ %21, %if.then.347 ], [ %23, %for.inc.3.2 ] %cmp10.1.3 = icmp slt i64 %30, %25 br i1 %cmp10.1.3, label %if.then.1.3, label %for.inc.1.3 if.then.1.3: ; preds = %for.inc.348 store i64 %25, ptr %arrayidx1, align 8, !tbaa !5 store i64 %30, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1.3 for.inc.1.3: ; preds = %if.then.1.3, %for.inc.348 %31 = phi i64 [ %25, %if.then.1.3 ], [ %30, %for.inc.348 ] %32 = phi i64 [ %30, %if.then.1.3 ], [ %25, %for.inc.348 ] %cmp10.2.3 = icmp slt i64 %32, %28 br i1 %cmp10.2.3, label %if.then.2.3, label %for.inc.2.3 if.then.2.3: ; preds = %for.inc.1.3 store i64 %28, ptr %arrayidx2, align 16, !tbaa !5 store i64 %32, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2.3 for.inc.2.3: ; preds = %if.then.2.3, %for.inc.1.3 %33 = phi i64 [ %28, %if.then.2.3 ], [ %32, %for.inc.1.3 ] %34 = phi i64 [ %32, %if.then.2.3 ], [ %28, %for.inc.1.3 ] %cmp10.3.3 = icmp slt i64 %34, %27 br i1 %cmp10.3.3, label %if.then.3.3, label %for.inc.3.3 if.then.3.3: ; preds = %for.inc.2.3 store i64 %27, ptr %arrayidx3, align 8, !tbaa !5 store i64 %34, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3.3 for.inc.3.3: ; preds = %if.then.3.3, %for.inc.2.3 %35 = phi i64 [ %34, %if.then.3.3 ], [ %27, %for.inc.2.3 ] %36 = phi i64 [ %27, %if.then.3.3 ], [ %34, %for.inc.2.3 ] %cmp10.4 = icmp slt i64 %29, %31 br i1 %cmp10.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3.3 store i64 %31, ptr %a, align 16, !tbaa !5 store i64 %29, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3.3 %37 = phi i64 [ %31, %if.then.4 ], [ %29, %for.inc.3.3 ] %38 = phi i64 [ %29, %if.then.4 ], [ %31, %for.inc.3.3 ] %cmp10.1.4 = icmp slt i64 %38, %33 br i1 %cmp10.1.4, label %if.then.1.4, label %for.inc.1.4 if.then.1.4: ; preds = %for.inc.4 store i64 %33, ptr %arrayidx1, align 8, !tbaa !5 store i64 %38, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1.4 for.inc.1.4: ; preds = %if.then.1.4, %for.inc.4 %39 = phi i64 [ %33, %if.then.1.4 ], [ %38, %for.inc.4 ] %40 = phi i64 [ %38, %if.then.1.4 ], [ %33, %for.inc.4 ] %cmp10.2.4 = icmp slt i64 %40, %36 br i1 %cmp10.2.4, label %if.then.2.4, label %for.inc.2.4 if.then.2.4: ; preds = %for.inc.1.4 store i64 %36, ptr %arrayidx2, align 16, !tbaa !5 store i64 %40, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2.4 for.inc.2.4: ; preds = %if.then.2.4, %for.inc.1.4 %41 = phi i64 [ %36, %if.then.2.4 ], [ %40, %for.inc.1.4 ] %42 = phi i64 [ %40, %if.then.2.4 ], [ %36, %for.inc.1.4 ] %cmp10.3.4 = icmp slt i64 %42, %35 br i1 %cmp10.3.4, label %if.then.3.4, label %for.inc.3.4 if.then.3.4: ; preds = %for.inc.2.4 store i64 %35, ptr %arrayidx3, align 8, !tbaa !5 store i64 %42, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3.4 for.inc.3.4: ; preds = %if.then.3.4, %for.inc.2.4 %43 = phi i64 [ %42, %if.then.3.4 ], [ %35, %for.inc.2.4 ] %44 = phi i64 [ %35, %if.then.3.4 ], [ %42, %for.inc.2.4 ] %cmp10.5 = icmp slt i64 %37, %39 br i1 %cmp10.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.3.4 store i64 %39, ptr %a, align 16, !tbaa !5 store i64 %37, ptr %arrayidx1, align 8, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.3.4 %45 = phi i64 [ %39, %if.then.5 ], [ %37, %for.inc.3.4 ] %46 = phi i64 [ %37, %if.then.5 ], [ %39, %for.inc.3.4 ] %cmp10.1.5 = icmp slt i64 %46, %41 br i1 %cmp10.1.5, label %if.then.1.5, label %for.inc.1.5 if.then.1.5: ; preds = %for.inc.5 store i64 %41, ptr %arrayidx1, align 8, !tbaa !5 store i64 %46, ptr %arrayidx2, align 16, !tbaa !5 br label %for.inc.1.5 for.inc.1.5: ; preds = %if.then.1.5, %for.inc.5 %47 = phi i64 [ %41, %if.then.1.5 ], [ %46, %for.inc.5 ] %48 = phi i64 [ %46, %if.then.1.5 ], [ %41, %for.inc.5 ] %cmp10.2.5 = icmp slt i64 %48, %44 br i1 %cmp10.2.5, label %if.then.2.5, label %for.inc.2.5 if.then.2.5: ; preds = %for.inc.1.5 store i64 %44, ptr %arrayidx2, align 16, !tbaa !5 store i64 %48, ptr %arrayidx3, align 8, !tbaa !5 br label %for.inc.2.5 for.inc.2.5: ; preds = %if.then.2.5, %for.inc.1.5 %49 = phi i64 [ %44, %if.then.2.5 ], [ %48, %for.inc.1.5 ] %50 = phi i64 [ %48, %if.then.2.5 ], [ %44, %for.inc.1.5 ] %cmp10.3.5 = icmp slt i64 %50, %43 br i1 %cmp10.3.5, label %if.then.3.5, label %for.inc.3.5 if.then.3.5: ; preds = %for.inc.2.5 store i64 %43, ptr %arrayidx3, align 8, !tbaa !5 store i64 %50, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.3.5 for.inc.3.5: ; preds = %if.then.3.5, %for.inc.2.5 %51 = phi i64 [ %50, %if.then.3.5 ], [ %43, %for.inc.2.5 ] %52 = phi i64 [ %43, %if.then.3.5 ], [ %50, %for.inc.2.5 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %45, i64 noundef %47, i64 noundef %49, i64 noundef %52, i64 noundef %51) call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #include<stdarg.h> #include<malloc.h> int main() { int i, j, a[5], buf; scanf("%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&a[4]); for(j=4; j>0; j--){ for(i=0; i<j; i++){ if(a[i] < a[i+1]){ buf = a[i]; a[i] = a[i+1]; a[i+1] = buf; } } } printf("%d %d %d %d %d\n",a[0],a[1],a[2],a[3],a[4]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238677/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238677/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [16 x i8] c"%d %d %d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [5 x i32], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #3 %arrayidx1 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 3 %arrayidx4 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) %0 = load i32, ptr %a, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp11 = icmp slt i32 %0, %1 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %entry store i32 %1, ptr %a, align 16, !tbaa !5 store i32 %0, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %2 = phi i32 [ %0, %entry ], [ %1, %if.then ] %3 = phi i32 [ %1, %entry ], [ %0, %if.then ] %4 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %cmp11.147 = icmp slt i32 %3, %4 br i1 %cmp11.147, label %if.then.149, label %for.inc.150 if.then.149: ; preds = %for.inc store i32 %4, ptr %arrayidx1, align 4, !tbaa !5 store i32 %3, ptr %arrayidx2, align 8, !tbaa !5 br label %for.inc.150 for.inc.150: ; preds = %if.then.149, %for.inc %5 = phi i32 [ %4, %if.then.149 ], [ %3, %for.inc ] %6 = phi i32 [ %3, %if.then.149 ], [ %4, %for.inc ] %7 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp11.252 = icmp slt i32 %6, %7 br i1 %cmp11.252, label %if.then.254, label %for.inc.255 if.then.254: ; preds = %for.inc.150 store i32 %7, ptr %arrayidx2, align 8, !tbaa !5 store i32 %6, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.255 for.inc.255: ; preds = %if.then.254, %for.inc.150 %8 = phi i32 [ %7, %if.then.254 ], [ %6, %for.inc.150 ] %9 = phi i32 [ %6, %if.then.254 ], [ %7, %for.inc.150 ] %10 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp11.357 = icmp slt i32 %9, %10 br i1 %cmp11.357, label %if.then.359, label %for.inc.360 if.then.359: ; preds = %for.inc.255 store i32 %10, ptr %arrayidx3, align 4, !tbaa !5 store i32 %9, ptr %arrayidx4, align 16, !tbaa !5 br label %for.inc.360 for.inc.360: ; preds = %if.then.359, %for.inc.255 %11 = phi i32 [ %9, %if.then.359 ], [ %10, %for.inc.255 ] %12 = phi i32 [ %10, %if.then.359 ], [ %9, %for.inc.255 ] %cmp11.1 = icmp slt i32 %2, %5 br i1 %cmp11.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc.360 store i32 %5, ptr %a, align 16, !tbaa !5 store i32 %2, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc.360 %13 = phi i32 [ %5, %if.then.1 ], [ %2, %for.inc.360 ] %14 = phi i32 [ %2, %if.then.1 ], [ %5, %for.inc.360 ] %cmp11.1.1 = icmp slt i32 %14, %8 br i1 %cmp11.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.1 store i32 %8, ptr %arrayidx1, align 4, !tbaa !5 store i32 %14, ptr %arrayidx2, align 8, !tbaa !5 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.1 %15 = phi i32 [ %8, %if.then.1.1 ], [ %14, %for.inc.1 ] %16 = phi i32 [ %14, %if.then.1.1 ], [ %8, %for.inc.1 ] %cmp11.1.2 = icmp slt i32 %16, %12 br i1 %cmp11.1.2, label %if.then.1.2, label %for.inc.1.2 if.then.1.2: ; preds = %for.inc.1.1 store i32 %12, ptr %arrayidx2, align 8, !tbaa !5 store i32 %16, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.1.2 for.inc.1.2: ; preds = %if.then.1.2, %for.inc.1.1 %17 = phi i32 [ %16, %if.then.1.2 ], [ %12, %for.inc.1.1 ] %18 = phi i32 [ %12, %if.then.1.2 ], [ %16, %for.inc.1.1 ] %cmp11.2 = icmp slt i32 %13, %15 br i1 %cmp11.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1.2 store i32 %15, ptr %a, align 16, !tbaa !5 store i32 %13, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1.2 %19 = phi i32 [ %15, %if.then.2 ], [ %13, %for.inc.1.2 ] %20 = phi i32 [ %13, %if.then.2 ], [ %15, %for.inc.1.2 ] %cmp11.2.1 = icmp slt i32 %20, %18 br i1 %cmp11.2.1, label %if.then.2.1, label %for.inc.2.1 if.then.2.1: ; preds = %for.inc.2 store i32 %18, ptr %arrayidx1, align 4, !tbaa !5 store i32 %20, ptr %arrayidx2, align 8, !tbaa !5 br label %for.inc.2.1 for.inc.2.1: ; preds = %if.then.2.1, %for.inc.2 %21 = phi i32 [ %20, %if.then.2.1 ], [ %18, %for.inc.2 ] %22 = phi i32 [ %18, %if.then.2.1 ], [ %20, %for.inc.2 ] %cmp11.3 = icmp slt i32 %19, %22 br i1 %cmp11.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2.1 store i32 %22, ptr %a, align 16, !tbaa !5 store i32 %19, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2.1 %23 = phi i32 [ %19, %if.then.3 ], [ %22, %for.inc.2.1 ] %24 = phi i32 [ %22, %if.then.3 ], [ %19, %for.inc.2.1 ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %24, i32 noundef %23, i32 noundef %21, i32 noundef %17, i32 noundef %11) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int n, count = 0, ii, countMax=0; scanf("%d", &n); int array[n]; for(ii = 0; ii < n; ii++){ scanf("%d", &array[ii]); } for(ii = 0; ii < n; ii++){ if(ii > 0 && ii < n-1 && array[ii] + 1 == array[ii+1] && array[ii] - 1 == array[ii-1]){ count++; } else if(ii == 0 && n > 1 && array[0] == 1 && array[1] == 2){count++;} else if(ii == n-1 && n>1 && array[n-1] == 1000 && array[n-2] == 999){count++;} else { if(count > countMax) { countMax = count; } count = 0; } } if(count > countMax){countMax = count;} printf("%d", countMax); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23872/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23872/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %cmp88 = icmp sgt i32 %3, 0 br i1 %cmp88, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %7, %for.body ] %.lcssa.fr = freeze i32 %.lcssa %cmp390 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp390, label %for.body4.lr.ph, label %for.end59 for.body4.lr.ph: ; preds = %for.cond2.preheader %sub = add nsw i32 %.lcssa.fr, -1 %cmp25.not = icmp eq i32 %.lcssa.fr, 1 %arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 1 %idxprom41 = zext i32 %sub to i64 %arrayidx42 = getelementptr inbounds i32, ptr %vla, i64 %idxprom41 %sub45 = add nsw i32 %.lcssa.fr, -2 %idxprom46 = zext i32 %sub45 to i64 %arrayidx47 = getelementptr inbounds i32, ptr %vla, i64 %idxprom46 br i1 %cmp25.not, label %for.end59, label %land.lhs.true26.peel land.lhs.true26.peel: ; preds = %for.body4.lr.ph %4 = zext i32 %sub to i64 %wide.trip.count = zext i32 %.lcssa.fr to i64 %5 = load i32, ptr %vla, align 16, !tbaa !5 %cmp28.peel = icmp eq i32 %5, 1 br i1 %cmp28.peel, label %land.lhs.true29.peel, label %for.body4.peel.next land.lhs.true29.peel: ; preds = %land.lhs.true26.peel %6 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp31.peel = icmp eq i32 %6, 2 %spec.select117 = zext i1 %cmp31.peel to i32 br label %for.body4.peel.next for.body4.peel.next: ; preds = %land.lhs.true29.peel, %land.lhs.true26.peel %count.1.peel = phi i32 [ 0, %land.lhs.true26.peel ], [ %spec.select117, %land.lhs.true29.peel ] %invariant.gep = getelementptr i32, 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 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 %7 = load i32, ptr %n, align 4 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.peel.next, %for.inc57 %indvars.iv101 = phi i64 [ 1, %for.body4.peel.next ], [ %indvars.iv.next102, %for.inc57 ] %count.094 = phi i32 [ %count.1.peel, %for.body4.peel.next ], [ %count.1, %for.inc57 ] %countMax.091 = phi i32 [ 0, %for.body4.peel.next ], [ %countMax.2, %for.inc57 ] %cmp6 = icmp ult i64 %indvars.iv101, %4 br i1 %cmp6, label %land.lhs.true7, label %if.else34 land.lhs.true7: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv101 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add = add nsw i32 %9, 1 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv101 %10 = load i32, ptr %gep, align 4, !tbaa !5 %cmp13 = icmp eq i32 %add, %10 br i1 %cmp13, label %land.lhs.true14, label %if.else34 land.lhs.true14: ; preds = %land.lhs.true7 %sub17 = add nsw i32 %9, -1 %11 = add nuw i64 %indvars.iv101, 4294967295 %idxprom19 = and i64 %11, 4294967295 %arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %idxprom19 %12 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %sub17, %12 br i1 %cmp21, label %if.then, label %if.else34 if.then: ; preds = %land.lhs.true14 %inc22 = add nsw i32 %count.094, 1 br label %for.inc57 if.else34: ; preds = %for.body4, %land.lhs.true7, %land.lhs.true14 %cmp36 = icmp eq i64 %indvars.iv101, %idxprom41 br i1 %cmp36, label %land.lhs.true39, label %if.else51 land.lhs.true39: ; preds = %if.else34 %13 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %cmp43 = icmp eq i32 %13, 1000 br i1 %cmp43, label %land.lhs.true44, label %if.else51 land.lhs.true44: ; preds = %land.lhs.true39 %14 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %cmp48 = icmp eq i32 %14, 999 br i1 %cmp48, label %if.then49, label %if.else51 if.then49: ; preds = %land.lhs.true44 %inc50 = add nsw i32 %count.094, 1 br label %for.inc57 if.else51: ; preds = %land.lhs.true44, %land.lhs.true39, %if.else34 %spec.select = call i32 @llvm.smax.i32(i32 %count.094, i32 %countMax.091) br label %for.inc57 for.inc57: ; preds = %if.then, %if.then49, %if.else51 %countMax.2 = phi i32 [ %countMax.091, %if.then ], [ %countMax.091, %if.then49 ], [ %spec.select, %if.else51 ] %count.1 = phi i32 [ %inc22, %if.then ], [ %inc50, %if.then49 ], [ 0, %if.else51 ] %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %exitcond.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count br i1 %exitcond.not, label %for.end59, label %for.body4, !llvm.loop !11 for.end59: ; preds = %for.inc57, %for.body4.lr.ph, %for.cond2.preheader %countMax.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %for.body4.lr.ph ], [ %countMax.2, %for.inc57 ] %count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %for.body4.lr.ph ], [ %count.1, %for.inc57 ] %spec.select87 = call i32 @llvm.smax.i32(i32 %count.0.lcssa, i32 %countMax.0.lcssa) %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select87) 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1}
// AOJ 2768 Scanner // 2018.4.18 bal4u #include <stdio.h> // バッファを経ずstdinから数値を得る //#define getchar_unlocked() getchar() int in() { int n = 0, c = getchar_unlocked(); do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } int T[52]; char dp[52][1002][1002]; int main() { int N, s, i, j, k, ans; N = in(); s = 0; for (i = 0; i < N; i++) s += T[i] = in(); dp[0][0][0] = 1; for (i = 0; i < N; i++) for (j = 0; j < 1000; j++) for (k = 0; k < 1000; k++) { if (!dp[i][j][k]) continue; if (j+T[i] < 1000) dp[i+1][j+T[i]][k] = 1; if (k+T[i] < 1000) dp[i+1][j][k+T[i]] = 1; dp[i+1][j][k] = 1; } ans = 0x10101010; for (i = 0; i < 1000; i++) for (j = 0; j < 1000; j++) { if (dp[N][i][j]) { k = i; if (k < j) k = j; if (k < s-i-j) k = s-i-j; if (k < ans) ans = k; } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238770/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @T = dso_local local_unnamed_addr global [52 x i32] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [52 x [1002 x [1002 x i8]]] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\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) #4 %.pre14.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 ], [ %.pre14.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.exit13 %4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ] %mul = mul nsw i32 %n.0, 10 %and = and i32 %c.0, 15 %add = add nsw i32 %and, %mul %_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !9 %_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !14 %cmp.not.i6 = icmp ult ptr %5, %6 br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !15 cond.true.i7: ; preds = %do.body %call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13 cond.false.i10: ; preds = %do.body %incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i12 = zext i8 %7 to i32 br label %getchar_unlocked.exit13 getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10 %8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ] %cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ] %cmp = icmp sgt i32 %cond.i9, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit13 ret i32 %add } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { 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 = %entry %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 %.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %entry %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %do.body.i.preheader do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i %.ph229 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.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.exit13.i %4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph229, %do.body.i.preheader ] %n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ] %mul.i = mul nsw i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add.i = add nsw i32 %and.i, %mul.i %_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9 %_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !14 %cmp.not.i6.i = icmp ult ptr %5, %6 br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !15 cond.true.i7.i: ; preds = %do.body.i %call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i cond.false.i10.i: ; preds = %do.body.i %incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i12.i = zext i8 %7 to i32 br label %getchar_unlocked.exit13.i getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i %8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ] %cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ] %cmp.i = icmp sgt i32 %cond.i9.i, 47 br i1 %cmp.i, label %do.body.i, label %for.cond.preheader, !llvm.loop !17 for.cond.preheader: ; preds = %getchar_unlocked.exit13.i %cmp177 = icmp sgt i32 %add.i, 0 br i1 %cmp177, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %for.cond.preheader store i8 1, ptr @dp, align 16, !tbaa !16 br label %for.cond65.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %add.i to i64 br label %for.body for.body: ; preds = %for.body.preheader, %in.exit176 %9 = phi ptr [ %8, %for.body.preheader ], [ %18, %in.exit176 ] %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %in.exit176 ] %s.0178 = phi i32 [ 0, %for.body.preheader ], [ %add, %in.exit176 ] %_IO_read_ptr.i.i146 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1 %10 = load ptr, ptr %_IO_read_ptr.i.i146, align 8, !tbaa !9 %_IO_read_end.i.i147 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2 %11 = load ptr, ptr %_IO_read_end.i.i147, align 8, !tbaa !14 %cmp.not.i.i148 = icmp ult ptr %10, %11 br i1 %cmp.not.i.i148, label %cond.false.i.i173, label %cond.true.i.i149, !prof !15 cond.true.i.i149: ; preds = %for.body %call.i.i150 = tail call i32 @__uflow(ptr noundef nonnull %9) #4 %.pre14.pre.i151 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i155.preheader cond.false.i.i173: ; preds = %for.body %incdec.ptr.i.i174 = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr.i.i174, ptr %_IO_read_ptr.i.i146, align 8, !tbaa !9 %12 = load i8, ptr %10, align 1, !tbaa !16 %conv3.i.i175 = zext i8 %12 to i32 br label %do.body.i155.preheader do.body.i155.preheader: ; preds = %cond.false.i.i173, %cond.true.i.i149 %.ph227 = phi ptr [ %9, %cond.false.i.i173 ], [ %.pre14.pre.i151, %cond.true.i.i149 ] %c.0.i157.ph = phi i32 [ %conv3.i.i175, %cond.false.i.i173 ], [ %call.i.i150, %cond.true.i.i149 ] br label %do.body.i155 do.body.i155: ; preds = %do.body.i155.preheader, %getchar_unlocked.exit13.i167 %13 = phi ptr [ %18, %getchar_unlocked.exit13.i167 ], [ %.ph227, %do.body.i155.preheader ] %14 = phi ptr [ %19, %getchar_unlocked.exit13.i167 ], [ %.ph227, %do.body.i155.preheader ] %n.0.i156 = phi i32 [ %add.i160, %getchar_unlocked.exit13.i167 ], [ 0, %do.body.i155.preheader ] %c.0.i157 = phi i32 [ %cond.i9.i168, %getchar_unlocked.exit13.i167 ], [ %c.0.i157.ph, %do.body.i155.preheader ] %mul.i158 = mul nsw i32 %n.0.i156, 10 %and.i159 = and i32 %c.0.i157, 15 %add.i160 = add nsw i32 %and.i159, %mul.i158 %_IO_read_ptr.i4.i161 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 1 %15 = load ptr, ptr %_IO_read_ptr.i4.i161, align 8, !tbaa !9 %_IO_read_end.i5.i162 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 2 %16 = load ptr, ptr %_IO_read_end.i5.i162, align 8, !tbaa !14 %cmp.not.i6.i163 = icmp ult ptr %15, %16 br i1 %cmp.not.i6.i163, label %cond.false.i10.i170, label %cond.true.i7.i164, !prof !15 cond.true.i7.i164: ; preds = %do.body.i155 %call.i8.i165 = tail call i32 @__uflow(ptr noundef nonnull %14) #4 %.pre.i166 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i167 cond.false.i10.i170: ; preds = %do.body.i155 %incdec.ptr.i11.i171 = getelementptr inbounds i8, ptr %15, i64 1 store ptr %incdec.ptr.i11.i171, ptr %_IO_read_ptr.i4.i161, align 8, !tbaa !9 %17 = load i8, ptr %15, align 1, !tbaa !16 %conv3.i12.i172 = zext i8 %17 to i32 br label %getchar_unlocked.exit13.i167 getchar_unlocked.exit13.i167: ; preds = %cond.false.i10.i170, %cond.true.i7.i164 %18 = phi ptr [ %.pre.i166, %cond.true.i7.i164 ], [ %13, %cond.false.i10.i170 ] %19 = phi ptr [ %.pre.i166, %cond.true.i7.i164 ], [ %14, %cond.false.i10.i170 ] %cond.i9.i168 = phi i32 [ %call.i8.i165, %cond.true.i7.i164 ], [ %conv3.i12.i172, %cond.false.i10.i170 ] %cmp.i169 = icmp sgt i32 %cond.i9.i168, 47 br i1 %cmp.i169, label %do.body.i155, label %in.exit176, !llvm.loop !17 in.exit176: ; preds = %getchar_unlocked.exit13.i167 %arrayidx = getelementptr inbounds [52 x i32], ptr @T, i64 0, i64 %indvars.iv store i32 %add.i160, ptr %arrayidx, align 4, !tbaa !19 %add = add nsw i32 %add.i160, %s.0178 %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.exit176 store i8 1, ptr @dp, align 16, !tbaa !16 br i1 %cmp177, label %for.cond5.preheader.preheader, label %for.cond65.preheader for.cond5.preheader.preheader: ; preds = %for.end %wide.trip.count200 = zext i32 %add.i to i64 br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc62 %indvars.iv197 = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %indvars.iv.next198, %for.inc62 ] %arrayidx18 = getelementptr inbounds [52 x i32], ptr @T, i64 0, i64 %indvars.iv197 %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 br label %for.cond8.preheader for.cond65.preheader: ; preds = %for.inc62, %for.end.thread, %for.end %s.0.lcssa211 = phi i32 [ 0, %for.end.thread ], [ %add, %for.end ], [ %add, %for.inc62 ] %idxprom71 = sext i32 %add.i to i64 %broadcast.splatinsert223 = insertelement <4 x i32> poison, i32 %s.0.lcssa211, i64 0 %broadcast.splat224 = shufflevector <4 x i32> %broadcast.splatinsert223, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.ph for.cond8.preheader: ; preds = %for.cond5.preheader, %for.inc59 %indvars.iv193 = phi i64 [ 0, %for.cond5.preheader ], [ %indvars.iv.next194, %for.inc59 ] %20 = trunc i64 %indvars.iv193 to i32 br label %for.body10 for.body10: ; preds = %for.cond8.preheader, %for.inc56 %indvars.iv189 = phi i64 [ 0, %for.cond8.preheader ], [ %indvars.iv.next190, %for.inc56 ] %arrayidx16 = getelementptr inbounds [52 x [1002 x [1002 x i8]]], ptr @dp, i64 0, i64 %indvars.iv197, i64 %indvars.iv193, i64 %indvars.iv189 %21 = load i8, ptr %arrayidx16, align 1, !tbaa !16 %tobool.not = icmp eq i8 %21, 0 br i1 %tobool.not, label %for.inc56, label %if.end if.end: ; preds = %for.body10 %22 = load i32, ptr %arrayidx18, align 4, !tbaa !19 %add19 = add nsw i32 %22, %20 %cmp20 = icmp slt i32 %add19, 1000 br i1 %cmp20, label %if.then21, label %if.end32 if.then21: ; preds = %if.end %idxprom28 = sext i32 %add19 to i64 %arrayidx31 = getelementptr inbounds [52 x [1002 x [1002 x i8]]], ptr @dp, i64 0, i64 %indvars.iv.next198, i64 %idxprom28, i64 %indvars.iv189 store i8 1, ptr %arrayidx31, align 1, !tbaa !16 br label %if.end32 if.end32: ; preds = %if.then21, %if.end %23 = trunc i64 %indvars.iv189 to i32 %add35 = add nsw i32 %22, %23 %cmp36 = icmp slt i32 %add35, 1000 br i1 %cmp36, label %if.then37, label %if.end48 if.then37: ; preds = %if.end32 %idxprom46 = sext i32 %add35 to i64 %arrayidx47 = getelementptr inbounds [52 x [1002 x [1002 x i8]]], ptr @dp, i64 0, i64 %indvars.iv.next198, i64 %indvars.iv193, i64 %idxprom46 store i8 1, ptr %arrayidx47, align 1, !tbaa !16 br label %if.end48 if.end48: ; preds = %if.then37, %if.end32 %arrayidx55 = getelementptr inbounds [52 x [1002 x [1002 x i8]]], ptr @dp, i64 0, i64 %indvars.iv.next198, i64 %indvars.iv193, i64 %indvars.iv189 store i8 1, ptr %arrayidx55, align 1, !tbaa !16 br label %for.inc56 for.inc56: ; preds = %for.body10, %if.end48 %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1 %exitcond192.not = icmp eq i64 %indvars.iv.next190, 1000 br i1 %exitcond192.not, label %for.inc59, label %for.body10, !llvm.loop !21 for.inc59: ; preds = %for.inc56 %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1 %exitcond196.not = icmp eq i64 %indvars.iv.next194, 1000 br i1 %exitcond196.not, label %for.inc62, label %for.cond8.preheader, !llvm.loop !22 for.inc62: ; preds = %for.inc59 %exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200 br i1 %exitcond201.not, label %for.cond65.preheader, label %for.cond5.preheader, !llvm.loop !23 vector.ph: ; preds = %middle.block, %for.cond65.preheader %indvars.iv206 = phi i64 [ 0, %for.cond65.preheader ], [ %indvars.iv.next207, %middle.block ] %ans.0187 = phi i32 [ 269488144, %for.cond65.preheader ], [ %40, %middle.block ] %24 = trunc i64 %indvars.iv206 to i32 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %ans.0187, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %24, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert221 = insertelement <4 x i64> poison, i64 %indvars.iv206, i64 0 %broadcast.splat222 = shufflevector <4 x i64> %broadcast.splatinsert221, <4 x i64> 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %predphi, %vector.body ] %vec.phi215 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %predphi225, %vector.body ] %vec.ind216 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next219, %vector.body ] %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4> %step.add217 = add <4 x i32> %vec.ind216, <i32 4, i32 4, i32 4, i32 4> %25 = getelementptr inbounds [52 x [1002 x [1002 x i8]]], ptr @dp, i64 0, i64 %idxprom71, i64 %indvars.iv206, i64 %index %wide.load = load <4 x i8>, ptr %25, align 2, !tbaa !16 %26 = getelementptr inbounds i8, ptr %25, i64 4 %wide.load220 = load <4 x i8>, ptr %26, align 2, !tbaa !16 %.not = icmp eq <4 x i8> %wide.load, zeroinitializer %.not226 = icmp eq <4 x i8> %wide.load220, zeroinitializer %27 = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> %broadcast.splat, <4 x i32> %vec.ind216) %28 = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> %broadcast.splat, <4 x i32> %step.add217) %29 = add nuw nsw <4 x i64> %broadcast.splat222, %vec.ind %30 = add nuw nsw <4 x i64> %broadcast.splat222, %step.add %31 = trunc <4 x i64> %29 to <4 x i32> %32 = trunc <4 x i64> %30 to <4 x i32> %33 = sub <4 x i32> %broadcast.splat224, %31 %34 = sub <4 x i32> %broadcast.splat224, %32 %35 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %27, <4 x i32> %33) %36 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %28, <4 x i32> %34) %37 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %35, <4 x i32> %vec.phi) %38 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %36, <4 x i32> %vec.phi215) %predphi = select <4 x i1> %.not, <4 x i32> %vec.phi, <4 x i32> %37 %predphi225 = select <4 x i1> %.not226, <4 x i32> %vec.phi215, <4 x i32> %38 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %vec.ind.next219 = add <4 x i32> %vec.ind216, <i32 8, i32 8, i32 8, i32 8> %39 = icmp eq i64 %index.next, 1000 br i1 %39, label %middle.block, label %vector.body, !llvm.loop !24 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %predphi, <4 x i32> %predphi225) %40 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1 %exitcond209.not = icmp eq i64 %indvars.iv.next207, 1000 br i1 %exitcond209.not, label %for.end97, label %vector.ph, !llvm.loop !27 for.end97: ; preds = %middle.block %call98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %40) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 declare i32 @__uflow(ptr noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.umax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3 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 nounwind "no-trapping-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 = { "no-trapping-math"="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 = !{!"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 = distinct !{!21, !18} !22 = distinct !{!22, !18} !23 = distinct !{!23, !18} !24 = distinct !{!24, !18, !25, !26} !25 = !{!"llvm.loop.isvectorized", i32 1} !26 = !{!"llvm.loop.unroll.runtime.disable"} !27 = distinct !{!27, !18}
#include <stdio.h> #define N 16 static int reconf ( int * a, int n ) { int d[ N ]; int res = 1; int i, j; for ( i = 0; i < n; ++i ) { d[ i ] = a[ i ]; } for ( j = 0; j < n; ++j ) { a[ j ] = 0; for ( i = 0; i < n; ++i ) { a[ j ] += !!( d[ i ] == d[ j ] ); } } for ( i = 0; i < n; ++i ) { res = res && ( a[ i ] == d[ i ] ); } return ( res ); } /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int i; for ( ; ; ) { int d[ N ]; int res = 0; int n; scanf ( "%d", &n ); if ( !( n ) ) break ; for ( i = 0; i < n; ++i ) { scanf ( "%d", d + i ); } while ( !reconf ( d, n ) ) ++res; printf ( "%d\n", res ); for ( i = 0; i < n; ++i ) { if ( i ) putchar ( ' ' ); printf ( "%d", d[ i ] ); } puts ( "" ); } return ( 0 ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238813/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238813/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %d.i = alloca [16 x i32], align 16 %d = alloca [16 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not46 = icmp eq i32 %0, 0 br i1 %tobool.not46, label %for.end22, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %27, %cleanup ], [ %0, %entry ] %cmp39 = icmp sgt i32 %1, 0 br i1 %cmp39, label %for.body, label %while.cond.preheader.thread while.cond.preheader.thread: ; preds = %for.cond1.preheader call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d.i) #5 br label %reconf.exit.thread while.cond.preheader: ; preds = %for.body %cmp57.i = icmp sgt i32 %.pr, 0 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d.i) #5 br i1 %cmp57.i, label %for.body5.us.preheader.i.lr.ph, label %reconf.exit.thread for.body5.us.preheader.i.lr.ph: ; preds = %while.cond.preheader %2 = zext i32 %.pr to i64 %3 = shl nuw nsw i64 %2, 2 %min.iters.check = icmp ult i32 %.pr, 8 %n.vec = and i64 %2, 4294967288 %cmp.n = icmp eq i64 %n.vec, %2 br label %for.body5.us.preheader.i.us for.body5.us.preheader.i.us: ; preds = %while.body.us, %for.body5.us.preheader.i.lr.ph %res.041.us = phi i32 [ 0, %for.body5.us.preheader.i.lr.ph ], [ %inc6.us, %while.body.us ] call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %d.i, ptr nonnull align 16 %d, i64 %3, i1 false), !tbaa !5 br label %for.body5.us.i.us for.body5.us.i.us: ; preds = %for.cond8.for.inc22_crit_edge.us.i.us, %for.body5.us.preheader.i.us %indvars.iv68.i.us = phi i64 [ 0, %for.body5.us.preheader.i.us ], [ %indvars.iv.next69.i.us, %for.cond8.for.inc22_crit_edge.us.i.us ] %arrayidx14.us.i.us = getelementptr inbounds [16 x i32], ptr %d.i, i64 0, i64 %indvars.iv68.i.us %4 = load i32, ptr %arrayidx14.us.i.us, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body10.us.i.us.preheader, label %vector.ph vector.ph: ; preds = %for.body5.us.i.us %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi58 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %5 = getelementptr inbounds [16 x i32], ptr %d.i, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load59 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = icmp eq <4 x i32> %wide.load, %broadcast.splat %8 = icmp eq <4 x i32> %wide.load59, %broadcast.splat %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.phi58, %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 !9 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) br i1 %cmp.n, label %for.cond8.for.inc22_crit_edge.us.i.us, label %for.body10.us.i.us.preheader for.body10.us.i.us.preheader: ; preds = %for.body5.us.i.us, %middle.block %indvars.iv.i.us.ph = phi i64 [ 0, %for.body5.us.i.us ], [ %n.vec, %middle.block ] %.ph = phi i32 [ 0, %for.body5.us.i.us ], [ %14, %middle.block ] br label %for.body10.us.i.us for.body10.us.i.us: ; preds = %for.body10.us.i.us.preheader, %for.body10.us.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %for.body10.us.i.us ], [ %indvars.iv.i.us.ph, %for.body10.us.i.us.preheader ] %15 = phi i32 [ %add.us.i.us, %for.body10.us.i.us ], [ %.ph, %for.body10.us.i.us.preheader ] %arrayidx12.us.i.us = getelementptr inbounds [16 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i.us %16 = load i32, ptr %arrayidx12.us.i.us, align 4, !tbaa !5 %cmp15.us.i.us = icmp eq i32 %16, %4 %lnot.ext.us.i.us = zext i1 %cmp15.us.i.us to i32 %add.us.i.us = add nuw nsw i32 %15, %lnot.ext.us.i.us %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %2 br i1 %exitcond.not.i.us, label %for.cond8.for.inc22_crit_edge.us.i.us, label %for.body10.us.i.us, !llvm.loop !13 for.cond8.for.inc22_crit_edge.us.i.us: ; preds = %for.body10.us.i.us, %middle.block %add.us.i.us.lcssa = phi i32 [ %14, %middle.block ], [ %add.us.i.us, %for.body10.us.i.us ] %arrayidx7.us.i.us = getelementptr inbounds i32, ptr %d, i64 %indvars.iv68.i.us store i32 %add.us.i.us.lcssa, ptr %arrayidx7.us.i.us, align 4, !tbaa !5 %indvars.iv.next69.i.us = add nuw nsw i64 %indvars.iv68.i.us, 1 %exitcond72.not.i.us = icmp eq i64 %indvars.iv.next69.i.us, %2 br i1 %exitcond72.not.i.us, label %for.body27.i.us, label %for.body5.us.i.us, !llvm.loop !14 for.body27.i.us: ; preds = %for.cond8.for.inc22_crit_edge.us.i.us, %for.body27.i.us.backedge %indvars.iv73.i.us = phi i64 [ %indvars.iv73.i.us.be, %for.body27.i.us.backedge ], [ 0, %for.cond8.for.inc22_crit_edge.us.i.us ] %res.064.i.us = phi i32 [ %res.064.i.us.be, %for.body27.i.us.backedge ], [ 1, %for.cond8.for.inc22_crit_edge.us.i.us ] %tobool.not.i.us = icmp eq i32 %res.064.i.us, 0 br i1 %tobool.not.i.us, label %land.end.i.us.thread, label %land.end.i.us land.end.i.us: ; preds = %for.body27.i.us %arrayidx29.i.us = getelementptr inbounds i32, ptr %d, i64 %indvars.iv73.i.us %17 = load i32, ptr %arrayidx29.i.us, align 4, !tbaa !5 %arrayidx31.i.us = getelementptr inbounds [16 x i32], ptr %d.i, i64 0, i64 %indvars.iv73.i.us %18 = load i32, ptr %arrayidx31.i.us, align 4, !tbaa !5 %cmp32.i.us = icmp eq i32 %17, %18 %land.ext.i.us = zext i1 %cmp32.i.us to i32 %indvars.iv.next74.i.us = add nuw nsw i64 %indvars.iv73.i.us, 1 %exitcond77.not.i.us = icmp eq i64 %indvars.iv.next74.i.us, %2 br i1 %exitcond77.not.i.us, label %reconf.exit.us, label %for.body27.i.us.backedge for.body27.i.us.backedge: ; preds = %land.end.i.us, %land.end.i.us.thread %indvars.iv73.i.us.be = phi i64 [ %indvars.iv.next74.i.us, %land.end.i.us ], [ %indvars.iv.next74.i.us56, %land.end.i.us.thread ] %res.064.i.us.be = phi i32 [ %land.ext.i.us, %land.end.i.us ], [ 0, %land.end.i.us.thread ] br label %for.body27.i.us, !llvm.loop !15 land.end.i.us.thread: ; preds = %for.body27.i.us %indvars.iv.next74.i.us56 = add nuw nsw i64 %indvars.iv73.i.us, 1 %exitcond77.not.i.us57 = icmp eq i64 %indvars.iv.next74.i.us56, %2 br i1 %exitcond77.not.i.us57, label %reconf.exit.us.thread, label %for.body27.i.us.backedge reconf.exit.us.thread: ; preds = %land.end.i.us.thread call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d.i) #5 br label %while.body.us reconf.exit.us: ; preds = %land.end.i.us call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d.i) #5 br i1 %cmp32.i.us, label %while.end, label %while.body.us while.body.us: ; preds = %reconf.exit.us.thread, %reconf.exit.us %inc6.us = add nuw nsw i32 %res.041.us, 1 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d.i) #5 br label %for.body5.us.preheader.i.us for.body: ; preds = %for.cond1.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond1.preheader ] %add.ptr = getelementptr inbounds i32, ptr %d, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %n, align 4, !tbaa !5 %19 = sext i32 %.pr to i64 %cmp = icmp slt i64 %indvars.iv.next, %19 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !16 reconf.exit.thread: ; preds = %while.cond.preheader.thread, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d.i) #5 br label %while.end while.end: ; preds = %reconf.exit.us, %reconf.exit.thread %res.038 = phi i32 [ 0, %reconf.exit.thread ], [ %res.041.us, %reconf.exit.us ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.038) %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp943 = icmp sgt i32 %20, 0 br i1 %cmp943, label %if.end14.peel, label %cleanup if.end14.peel: ; preds = %while.end %.pre = load i32, ptr %d, align 16, !tbaa !5 %call15.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp9.peel = icmp sgt i32 %21, 1 br i1 %cmp9.peel, label %if.end14, label %cleanup if.end14: ; preds = %if.end14.peel, %if.end14 %indvars.iv49 = phi i64 [ %indvars.iv.next50, %if.end14 ], [ 1, %if.end14.peel ] %22 = load ptr, ptr @stdout, align 8, !tbaa !17 %call.i = call noundef i32 @putc(i32 noundef 32, ptr noundef %22) %arrayidx = getelementptr inbounds [16 x i32], ptr %d, i64 0, i64 %indvars.iv49 %23 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23) %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp9 = icmp slt i64 %indvars.iv.next50, %25 br i1 %cmp9, label %if.end14, label %cleanup, !llvm.loop !19 cleanup: ; preds = %if.end14, %if.end14.peel, %while.end %26 = load ptr, ptr @stdout, align 8, !tbaa !17 %call.i31 = call noundef i32 @putc(i32 noundef 10, ptr noundef %26) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %27 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %27, 0 br i1 %tobool.not, label %for.end22, label %for.cond1.preheader for.end22: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; 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) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = !{!18, !18, i64 0} !18 = !{!"any pointer", !7, i64 0} !19 = distinct !{!19, !10, !20} !20 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main(){ int A; int B; scanf("%d",&A); scanf("%d",&B); if(A % B == 0){ printf("%d\n",-1); }else{ printf("%d\n",A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238857/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238857/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %. = select i1 %cmp, i32 -1, i32 %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdint.h> int main(void) { int64_t X = 0, Y = 0; int64_t answer; scanf("%ld %ld", &X, &Y); if (Y == 1 || X == Y || X % Y == 0) { answer = -1; } else { answer = X * (Y - 1); } printf("%ld\n", answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238907/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238907/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i64, align 8 %Y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3 store i64 0, ptr %X, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #3 store i64 0, ptr %Y, align 8, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y) %0 = load i64, ptr %Y, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %1 = load i64, ptr %X, align 8, !tbaa !5 %cmp1 = icmp eq i64 %1, %0 br i1 %cmp1, label %if.end, label %lor.lhs.false2 lor.lhs.false2: ; preds = %lor.lhs.false %rem = srem i64 %1, %0 %cmp3 = icmp eq i64 %rem, 0 br i1 %cmp3, label %if.end, label %if.else if.else: ; preds = %lor.lhs.false2 %sub = add nsw i64 %0, -1 %mul = mul nsw i64 %1, %sub br label %if.end if.end: ; preds = %entry, %lor.lhs.false, %lor.lhs.false2, %if.else %answer.0 = phi i64 [ %mul, %if.else ], [ -1, %lor.lhs.false2 ], [ -1, %lor.lhs.false ], [ -1, %entry ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %answer.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void) { int h1, m1, h2, m2, k, de; scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &k); m1 += h1*60; m2 += h2*60; de = m2 - m1; printf("%d\n", de-k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_238950/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_238950/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1 @.str.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: %h1 = alloca i32, align 4 %m1 = alloca i32, align 4 %h2 = alloca i32, align 4 %m2 = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %k) %0 = load i32, ptr %h1, align 4, !tbaa !5 %mul = mul nsw i32 %0, 60 %1 = load i32, ptr %m1, align 4, !tbaa !5 %add = add nsw i32 %1, %mul store i32 %add, ptr %m1, align 4, !tbaa !5 %2 = load i32, ptr %h2, align 4, !tbaa !5 %mul1 = mul nsw i32 %2, 60 %3 = load i32, ptr %m2, align 4, !tbaa !5 %add2 = add nsw i32 %3, %mul1 store i32 %add2, ptr %m2, align 4, !tbaa !5 %4 = load i32, ptr %k, align 4, !tbaa !5 %5 = add i32 %add, %4 %sub3 = sub i32 %add2, %5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int cmp(const void *a,const void *b) { return *(int *)a-*(int *)b; } int max(int a,int b) { if(a>b) return a; return b; } int main() { int i,n,j,t,a[105]; scanf("%d%d",&n,&t); for(i=1;i<=n;i++) { scanf("%d",&a[i]); } j=0; for(i=1;i<=n;i++) { j+=(86400-a[i]); if(t<=j) break; } printf("%d\n",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23900/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [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 @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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %t = alloca i32, align 4 %a = alloca [105 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %a) #6 %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.not19 = icmp slt i32 %0, 1 br i1 %cmp.not19, label %for.end10, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not21 = icmp slt i32 %3, 1 br i1 %cmp3.not21, label %for.end10, label %for.body4.lr.ph for.body4.lr.ph: ; preds = %for.cond2.preheader %1 = load i32, ptr %t, align 4, !tbaa !5 %2 = add nuw i32 %3, 1 %wide.trip.count = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [105 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.lr.ph, %for.inc8 %indvars.iv28 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next29, %for.inc8 ] %j.023 = phi i32 [ 0, %for.body4.lr.ph ], [ %add, %for.inc8 ] %arrayidx6 = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv28 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %reass.sub = sub i32 %j.023, %5 %add = add i32 %reass.sub, 86400 %cmp7.not = icmp sgt i32 %1, %add br i1 %cmp7.not, label %for.inc8, label %for.end10.loopexit.split.loop.exit for.inc8: ; preds = %for.body4 %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 %exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count br i1 %exitcond.not, label %for.end10, label %for.body4, !llvm.loop !11 for.end10.loopexit.split.loop.exit: ; preds = %for.body4 %6 = trunc i64 %indvars.iv28 to i32 br label %for.end10 for.end10: ; preds = %for.inc8, %for.end10.loopexit.split.loop.exit, %entry, %for.cond2.preheader %i.1.lcssa = phi i32 [ 1, %for.cond2.preheader ], [ 1, %entry ], [ %6, %for.end10.loopexit.split.loop.exit ], [ %2, %for.inc8 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.1.lcssa) call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { 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}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #include <stdbool.h> #define rep(i, n) for(int i=0; i<(n); ++i) #define max 100000 //qsort(str, n, sizeof(int), up_comp); int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;} int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;} int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );} int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;} int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);} int main(void){ int h[2], m[2], k; int m1, m2; scanf("%d%d%d%d%d", &h[0], &m[0], &h[1], &m[1], &k); m1=h[0]*60+m[0]; m2=h[1]*60+m[1]; m2=m2-m1; printf("%d", m2-k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239050/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239050/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1 @.str.1 = 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 @up_comp(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 @down_comp(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 nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count_digit(i32 noundef %a) local_unnamed_addr #3 { entry: %cmp.not3 = icmp eq i32 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i32 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i32 %a.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %a.addr.04.off = add i32 %a.addr.04, 9 %cmp.not = icmp ult i32 %a.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end3, %entry %a.tr = phi i32 [ %a, %entry ], [ %spec.select17, %if.end3 ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %if.end3 ] %spec.select17 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr) %cmp1 = icmp slt i32 %spec.select17, 1 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %tailrecurse %spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr) %rem = srem i32 %spec.select, %spec.select17 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %tailrecurse cleanup: ; preds = %if.end3, %tailrecurse %retval.0 = phi i32 [ -1, %tailrecurse ], [ %spec.select17, %if.end3 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %h = alloca [2 x i32], align 4 %m = alloca [2 x i32], align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #10 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #10 %arrayidx2 = getelementptr inbounds [2 x i32], ptr %h, i64 0, i64 1 %arrayidx3 = getelementptr inbounds [2 x i32], ptr %m, i64 0, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %m, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %k) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %4 = load i32, ptr %k, align 4, !tbaa !5 %reass.add = sub i32 %2, %0 %reass.mul = mul i32 %reass.add, 60 %5 = add i32 %1, %4 %add9 = sub i32 %3, %5 %sub10 = add i32 %add9, %reass.mul %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 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(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}