Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main()
{
int w1,h1,w2,h2;
int r=0;
scanf("%d%d%d%d",&w1,&h1,&w2,&h2);
r = w1+h1+h1+2;
if(w1 > w2) r+=w1-w2;
else if(w2>w1) r+= w2-w1;
r+= h2+h2+w2+2;
printf("%d",r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22468/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w1 = alloca i32, align 4
%h1 = alloca i32, align 4
%w2 = alloca i32, align 4
%h2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w1, ptr noundef nonnull %h1, ptr noundef nonnull %w2, ptr noundef nonnull %h2)
%0 = load i32, ptr %w1, align 4, !tbaa !5
%1 = load i32, ptr %h1, align 4, !tbaa !5
%reass.add = shl i32 %1, 1
%add1 = add i32 %0, 2
%add2 = add i32 %add1, %reass.add
%2 = load i32, ptr %w2, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %2
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = sub i32 %0, %2
%add3 = add nsw i32 %sub, %add2
br label %if.end8
if.else: ; preds = %entry
%cmp4 = icmp sgt i32 %2, %0
br i1 %cmp4, label %if.then5, label %if.end8
if.then5: ; preds = %if.else
%sub6 = sub i32 %2, %0
%add7 = add nsw i32 %sub6, %add2
br label %if.end8
if.end8: ; preds = %if.else, %if.then5, %if.then
%r.0 = phi i32 [ %add3, %if.then ], [ %add7, %if.then5 ], [ %add2, %if.else ]
%3 = load i32, ptr %h2, align 4, !tbaa !5
%add9 = shl nsw i32 %3, 1
%add10 = add i32 %2, 2
%add11 = add i32 %add10, %r.0
%add12 = add i32 %add11, %add9
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add12)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c, tmp;
scanf("%d%d%d", &a, &b, &c);
if(b < a){
tmp = b;
b = a;
a = tmp;
}
printf("%s\n", c > a && c < b ? "Yes" : "No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224722/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224722/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %b, align 4, !tbaa !5
store i32 %0, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4
%cmp1 = icmp sgt i32 %4, %3
%cmp2 = icmp slt i32 %4, %2
%5 = and i1 %cmp1, %cmp2
%cond = select i1 %5, ptr @.str.2, ptr @.str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007
int main(int argc, char const *argv[])
{
int a,b,c;
int temp;
scanf("%d%d%d",&a,&b,&c);
if(a > b){
temp = a;
a = b;
b = temp;
}
if(a < c && c < b) puts("Yes");
else puts("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224766/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224766/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp slt i32 %3, %4
%cmp2 = icmp slt i32 %4, %2
%or.cond = and i1 %cmp1, %cmp2
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <assert.h>
#include <stdio.h>
int n, p, i, t, y = 1, d[10000] = {1};
long long r;
char s[200002];
int main() {
assert(scanf("%d%d%s", &n, &p, s + 1) == 3);
if (10 % p == 0) {
while(i++<n) {
if((s[i] - '0') % p == 0)
r += i;
}
}
else {
for(; n; n--) {
t = (t + (s[n] - '0') * y) % p;
d[t]++;
y = y * 10 % p;
}
for(i = 0; i < p; i++)
r += (long long) d[i] * (d[i] - 1);
r /= 2;
}
printf("%lld\n", r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224816/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224816/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@y = dso_local local_unnamed_addr global i32 1, align 4
@d = dso_local local_unnamed_addr global <{ i32, [9999 x i32] }> <{ i32 1, [9999 x i32] zeroinitializer }>, align 16
@.str = private unnamed_addr constant [7 x i8] c"%d%d%s\00", align 1
@n = dso_local global i32 0, align 4
@p = dso_local global i32 0, align 4
@s = dso_local global [200002 x i8] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [36 x i8] c"scanf(\22%d%d%s\22, &n, &p, s + 1) == 3\00", align 1
@.str.2 = private unnamed_addr constant [63 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/C/Source_224816/source.c\00", align 1
@__PRETTY_FUNCTION__.main = private unnamed_addr constant [11 x i8] c"int main()\00", align 1
@i = dso_local local_unnamed_addr global i32 0, align 4
@r = dso_local local_unnamed_addr global i64 0, align 8
@t = dso_local local_unnamed_addr global i32 0, align 4
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: 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, ptr noundef nonnull @p, ptr noundef nonnull getelementptr inbounds ([200002 x i8], ptr @s, i64 0, i64 1))
%cmp = icmp eq i32 %call, 3
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 9, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #3
unreachable
if.end: ; preds = %entry
%0 = load i32, ptr @p, align 4, !tbaa !5
%rem = srem i32 10, %0
%cmp1 = icmp eq i32 %rem, 0
%1 = load i32, ptr @n, align 4, !tbaa !5
br i1 %cmp1, label %while.cond.preheader, label %for.condthread-pre-split
while.cond.preheader: ; preds = %if.end
%i.promoted = load i32, ptr @i, align 4, !tbaa !5
%r.promoted51 = load i64, ptr @r, align 8, !tbaa !9
%inc54 = add nsw i32 %i.promoted, 1
%cmp355 = icmp slt i32 %i.promoted, %1
br i1 %cmp355, label %while.body.preheader, label %if.end38.loopexit
while.body.preheader: ; preds = %while.cond.preheader
%2 = sext i32 %i.promoted to i64
%3 = add nsw i64 %2, 1
%4 = add i32 %1, 1
%5 = sub i32 %1, %i.promoted
%.neg = add i32 %i.promoted, 1
%xtraiter69 = and i32 %5, 1
%lcmp.mod70.not = icmp eq i32 %xtraiter69, 0
br i1 %lcmp.mod70.not, label %while.body.prol.loopexit, label %while.body.prol
while.body.prol: ; preds = %while.body.preheader
%arrayidx.prol = getelementptr inbounds [200002 x i8], ptr @s, i64 0, i64 %3
%6 = load i8, ptr %arrayidx.prol, align 1, !tbaa !11
%conv.prol = sext i8 %6 to i32
%sub.prol = add nsw i32 %conv.prol, -48
%rem4.prol = srem i32 %sub.prol, %0
%cmp5.prol = icmp eq i32 %rem4.prol, 0
br i1 %cmp5.prol, label %if.then7.prol, label %if.end9.prol
if.then7.prol: ; preds = %while.body.prol
%add.prol = add nsw i64 %r.promoted51, %3
store i64 %add.prol, ptr @r, align 8, !tbaa !9
br label %if.end9.prol
if.end9.prol: ; preds = %if.then7.prol, %while.body.prol
%add52.prol = phi i64 [ %add.prol, %if.then7.prol ], [ %r.promoted51, %while.body.prol ]
%indvars.iv.next65.prol = add nsw i64 %2, 2
br label %while.body.prol.loopexit
while.body.prol.loopexit: ; preds = %if.end9.prol, %while.body.preheader
%add52.lcssa.unr = phi i64 [ undef, %while.body.preheader ], [ %add52.prol, %if.end9.prol ]
%indvars.iv64.unr = phi i64 [ %3, %while.body.preheader ], [ %indvars.iv.next65.prol, %if.end9.prol ]
%add5356.unr = phi i64 [ %r.promoted51, %while.body.preheader ], [ %add52.prol, %if.end9.prol ]
%7 = icmp eq i32 %1, %.neg
br i1 %7, label %if.end38.loopexit, label %while.body
while.body: ; preds = %while.body.prol.loopexit, %if.end9.1
%indvars.iv64 = phi i64 [ %indvars.iv.next65.1, %if.end9.1 ], [ %indvars.iv64.unr, %while.body.prol.loopexit ]
%add5356 = phi i64 [ %add52.1, %if.end9.1 ], [ %add5356.unr, %while.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [200002 x i8], ptr @s, i64 0, i64 %indvars.iv64
%8 = load i8, ptr %arrayidx, align 1, !tbaa !11
%conv = sext i8 %8 to i32
%sub = add nsw i32 %conv, -48
%rem4 = srem i32 %sub, %0
%cmp5 = icmp eq i32 %rem4, 0
br i1 %cmp5, label %if.then7, label %if.end9
if.then7: ; preds = %while.body
%add = add nsw i64 %add5356, %indvars.iv64
store i64 %add, ptr @r, align 8, !tbaa !9
br label %if.end9
if.end9: ; preds = %if.then7, %while.body
%add52 = phi i64 [ %add, %if.then7 ], [ %add5356, %while.body ]
%indvars.iv.next65 = add nsw i64 %indvars.iv64, 1
%arrayidx.1 = getelementptr inbounds [200002 x i8], ptr @s, i64 0, i64 %indvars.iv.next65
%9 = load i8, ptr %arrayidx.1, align 1, !tbaa !11
%conv.1 = sext i8 %9 to i32
%sub.1 = add nsw i32 %conv.1, -48
%rem4.1 = srem i32 %sub.1, %0
%cmp5.1 = icmp eq i32 %rem4.1, 0
br i1 %cmp5.1, label %if.then7.1, label %if.end9.1
if.then7.1: ; preds = %if.end9
%add.1 = add nsw i64 %add52, %indvars.iv.next65
store i64 %add.1, ptr @r, align 8, !tbaa !9
br label %if.end9.1
if.end9.1: ; preds = %if.then7.1, %if.end9
%add52.1 = phi i64 [ %add.1, %if.then7.1 ], [ %add52, %if.end9 ]
%indvars.iv.next65.1 = add nsw i64 %indvars.iv64, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next65.1 to i32
%exitcond67.not.1 = icmp eq i32 %4, %lftr.wideiv.1
br i1 %exitcond67.not.1, label %if.end38.loopexit, label %while.body, !llvm.loop !12
for.condthread-pre-split: ; preds = %if.end
%tobool.not43 = icmp eq i32 %1, 0
br i1 %tobool.not43, label %for.cond22.preheader, label %for.body.preheader
for.body.preheader: ; preds = %for.condthread-pre-split
%y.promoted = load i32, ptr @y, align 4, !tbaa !5
%t.promoted = load i32, ptr @t, align 4, !tbaa !5
%10 = sext i32 %1 to i64
br label %for.body
for.cond.for.cond22.preheader_crit_edge: ; preds = %for.body
store i32 %rem16, ptr @t, align 4, !tbaa !5
store i32 %rem21, ptr @y, align 4, !tbaa !5
store i32 0, ptr @n, align 4, !tbaa !5
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.cond.for.cond22.preheader_crit_edge, %for.condthread-pre-split
%r.promoted = load i64, ptr @r, align 8, !tbaa !9
%cmp2347 = icmp sgt i32 %0, 0
br i1 %cmp2347, label %for.body25.preheader, label %for.end37
for.body25.preheader: ; preds = %for.cond22.preheader
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 1
%11 = icmp eq i32 %0, 1
br i1 %11, label %for.end37.loopexit.unr-lcssa, label %for.body25.preheader.new
for.body25.preheader.new: ; preds = %for.body25.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body25
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %10, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%rem164145 = phi i32 [ %t.promoted, %for.body.preheader ], [ %rem16, %for.body ]
%rem214244 = phi i32 [ %y.promoted, %for.body.preheader ], [ %rem21, %for.body ]
%arrayidx12 = getelementptr inbounds [200002 x i8], ptr @s, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx12, align 1, !tbaa !11
%conv13 = sext i8 %12 to i32
%sub14 = add nsw i32 %conv13, -48
%mul = mul nsw i32 %sub14, %rem214244
%add15 = add nsw i32 %mul, %rem164145
%rem16 = srem i32 %add15, %0
%idxprom17 = sext i32 %rem16 to i64
%arrayidx18 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %idxprom17
%13 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%inc19 = add nsw i32 %13, 1
store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5
%mul20 = mul nsw i32 %rem214244, 10
%rem21 = srem i32 %mul20, %0
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%14 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %14, 0
br i1 %tobool.not, label %for.cond.for.cond22.preheader_crit_edge, label %for.body, !llvm.loop !14
for.body25: ; preds = %for.body25, %for.body25.preheader.new
%indvars.iv61 = phi i64 [ 0, %for.body25.preheader.new ], [ %indvars.iv.next62.1, %for.body25 ]
%add344648 = phi i64 [ %r.promoted, %for.body25.preheader.new ], [ %add34.1, %for.body25 ]
%niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.1, %for.body25 ]
%arrayidx27 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv61
%15 = load i32, ptr %arrayidx27, align 8, !tbaa !5
%conv28 = sext i32 %15 to i64
%sub31 = add nsw i32 %15, -1
%conv32 = sext i32 %sub31 to i64
%mul33 = mul nsw i64 %conv32, %conv28
%add34 = add nsw i64 %mul33, %add344648
%indvars.iv.next62 = or i64 %indvars.iv61, 1
%arrayidx27.1 = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv.next62
%16 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5
%conv28.1 = sext i32 %16 to i64
%sub31.1 = add nsw i32 %16, -1
%conv32.1 = sext i32 %sub31.1 to i64
%mul33.1 = mul nsw i64 %conv32.1, %conv28.1
%add34.1 = add nsw i64 %mul33.1, %add34
%indvars.iv.next62.1 = add nuw nsw i64 %indvars.iv61, 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.end37.loopexit.unr-lcssa, label %for.body25, !llvm.loop !15
for.end37.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader
%add34.lcssa.ph = phi i64 [ undef, %for.body25.preheader ], [ %add34.1, %for.body25 ]
%indvars.iv61.unr = phi i64 [ 0, %for.body25.preheader ], [ %indvars.iv.next62.1, %for.body25 ]
%add344648.unr = phi i64 [ %r.promoted, %for.body25.preheader ], [ %add34.1, %for.body25 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end37, label %for.body25.epil
for.body25.epil: ; preds = %for.end37.loopexit.unr-lcssa
%arrayidx27.epil = getelementptr inbounds [10000 x i32], ptr @d, i64 0, i64 %indvars.iv61.unr
%17 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5
%conv28.epil = sext i32 %17 to i64
%sub31.epil = add nsw i32 %17, -1
%conv32.epil = sext i32 %sub31.epil to i64
%mul33.epil = mul nsw i64 %conv32.epil, %conv28.epil
%add34.epil = add nsw i64 %mul33.epil, %add344648.unr
br label %for.end37
for.end37: ; preds = %for.body25.epil, %for.end37.loopexit.unr-lcssa, %for.cond22.preheader
%18 = phi i64 [ %r.promoted, %for.cond22.preheader ], [ %add34.lcssa.ph, %for.end37.loopexit.unr-lcssa ], [ %add34.epil, %for.body25.epil ]
%storemerge.lcssa = phi i32 [ 0, %for.cond22.preheader ], [ %0, %for.end37.loopexit.unr-lcssa ], [ %0, %for.body25.epil ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%div = sdiv i64 %18, 2
store i64 %div, ptr @r, align 8, !tbaa !9
br label %if.end38
if.end38.loopexit: ; preds = %while.body.prol.loopexit, %if.end9.1, %while.cond.preheader
%19 = phi i64 [ %r.promoted51, %while.cond.preheader ], [ %add52.lcssa.unr, %while.body.prol.loopexit ], [ %add52.1, %if.end9.1 ]
%inc.lcssa = phi i32 [ %inc54, %while.cond.preheader ], [ %4, %if.end9.1 ], [ %4, %while.body.prol.loopexit ]
store i32 %inc.lcssa, ptr @i, align 4, !tbaa !5
br label %if.end38
if.end38: ; preds = %if.end38.loopexit, %for.end37
%20 = phi i64 [ %19, %if.end38.loopexit ], [ %div, %for.end37 ]
%call39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %20)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
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 = { 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 #3 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long ll;
typedef long double ld;
#define INF (1LL<<60)
/*swap 交換*/
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
/*2つのうち大きい数を返す*/
ll max2(ll a,ll b){return a>=b?a:b;}
/*2つのうち小さい数を返す*/
ll min2(ll a,ll b){return a>=b?b:a;}
/*絶対値*/
ll ABS(ll a){return a>=0?a:(-a);}
typedef struct{
ll aa;
ll bb;
}frequent;
// 小大
int compare(const void *a, const void *b){return *(ll *)a - *(ll *)b;}
int main(void){
ll n,i,ans=0;
scanf("%lld",&n);
char s[12],ini[n];
for(i=0;i<n;i++){
scanf("%s",s);
ini[i] = s[0];
}
// for(i=0;i<n;i++){
// printf("%c ",ini[i]);
// }
ll letter[]={0,0,0,0,0};
for(i=0;i<n;i++){
if(ini[i]=='M') letter[0]++;
if(ini[i]=='A') letter[1]++;
if(ini[i]=='R') letter[2]++;
if(ini[i]=='C') letter[3]++;
if(ini[i]=='H') letter[4]++;
}
// for(i=0;i<5;i++){
// printf("%lld ",letter[i]);
// }
for(i=0;i<5;i++){
for(ll j=i+1;j<5;j++){
for(ll k=j+1;k<5;k++){
ans+=letter[i]*letter[j]*letter[k];
}
}
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i64, align 8
%s = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #8
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp103 = icmp sgt i64 %2, 0
br i1 %cmp103, label %for.body, label %for.cond46.loopexit.4
for.body: ; preds = %entry, %for.body
%i.0104 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%3 = load i8, ptr %s, align 1, !tbaa !9
%arrayidx2 = getelementptr inbounds i8, ptr %vla, i64 %i.0104
store i8 %3, ptr %arrayidx2, align 1, !tbaa !9
%inc = add nuw nsw i64 %i.0104, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body
%cmp4106 = icmp sgt i64 %4, 0
br i1 %cmp4106, label %for.body5.preheader, label %for.cond46.loopexit.4
for.body5.preheader: ; preds = %for.end
%xtraiter = and i64 %4, 1
%5 = icmp eq i64 %4, 1
br i1 %5, label %for.cond46.loopexit.4.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %4, -2
br label %for.body5
for.body5: ; preds = %for.inc43.1, %for.body5.preheader.new
%inc17116 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc17115.1, %for.inc43.1 ]
%inc25114 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc25113.1, %for.inc43.1 ]
%inc33112 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc33111.1, %for.inc43.1 ]
%inc41110 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc41109.1, %for.inc43.1 ]
%i.1107 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc44.1, %for.inc43.1 ]
%6 = phi i64 [ 0, %for.body5.preheader.new ], [ %10, %for.inc43.1 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc43.1 ]
%arrayidx6 = getelementptr inbounds i8, ptr %vla, i64 %i.1107
%7 = load i8, ptr %arrayidx6, align 2, !tbaa !9
switch i8 %7, label %for.inc43 [
i8 77, label %if.end.thread
i8 65, label %if.then15
i8 82, label %if.end26.thread
i8 67, label %if.then31
i8 72, label %if.then39
]
if.end.thread: ; preds = %for.body5
%inc10 = add nsw i64 %6, 1
br label %for.inc43
if.then15: ; preds = %for.body5
%inc17 = add nsw i64 %inc17116, 1
br label %for.inc43
if.end26.thread: ; preds = %for.body5
%inc25 = add nsw i64 %inc25114, 1
br label %for.inc43
if.then31: ; preds = %for.body5
%inc33 = add nsw i64 %inc33112, 1
br label %for.inc43
if.then39: ; preds = %for.body5
%inc41 = add nsw i64 %inc41110, 1
br label %for.inc43
for.inc43: ; preds = %for.body5, %if.then15, %if.end.thread, %if.then31, %if.end26.thread, %if.then39
%inc17115 = phi i64 [ %inc17116, %for.body5 ], [ %inc17, %if.then15 ], [ %inc17116, %if.end.thread ], [ %inc17116, %if.then31 ], [ %inc17116, %if.end26.thread ], [ %inc17116, %if.then39 ]
%inc25113 = phi i64 [ %inc25114, %for.body5 ], [ %inc25114, %if.then15 ], [ %inc25114, %if.end.thread ], [ %inc25114, %if.then31 ], [ %inc25, %if.end26.thread ], [ %inc25114, %if.then39 ]
%inc33111 = phi i64 [ %inc33112, %for.body5 ], [ %inc33112, %if.then15 ], [ %inc33112, %if.end.thread ], [ %inc33, %if.then31 ], [ %inc33112, %if.end26.thread ], [ %inc33112, %if.then39 ]
%inc41109 = phi i64 [ %inc41110, %for.body5 ], [ %inc41110, %if.then15 ], [ %inc41110, %if.end.thread ], [ %inc41110, %if.then31 ], [ %inc41110, %if.end26.thread ], [ %inc41, %if.then39 ]
%8 = phi i64 [ %6, %for.body5 ], [ %6, %if.then15 ], [ %inc10, %if.end.thread ], [ %6, %if.then31 ], [ %6, %if.end26.thread ], [ %6, %if.then39 ]
%inc44 = or i64 %i.1107, 1
%arrayidx6.1 = getelementptr inbounds i8, ptr %vla, i64 %inc44
%9 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9
switch i8 %9, label %for.inc43.1 [
i8 77, label %if.end.thread.1
i8 65, label %if.then15.1
i8 82, label %if.end26.thread.1
i8 67, label %if.then31.1
i8 72, label %if.then39.1
]
if.then39.1: ; preds = %for.inc43
%inc41.1 = add nsw i64 %inc41109, 1
br label %for.inc43.1
if.then31.1: ; preds = %for.inc43
%inc33.1 = add nsw i64 %inc33111, 1
br label %for.inc43.1
if.end26.thread.1: ; preds = %for.inc43
%inc25.1 = add nsw i64 %inc25113, 1
br label %for.inc43.1
if.then15.1: ; preds = %for.inc43
%inc17.1 = add nsw i64 %inc17115, 1
br label %for.inc43.1
if.end.thread.1: ; preds = %for.inc43
%inc10.1 = add nsw i64 %8, 1
br label %for.inc43.1
for.inc43.1: ; preds = %if.end.thread.1, %if.then15.1, %if.end26.thread.1, %if.then31.1, %if.then39.1, %for.inc43
%inc17115.1 = phi i64 [ %inc17115, %for.inc43 ], [ %inc17.1, %if.then15.1 ], [ %inc17115, %if.end.thread.1 ], [ %inc17115, %if.then31.1 ], [ %inc17115, %if.end26.thread.1 ], [ %inc17115, %if.then39.1 ]
%inc25113.1 = phi i64 [ %inc25113, %for.inc43 ], [ %inc25113, %if.then15.1 ], [ %inc25113, %if.end.thread.1 ], [ %inc25113, %if.then31.1 ], [ %inc25.1, %if.end26.thread.1 ], [ %inc25113, %if.then39.1 ]
%inc33111.1 = phi i64 [ %inc33111, %for.inc43 ], [ %inc33111, %if.then15.1 ], [ %inc33111, %if.end.thread.1 ], [ %inc33.1, %if.then31.1 ], [ %inc33111, %if.end26.thread.1 ], [ %inc33111, %if.then39.1 ]
%inc41109.1 = phi i64 [ %inc41109, %for.inc43 ], [ %inc41109, %if.then15.1 ], [ %inc41109, %if.end.thread.1 ], [ %inc41109, %if.then31.1 ], [ %inc41109, %if.end26.thread.1 ], [ %inc41.1, %if.then39.1 ]
%10 = phi i64 [ %8, %for.inc43 ], [ %8, %if.then15.1 ], [ %inc10.1, %if.end.thread.1 ], [ %8, %if.then31.1 ], [ %8, %if.end26.thread.1 ], [ %8, %if.then39.1 ]
%inc44.1 = add nuw nsw i64 %i.1107, 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.cond46.loopexit.4.loopexit.unr-lcssa, label %for.body5, !llvm.loop !12
for.cond46.loopexit.4.loopexit.unr-lcssa: ; preds = %for.inc43.1, %for.body5.preheader
%inc17115.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %inc17115.1, %for.inc43.1 ]
%inc25113.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %inc25113.1, %for.inc43.1 ]
%inc33111.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %inc33111.1, %for.inc43.1 ]
%inc41109.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %inc41109.1, %for.inc43.1 ]
%.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %10, %for.inc43.1 ]
%inc17116.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc17115.1, %for.inc43.1 ]
%inc25114.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc25113.1, %for.inc43.1 ]
%inc33112.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc33111.1, %for.inc43.1 ]
%inc41110.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc41109.1, %for.inc43.1 ]
%i.1107.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc44.1, %for.inc43.1 ]
%.unr = phi i64 [ 0, %for.body5.preheader ], [ %10, %for.inc43.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond46.loopexit.4, label %for.body5.epil
for.body5.epil: ; preds = %for.cond46.loopexit.4.loopexit.unr-lcssa
%arrayidx6.epil = getelementptr inbounds i8, ptr %vla, i64 %i.1107.unr
%11 = load i8, ptr %arrayidx6.epil, align 1, !tbaa !9
switch i8 %11, label %for.cond46.loopexit.4 [
i8 77, label %if.end.thread.epil
i8 65, label %if.then15.epil
i8 82, label %if.end26.thread.epil
i8 67, label %if.then31.epil
i8 72, label %if.then39.epil
]
if.then39.epil: ; preds = %for.body5.epil
%inc41.epil = add nsw i64 %inc41110.unr, 1
br label %for.cond46.loopexit.4
if.then31.epil: ; preds = %for.body5.epil
%inc33.epil = add nsw i64 %inc33112.unr, 1
br label %for.cond46.loopexit.4
if.end26.thread.epil: ; preds = %for.body5.epil
%inc25.epil = add nsw i64 %inc25114.unr, 1
br label %for.cond46.loopexit.4
if.then15.epil: ; preds = %for.body5.epil
%inc17.epil = add nsw i64 %inc17116.unr, 1
br label %for.cond46.loopexit.4
if.end.thread.epil: ; preds = %for.body5.epil
%inc10.epil = add nsw i64 %.unr, 1
br label %for.cond46.loopexit.4
for.cond46.loopexit.4: ; preds = %for.cond46.loopexit.4.loopexit.unr-lcssa, %if.end.thread.epil, %if.then15.epil, %if.end26.thread.epil, %if.then31.epil, %if.then39.epil, %for.body5.epil, %entry, %for.end
%letter.sroa.8.0 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %inc17115.lcssa.ph, %for.cond46.loopexit.4.loopexit.unr-lcssa ], [ %inc17116.unr, %for.body5.epil ], [ %inc17.epil, %if.then15.epil ], [ %inc17116.unr, %if.end.thread.epil ], [ %inc17116.unr, %if.then31.epil ], [ %inc17116.unr, %if.end26.thread.epil ], [ %inc17116.unr, %if.then39.epil ]
%letter.sroa.14.0 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %inc25113.lcssa.ph, %for.cond46.loopexit.4.loopexit.unr-lcssa ], [ %inc25114.unr, %for.body5.epil ], [ %inc25114.unr, %if.then15.epil ], [ %inc25114.unr, %if.end.thread.epil ], [ %inc25114.unr, %if.then31.epil ], [ %inc25.epil, %if.end26.thread.epil ], [ %inc25114.unr, %if.then39.epil ]
%letter.sroa.21.0 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %inc33111.lcssa.ph, %for.cond46.loopexit.4.loopexit.unr-lcssa ], [ %inc33112.unr, %for.body5.epil ], [ %inc33112.unr, %if.then15.epil ], [ %inc33112.unr, %if.end.thread.epil ], [ %inc33.epil, %if.then31.epil ], [ %inc33112.unr, %if.end26.thread.epil ], [ %inc33112.unr, %if.then39.epil ]
%letter.sroa.30.0 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %inc41109.lcssa.ph, %for.cond46.loopexit.4.loopexit.unr-lcssa ], [ %inc41110.unr, %for.body5.epil ], [ %inc41110.unr, %if.then15.epil ], [ %inc41110.unr, %if.end.thread.epil ], [ %inc41110.unr, %if.then31.epil ], [ %inc41110.unr, %if.end26.thread.epil ], [ %inc41.epil, %if.then39.epil ]
%.lcssa105 = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %.lcssa.ph, %for.cond46.loopexit.4.loopexit.unr-lcssa ], [ %.unr, %for.body5.epil ], [ %.unr, %if.then15.epil ], [ %inc10.epil, %if.end.thread.epil ], [ %.unr, %if.then31.epil ], [ %.unr, %if.end26.thread.epil ], [ %.unr, %if.then39.epil ]
%mul.2 = mul nsw i64 %letter.sroa.21.0, %letter.sroa.14.0
%mul63.2 = mul nsw i64 %mul.2, %letter.sroa.30.0
%mul.1.1 = mul nsw i64 %letter.sroa.21.0, %letter.sroa.8.0
%mul63.1.1 = mul nsw i64 %mul.1.1, %letter.sroa.30.0
%mul.1 = mul nsw i64 %letter.sroa.14.0, %letter.sroa.8.0
%mul63.1.1134 = mul nsw i64 %mul.1, %letter.sroa.30.0
%mul63.1 = mul nsw i64 %mul.1, %letter.sroa.21.0
%mul.2150 = mul nsw i64 %letter.sroa.21.0, %.lcssa105
%mul63.2153 = mul nsw i64 %mul.2150, %letter.sroa.30.0
%mul.1140 = mul nsw i64 %letter.sroa.14.0, %.lcssa105
%mul63.1143.1 = mul nsw i64 %mul.1140, %letter.sroa.30.0
%mul63.1143 = mul nsw i64 %mul.1140, %letter.sroa.21.0
%mul = mul nsw i64 %letter.sroa.8.0, %.lcssa105
%mul63226 = add i64 %letter.sroa.21.0, %letter.sroa.14.0
%add64.1175227 = add i64 %letter.sroa.30.0, %mul63226
%add64.2179 = mul i64 %mul, %add64.1175227
%add64.1144 = add nsw i64 %mul63.1143, %add64.2179
%add64.1144.1 = add nsw i64 %mul63.1143.1, %add64.1144
%add64.2154 = add nsw i64 %mul63.2153, %add64.1144.1
%add64.1 = add nsw i64 %mul63.1, %add64.2154
%add64.1.1135 = add nsw i64 %mul63.1.1134, %add64.1
%add64.1.1 = add nsw i64 %mul63.1.1, %add64.1.1135
%add64.2 = add nsw i64 %mul63.2, %add64.1.1
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add64.2)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8
ret i32 0
}
; 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
declare ptr @llvm.stacksave.p0() #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
#define max(A, B) ((A)>(B)?(A):(B))
#define min(A, B) ((A)<(B)?(A):(B))
void solve(){
int n, l, r, maxl=1, minr=1000000001;
scanf("%d", &n);
while(n--){
scanf("%d %d", &l, &r);
maxl=max(maxl, l);
minr=min(minr, r);
}
printf("%d\n", maxl-minr>=0?maxl-minr:0);
}
int main(){
int t;
scanf("%d", &t);
while(t--) solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @solve() local_unnamed_addr #0 {
entry:
%n = 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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec20 = add nsw i32 %0, -1
store i32 %dec20, ptr %n, align 4, !tbaa !5
%tobool.not21 = icmp eq i32 %0, 0
br i1 %tobool.not21, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%minr.023 = phi i32 [ %cond6, %while.body ], [ 1000000001, %entry ]
%maxl.022 = phi i32 [ %cond, %while.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %l, align 4
%cond = call i32 @llvm.smax.i32(i32 %maxl.022, i32 %1)
%2 = load i32, ptr %r, align 4
%cond6 = call i32 @llvm.smin.i32(i32 %minr.023, i32 %2)
%3 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !9
while.end.loopexit: ; preds = %while.body
%4 = sub nsw i32 %cond, %cond6
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%sub = phi i32 [ -1000000000, %entry ], [ %4, %while.end.loopexit ]
%cond12 = call i32 @llvm.smax.i32(i32 %sub, i32 0)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond12)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret 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: 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:
%n.i = alloca i32, align 4
%l.i = alloca i32, align 4
%r.i = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec1 = add nsw i32 %0, -1
store i32 %dec1, ptr %t, align 4, !tbaa !5
%tobool.not2 = icmp eq i32 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %solve.exit
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n.i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l.i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r.i) #4
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n.i)
%1 = load i32, ptr %n.i, align 4, !tbaa !5
%dec20.i = add nsw i32 %1, -1
store i32 %dec20.i, ptr %n.i, align 4, !tbaa !5
%tobool.not21.i = icmp eq i32 %1, 0
br i1 %tobool.not21.i, label %solve.exit, label %while.body.i
while.body.i: ; preds = %while.body, %while.body.i
%minr.023.i = phi i32 [ %cond6.i, %while.body.i ], [ 1000000001, %while.body ]
%maxl.022.i = phi i32 [ %cond.i, %while.body.i ], [ 1, %while.body ]
%call1.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l.i, ptr noundef nonnull %r.i)
%2 = load i32, ptr %l.i, align 4
%cond.i = call i32 @llvm.smax.i32(i32 %maxl.022.i, i32 %2)
%3 = load i32, ptr %r.i, align 4
%cond6.i = call i32 @llvm.smin.i32(i32 %minr.023.i, i32 %3)
%4 = load i32, ptr %n.i, align 4, !tbaa !5
%dec.i = add nsw i32 %4, -1
store i32 %dec.i, ptr %n.i, align 4, !tbaa !5
%tobool.not.i = icmp eq i32 %4, 0
br i1 %tobool.not.i, label %while.end.loopexit.i, label %while.body.i, !llvm.loop !9
while.end.loopexit.i: ; preds = %while.body.i
%5 = sub nsw i32 %cond.i, %cond6.i
br label %solve.exit
solve.exit: ; preds = %while.body, %while.end.loopexit.i
%sub.i = phi i32 [ -1000000000, %while.body ], [ %5, %while.end.loopexit.i ]
%cond12.i = call i32 @llvm.smax.i32(i32 %sub.i, i32 0)
%call13.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond12.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r.i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l.i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n.i) #4
%6 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %solve.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <string.h>
int main(){
int i,j,n;
scanf("%d",&n);
char s[12];
long long m=0,a=0,r=0,c=0,h=0;
scanf("%c",&s[0]);
for(i=0;i<n;i++){
for(j=0;j<=10;j++){
scanf("%c",&s[j]);
if(s[j]=='\n') break;
}
if(s[0]=='M') m++;
if(s[0]=='A') a++;
if(s[0]=='R') r++;
if(s[0]=='C') c++;
if(s[0]=='H') h++;
}
long long x=0;
x=m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h;
printf("%lld",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp122 = icmp sgt i32 %0, 0
br i1 %cmp122, label %for.cond2.preheader, label %for.end48
for.cond2.preheader: ; preds = %entry, %for.end
%i.0128 = phi i32 [ %inc47, %for.end ], [ 0, %entry ]
%h.0127 = phi i64 [ %h.1, %for.end ], [ 0, %entry ]
%c.0126 = phi i64 [ %c.1, %for.end ], [ 0, %entry ]
%r.0125 = phi i64 [ %r.1, %for.end ], [ 0, %entry ]
%a.0124 = phi i64 [ %a.1, %for.end ], [ 0, %entry ]
%m.0123 = phi i64 [ %spec.select, %for.end ], [ 0, %entry ]
br label %for.body4
for.body4: ; preds = %for.body4, %for.cond2.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx5 = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%1 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp9 = icmp ne i8 %1, 10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp3 = icmp ult i64 %indvars.iv, 10
%or.cond = and i1 %cmp9, %cmp3
br i1 %or.cond, label %for.body4, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body4
%2 = load i8, ptr %s, align 1, !tbaa !9
%cmp13 = icmp eq i8 %2, 77
%inc16 = zext i1 %cmp13 to i64
%spec.select = add nuw nsw i64 %m.0123, %inc16
%cmp20 = icmp eq i8 %2, 65
%inc23 = zext i1 %cmp20 to i64
%a.1 = add nuw nsw i64 %a.0124, %inc23
%cmp27 = icmp eq i8 %2, 82
%inc30 = zext i1 %cmp27 to i64
%r.1 = add nuw nsw i64 %r.0125, %inc30
%cmp34 = icmp eq i8 %2, 67
%inc37 = zext i1 %cmp34 to i64
%c.1 = add nuw nsw i64 %c.0126, %inc37
%cmp41 = icmp eq i8 %2, 72
%inc44 = zext i1 %cmp41 to i64
%h.1 = add nuw nsw i64 %h.0127, %inc44
%inc47 = add nuw nsw i32 %i.0128, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc47, %3
br i1 %cmp, label %for.cond2.preheader, label %for.end48, !llvm.loop !12
for.end48: ; preds = %for.end, %entry
%m.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.end ]
%a.0.lcssa = phi i64 [ 0, %entry ], [ %a.1, %for.end ]
%r.0.lcssa = phi i64 [ 0, %entry ], [ %r.1, %for.end ]
%c.0.lcssa = phi i64 [ 0, %entry ], [ %c.1, %for.end ]
%h.0.lcssa = phi i64 [ 0, %entry ], [ %h.1, %for.end ]
%mul = mul nsw i64 %a.0.lcssa, %m.0.lcssa
%mul51111 = add i64 %c.0.lcssa, %r.0.lcssa
%mul53112 = add i64 %mul51111, %h.0.lcssa
%add54 = mul i64 %mul, %mul53112
%reass.add118 = add i64 %a.0.lcssa, %m.0.lcssa
%reass.add119 = add i64 %reass.add118, %r.0.lcssa
%reass.mul120 = mul i64 %reass.add119, %c.0.lcssa
%mul64134 = add i64 %m.0.lcssa, %a.0.lcssa
%reass.add114 = mul i64 %r.0.lcssa, %mul64134
%reass.add115 = add i64 %reass.add114, %reass.mul120
%reass.mul = mul i64 %reass.add115, %h.0.lcssa
%reass.mul117 = mul i64 %reass.add114, %c.0.lcssa
%add72 = add i64 %add54, %reass.mul117
%add75 = add i64 %add72, %reass.mul
%call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add75)
call void @llvm.lifetime.end.p0(i64 12, 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"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int i,j,ppp,line[9];
char row[9];
int main(){
while(1){
for(i=0;i<3;i++){
scanf("%s",row);
if(row[0]=='0')return 0;
for(j=0;j<3;j++){
if(row[j]=='w')ppp=1;
else if(row[j]=='b')ppp=-1;
else continue;
line[j]+=ppp;
line[3+i]+=ppp;
if(i==j)line[6]+=ppp;
if(i==2-j)line[7]+=ppp;
}
}
ppp=0;
for(i=0;i<8;i++){
if(line[i]==3){if(ppp==0)printf("w\n");ppp++;}
if(line[i]==-3){if(ppp==0)printf("b\n");ppp++;}
line[i]=0;
}
if(ppp==0)printf("NA\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@row = dso_local global [9 x i8] zeroinitializer, align 1
@j = dso_local local_unnamed_addr global i32 0, align 4
@ppp = dso_local local_unnamed_addr global i32 0, align 4
@line = dso_local local_unnamed_addr global [9 x i32] zeroinitializer, align 16
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %while.body
while.body: ; preds = %while.body.backedge, %entry
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %while.body, %for.inc.2
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @row)
%0 = load i8, ptr @row, align 1, !tbaa !9
%cmp1 = icmp eq i8 %0, 48
br i1 %cmp1, label %if.then, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body
%1 = load i32, ptr @i, align 4
%add22 = add nsw i32 %1, 3
%idxprom23 = sext i32 %add22 to i64
%arrayidx24 = getelementptr inbounds [9 x i32], ptr @line, i64 0, i64 %idxprom23
switch i8 %0, label %for.inc [
i8 119, label %if.end19
i8 98, label %if.then16
]
if.then: ; preds = %for.body
ret i32 0
if.then16: ; preds = %for.cond3.preheader
br label %if.end19
if.end19: ; preds = %for.cond3.preheader, %if.then16
%storemerge82 = phi i32 [ -1, %if.then16 ], [ 1, %for.cond3.preheader ]
store i32 %storemerge82, ptr @ppp, align 4, !tbaa !5
%2 = load i32, ptr @line, align 16, !tbaa !5
%add = add nsw i32 %2, %storemerge82
store i32 %add, ptr @line, align 16, !tbaa !5
%3 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25 = add nsw i32 %3, %storemerge82
store i32 %add25, ptr %arrayidx24, align 4, !tbaa !5
switch i32 %1, label %for.inc [
i32 0, label %if.end30.thread
i32 2, label %if.then33
]
if.end30.thread: ; preds = %if.end19
%4 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
%add29 = add nsw i32 %4, %storemerge82
store i32 %add29, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc
if.then33: ; preds = %if.end19
%5 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 7), align 4, !tbaa !5
%add34 = add nsw i32 %5, %storemerge82
store i32 %add34, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 7), align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end19, %if.end30.thread, %for.cond3.preheader, %if.then33
%6 = load i8, ptr getelementptr inbounds ([9 x i8], ptr @row, i64 0, i64 1), align 1, !tbaa !9
switch i8 %6, label %for.inc.1 [
i8 119, label %if.end19.1
i8 98, label %if.then16.1
]
if.then16.1: ; preds = %for.inc
br label %if.end19.1
if.end19.1: ; preds = %if.then16.1, %for.inc
%storemerge82.1 = phi i32 [ -1, %if.then16.1 ], [ 1, %for.inc ]
store i32 %storemerge82.1, ptr @ppp, align 4, !tbaa !5
%7 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 1), align 4, !tbaa !5
%add.1 = add nsw i32 %7, %storemerge82.1
store i32 %add.1, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 1), align 4, !tbaa !5
%8 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25.1 = add nsw i32 %8, %storemerge82.1
store i32 %add25.1, ptr %arrayidx24, align 4, !tbaa !5
%cmp26.1 = icmp eq i32 %1, 1
br i1 %cmp26.1, label %if.then33.1, label %for.inc.1
if.then33.1: ; preds = %if.end19.1
%9 = load <2 x i32>, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
%10 = insertelement <2 x i32> poison, i32 %storemerge82.1, i64 0
%11 = shufflevector <2 x i32> %10, <2 x i32> poison, <2 x i32> zeroinitializer
%12 = add nsw <2 x i32> %9, %11
store <2 x i32> %12, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end19.1, %if.then33.1, %for.inc
%13 = load i8, ptr getelementptr inbounds ([9 x i8], ptr @row, i64 0, i64 2), align 1, !tbaa !9
switch i8 %13, label %for.inc.2 [
i8 119, label %if.end19.2
i8 98, label %if.then16.2
]
if.then16.2: ; preds = %for.inc.1
br label %if.end19.2
if.end19.2: ; preds = %if.then16.2, %for.inc.1
%storemerge82.2 = phi i32 [ -1, %if.then16.2 ], [ 1, %for.inc.1 ]
store i32 %storemerge82.2, ptr @ppp, align 4, !tbaa !5
%14 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 2), align 8, !tbaa !5
%add.2 = add nsw i32 %14, %storemerge82.2
store i32 %add.2, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 2), align 8, !tbaa !5
%15 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25.2 = add nsw i32 %15, %storemerge82.2
store i32 %add25.2, ptr %arrayidx24, align 4, !tbaa !5
switch i32 %1, label %for.inc.2 [
i32 2, label %for.inc.2.thread
i32 0, label %if.then33.2
]
for.inc.2.thread: ; preds = %if.end19.2
%16 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
%add29.2 = add nsw i32 %16, %storemerge82.2
store i32 %add29.2, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 6), align 8, !tbaa !5
store i32 3, ptr @j, align 4, !tbaa !5
br label %for.end38
if.then33.2: ; preds = %if.end19.2
%17 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 7), align 4, !tbaa !5
%add34.2 = add nsw i32 %17, %storemerge82.2
store i32 %add34.2, ptr getelementptr inbounds ([9 x i32], ptr @line, i64 0, i64 7), align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end19.2, %if.then33.2, %for.inc.1
store i32 3, ptr @j, align 4, !tbaa !5
%inc37 = add nsw i32 %1, 1
store i32 %inc37, ptr @i, align 4, !tbaa !5
%cmp = icmp slt i32 %1, 2
br i1 %cmp, label %for.body, label %for.end38, !llvm.loop !10
for.end38: ; preds = %for.inc.2, %for.inc.2.thread
store i32 0, ptr @ppp, align 4, !tbaa !5
store i32 0, ptr @i, align 4, !tbaa !5
br label %for.body42
for.body42: ; preds = %for.end38, %if.end66
%18 = phi i32 [ 0, %for.end38 ], [ %26, %if.end66 ]
%storemerge7884 = phi i32 [ 0, %for.end38 ], [ %inc70, %if.end66 ]
%idxprom43 = sext i32 %storemerge7884 to i64
%arrayidx44 = getelementptr inbounds [9 x i32], ptr @line, i64 0, i64 %idxprom43
%19 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%cmp45 = icmp eq i32 %19, 3
br i1 %cmp45, label %if.then47, label %if.end54
if.then47: ; preds = %for.body42
%cmp48 = icmp eq i32 %18, 0
br i1 %cmp48, label %if.then50, label %if.end52
if.then50: ; preds = %if.then47
%puts79 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre = load i32, ptr @ppp, align 4, !tbaa !5
%.pre87.pre = load i32, ptr @i, align 4, !tbaa !5
%idxprom55.phi.trans.insert.phi.trans.insert = sext i32 %.pre87.pre to i64
%arrayidx56.phi.trans.insert.phi.trans.insert = getelementptr inbounds [9 x i32], ptr @line, i64 0, i64 %idxprom55.phi.trans.insert.phi.trans.insert
%.pre88.pre = load i32, ptr %arrayidx56.phi.trans.insert.phi.trans.insert, align 4, !tbaa !5
br label %if.end52
if.end52: ; preds = %if.then50, %if.then47
%idxprom55.phi.trans.insert.pre-phi = phi i64 [ %idxprom55.phi.trans.insert.phi.trans.insert, %if.then50 ], [ %idxprom43, %if.then47 ]
%.pre88 = phi i32 [ %.pre88.pre, %if.then50 ], [ 3, %if.then47 ]
%.pre87 = phi i32 [ %.pre87.pre, %if.then50 ], [ %storemerge7884, %if.then47 ]
%20 = phi i32 [ %.pre, %if.then50 ], [ %18, %if.then47 ]
%inc53 = add nsw i32 %20, 1
store i32 %inc53, ptr @ppp, align 4, !tbaa !5
br label %if.end54
if.end54: ; preds = %if.end52, %for.body42
%idxprom55.pre-phi = phi i64 [ %idxprom55.phi.trans.insert.pre-phi, %if.end52 ], [ %idxprom43, %for.body42 ]
%21 = phi i32 [ %.pre88, %if.end52 ], [ %19, %for.body42 ]
%22 = phi i32 [ %.pre87, %if.end52 ], [ %storemerge7884, %for.body42 ]
%23 = phi i32 [ %inc53, %if.end52 ], [ %18, %for.body42 ]
%cmp57 = icmp eq i32 %21, -3
br i1 %cmp57, label %if.then59, label %if.end66
if.then59: ; preds = %if.end54
%cmp60 = icmp eq i32 %23, 0
br i1 %cmp60, label %if.then62, label %if.end64
if.then62: ; preds = %if.then59
%puts80 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
%.pre89 = load i32, ptr @ppp, align 4, !tbaa !5
%.pre90.pre = load i32, ptr @i, align 4, !tbaa !5
%.pre95 = sext i32 %.pre90.pre to i64
br label %if.end64
if.end64: ; preds = %if.then62, %if.then59
%.pre94.pre-phi = phi i64 [ %.pre95, %if.then62 ], [ %idxprom55.pre-phi, %if.then59 ]
%.pre90 = phi i32 [ %.pre90.pre, %if.then62 ], [ %22, %if.then59 ]
%24 = phi i32 [ %.pre89, %if.then62 ], [ %23, %if.then59 ]
%inc65 = add nsw i32 %24, 1
store i32 %inc65, ptr @ppp, align 4, !tbaa !5
br label %if.end66
if.end66: ; preds = %if.end64, %if.end54
%idxprom67.pre-phi = phi i64 [ %.pre94.pre-phi, %if.end64 ], [ %idxprom55.pre-phi, %if.end54 ]
%25 = phi i32 [ %.pre90, %if.end64 ], [ %22, %if.end54 ]
%26 = phi i32 [ %inc65, %if.end64 ], [ %23, %if.end54 ]
%arrayidx68 = getelementptr inbounds [9 x i32], ptr @line, i64 0, i64 %idxprom67.pre-phi
store i32 0, ptr %arrayidx68, align 4, !tbaa !5
%inc70 = add nsw i32 %25, 1
store i32 %inc70, ptr @i, align 4, !tbaa !5
%cmp40 = icmp slt i32 %25, 7
br i1 %cmp40, label %for.body42, label %for.end71, !llvm.loop !12
for.end71: ; preds = %if.end66
%cmp72 = icmp eq i32 %26, 0
br i1 %cmp72, label %if.then74, label %while.body.backedge
if.then74: ; preds = %for.end71
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %while.body.backedge
while.body.backedge: ; preds = %if.then74, %for.end71
br label %while.body
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void){
int H,W;
int i,j;
while(1){
scanf("%d %d",&H,&W);
if(H==0&&W==0)break;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if(i%2==1&&j%2==1){
printf("#");
}else if(i%2==0&&j%2==0){
printf("#");
}
else if(i==0&&j==0){
printf("#");
}
else printf(".");
}printf("\n");
}printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225103/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225103/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp56 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp157 = icmp eq i32 %1, 0
%or.cond58 = select i1 %cmp56, i1 %cmp157, i1 false
br i1 %or.cond58, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end33
%2 = phi i32 [ %10, %for.end33 ], [ %0, %entry ]
%cmp253 = icmp sgt i32 %2, 0
br i1 %cmp253, label %for.cond3.preheader, label %for.end33
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.054 = phi i32 [ %inc32, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp451 = icmp sgt i32 %3, 0
br i1 %cmp451, label %for.body5.lr.ph, label %for.end
for.body5.lr.ph: ; preds = %for.cond3.preheader
%4 = and i32 %i.054, 1
br label %for.body5
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%j.052 = phi i32 [ 0, %for.body5.lr.ph ], [ %inc, %for.body5 ]
%5 = and i32 %4, %j.052
%or.cond49.not.not = icmp eq i32 %5, 0
%6 = or i32 %j.052, %i.054
%7 = and i32 %6, 1
%or.cond50 = icmp eq i32 %7, 0
%. = select i1 %or.cond50, i32 35, i32 46
%.sink = select i1 %or.cond49.not.not, i32 %., i32 35
%putchar48 = call i32 @putchar(i32 %.sink)
%inc = add nuw nsw i32 %j.052, 1
%8 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %8
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar44 = call i32 @putchar(i32 10)
%inc32 = add nuw nsw i32 %i.054, 1
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc32, %9
br i1 %cmp2, label %for.cond3.preheader, label %for.end33, !llvm.loop !11
for.end33: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%10 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %10, 0
%11 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %11, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end33, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int h,w,i,j,c;
while(1){
c=1;
scanf("%d%d",&h,&w);
if(!h&&!w)
return 0;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(c%2==1)
printf("#");
else
printf(".");
c++;
}
if(i%2==0)
c=2;
else
c=1;
printf("\n");
}
printf("\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225147/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225147/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%tobool35 = icmp ne i32 %0, 0
%1 = load i32, ptr %w, align 4
%tobool136 = icmp ne i32 %1, 0
%or.cond37 = select i1 %tobool35, i1 true, i1 %tobool136
br i1 %or.cond37, label %for.cond.preheader, label %if.then
for.cond.preheader: ; preds = %entry, %for.end19
%2 = phi i32 [ %7, %for.end19 ], [ %0, %entry ]
%cmp31 = icmp sgt i32 %2, 0
br i1 %cmp31, label %for.cond2.preheader, label %for.end19
if.then: ; preds = %for.end19, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
for.cond2.preheader: ; preds = %for.cond.preheader, %for.end
%c.033 = phi i32 [ %., %for.end ], [ 1, %for.cond.preheader ]
%i.032 = phi i32 [ %inc18, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp328 = icmp sgt i32 %3, 0
br i1 %cmp328, label %for.body4, label %for.end
for.body4: ; preds = %for.cond2.preheader, %for.body4
%c.130 = phi i32 [ %inc, %for.body4 ], [ %c.033, %for.cond2.preheader ]
%j.029 = phi i32 [ %inc10, %for.body4 ], [ 0, %for.cond2.preheader ]
%4 = and i32 %c.130, 1
%cmp5.not = icmp eq i32 %4, 0
%.38 = select i1 %cmp5.not, i32 46, i32 35
%putchar26 = call i32 @putchar(i32 %.38)
%inc = add nuw nsw i32 %c.130, 1
%inc10 = add nuw nsw i32 %j.029, 1
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc10, %5
br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body4, %for.cond2.preheader
%rem11 = and i32 %i.032, 1
%cmp12 = icmp eq i32 %rem11, 0
%. = select i1 %cmp12, i32 2, i32 1
%putchar25 = call i32 @putchar(i32 10)
%inc18 = add nuw nsw i32 %i.032, 1
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp slt i32 %inc18, %6
br i1 %cmp, label %for.cond2.preheader, label %for.end19, !llvm.loop !11
for.end19: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%7 = load i32, ptr %h, align 4, !tbaa !5
%tobool = icmp ne i32 %7, 0
%8 = load i32, ptr %w, align 4
%tobool1 = icmp ne i32 %8, 0
%or.cond = select i1 %tobool, i1 true, i1 %tobool1
br i1 %or.cond, label %for.cond.preheader, label %if.then
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
struct rectangle {
int h, w;
};
int main(void)
{
int i, j;
struct rectangle a;
while (1) {
scanf("%d %d", &a.h, &a.w);
if (a.h == 0 && a.w == 0)
break;
for (i = 0; i < a.h; i++) {
for (j = 0; j < a.w; j++) {
if (i % 2 == j % 2)
printf("#");
else
printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225190/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225190/source.c"
target datalayout = "e-m:e-p270: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.rectangle = type { i32, i32 }
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca %struct.rectangle, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
%w = getelementptr inbounds %struct.rectangle, ptr %a, i64 0, i32 1
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %w)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp33 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp334 = icmp eq i32 %1, 0
%or.cond35 = select i1 %cmp33, i1 %cmp334, i1 false
br i1 %or.cond35, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end19
%2 = phi i32 [ %8, %for.end19 ], [ %0, %entry ]
%cmp530 = icmp sgt i32 %2, 0
br i1 %cmp530, label %for.cond6.preheader, label %for.end19
for.cond6.preheader: ; preds = %for.cond.preheader, %for.end
%i.031 = phi i32 [ %inc18, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !10
%cmp828 = icmp sgt i32 %3, 0
br i1 %cmp828, label %for.body9, label %for.end
for.body9: ; preds = %for.cond6.preheader, %for.body9
%j.029 = phi i32 [ %inc, %for.body9 ], [ 0, %for.cond6.preheader ]
%4 = xor i32 %j.029, %i.031
%5 = and i32 %4, 1
%cmp11 = icmp eq i32 %5, 0
%. = select i1 %cmp11, i32 35, i32 46
%putchar27 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.029, 1
%6 = load i32, ptr %w, align 4, !tbaa !10
%cmp8 = icmp slt i32 %inc, %6
br i1 %cmp8, label %for.body9, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body9, %for.cond6.preheader
%putchar25 = call i32 @putchar(i32 10)
%inc18 = add nuw nsw i32 %i.031, 1
%7 = load i32, ptr %a, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc18, %7
br i1 %cmp5, label %for.cond6.preheader, label %for.end19, !llvm.loop !13
for.end19: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %w)
%8 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %8, 0
%9 = load i32, ptr %w, align 4
%cmp3 = icmp eq i32 %9, 0
%or.cond = select i1 %cmp, i1 %cmp3, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end19, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"rectangle", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main(void)
{
int H,W,i,j;
for(;;){
scanf("%d %d",&H,&W);
if(H==0 && W==0){
return 0;
}
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if((j+i)%2==0){
printf("#");
}
else{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp29 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp130 = icmp eq i32 %1, 0
%or.cond31 = select i1 %cmp29, i1 %cmp130, i1 false
br i1 %or.cond31, label %if.then, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.end15
%2 = phi i32 [ %6, %for.end15 ], [ %0, %entry ]
%cmp326 = icmp sgt i32 %2, 0
br i1 %cmp326, label %for.cond4.preheader, label %for.end15
if.then: ; preds = %for.end15, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
for.cond4.preheader: ; preds = %for.cond2.preheader, %for.end
%i.027 = phi i32 [ %inc14, %for.end ], [ 0, %for.cond2.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp524 = icmp sgt i32 %3, 0
br i1 %cmp524, label %for.body6, label %for.end
for.body6: ; preds = %for.cond4.preheader, %for.body6
%j.025 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond4.preheader ]
%add = add nuw nsw i32 %j.025, %i.027
%rem = and i32 %add, 1
%cmp7 = icmp eq i32 %rem, 0
%. = select i1 %cmp7, i32 35, i32 46
%putchar23 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.025, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc, %4
br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body6, %for.cond4.preheader
%putchar21 = call i32 @putchar(i32 10)
%inc14 = add nuw nsw i32 %i.027, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc14, %5
br i1 %cmp3, label %for.cond4.preheader, label %for.end15, !llvm.loop !11
for.end15: ; preds = %for.end, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %for.cond2.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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int a,b,c,d,e,f,g;
for(e=0;;e++){
scanf("%d%d",&a,&b);
if(a==0&&b==0){
break;
}
for(d=0;d<a;d++){
if(d%2==1){
for(c=0;c<b/2;c++){
printf(".#");
}
if(b%2==1){
printf(".");
}
}
else if(d%2==0){
for(c=0;c<b/2;c++){
printf("#.");
}
if(b%2==1){
printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c".#\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"#.\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp61 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp162 = icmp eq i32 %1, 0
%or.cond63 = select i1 %cmp61, i1 %cmp162, i1 false
br i1 %or.cond63, label %for.end40, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.end36
%2 = phi i32 [ %9, %for.end36 ], [ %0, %entry ]
%cmp358 = icmp sgt i32 %2, 0
br i1 %cmp358, label %for.body, label %for.end36
for.body: ; preds = %for.cond2.preheader, %if.end32
%d.059 = phi i32 [ %inc35, %if.end32 ], [ 0, %for.cond2.preheader ]
%rem = and i32 %d.059, 1
%cmp4.not = icmp eq i32 %rem, 0
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp2055 = icmp sgt i32 %3, 1
br i1 %cmp4.not, label %for.cond18.preheader, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body
br i1 %cmp2055, label %for.body8, label %for.end
for.cond18.preheader: ; preds = %for.body
br i1 %cmp2055, label %for.body21, label %for.end25
for.body8: ; preds = %for.cond6.preheader, %for.body8
%c.053 = phi i32 [ %inc, %for.body8 ], [ 0, %for.cond6.preheader ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%inc = add nuw nsw i32 %c.053, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %4, 2
%cmp7 = icmp slt i32 %inc, %div
br i1 %cmp7, label %for.body8, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body8, %for.cond6.preheader
%.lcssa = phi i32 [ %3, %for.cond6.preheader ], [ %4, %for.body8 ]
%5 = and i32 %.lcssa, -2147483647
%cmp11 = icmp eq i32 %5, 1
br i1 %cmp11, label %if.end32.sink.split, label %if.end32
for.body21: ; preds = %for.cond18.preheader, %for.body21
%c.156 = phi i32 [ %inc24, %for.body21 ], [ 0, %for.cond18.preheader ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
%inc24 = add nuw nsw i32 %c.156, 1
%6 = load i32, ptr %b, align 4, !tbaa !5
%div19 = sdiv i32 %6, 2
%cmp20 = icmp slt i32 %inc24, %div19
br i1 %cmp20, label %for.body21, label %for.end25, !llvm.loop !11
for.end25: ; preds = %for.body21, %for.cond18.preheader
%.lcssa50 = phi i32 [ %3, %for.cond18.preheader ], [ %6, %for.body21 ]
%7 = and i32 %.lcssa50, -2147483647
%cmp27 = icmp eq i32 %7, 1
br i1 %cmp27, label %if.end32.sink.split, label %if.end32
if.end32.sink.split: ; preds = %for.end25, %for.end
%.sink = phi i32 [ 46, %for.end ], [ 35, %for.end25 ]
%putchar47 = call i32 @putchar(i32 %.sink)
br label %if.end32
if.end32: ; preds = %if.end32.sink.split, %for.end25, %for.end
%putchar49 = call i32 @putchar(i32 10)
%inc35 = add nuw nsw i32 %d.059, 1
%8 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc35, %8
br i1 %cmp3, label %for.body, label %for.end36, !llvm.loop !12
for.end36: ; preds = %if.end32, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%9 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %for.end40, label %for.cond2.preheader
for.end40: ; preds = %for.end36, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
// AOJ 2412: Village
// 2017.12.8 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#define HASHSIZ 3000017
typedef struct { unsigned long long t; } HASH;
HASH hash[HASHSIZ+2], *hashend = hash+HASHSIZ;
void insert(int x, int y)
{
unsigned long long t = ((unsigned long long)x << 32) | y;
HASH *p = hash + (int)(t % HASHSIZ);
while (p->t) {
if (p->t == t) return;
if (++p == hashend) p = hash;
}
p->t = t;
}
int lookup(int x, int y)
{
unsigned long long t = ((unsigned long long)x << 32) | y;
HASH *p = hash + (int)(t % HASHSIZ);
while (p->t) {
if (p->t == t) return 1;
if (++p == hashend) p = hash;
}
return 0;
}
#define BASE 1000000000
int ans;
char buf[30], *p;
int getdbl()
{
int minus = 0;
int n = 0;
if (*p == '-') minus = 1, p++;
while (*p >= '0') n = 10*n + (*p++ & 0xf);
n *= 1000;
if (*p == '.') {
p++;
if (*p >= '0') n += (*p++ & 0xf) * 100;
if (*p >= '0') n += (*p++ & 0xf) * 10;
if (*p >= '0') n += (*p++ & 0xf);
}
p++;
if (minus) n = -n;
return n;
}
int main()
{
int n, r, x0, y0, x, y, i, j;
fgets(p=buf, 30, stdin);
n = atoi(p); while (*p >= '0') p++; p++;
r = getdbl();
while (n--) {
fgets(p=buf, 30, stdin);
x0 = getdbl(), y0 = getdbl();
if (x0 < 0) x = (x0+1)/r-1; else x = x0/r;
if (y0 < 0) y = (y0+1)/r-1; else y = y0/r;
for (i = x-1; i <= x+1; i++) for (j = y-1; j <= y+1; j++) {
if (lookup(i+BASE, j+BASE)) goto next;
}
ans++, insert(x+BASE, y+BASE);
next:;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225349/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225349/source.c"
target datalayout = "e-m:e-p270: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.HASH = type { i64 }
@hash = dso_local global [3000019 x %struct.HASH] zeroinitializer, align 16
@hashend = dso_local local_unnamed_addr global ptr getelementptr inbounds ([3000019 x %struct.HASH], ptr @hash, i64 0, i64 3000017, i32 0), align 8
@p = dso_local local_unnamed_addr global ptr null, align 8
@buf = dso_local global [30 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@ans = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insert(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%conv = sext i32 %x to i64
%shl = shl nsw i64 %conv, 32
%conv1 = sext i32 %y to i64
%or = or i64 %shl, %conv1
%rem = urem i64 %or, 3000017
%add.ptr = getelementptr inbounds %struct.HASH, ptr @hash, i64 %rem
%0 = load i64, ptr %add.ptr, align 8, !tbaa !5
%tobool.not18 = icmp eq i64 %0, 0
br i1 %tobool.not18, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%1 = load ptr, ptr @hashend, align 8
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%2 = phi i64 [ %0, %while.body.lr.ph ], [ %3, %if.end ]
%p.019 = phi ptr [ %add.ptr, %while.body.lr.ph ], [ %spec.store.select, %if.end ]
%cmp = icmp eq i64 %2, %or
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %while.body
%incdec.ptr = getelementptr inbounds %struct.HASH, ptr %p.019, i64 1
%cmp6 = icmp eq ptr %incdec.ptr, %1
%spec.store.select = select i1 %cmp6, ptr @hash, ptr %incdec.ptr
%3 = load i64, ptr %spec.store.select, align 8, !tbaa !5
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %if.end, %entry
%p.0.lcssa = phi ptr [ %add.ptr, %entry ], [ %spec.store.select, %if.end ]
store i64 %or, ptr %p.0.lcssa, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %while.body, %while.end
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @lookup(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 {
entry:
%conv = sext i32 %x to i64
%shl = shl nsw i64 %conv, 32
%conv1 = sext i32 %y to i64
%or = or i64 %shl, %conv1
%rem = urem i64 %or, 3000017
%add.ptr = getelementptr inbounds %struct.HASH, ptr @hash, i64 %rem
%0 = load i64, ptr %add.ptr, align 8, !tbaa !5
%tobool.not14 = icmp eq i64 %0, 0
br i1 %tobool.not14, label %cleanup, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%1 = load ptr, ptr @hashend, align 8
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%2 = phi i64 [ %0, %while.body.lr.ph ], [ %3, %if.end ]
%p.015 = phi ptr [ %add.ptr, %while.body.lr.ph ], [ %spec.store.select, %if.end ]
%cmp = icmp eq i64 %2, %or
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %while.body
%incdec.ptr = getelementptr inbounds %struct.HASH, ptr %p.015, i64 1
%cmp6 = icmp eq ptr %incdec.ptr, %1
%spec.store.select = select i1 %cmp6, ptr @hash, ptr %incdec.ptr
%3 = load i64, ptr %spec.store.select, align 8, !tbaa !5
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !12
cleanup: ; preds = %while.body, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end ], [ 1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @getdbl() local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr @p, align 8, !tbaa !13
%1 = load i8, ptr %0, align 1, !tbaa !15
%cmp.not = icmp eq i8 %1, 45
br i1 %cmp.not, label %if.then, label %if.end
if.then: ; preds = %entry
%incdec.ptr = getelementptr inbounds i8, ptr %0, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !13
%.pre = load i8, ptr %incdec.ptr, align 1, !tbaa !15
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i8 [ %.pre, %if.then ], [ %1, %entry ]
%p.promoted = phi ptr [ %incdec.ptr, %if.then ], [ %0, %entry ]
%cmp354 = icmp sgt i8 %2, 47
br i1 %cmp354, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%n.056 = phi i32 [ %add, %while.body ], [ 0, %if.end ]
%incdec.ptr55355 = phi ptr [ %incdec.ptr5, %while.body ], [ %p.promoted, %if.end ]
%mul = mul nsw i32 %n.056, 10
%incdec.ptr5 = getelementptr inbounds i8, ptr %incdec.ptr55355, i64 1
store ptr %incdec.ptr5, ptr @p, align 8, !tbaa !13
%3 = load i8, ptr %incdec.ptr55355, align 1, !tbaa !15
%4 = and i8 %3, 15
%and = zext i8 %4 to i32
%add = add nsw i32 %mul, %and
%5 = load i8, ptr %incdec.ptr5, align 1, !tbaa !15
%cmp3 = icmp sgt i8 %5, 47
br i1 %cmp3, label %while.body, label %while.end.loopexit, !llvm.loop !16
while.end.loopexit: ; preds = %while.body
%6 = mul nsw i32 %add, 1000
br label %while.end
while.end: ; preds = %while.end.loopexit, %if.end
%n.0.lcssa = phi i32 [ 0, %if.end ], [ %6, %while.end.loopexit ]
%.lcssa52 = phi ptr [ %p.promoted, %if.end ], [ %incdec.ptr5, %while.end.loopexit ]
%.lcssa = phi i8 [ %2, %if.end ], [ %5, %while.end.loopexit ]
%cmp9 = icmp eq i8 %.lcssa, 46
br i1 %cmp9, label %if.then11, label %if.end42
if.then11: ; preds = %while.end
%incdec.ptr12 = getelementptr inbounds i8, ptr %.lcssa52, i64 1
store ptr %incdec.ptr12, ptr @p, align 8, !tbaa !13
%7 = load i8, ptr %incdec.ptr12, align 1, !tbaa !15
%cmp14 = icmp sgt i8 %7, 47
br i1 %cmp14, label %if.end22, label %if.end42
if.end22: ; preds = %if.then11
%incdec.ptr17 = getelementptr inbounds i8, ptr %.lcssa52, i64 2
store ptr %incdec.ptr17, ptr @p, align 8, !tbaa !13
%8 = load i8, ptr %incdec.ptr12, align 1, !tbaa !15
%9 = and i8 %8, 15
%and19 = zext i8 %9 to i32
%mul20 = mul nuw nsw i32 %and19, 100
%add21 = add nsw i32 %mul20, %n.0.lcssa
%.pre61 = load i8, ptr %incdec.ptr17, align 1, !tbaa !15
%10 = icmp sgt i8 %.pre61, 47
br i1 %10, label %if.end32, label %if.end42
if.end32: ; preds = %if.end22
%incdec.ptr27 = getelementptr inbounds i8, ptr %.lcssa52, i64 3
store ptr %incdec.ptr27, ptr @p, align 8, !tbaa !13
%11 = load i8, ptr %incdec.ptr17, align 1, !tbaa !15
%12 = and i8 %11, 15
%narrow = mul nuw i8 %12, 10
%mul30 = zext i8 %narrow to i32
%add31 = add nsw i32 %add21, %mul30
%.pre62 = load i8, ptr %incdec.ptr27, align 1, !tbaa !15
%13 = icmp sgt i8 %.pre62, 47
br i1 %13, label %if.then36, label %if.end42
if.then36: ; preds = %if.end32
%incdec.ptr37 = getelementptr inbounds i8, ptr %.lcssa52, i64 4
store ptr %incdec.ptr37, ptr @p, align 8, !tbaa !13
%14 = load i8, ptr %incdec.ptr27, align 1, !tbaa !15
%15 = and i8 %14, 15
%and39 = zext i8 %15 to i32
%add40 = add nsw i32 %add31, %and39
br label %if.end42
if.end42: ; preds = %if.then11, %if.end22, %if.end32, %if.then36, %while.end
%16 = phi ptr [ %incdec.ptr37, %if.then36 ], [ %incdec.ptr27, %if.end32 ], [ %.lcssa52, %while.end ], [ %incdec.ptr17, %if.end22 ], [ %incdec.ptr12, %if.then11 ]
%n.3 = phi i32 [ %add40, %if.then36 ], [ %add31, %if.end32 ], [ %n.0.lcssa, %while.end ], [ %add21, %if.end22 ], [ %n.0.lcssa, %if.then11 ]
%incdec.ptr43 = getelementptr inbounds i8, ptr %16, i64 1
store ptr %incdec.ptr43, ptr @p, align 8, !tbaa !13
%sub = sub nsw i32 0, %n.3
%spec.select = select i1 %cmp.not, i32 %sub, i32 %n.3
ret i32 %spec.select
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
store ptr @buf, ptr @p, align 8, !tbaa !13
%0 = load ptr, ptr @stdin, align 8, !tbaa !13
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 30, ptr noundef %0)
%1 = load ptr, ptr @p, align 8, !tbaa !13
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull %1, ptr noundef null, i32 noundef 10) #6
%conv.i = trunc i64 %call.i to i32
%p.promoted = load ptr, ptr @p, align 8, !tbaa !13
%2 = load i8, ptr %p.promoted, align 1, !tbaa !15
%cmp177 = icmp sgt i8 %2, 47
br i1 %cmp177, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%incdec.ptr176178 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ]
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr176178, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !13
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !15
%cmp = icmp sgt i8 %3, 47
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %while.body, %entry
%.lcssa175 = phi ptr [ %p.promoted, %entry ], [ %incdec.ptr, %while.body ]
%incdec.ptr3 = getelementptr inbounds i8, ptr %.lcssa175, i64 1
store ptr %incdec.ptr3, ptr @p, align 8, !tbaa !13
%4 = load i8, ptr %incdec.ptr3, align 1, !tbaa !15
%cmp.not.i = icmp eq i8 %4, 45
br i1 %cmp.not.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %while.end
%incdec.ptr.i = getelementptr inbounds i8, ptr %.lcssa175, i64 2
store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !13
%.pre.i = load i8, ptr %incdec.ptr.i, align 1, !tbaa !15
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.end
%5 = phi i8 [ %.pre.i, %if.then.i ], [ %4, %while.end ]
%p.promoted.i = phi ptr [ %incdec.ptr.i, %if.then.i ], [ %incdec.ptr3, %while.end ]
%cmp354.i = icmp sgt i8 %5, 47
br i1 %cmp354.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %if.end.i, %while.body.i
%n.056.i = phi i32 [ %add.i, %while.body.i ], [ 0, %if.end.i ]
%incdec.ptr55355.i = phi ptr [ %incdec.ptr5.i, %while.body.i ], [ %p.promoted.i, %if.end.i ]
%mul.i = mul nsw i32 %n.056.i, 10
%incdec.ptr5.i = getelementptr inbounds i8, ptr %incdec.ptr55355.i, i64 1
store ptr %incdec.ptr5.i, ptr @p, align 8, !tbaa !13
%6 = load i8, ptr %incdec.ptr55355.i, align 1, !tbaa !15
%7 = and i8 %6, 15
%and.i = zext i8 %7 to i32
%add.i = add nsw i32 %mul.i, %and.i
%8 = load i8, ptr %incdec.ptr5.i, align 1, !tbaa !15
%cmp3.i = icmp sgt i8 %8, 47
br i1 %cmp3.i, label %while.body.i, label %while.end.loopexit.i, !llvm.loop !16
while.end.loopexit.i: ; preds = %while.body.i
%9 = mul nsw i32 %add.i, 1000
br label %while.end.i
while.end.i: ; preds = %while.end.loopexit.i, %if.end.i
%n.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %9, %while.end.loopexit.i ]
%.lcssa52.i = phi ptr [ %p.promoted.i, %if.end.i ], [ %incdec.ptr5.i, %while.end.loopexit.i ]
%.lcssa.i = phi i8 [ %5, %if.end.i ], [ %8, %while.end.loopexit.i ]
%cmp9.i = icmp eq i8 %.lcssa.i, 46
br i1 %cmp9.i, label %if.then11.i, label %getdbl.exit
if.then11.i: ; preds = %while.end.i
%incdec.ptr12.i = getelementptr inbounds i8, ptr %.lcssa52.i, i64 1
store ptr %incdec.ptr12.i, ptr @p, align 8, !tbaa !13
%10 = load i8, ptr %incdec.ptr12.i, align 1, !tbaa !15
%cmp14.i = icmp sgt i8 %10, 47
br i1 %cmp14.i, label %if.end22.i, label %getdbl.exit
if.end22.i: ; preds = %if.then11.i
%incdec.ptr17.i = getelementptr inbounds i8, ptr %.lcssa52.i, i64 2
store ptr %incdec.ptr17.i, ptr @p, align 8, !tbaa !13
%11 = load i8, ptr %incdec.ptr12.i, align 1, !tbaa !15
%12 = and i8 %11, 15
%and19.i = zext i8 %12 to i32
%mul20.i = mul nuw nsw i32 %and19.i, 100
%add21.i = add nsw i32 %mul20.i, %n.0.lcssa.i
%.pre61.i = load i8, ptr %incdec.ptr17.i, align 1, !tbaa !15
%13 = icmp sgt i8 %.pre61.i, 47
br i1 %13, label %if.end32.i, label %getdbl.exit
if.end32.i: ; preds = %if.end22.i
%incdec.ptr27.i = getelementptr inbounds i8, ptr %.lcssa52.i, i64 3
store ptr %incdec.ptr27.i, ptr @p, align 8, !tbaa !13
%14 = load i8, ptr %incdec.ptr17.i, align 1, !tbaa !15
%15 = and i8 %14, 15
%narrow.i = mul nuw i8 %15, 10
%mul30.i = zext i8 %narrow.i to i32
%add31.i = add nsw i32 %add21.i, %mul30.i
%.pre62.i = load i8, ptr %incdec.ptr27.i, align 1, !tbaa !15
%16 = icmp sgt i8 %.pre62.i, 47
br i1 %16, label %if.then36.i, label %getdbl.exit
if.then36.i: ; preds = %if.end32.i
%incdec.ptr37.i = getelementptr inbounds i8, ptr %.lcssa52.i, i64 4
store ptr %incdec.ptr37.i, ptr @p, align 8, !tbaa !13
%17 = load i8, ptr %incdec.ptr27.i, align 1, !tbaa !15
%18 = and i8 %17, 15
%and39.i = zext i8 %18 to i32
%add40.i = add nsw i32 %add31.i, %and39.i
br label %getdbl.exit
getdbl.exit: ; preds = %while.end.i, %if.then11.i, %if.end22.i, %if.end32.i, %if.then36.i
%19 = phi ptr [ %incdec.ptr37.i, %if.then36.i ], [ %incdec.ptr27.i, %if.end32.i ], [ %.lcssa52.i, %while.end.i ], [ %incdec.ptr17.i, %if.end22.i ], [ %incdec.ptr12.i, %if.then11.i ]
%n.3.i = phi i32 [ %add40.i, %if.then36.i ], [ %add31.i, %if.end32.i ], [ %n.0.lcssa.i, %while.end.i ], [ %add21.i, %if.end22.i ], [ %n.0.lcssa.i, %if.then11.i ]
%incdec.ptr43.i = getelementptr inbounds i8, ptr %19, i64 1
store ptr %incdec.ptr43.i, ptr @p, align 8, !tbaa !13
%sub.i = sub nsw i32 0, %n.3.i
%spec.select.i = select i1 %cmp.not.i, i32 %sub.i, i32 %n.3.i
%tobool.not182 = icmp eq i32 %conv.i, 0
br i1 %tobool.not182, label %while.end44, label %while.body6
while.body6: ; preds = %getdbl.exit, %next
%dec183.in = phi i32 [ %dec183, %next ], [ %conv.i, %getdbl.exit ]
%dec183 = add nsw i32 %dec183.in, -1
store ptr @buf, ptr @p, align 8, !tbaa !13
%20 = load ptr, ptr @stdin, align 8, !tbaa !13
%call7 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 30, ptr noundef %20)
%21 = load ptr, ptr @p, align 8, !tbaa !13
%22 = load i8, ptr %21, align 1, !tbaa !15
%cmp.not.i61 = icmp eq i8 %22, 45
br i1 %cmp.not.i61, label %if.then.i102, label %if.end.i62
if.then.i102: ; preds = %while.body6
%incdec.ptr.i103 = getelementptr inbounds i8, ptr %21, i64 1
store ptr %incdec.ptr.i103, ptr @p, align 8, !tbaa !13
%.pre.i104 = load i8, ptr %incdec.ptr.i103, align 1, !tbaa !15
br label %if.end.i62
if.end.i62: ; preds = %if.then.i102, %while.body6
%23 = phi i8 [ %.pre.i104, %if.then.i102 ], [ %22, %while.body6 ]
%p.promoted.i63 = phi ptr [ %incdec.ptr.i103, %if.then.i102 ], [ %21, %while.body6 ]
%cmp354.i64 = icmp sgt i8 %23, 47
br i1 %cmp354.i64, label %while.body.i93, label %while.end.i65
while.body.i93: ; preds = %if.end.i62, %while.body.i93
%n.056.i94 = phi i32 [ %add.i99, %while.body.i93 ], [ 0, %if.end.i62 ]
%incdec.ptr55355.i95 = phi ptr [ %incdec.ptr5.i97, %while.body.i93 ], [ %p.promoted.i63, %if.end.i62 ]
%mul.i96 = mul nsw i32 %n.056.i94, 10
%incdec.ptr5.i97 = getelementptr inbounds i8, ptr %incdec.ptr55355.i95, i64 1
store ptr %incdec.ptr5.i97, ptr @p, align 8, !tbaa !13
%24 = load i8, ptr %incdec.ptr55355.i95, align 1, !tbaa !15
%25 = and i8 %24, 15
%and.i98 = zext i8 %25 to i32
%add.i99 = add nsw i32 %mul.i96, %and.i98
%26 = load i8, ptr %incdec.ptr5.i97, align 1, !tbaa !15
%cmp3.i100 = icmp sgt i8 %26, 47
br i1 %cmp3.i100, label %while.body.i93, label %while.end.loopexit.i101, !llvm.loop !16
while.end.loopexit.i101: ; preds = %while.body.i93
%27 = mul nsw i32 %add.i99, 1000
br label %while.end.i65
while.end.i65: ; preds = %while.end.loopexit.i101, %if.end.i62
%n.0.lcssa.i66 = phi i32 [ 0, %if.end.i62 ], [ %27, %while.end.loopexit.i101 ]
%.lcssa52.i67 = phi ptr [ %p.promoted.i63, %if.end.i62 ], [ %incdec.ptr5.i97, %while.end.loopexit.i101 ]
%.lcssa.i68 = phi i8 [ %23, %if.end.i62 ], [ %26, %while.end.loopexit.i101 ]
%cmp9.i69 = icmp eq i8 %.lcssa.i68, 46
br i1 %cmp9.i69, label %if.then11.i74, label %getdbl.exit105
if.then11.i74: ; preds = %while.end.i65
%incdec.ptr12.i75 = getelementptr inbounds i8, ptr %.lcssa52.i67, i64 1
store ptr %incdec.ptr12.i75, ptr @p, align 8, !tbaa !13
%28 = load i8, ptr %incdec.ptr12.i75, align 1, !tbaa !15
%cmp14.i76 = icmp sgt i8 %28, 47
br i1 %cmp14.i76, label %if.end22.i77, label %getdbl.exit105
if.end22.i77: ; preds = %if.then11.i74
%incdec.ptr17.i78 = getelementptr inbounds i8, ptr %.lcssa52.i67, i64 2
store ptr %incdec.ptr17.i78, ptr @p, align 8, !tbaa !13
%29 = load i8, ptr %incdec.ptr12.i75, align 1, !tbaa !15
%30 = and i8 %29, 15
%and19.i79 = zext i8 %30 to i32
%mul20.i80 = mul nuw nsw i32 %and19.i79, 100
%add21.i81 = add nsw i32 %mul20.i80, %n.0.lcssa.i66
%.pre61.i82 = load i8, ptr %incdec.ptr17.i78, align 1, !tbaa !15
%31 = icmp sgt i8 %.pre61.i82, 47
br i1 %31, label %if.end32.i83, label %getdbl.exit105
if.end32.i83: ; preds = %if.end22.i77
%incdec.ptr27.i84 = getelementptr inbounds i8, ptr %.lcssa52.i67, i64 3
store ptr %incdec.ptr27.i84, ptr @p, align 8, !tbaa !13
%32 = load i8, ptr %incdec.ptr17.i78, align 1, !tbaa !15
%33 = and i8 %32, 15
%narrow.i85 = mul nuw i8 %33, 10
%mul30.i86 = zext i8 %narrow.i85 to i32
%add31.i87 = add nsw i32 %add21.i81, %mul30.i86
%.pre62.i88 = load i8, ptr %incdec.ptr27.i84, align 1, !tbaa !15
%34 = icmp sgt i8 %.pre62.i88, 47
br i1 %34, label %if.then36.i89, label %getdbl.exit105
if.then36.i89: ; preds = %if.end32.i83
%incdec.ptr37.i90 = getelementptr inbounds i8, ptr %.lcssa52.i67, i64 4
store ptr %incdec.ptr37.i90, ptr @p, align 8, !tbaa !13
%35 = load i8, ptr %incdec.ptr27.i84, align 1, !tbaa !15
%36 = and i8 %35, 15
%and39.i91 = zext i8 %36 to i32
%add40.i92 = add nsw i32 %add31.i87, %and39.i91
br label %getdbl.exit105
getdbl.exit105: ; preds = %while.end.i65, %if.then11.i74, %if.end22.i77, %if.end32.i83, %if.then36.i89
%37 = phi ptr [ %incdec.ptr37.i90, %if.then36.i89 ], [ %incdec.ptr27.i84, %if.end32.i83 ], [ %.lcssa52.i67, %while.end.i65 ], [ %incdec.ptr17.i78, %if.end22.i77 ], [ %incdec.ptr12.i75, %if.then11.i74 ]
%n.3.i70 = phi i32 [ %add40.i92, %if.then36.i89 ], [ %add31.i87, %if.end32.i83 ], [ %n.0.lcssa.i66, %while.end.i65 ], [ %add21.i81, %if.end22.i77 ], [ %n.0.lcssa.i66, %if.then11.i74 ]
%incdec.ptr43.i71 = getelementptr inbounds i8, ptr %37, i64 1
store ptr %incdec.ptr43.i71, ptr @p, align 8, !tbaa !13
%sub.i72 = sub nsw i32 0, %n.3.i70
%spec.select.i73 = select i1 %cmp.not.i61, i32 %sub.i72, i32 %n.3.i70
%38 = load i8, ptr %incdec.ptr43.i71, align 1, !tbaa !15
%cmp.not.i106 = icmp eq i8 %38, 45
br i1 %cmp.not.i106, label %if.then.i147, label %if.end.i107
if.then.i147: ; preds = %getdbl.exit105
%incdec.ptr.i148 = getelementptr inbounds i8, ptr %37, i64 2
store ptr %incdec.ptr.i148, ptr @p, align 8, !tbaa !13
%.pre.i149 = load i8, ptr %incdec.ptr.i148, align 1, !tbaa !15
br label %if.end.i107
if.end.i107: ; preds = %if.then.i147, %getdbl.exit105
%39 = phi i8 [ %.pre.i149, %if.then.i147 ], [ %38, %getdbl.exit105 ]
%p.promoted.i108 = phi ptr [ %incdec.ptr.i148, %if.then.i147 ], [ %incdec.ptr43.i71, %getdbl.exit105 ]
%cmp354.i109 = icmp sgt i8 %39, 47
br i1 %cmp354.i109, label %while.body.i138, label %while.end.i110
while.body.i138: ; preds = %if.end.i107, %while.body.i138
%n.056.i139 = phi i32 [ %add.i144, %while.body.i138 ], [ 0, %if.end.i107 ]
%incdec.ptr55355.i140 = phi ptr [ %incdec.ptr5.i142, %while.body.i138 ], [ %p.promoted.i108, %if.end.i107 ]
%mul.i141 = mul nsw i32 %n.056.i139, 10
%incdec.ptr5.i142 = getelementptr inbounds i8, ptr %incdec.ptr55355.i140, i64 1
store ptr %incdec.ptr5.i142, ptr @p, align 8, !tbaa !13
%40 = load i8, ptr %incdec.ptr55355.i140, align 1, !tbaa !15
%41 = and i8 %40, 15
%and.i143 = zext i8 %41 to i32
%add.i144 = add nsw i32 %mul.i141, %and.i143
%42 = load i8, ptr %incdec.ptr5.i142, align 1, !tbaa !15
%cmp3.i145 = icmp sgt i8 %42, 47
br i1 %cmp3.i145, label %while.body.i138, label %while.end.loopexit.i146, !llvm.loop !16
while.end.loopexit.i146: ; preds = %while.body.i138
%43 = mul nsw i32 %add.i144, 1000
br label %while.end.i110
while.end.i110: ; preds = %while.end.loopexit.i146, %if.end.i107
%n.0.lcssa.i111 = phi i32 [ 0, %if.end.i107 ], [ %43, %while.end.loopexit.i146 ]
%.lcssa52.i112 = phi ptr [ %p.promoted.i108, %if.end.i107 ], [ %incdec.ptr5.i142, %while.end.loopexit.i146 ]
%.lcssa.i113 = phi i8 [ %39, %if.end.i107 ], [ %42, %while.end.loopexit.i146 ]
%cmp9.i114 = icmp eq i8 %.lcssa.i113, 46
br i1 %cmp9.i114, label %if.then11.i119, label %getdbl.exit150
if.then11.i119: ; preds = %while.end.i110
%incdec.ptr12.i120 = getelementptr inbounds i8, ptr %.lcssa52.i112, i64 1
store ptr %incdec.ptr12.i120, ptr @p, align 8, !tbaa !13
%44 = load i8, ptr %incdec.ptr12.i120, align 1, !tbaa !15
%cmp14.i121 = icmp sgt i8 %44, 47
br i1 %cmp14.i121, label %if.end22.i122, label %getdbl.exit150
if.end22.i122: ; preds = %if.then11.i119
%incdec.ptr17.i123 = getelementptr inbounds i8, ptr %.lcssa52.i112, i64 2
store ptr %incdec.ptr17.i123, ptr @p, align 8, !tbaa !13
%45 = load i8, ptr %incdec.ptr12.i120, align 1, !tbaa !15
%46 = and i8 %45, 15
%and19.i124 = zext i8 %46 to i32
%mul20.i125 = mul nuw nsw i32 %and19.i124, 100
%add21.i126 = add nsw i32 %mul20.i125, %n.0.lcssa.i111
%.pre61.i127 = load i8, ptr %incdec.ptr17.i123, align 1, !tbaa !15
%47 = icmp sgt i8 %.pre61.i127, 47
br i1 %47, label %if.end32.i128, label %getdbl.exit150
if.end32.i128: ; preds = %if.end22.i122
%incdec.ptr27.i129 = getelementptr inbounds i8, ptr %.lcssa52.i112, i64 3
store ptr %incdec.ptr27.i129, ptr @p, align 8, !tbaa !13
%48 = load i8, ptr %incdec.ptr17.i123, align 1, !tbaa !15
%49 = and i8 %48, 15
%narrow.i130 = mul nuw i8 %49, 10
%mul30.i131 = zext i8 %narrow.i130 to i32
%add31.i132 = add nsw i32 %add21.i126, %mul30.i131
%.pre62.i133 = load i8, ptr %incdec.ptr27.i129, align 1, !tbaa !15
%50 = icmp sgt i8 %.pre62.i133, 47
br i1 %50, label %if.then36.i134, label %getdbl.exit150
if.then36.i134: ; preds = %if.end32.i128
%incdec.ptr37.i135 = getelementptr inbounds i8, ptr %.lcssa52.i112, i64 4
store ptr %incdec.ptr37.i135, ptr @p, align 8, !tbaa !13
%51 = load i8, ptr %incdec.ptr27.i129, align 1, !tbaa !15
%52 = and i8 %51, 15
%and39.i136 = zext i8 %52 to i32
%add40.i137 = add nsw i32 %add31.i132, %and39.i136
br label %getdbl.exit150
getdbl.exit150: ; preds = %while.end.i110, %if.then11.i119, %if.end22.i122, %if.end32.i128, %if.then36.i134
%53 = phi ptr [ %incdec.ptr37.i135, %if.then36.i134 ], [ %incdec.ptr27.i129, %if.end32.i128 ], [ %.lcssa52.i112, %while.end.i110 ], [ %incdec.ptr17.i123, %if.end22.i122 ], [ %incdec.ptr12.i120, %if.then11.i119 ]
%n.3.i115 = phi i32 [ %add40.i137, %if.then36.i134 ], [ %add31.i132, %if.end32.i128 ], [ %n.0.lcssa.i111, %while.end.i110 ], [ %add21.i126, %if.end22.i122 ], [ %n.0.lcssa.i111, %if.then11.i119 ]
%incdec.ptr43.i116 = getelementptr inbounds i8, ptr %53, i64 1
store ptr %incdec.ptr43.i116, ptr @p, align 8, !tbaa !13
%sub.i117 = sub nsw i32 0, %n.3.i115
%spec.select.i118 = select i1 %cmp.not.i106, i32 %sub.i117, i32 %n.3.i115
%cmp10 = icmp slt i32 %spec.select.i73, 0
br i1 %cmp10, label %if.then, label %if.else
if.then: ; preds = %getdbl.exit150
%add = add nsw i32 %spec.select.i73, 1
%div = sdiv i32 %add, %spec.select.i
%sub = add nsw i32 %div, -1
br label %if.end
if.else: ; preds = %getdbl.exit150
%div12 = sdiv i32 %spec.select.i73, %spec.select.i
br label %if.end
if.end: ; preds = %if.else, %if.then
%x.0 = phi i32 [ %sub, %if.then ], [ %div12, %if.else ]
%cmp13 = icmp slt i32 %spec.select.i118, 0
br i1 %cmp13, label %if.then15, label %if.else19
if.then15: ; preds = %if.end
%add16 = add nsw i32 %spec.select.i118, 1
%div17 = sdiv i32 %add16, %spec.select.i
%sub18 = add nsw i32 %div17, -1
br label %if.end21
if.else19: ; preds = %if.end
%div20 = sdiv i32 %spec.select.i118, %spec.select.i
br label %if.end21
if.end21: ; preds = %if.else19, %if.then15
%y.0 = phi i32 [ %sub18, %if.then15 ], [ %div20, %if.else19 ]
%sub22 = add i32 %x.0, -1
%sub26 = add i32 %y.0, -1
%54 = load ptr, ptr @hashend, align 8
%55 = sext i32 %sub26 to i64
%56 = sext i32 %y.0 to i64
%57 = sext i32 %sub22 to i64
%58 = sext i32 %x.0 to i64
br label %for.body
for.body: ; preds = %if.end21, %for.inc38
%indvars.iv189 = phi i64 [ %57, %if.end21 ], [ %indvars.iv.next190, %for.inc38 ]
%59 = shl i64 %indvars.iv189, 32
%shl.i = add i64 %59, 4294967296000000000
br label %for.body31
for.body31: ; preds = %for.body, %for.inc
%indvars.iv = phi i64 [ %55, %for.body ], [ %indvars.iv.next, %for.inc ]
%60 = add nsw i64 %indvars.iv, 1000000000
%or.i = or i64 %shl.i, %60
%rem.i = urem i64 %or.i, 3000017
%add.ptr.i = getelementptr inbounds %struct.HASH, ptr @hash, i64 %rem.i
%61 = load i64, ptr %add.ptr.i, align 8, !tbaa !5
%tobool.not14.i = icmp eq i64 %61, 0
br i1 %tobool.not14.i, label %for.inc, label %while.body.i152
while.body.i152: ; preds = %for.body31, %if.end.i153
%62 = phi i64 [ %63, %if.end.i153 ], [ %61, %for.body31 ]
%p.015.i = phi ptr [ %spec.store.select.i, %if.end.i153 ], [ %add.ptr.i, %for.body31 ]
%cmp.i = icmp eq i64 %62, %or.i
br i1 %cmp.i, label %next, label %if.end.i153
if.end.i153: ; preds = %while.body.i152
%incdec.ptr.i154 = getelementptr inbounds %struct.HASH, ptr %p.015.i, i64 1
%cmp6.i = icmp eq ptr %incdec.ptr.i154, %54
%spec.store.select.i = select i1 %cmp6.i, ptr @hash, ptr %incdec.ptr.i154
%63 = load i64, ptr %spec.store.select.i, align 8, !tbaa !5
%tobool.not.i = icmp eq i64 %63, 0
br i1 %tobool.not.i, label %for.inc, label %while.body.i152, !llvm.loop !12
for.inc: ; preds = %if.end.i153, %for.body31
%indvars.iv.next = add i64 %indvars.iv, 1
%cmp29.not = icmp sgt i64 %indvars.iv, %56
br i1 %cmp29.not, label %for.inc38, label %for.body31, !llvm.loop !18
for.inc38: ; preds = %for.inc
%indvars.iv.next190 = add i64 %indvars.iv189, 1
%cmp24.not = icmp sgt i64 %indvars.iv189, %58
br i1 %cmp24.not, label %for.end40, label %for.body, !llvm.loop !19
for.end40: ; preds = %for.inc38
%64 = load i32, ptr @ans, align 4, !tbaa !20
%inc41 = add nsw i32 %64, 1
store i32 %inc41, ptr @ans, align 4, !tbaa !20
%add42 = add nsw i32 %x.0, 1000000000
%add43 = add nsw i32 %y.0, 1000000000
%conv.i155 = sext i32 %add42 to i64
%shl.i156 = shl nsw i64 %conv.i155, 32
%conv1.i157 = sext i32 %add43 to i64
%or.i158 = or i64 %shl.i156, %conv1.i157
%rem.i159 = urem i64 %or.i158, 3000017
%add.ptr.i160 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %rem.i159
%65 = load i64, ptr %add.ptr.i160, align 8, !tbaa !5
%tobool.not18.i = icmp eq i64 %65, 0
br i1 %tobool.not18.i, label %while.end.i169, label %while.body.i162
while.body.i162: ; preds = %for.end40, %if.end.i164
%66 = phi i64 [ %67, %if.end.i164 ], [ %65, %for.end40 ]
%p.019.i = phi ptr [ %spec.store.select.i167, %if.end.i164 ], [ %add.ptr.i160, %for.end40 ]
%cmp.i163 = icmp eq i64 %66, %or.i158
br i1 %cmp.i163, label %next, label %if.end.i164
if.end.i164: ; preds = %while.body.i162
%incdec.ptr.i165 = getelementptr inbounds %struct.HASH, ptr %p.019.i, i64 1
%cmp6.i166 = icmp eq ptr %incdec.ptr.i165, %54
%spec.store.select.i167 = select i1 %cmp6.i166, ptr @hash, ptr %incdec.ptr.i165
%67 = load i64, ptr %spec.store.select.i167, align 8, !tbaa !5
%tobool.not.i168 = icmp eq i64 %67, 0
br i1 %tobool.not.i168, label %while.end.i169, label %while.body.i162, !llvm.loop !10
while.end.i169: ; preds = %if.end.i164, %for.end40
%p.0.lcssa.i = phi ptr [ %add.ptr.i160, %for.end40 ], [ %spec.store.select.i167, %if.end.i164 ]
store i64 %or.i158, ptr %p.0.lcssa.i, align 8, !tbaa !5
br label %next
next: ; preds = %while.body.i162, %while.body.i152, %while.end.i169
%tobool.not = icmp eq i32 %dec183, 0
br i1 %tobool.not, label %while.end44, label %while.body6, !llvm.loop !22
while.end44: ; preds = %next, %getdbl.exit
%68 = load i32, ptr @ans, align 4, !tbaa !20
%call45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %68)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 0}
!6 = !{!"", !7, i64 0}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !8, i64 0}
!22 = distinct !{!22, !11}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct { int i, p; char *s; } T;
T t[105];
int cmp(const void *u, const void *v) {
int t;
if (t = strcmp(((T *)u)->s, ((T *)v)->s)) return t;
return ((T *)v)->p - ((T *)u)->p;
}
char S[105][15];
int main(){
int i, N;
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%s%d", S[i], &t[i].p);
t[i].s = S[i], t[i].i = i;
}
qsort(t, N, sizeof(T), cmp);
for (i = 0; i < N; i++) printf("%d\n", t[i].i+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225392/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225392/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.T = type { i32, i32, ptr }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1
@S = dso_local global [105 x [15 x i8]] zeroinitializer, align 16
@t = dso_local global [105 x %struct.T] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %u, ptr nocapture noundef readonly %v) #0 {
entry:
%s = getelementptr inbounds %struct.T, ptr %u, i64 0, i32 2
%0 = load ptr, ptr %s, align 8, !tbaa !5
%s1 = getelementptr inbounds %struct.T, ptr %v, i64 0, i32 2
%1 = load ptr, ptr %s1, align 8, !tbaa !5
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #6
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%p = getelementptr inbounds %struct.T, ptr %v, i64 0, i32 1
%2 = load i32, ptr %p, align 4, !tbaa !11
%p2 = getelementptr inbounds %struct.T, ptr %u, i64 0, i32 1
%3 = load i32, ptr %p2, align 4, !tbaa !11
%sub = sub nsw i32 %2, %3
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %sub, %if.end ], [ %call, %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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !12
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [105 x [15 x i8]], ptr @S, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [105 x %struct.T], ptr @t, i64 0, i64 %indvars.iv
%p = getelementptr inbounds [105 x %struct.T], ptr @t, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %p)
%s = getelementptr inbounds [105 x %struct.T], ptr @t, i64 0, i64 %indvars.iv, i32 2
store ptr %arrayidx, ptr %s, align 8, !tbaa !5
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %arrayidx2, align 16, !tbaa !13
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !12
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %3, %for.body ]
call void @qsort(ptr noundef nonnull @t, i64 noundef %conv.pre-phi, i64 noundef 16, ptr noundef nonnull @cmp) #7
%4 = load i32, ptr %N, align 4, !tbaa !12
%cmp1335 = icmp sgt i32 %4, 0
br i1 %cmp1335, label %for.body15, label %for.end22
for.body15: ; preds = %for.end, %for.body15
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body15 ], [ 0, %for.end ]
%arrayidx17 = getelementptr inbounds [105 x %struct.T], ptr @t, i64 0, i64 %indvars.iv39
%5 = load i32, ptr %arrayidx17, align 16, !tbaa !13
%add = add nsw i32 %5, 1
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%6 = load i32, ptr %N, align 4, !tbaa !12
%7 = sext i32 %6 to i64
%cmp13 = icmp slt i64 %indvars.iv.next40, %7
br i1 %cmp13, label %for.body15, label %for.end22, !llvm.loop !16
for.end22: ; preds = %for.body15, %for.end
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
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
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
|
#include <stdio.h>
#include <stdlib.h>
char a[100][10000];
int b[100][28]={0};
int main()
{
int m;
int q=0;
while(scanf("%d",&m)!=EOF)
{
getchar();
int i;
int flag=1;
for(i=0;i<=m;i++) scanf("%c",&a[q][i]);
for(i=0;i<m;i++)
{
if(a[q][i]=='a'||a[q][i]=='A') {b[q][0]=1;}
else if(a[q][i]=='b'||a[q][i]=='B') {b[q][1]=1;}
else if(a[q][i]=='c'||a[q][i]=='C') {b[q][2]=1;}
else if(a[q][i]=='d'||a[q][i]=='D') {b[q][3]=1;}
else if(a[q][i]=='e'||a[q][i]=='E') {b[q][4]=1;}
else if(a[q][i]=='f'||a[q][i]=='F') {b[q][5]=1;}
else if(a[q][i]=='g'||a[q][i]=='G') {b[q][6]=1;}
else if(a[q][i]=='h'||a[q][i]=='H') {b[q][7]=1;}
else if(a[q][i]=='i'||a[q][i]=='I') {b[q][8]=1;}
else if(a[q][i]=='j'||a[q][i]=='J') {b[q][9]=1;}
else if(a[q][i]=='k'||a[q][i]=='K') {b[q][10]=1;}
else if(a[q][i]=='l'||a[q][i]=='L') {b[q][11]=1;}
else if(a[q][i]=='m'||a[q][i]=='M') {b[q][12]=1;}
else if(a[q][i]=='n'||a[q][i]=='N') {b[q][13]=1;}
else if(a[q][i]=='o'||a[q][i]=='O') {b[q][14]=1;}
else if(a[q][i]=='p'||a[q][i]=='P') {b[q][15]=1;}
else if(a[q][i]=='q'||a[q][i]=='Q') {b[q][16]=1;}
else if(a[q][i]=='r'||a[q][i]=='R') {b[q][17]=1;}
else if(a[q][i]=='s'||a[q][i]=='S') {b[q][18]=1;}
else if(a[q][i]=='t'||a[q][i]=='T') {b[q][19]=1;}
else if(a[q][i]=='u'||a[q][i]=='U') {b[q][20]=1;}
else if(a[q][i]=='v'||a[q][i]=='V') {b[q][21]=1;}
else if(a[q][i]=='w'||a[q][i]=='W') {b[q][22]=1;}
else if(a[q][i]=='x'||a[q][i]=='X') {b[q][23]=1;}
else if(a[q][i]=='y'||a[q][i]=='Y') {b[q][24]=1;}
else if(a[q][i]=='z'||a[q][i]=='Z') {b[q][25]=1;}
}
for(i=0;i<26;i++) {if(b[q][i]==0) {flag=0; printf("NO\n"); break; } }
if(flag==1) printf("YES\n");
q++;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@b = dso_local local_unnamed_addr global [100 x [28 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@a = dso_local global [100 x [10000 x i8]] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call719 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not720 = icmp eq i32 %call719, -1
br i1 %cmp.not720, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end572
%indvars.iv731 = phi i64 [ %indvars.iv.next732, %if.end572 ], [ 0, %entry ]
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %m, align 4, !tbaa !9
%cmp2.not714 = icmp slt i32 %1, 0
br i1 %cmp2.not714, label %for.cond552.preheader, label %for.body
for.cond6.preheader: ; preds = %for.body
%cmp7716 = icmp sgt i32 %2, 0
br i1 %cmp7716, label %for.body8.lr.ph, label %for.cond552.preheader
for.body8.lr.ph: ; preds = %for.cond6.preheader
%arrayidx523 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 25
%arrayidx503 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 24
%arrayidx483 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 23
%arrayidx463 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 22
%arrayidx443 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 21
%arrayidx423 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 20
%arrayidx403 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 19
%arrayidx383 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 18
%arrayidx363 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 17
%arrayidx343 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 16
%arrayidx323 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 15
%arrayidx303 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 14
%arrayidx283 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 13
%arrayidx263 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 12
%arrayidx243 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 11
%arrayidx223 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 10
%arrayidx203 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 9
%arrayidx183 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 8
%arrayidx163 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 7
%arrayidx143 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 6
%arrayidx123 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 5
%arrayidx103 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 4
%arrayidx83 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 3
%arrayidx63 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 2
%arrayidx43 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 1
%arrayidx23 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731
%wide.trip.count = zext i32 %2 to i64
br label %for.body8
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx4 = getelementptr inbounds [100 x [10000 x i8]], ptr @a, i64 0, i64 %indvars.iv731, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %m, align 4, !tbaa !9
%3 = sext i32 %2 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp2.not.not, label %for.body, label %for.cond6.preheader, !llvm.loop !11
for.cond552.preheader: ; preds = %for.inc549, %while.body, %for.cond6.preheader
%arrayidx559 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 0
%4 = load i32, ptr %arrayidx559, align 16, !tbaa !9
%cmp560 = icmp eq i32 %4, 0
br i1 %cmp560, label %if.then562, label %for.cond552
for.body8: ; preds = %for.body8.lr.ph, %for.inc549
%indvars.iv724 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next725, %for.inc549 ]
%arrayidx12 = getelementptr inbounds [100 x [10000 x i8]], ptr @a, i64 0, i64 %indvars.iv731, i64 %indvars.iv724
%5 = load i8, ptr %arrayidx12, align 1, !tbaa !13
switch i8 %5, label %for.inc549 [
i8 97, label %if.then
i8 65, label %if.then
i8 98, label %if.then40
i8 66, label %if.then40
i8 99, label %if.then60
i8 67, label %if.then60
i8 100, label %if.then80
i8 68, label %if.then80
i8 101, label %if.then100
i8 69, label %if.then100
i8 102, label %if.then120
i8 70, label %if.then120
i8 103, label %if.then140
i8 71, label %if.then140
i8 104, label %if.then160
i8 72, label %if.then160
i8 105, label %if.then180
i8 73, label %if.then180
i8 106, label %if.then200
i8 74, label %if.then200
i8 107, label %if.then220
i8 75, label %if.then220
i8 108, label %if.then240
i8 76, label %if.then240
i8 109, label %if.then260
i8 77, label %if.then260
i8 110, label %if.then280
i8 78, label %if.then280
i8 111, label %if.then300
i8 79, label %if.then300
i8 112, label %if.then320
i8 80, label %if.then320
i8 113, label %if.then340
i8 81, label %if.then340
i8 114, label %if.then360
i8 82, label %if.then360
i8 115, label %if.then380
i8 83, label %if.then380
i8 116, label %if.then400
i8 84, label %if.then400
i8 117, label %if.then420
i8 85, label %if.then420
i8 118, label %if.then440
i8 86, label %if.then440
i8 119, label %if.then460
i8 87, label %if.then460
i8 120, label %if.then480
i8 88, label %if.then480
i8 121, label %if.then500
i8 89, label %if.then500
i8 122, label %if.then520
i8 90, label %if.then520
]
if.then: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx23, align 16, !tbaa !9
br label %for.inc549
if.then40: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx43, align 4, !tbaa !9
br label %for.inc549
if.then60: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx63, align 8, !tbaa !9
br label %for.inc549
if.then80: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx83, align 4, !tbaa !9
br label %for.inc549
if.then100: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx103, align 16, !tbaa !9
br label %for.inc549
if.then120: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx123, align 4, !tbaa !9
br label %for.inc549
if.then140: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx143, align 8, !tbaa !9
br label %for.inc549
if.then160: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx163, align 4, !tbaa !9
br label %for.inc549
if.then180: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx183, align 16, !tbaa !9
br label %for.inc549
if.then200: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx203, align 4, !tbaa !9
br label %for.inc549
if.then220: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx223, align 8, !tbaa !9
br label %for.inc549
if.then240: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx243, align 4, !tbaa !9
br label %for.inc549
if.then260: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx263, align 16, !tbaa !9
br label %for.inc549
if.then280: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx283, align 4, !tbaa !9
br label %for.inc549
if.then300: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx303, align 8, !tbaa !9
br label %for.inc549
if.then320: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx323, align 4, !tbaa !9
br label %for.inc549
if.then340: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx343, align 16, !tbaa !9
br label %for.inc549
if.then360: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx363, align 4, !tbaa !9
br label %for.inc549
if.then380: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx383, align 8, !tbaa !9
br label %for.inc549
if.then400: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx403, align 4, !tbaa !9
br label %for.inc549
if.then420: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx423, align 16, !tbaa !9
br label %for.inc549
if.then440: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx443, align 4, !tbaa !9
br label %for.inc549
if.then460: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx463, align 8, !tbaa !9
br label %for.inc549
if.then480: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx483, align 4, !tbaa !9
br label %for.inc549
if.then500: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx503, align 16, !tbaa !9
br label %for.inc549
if.then520: ; preds = %for.body8, %for.body8
store i32 1, ptr %arrayidx523, align 4, !tbaa !9
br label %for.inc549
for.inc549: ; preds = %for.body8, %if.then, %if.then60, %if.then100, %if.then140, %if.then180, %if.then220, %if.then260, %if.then300, %if.then340, %if.then380, %if.then420, %if.then460, %if.then500, %if.then520, %if.then480, %if.then440, %if.then400, %if.then360, %if.then320, %if.then280, %if.then240, %if.then200, %if.then160, %if.then120, %if.then80, %if.then40
%indvars.iv.next725 = add nuw nsw i64 %indvars.iv724, 1
%exitcond.not = icmp eq i64 %indvars.iv.next725, %wide.trip.count
br i1 %exitcond.not, label %for.cond552.preheader, label %for.body8, !llvm.loop !14
for.cond552: ; preds = %for.cond552.preheader
%arrayidx559.1 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 1
%6 = load i32, ptr %arrayidx559.1, align 4, !tbaa !9
%cmp560.1 = icmp eq i32 %6, 0
br i1 %cmp560.1, label %if.then562, label %for.cond552.1
for.cond552.1: ; preds = %for.cond552
%arrayidx559.2 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 2
%7 = load i32, ptr %arrayidx559.2, align 8, !tbaa !9
%cmp560.2 = icmp eq i32 %7, 0
br i1 %cmp560.2, label %if.then562, label %for.cond552.2
for.cond552.2: ; preds = %for.cond552.1
%arrayidx559.3 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 3
%8 = load i32, ptr %arrayidx559.3, align 4, !tbaa !9
%cmp560.3 = icmp eq i32 %8, 0
br i1 %cmp560.3, label %if.then562, label %for.cond552.3
for.cond552.3: ; preds = %for.cond552.2
%arrayidx559.4 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 4
%9 = load i32, ptr %arrayidx559.4, align 16, !tbaa !9
%cmp560.4 = icmp eq i32 %9, 0
br i1 %cmp560.4, label %if.then562, label %for.cond552.4
for.cond552.4: ; preds = %for.cond552.3
%arrayidx559.5 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 5
%10 = load i32, ptr %arrayidx559.5, align 4, !tbaa !9
%cmp560.5 = icmp eq i32 %10, 0
br i1 %cmp560.5, label %if.then562, label %for.cond552.5
for.cond552.5: ; preds = %for.cond552.4
%arrayidx559.6 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 6
%11 = load i32, ptr %arrayidx559.6, align 8, !tbaa !9
%cmp560.6 = icmp eq i32 %11, 0
br i1 %cmp560.6, label %if.then562, label %for.cond552.6
for.cond552.6: ; preds = %for.cond552.5
%arrayidx559.7 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 7
%12 = load i32, ptr %arrayidx559.7, align 4, !tbaa !9
%cmp560.7 = icmp eq i32 %12, 0
br i1 %cmp560.7, label %if.then562, label %for.cond552.7
for.cond552.7: ; preds = %for.cond552.6
%arrayidx559.8 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 8
%13 = load i32, ptr %arrayidx559.8, align 16, !tbaa !9
%cmp560.8 = icmp eq i32 %13, 0
br i1 %cmp560.8, label %if.then562, label %for.cond552.8
for.cond552.8: ; preds = %for.cond552.7
%arrayidx559.9 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 9
%14 = load i32, ptr %arrayidx559.9, align 4, !tbaa !9
%cmp560.9 = icmp eq i32 %14, 0
br i1 %cmp560.9, label %if.then562, label %for.cond552.9
for.cond552.9: ; preds = %for.cond552.8
%arrayidx559.10 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 10
%15 = load i32, ptr %arrayidx559.10, align 8, !tbaa !9
%cmp560.10 = icmp eq i32 %15, 0
br i1 %cmp560.10, label %if.then562, label %for.cond552.10
for.cond552.10: ; preds = %for.cond552.9
%arrayidx559.11 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 11
%16 = load i32, ptr %arrayidx559.11, align 4, !tbaa !9
%cmp560.11 = icmp eq i32 %16, 0
br i1 %cmp560.11, label %if.then562, label %for.cond552.11
for.cond552.11: ; preds = %for.cond552.10
%arrayidx559.12 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 12
%17 = load i32, ptr %arrayidx559.12, align 16, !tbaa !9
%cmp560.12 = icmp eq i32 %17, 0
br i1 %cmp560.12, label %if.then562, label %for.cond552.12
for.cond552.12: ; preds = %for.cond552.11
%arrayidx559.13 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 13
%18 = load i32, ptr %arrayidx559.13, align 4, !tbaa !9
%cmp560.13 = icmp eq i32 %18, 0
br i1 %cmp560.13, label %if.then562, label %for.cond552.13
for.cond552.13: ; preds = %for.cond552.12
%arrayidx559.14 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 14
%19 = load i32, ptr %arrayidx559.14, align 8, !tbaa !9
%cmp560.14 = icmp eq i32 %19, 0
br i1 %cmp560.14, label %if.then562, label %for.cond552.14
for.cond552.14: ; preds = %for.cond552.13
%arrayidx559.15 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 15
%20 = load i32, ptr %arrayidx559.15, align 4, !tbaa !9
%cmp560.15 = icmp eq i32 %20, 0
br i1 %cmp560.15, label %if.then562, label %for.cond552.15
for.cond552.15: ; preds = %for.cond552.14
%arrayidx559.16 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 16
%21 = load i32, ptr %arrayidx559.16, align 16, !tbaa !9
%cmp560.16 = icmp eq i32 %21, 0
br i1 %cmp560.16, label %if.then562, label %for.cond552.16
for.cond552.16: ; preds = %for.cond552.15
%arrayidx559.17 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 17
%22 = load i32, ptr %arrayidx559.17, align 4, !tbaa !9
%cmp560.17 = icmp eq i32 %22, 0
br i1 %cmp560.17, label %if.then562, label %for.cond552.17
for.cond552.17: ; preds = %for.cond552.16
%arrayidx559.18 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 18
%23 = load i32, ptr %arrayidx559.18, align 8, !tbaa !9
%cmp560.18 = icmp eq i32 %23, 0
br i1 %cmp560.18, label %if.then562, label %for.cond552.18
for.cond552.18: ; preds = %for.cond552.17
%arrayidx559.19 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 19
%24 = load i32, ptr %arrayidx559.19, align 4, !tbaa !9
%cmp560.19 = icmp eq i32 %24, 0
br i1 %cmp560.19, label %if.then562, label %for.cond552.19
for.cond552.19: ; preds = %for.cond552.18
%arrayidx559.20 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 20
%25 = load i32, ptr %arrayidx559.20, align 16, !tbaa !9
%cmp560.20 = icmp eq i32 %25, 0
br i1 %cmp560.20, label %if.then562, label %for.cond552.20
for.cond552.20: ; preds = %for.cond552.19
%arrayidx559.21 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 21
%26 = load i32, ptr %arrayidx559.21, align 4, !tbaa !9
%cmp560.21 = icmp eq i32 %26, 0
br i1 %cmp560.21, label %if.then562, label %for.cond552.21
for.cond552.21: ; preds = %for.cond552.20
%arrayidx559.22 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 22
%27 = load i32, ptr %arrayidx559.22, align 8, !tbaa !9
%cmp560.22 = icmp eq i32 %27, 0
br i1 %cmp560.22, label %if.then562, label %for.cond552.22
for.cond552.22: ; preds = %for.cond552.21
%arrayidx559.23 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 23
%28 = load i32, ptr %arrayidx559.23, align 4, !tbaa !9
%cmp560.23 = icmp eq i32 %28, 0
br i1 %cmp560.23, label %if.then562, label %for.cond552.23
for.cond552.23: ; preds = %for.cond552.22
%arrayidx559.24 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 24
%29 = load i32, ptr %arrayidx559.24, align 16, !tbaa !9
%cmp560.24 = icmp eq i32 %29, 0
br i1 %cmp560.24, label %if.then562, label %for.cond552.24
for.cond552.24: ; preds = %for.cond552.23
%arrayidx559.25 = getelementptr inbounds [100 x [28 x i32]], ptr @b, i64 0, i64 %indvars.iv731, i64 25
%30 = load i32, ptr %arrayidx559.25, align 4, !tbaa !9
%cmp560.25 = icmp eq i32 %30, 0
br i1 %cmp560.25, label %if.then562, label %if.end572
if.then562: ; preds = %for.cond552.24, %for.cond552.23, %for.cond552.22, %for.cond552.21, %for.cond552.20, %for.cond552.19, %for.cond552.18, %for.cond552.17, %for.cond552.16, %for.cond552.15, %for.cond552.14, %for.cond552.13, %for.cond552.12, %for.cond552.11, %for.cond552.10, %for.cond552.9, %for.cond552.8, %for.cond552.7, %for.cond552.6, %for.cond552.5, %for.cond552.4, %for.cond552.3, %for.cond552.2, %for.cond552.1, %for.cond552, %for.cond552.preheader
br label %if.end572
if.end572: ; preds = %for.cond552.24, %if.then562
%str.sink = phi ptr [ @str, %if.then562 ], [ @str.4, %for.cond552.24 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%indvars.iv.next732 = add nuw i64 %indvars.iv731, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end572, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main(){
int size, i, j;
char *word;
char alfabet[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
scanf("%d", &size);
if(size < 26){
printf("NO");
return 0;
}
getchar();
word = (char*) malloc((size*sizeof(char)));
scanf("%s", word);
for(i=0; i<26; i++){
int f = 0;
for(j=0; j<size; j++){
if(alfabet[i] == tolower(word[j])){
f = 1;
break;
}
}
if(!f){
printf("NO");
return 0;
}
}
printf("YES");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22550/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22550/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"NO\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"YES\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:
%size = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %size)
%0 = load i32, ptr %size, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 26
br i1 %cmp, label %cleanup29, label %if.end
if.end: ; preds = %entry
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = call i32 @getc(ptr noundef %1)
%2 = load i32, ptr %size, align 4, !tbaa !5
%conv = sext i32 %2 to i64
%call3 = call noalias ptr @malloc(i64 noundef %conv) #6
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %call3)
%3 = load i32, ptr %size, align 4, !tbaa !5
%cmp8.not39 = icmp sgt i32 %3, 0
br i1 %cmp8.not39, label %if.end.split, label %cleanup29
if.end.split: ; preds = %if.end
%call12 = tail call ptr @__ctype_tolower_loc() #7
%4 = load ptr, ptr %call12, align 8, !tbaa !9
%wide.trip.count = zext i32 %3 to i64
br label %for.body10
for.cond7: ; preds = %for.body10
%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 %cleanup29, label %for.body10, !llvm.loop !11
for.body10: ; preds = %if.end.split, %for.cond7
%indvars.iv = phi i64 [ 0, %if.end.split ], [ %indvars.iv.next, %for.cond7 ]
%arrayidx14 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv
%5 = load i8, ptr %arrayidx14, align 1, !tbaa !13
%idxprom16 = sext i8 %5 to i64
%arrayidx17 = getelementptr inbounds i32, ptr %4, i64 %idxprom16
%6 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %6, 97
br i1 %cmp18, label %for.body10.1, label %for.cond7
for.body10.1: ; preds = %for.body10, %for.cond7.1
%indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.cond7.1 ], [ 0, %for.body10 ]
%arrayidx14.1 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.1
%7 = load i8, ptr %arrayidx14.1, align 1, !tbaa !13
%idxprom16.1 = sext i8 %7 to i64
%arrayidx17.1 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.1
%8 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5
%cmp18.1 = icmp eq i32 %8, 98
br i1 %cmp18.1, label %for.body10.2, label %for.cond7.1
for.cond7.1: ; preds = %for.body10.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
%exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
br i1 %exitcond.1.not, label %cleanup29, label %for.body10.1, !llvm.loop !11
for.body10.2: ; preds = %for.body10.1, %for.cond7.2
%indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.cond7.2 ], [ 0, %for.body10.1 ]
%arrayidx14.2 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.2
%9 = load i8, ptr %arrayidx14.2, align 1, !tbaa !13
%idxprom16.2 = sext i8 %9 to i64
%arrayidx17.2 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.2
%10 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5
%cmp18.2 = icmp eq i32 %10, 99
br i1 %cmp18.2, label %for.body10.3, label %for.cond7.2
for.cond7.2: ; preds = %for.body10.2
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
%exitcond.2.not = icmp eq i64 %indvars.iv.next.2, %wide.trip.count
br i1 %exitcond.2.not, label %cleanup29, label %for.body10.2, !llvm.loop !11
for.body10.3: ; preds = %for.body10.2, %for.cond7.3
%indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %for.cond7.3 ], [ 0, %for.body10.2 ]
%arrayidx14.3 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.3
%11 = load i8, ptr %arrayidx14.3, align 1, !tbaa !13
%idxprom16.3 = sext i8 %11 to i64
%arrayidx17.3 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.3
%12 = load i32, ptr %arrayidx17.3, align 4, !tbaa !5
%cmp18.3 = icmp eq i32 %12, 100
br i1 %cmp18.3, label %for.body10.4, label %for.cond7.3
for.cond7.3: ; preds = %for.body10.3
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
%exitcond.3.not = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.3.not, label %cleanup29, label %for.body10.3, !llvm.loop !11
for.body10.4: ; preds = %for.body10.3, %for.cond7.4
%indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %for.cond7.4 ], [ 0, %for.body10.3 ]
%arrayidx14.4 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.4
%13 = load i8, ptr %arrayidx14.4, align 1, !tbaa !13
%idxprom16.4 = sext i8 %13 to i64
%arrayidx17.4 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.4
%14 = load i32, ptr %arrayidx17.4, align 4, !tbaa !5
%cmp18.4 = icmp eq i32 %14, 101
br i1 %cmp18.4, label %for.body10.5, label %for.cond7.4
for.cond7.4: ; preds = %for.body10.4
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
%exitcond.4.not = icmp eq i64 %indvars.iv.next.4, %wide.trip.count
br i1 %exitcond.4.not, label %cleanup29, label %for.body10.4, !llvm.loop !11
for.body10.5: ; preds = %for.body10.4, %for.cond7.5
%indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %for.cond7.5 ], [ 0, %for.body10.4 ]
%arrayidx14.5 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.5
%15 = load i8, ptr %arrayidx14.5, align 1, !tbaa !13
%idxprom16.5 = sext i8 %15 to i64
%arrayidx17.5 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.5
%16 = load i32, ptr %arrayidx17.5, align 4, !tbaa !5
%cmp18.5 = icmp eq i32 %16, 102
br i1 %cmp18.5, label %for.body10.6, label %for.cond7.5
for.cond7.5: ; preds = %for.body10.5
%indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
%exitcond.5.not = icmp eq i64 %indvars.iv.next.5, %wide.trip.count
br i1 %exitcond.5.not, label %cleanup29, label %for.body10.5, !llvm.loop !11
for.body10.6: ; preds = %for.body10.5, %for.cond7.6
%indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %for.cond7.6 ], [ 0, %for.body10.5 ]
%arrayidx14.6 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.6
%17 = load i8, ptr %arrayidx14.6, align 1, !tbaa !13
%idxprom16.6 = sext i8 %17 to i64
%arrayidx17.6 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.6
%18 = load i32, ptr %arrayidx17.6, align 4, !tbaa !5
%cmp18.6 = icmp eq i32 %18, 103
br i1 %cmp18.6, label %for.body10.7, label %for.cond7.6
for.cond7.6: ; preds = %for.body10.6
%indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
%exitcond.6.not = icmp eq i64 %indvars.iv.next.6, %wide.trip.count
br i1 %exitcond.6.not, label %cleanup29, label %for.body10.6, !llvm.loop !11
for.body10.7: ; preds = %for.body10.6, %for.cond7.7
%indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %for.cond7.7 ], [ 0, %for.body10.6 ]
%arrayidx14.7 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.7
%19 = load i8, ptr %arrayidx14.7, align 1, !tbaa !13
%idxprom16.7 = sext i8 %19 to i64
%arrayidx17.7 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.7
%20 = load i32, ptr %arrayidx17.7, align 4, !tbaa !5
%cmp18.7 = icmp eq i32 %20, 104
br i1 %cmp18.7, label %for.body10.8, label %for.cond7.7
for.cond7.7: ; preds = %for.body10.7
%indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
%exitcond.7.not = icmp eq i64 %indvars.iv.next.7, %wide.trip.count
br i1 %exitcond.7.not, label %cleanup29, label %for.body10.7, !llvm.loop !11
for.body10.8: ; preds = %for.body10.7, %for.cond7.8
%indvars.iv.8 = phi i64 [ %indvars.iv.next.8, %for.cond7.8 ], [ 0, %for.body10.7 ]
%arrayidx14.8 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.8
%21 = load i8, ptr %arrayidx14.8, align 1, !tbaa !13
%idxprom16.8 = sext i8 %21 to i64
%arrayidx17.8 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.8
%22 = load i32, ptr %arrayidx17.8, align 4, !tbaa !5
%cmp18.8 = icmp eq i32 %22, 105
br i1 %cmp18.8, label %for.body10.9, label %for.cond7.8
for.cond7.8: ; preds = %for.body10.8
%indvars.iv.next.8 = add nuw nsw i64 %indvars.iv.8, 1
%exitcond.8.not = icmp eq i64 %indvars.iv.next.8, %wide.trip.count
br i1 %exitcond.8.not, label %cleanup29, label %for.body10.8, !llvm.loop !11
for.body10.9: ; preds = %for.body10.8, %for.cond7.9
%indvars.iv.9 = phi i64 [ %indvars.iv.next.9, %for.cond7.9 ], [ 0, %for.body10.8 ]
%arrayidx14.9 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.9
%23 = load i8, ptr %arrayidx14.9, align 1, !tbaa !13
%idxprom16.9 = sext i8 %23 to i64
%arrayidx17.9 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.9
%24 = load i32, ptr %arrayidx17.9, align 4, !tbaa !5
%cmp18.9 = icmp eq i32 %24, 106
br i1 %cmp18.9, label %for.body10.10, label %for.cond7.9
for.cond7.9: ; preds = %for.body10.9
%indvars.iv.next.9 = add nuw nsw i64 %indvars.iv.9, 1
%exitcond.9.not = icmp eq i64 %indvars.iv.next.9, %wide.trip.count
br i1 %exitcond.9.not, label %cleanup29, label %for.body10.9, !llvm.loop !11
for.body10.10: ; preds = %for.body10.9, %for.cond7.10
%indvars.iv.10 = phi i64 [ %indvars.iv.next.10, %for.cond7.10 ], [ 0, %for.body10.9 ]
%arrayidx14.10 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.10
%25 = load i8, ptr %arrayidx14.10, align 1, !tbaa !13
%idxprom16.10 = sext i8 %25 to i64
%arrayidx17.10 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.10
%26 = load i32, ptr %arrayidx17.10, align 4, !tbaa !5
%cmp18.10 = icmp eq i32 %26, 107
br i1 %cmp18.10, label %for.body10.11, label %for.cond7.10
for.cond7.10: ; preds = %for.body10.10
%indvars.iv.next.10 = add nuw nsw i64 %indvars.iv.10, 1
%exitcond.10.not = icmp eq i64 %indvars.iv.next.10, %wide.trip.count
br i1 %exitcond.10.not, label %cleanup29, label %for.body10.10, !llvm.loop !11
for.body10.11: ; preds = %for.body10.10, %for.cond7.11
%indvars.iv.11 = phi i64 [ %indvars.iv.next.11, %for.cond7.11 ], [ 0, %for.body10.10 ]
%arrayidx14.11 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.11
%27 = load i8, ptr %arrayidx14.11, align 1, !tbaa !13
%idxprom16.11 = sext i8 %27 to i64
%arrayidx17.11 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.11
%28 = load i32, ptr %arrayidx17.11, align 4, !tbaa !5
%cmp18.11 = icmp eq i32 %28, 108
br i1 %cmp18.11, label %for.body10.12, label %for.cond7.11
for.cond7.11: ; preds = %for.body10.11
%indvars.iv.next.11 = add nuw nsw i64 %indvars.iv.11, 1
%exitcond.11.not = icmp eq i64 %indvars.iv.next.11, %wide.trip.count
br i1 %exitcond.11.not, label %cleanup29, label %for.body10.11, !llvm.loop !11
for.body10.12: ; preds = %for.body10.11, %for.cond7.12
%indvars.iv.12 = phi i64 [ %indvars.iv.next.12, %for.cond7.12 ], [ 0, %for.body10.11 ]
%arrayidx14.12 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.12
%29 = load i8, ptr %arrayidx14.12, align 1, !tbaa !13
%idxprom16.12 = sext i8 %29 to i64
%arrayidx17.12 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.12
%30 = load i32, ptr %arrayidx17.12, align 4, !tbaa !5
%cmp18.12 = icmp eq i32 %30, 109
br i1 %cmp18.12, label %for.body10.13, label %for.cond7.12
for.cond7.12: ; preds = %for.body10.12
%indvars.iv.next.12 = add nuw nsw i64 %indvars.iv.12, 1
%exitcond.12.not = icmp eq i64 %indvars.iv.next.12, %wide.trip.count
br i1 %exitcond.12.not, label %cleanup29, label %for.body10.12, !llvm.loop !11
for.body10.13: ; preds = %for.body10.12, %for.cond7.13
%indvars.iv.13 = phi i64 [ %indvars.iv.next.13, %for.cond7.13 ], [ 0, %for.body10.12 ]
%arrayidx14.13 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.13
%31 = load i8, ptr %arrayidx14.13, align 1, !tbaa !13
%idxprom16.13 = sext i8 %31 to i64
%arrayidx17.13 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.13
%32 = load i32, ptr %arrayidx17.13, align 4, !tbaa !5
%cmp18.13 = icmp eq i32 %32, 110
br i1 %cmp18.13, label %for.body10.14, label %for.cond7.13
for.cond7.13: ; preds = %for.body10.13
%indvars.iv.next.13 = add nuw nsw i64 %indvars.iv.13, 1
%exitcond.13.not = icmp eq i64 %indvars.iv.next.13, %wide.trip.count
br i1 %exitcond.13.not, label %cleanup29, label %for.body10.13, !llvm.loop !11
for.body10.14: ; preds = %for.body10.13, %for.cond7.14
%indvars.iv.14 = phi i64 [ %indvars.iv.next.14, %for.cond7.14 ], [ 0, %for.body10.13 ]
%arrayidx14.14 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.14
%33 = load i8, ptr %arrayidx14.14, align 1, !tbaa !13
%idxprom16.14 = sext i8 %33 to i64
%arrayidx17.14 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.14
%34 = load i32, ptr %arrayidx17.14, align 4, !tbaa !5
%cmp18.14 = icmp eq i32 %34, 111
br i1 %cmp18.14, label %for.body10.15, label %for.cond7.14
for.cond7.14: ; preds = %for.body10.14
%indvars.iv.next.14 = add nuw nsw i64 %indvars.iv.14, 1
%exitcond.14.not = icmp eq i64 %indvars.iv.next.14, %wide.trip.count
br i1 %exitcond.14.not, label %cleanup29, label %for.body10.14, !llvm.loop !11
for.body10.15: ; preds = %for.body10.14, %for.cond7.15
%indvars.iv.15 = phi i64 [ %indvars.iv.next.15, %for.cond7.15 ], [ 0, %for.body10.14 ]
%arrayidx14.15 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.15
%35 = load i8, ptr %arrayidx14.15, align 1, !tbaa !13
%idxprom16.15 = sext i8 %35 to i64
%arrayidx17.15 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.15
%36 = load i32, ptr %arrayidx17.15, align 4, !tbaa !5
%cmp18.15 = icmp eq i32 %36, 112
br i1 %cmp18.15, label %for.body10.16, label %for.cond7.15
for.cond7.15: ; preds = %for.body10.15
%indvars.iv.next.15 = add nuw nsw i64 %indvars.iv.15, 1
%exitcond.15.not = icmp eq i64 %indvars.iv.next.15, %wide.trip.count
br i1 %exitcond.15.not, label %cleanup29, label %for.body10.15, !llvm.loop !11
for.body10.16: ; preds = %for.body10.15, %for.cond7.16
%indvars.iv.16 = phi i64 [ %indvars.iv.next.16, %for.cond7.16 ], [ 0, %for.body10.15 ]
%arrayidx14.16 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.16
%37 = load i8, ptr %arrayidx14.16, align 1, !tbaa !13
%idxprom16.16 = sext i8 %37 to i64
%arrayidx17.16 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.16
%38 = load i32, ptr %arrayidx17.16, align 4, !tbaa !5
%cmp18.16 = icmp eq i32 %38, 113
br i1 %cmp18.16, label %for.body10.17, label %for.cond7.16
for.cond7.16: ; preds = %for.body10.16
%indvars.iv.next.16 = add nuw nsw i64 %indvars.iv.16, 1
%exitcond.16.not = icmp eq i64 %indvars.iv.next.16, %wide.trip.count
br i1 %exitcond.16.not, label %cleanup29, label %for.body10.16, !llvm.loop !11
for.body10.17: ; preds = %for.body10.16, %for.cond7.17
%indvars.iv.17 = phi i64 [ %indvars.iv.next.17, %for.cond7.17 ], [ 0, %for.body10.16 ]
%arrayidx14.17 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.17
%39 = load i8, ptr %arrayidx14.17, align 1, !tbaa !13
%idxprom16.17 = sext i8 %39 to i64
%arrayidx17.17 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.17
%40 = load i32, ptr %arrayidx17.17, align 4, !tbaa !5
%cmp18.17 = icmp eq i32 %40, 114
br i1 %cmp18.17, label %for.body10.18, label %for.cond7.17
for.cond7.17: ; preds = %for.body10.17
%indvars.iv.next.17 = add nuw nsw i64 %indvars.iv.17, 1
%exitcond.17.not = icmp eq i64 %indvars.iv.next.17, %wide.trip.count
br i1 %exitcond.17.not, label %cleanup29, label %for.body10.17, !llvm.loop !11
for.body10.18: ; preds = %for.body10.17, %for.cond7.18
%indvars.iv.18 = phi i64 [ %indvars.iv.next.18, %for.cond7.18 ], [ 0, %for.body10.17 ]
%arrayidx14.18 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.18
%41 = load i8, ptr %arrayidx14.18, align 1, !tbaa !13
%idxprom16.18 = sext i8 %41 to i64
%arrayidx17.18 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.18
%42 = load i32, ptr %arrayidx17.18, align 4, !tbaa !5
%cmp18.18 = icmp eq i32 %42, 115
br i1 %cmp18.18, label %for.body10.19, label %for.cond7.18
for.cond7.18: ; preds = %for.body10.18
%indvars.iv.next.18 = add nuw nsw i64 %indvars.iv.18, 1
%exitcond.18.not = icmp eq i64 %indvars.iv.next.18, %wide.trip.count
br i1 %exitcond.18.not, label %cleanup29, label %for.body10.18, !llvm.loop !11
for.body10.19: ; preds = %for.body10.18, %for.cond7.19
%indvars.iv.19 = phi i64 [ %indvars.iv.next.19, %for.cond7.19 ], [ 0, %for.body10.18 ]
%arrayidx14.19 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.19
%43 = load i8, ptr %arrayidx14.19, align 1, !tbaa !13
%idxprom16.19 = sext i8 %43 to i64
%arrayidx17.19 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.19
%44 = load i32, ptr %arrayidx17.19, align 4, !tbaa !5
%cmp18.19 = icmp eq i32 %44, 116
br i1 %cmp18.19, label %for.body10.20, label %for.cond7.19
for.cond7.19: ; preds = %for.body10.19
%indvars.iv.next.19 = add nuw nsw i64 %indvars.iv.19, 1
%exitcond.19.not = icmp eq i64 %indvars.iv.next.19, %wide.trip.count
br i1 %exitcond.19.not, label %cleanup29, label %for.body10.19, !llvm.loop !11
for.body10.20: ; preds = %for.body10.19, %for.cond7.20
%indvars.iv.20 = phi i64 [ %indvars.iv.next.20, %for.cond7.20 ], [ 0, %for.body10.19 ]
%arrayidx14.20 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.20
%45 = load i8, ptr %arrayidx14.20, align 1, !tbaa !13
%idxprom16.20 = sext i8 %45 to i64
%arrayidx17.20 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.20
%46 = load i32, ptr %arrayidx17.20, align 4, !tbaa !5
%cmp18.20 = icmp eq i32 %46, 117
br i1 %cmp18.20, label %for.body10.21, label %for.cond7.20
for.cond7.20: ; preds = %for.body10.20
%indvars.iv.next.20 = add nuw nsw i64 %indvars.iv.20, 1
%exitcond.20.not = icmp eq i64 %indvars.iv.next.20, %wide.trip.count
br i1 %exitcond.20.not, label %cleanup29, label %for.body10.20, !llvm.loop !11
for.body10.21: ; preds = %for.body10.20, %for.cond7.21
%indvars.iv.21 = phi i64 [ %indvars.iv.next.21, %for.cond7.21 ], [ 0, %for.body10.20 ]
%arrayidx14.21 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.21
%47 = load i8, ptr %arrayidx14.21, align 1, !tbaa !13
%idxprom16.21 = sext i8 %47 to i64
%arrayidx17.21 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.21
%48 = load i32, ptr %arrayidx17.21, align 4, !tbaa !5
%cmp18.21 = icmp eq i32 %48, 118
br i1 %cmp18.21, label %for.body10.22, label %for.cond7.21
for.cond7.21: ; preds = %for.body10.21
%indvars.iv.next.21 = add nuw nsw i64 %indvars.iv.21, 1
%exitcond.21.not = icmp eq i64 %indvars.iv.next.21, %wide.trip.count
br i1 %exitcond.21.not, label %cleanup29, label %for.body10.21, !llvm.loop !11
for.body10.22: ; preds = %for.body10.21, %for.cond7.22
%indvars.iv.22 = phi i64 [ %indvars.iv.next.22, %for.cond7.22 ], [ 0, %for.body10.21 ]
%arrayidx14.22 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.22
%49 = load i8, ptr %arrayidx14.22, align 1, !tbaa !13
%idxprom16.22 = sext i8 %49 to i64
%arrayidx17.22 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.22
%50 = load i32, ptr %arrayidx17.22, align 4, !tbaa !5
%cmp18.22 = icmp eq i32 %50, 119
br i1 %cmp18.22, label %for.body10.23, label %for.cond7.22
for.cond7.22: ; preds = %for.body10.22
%indvars.iv.next.22 = add nuw nsw i64 %indvars.iv.22, 1
%exitcond.22.not = icmp eq i64 %indvars.iv.next.22, %wide.trip.count
br i1 %exitcond.22.not, label %cleanup29, label %for.body10.22, !llvm.loop !11
for.body10.23: ; preds = %for.body10.22, %for.cond7.23
%indvars.iv.23 = phi i64 [ %indvars.iv.next.23, %for.cond7.23 ], [ 0, %for.body10.22 ]
%arrayidx14.23 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.23
%51 = load i8, ptr %arrayidx14.23, align 1, !tbaa !13
%idxprom16.23 = sext i8 %51 to i64
%arrayidx17.23 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.23
%52 = load i32, ptr %arrayidx17.23, align 4, !tbaa !5
%cmp18.23 = icmp eq i32 %52, 120
br i1 %cmp18.23, label %for.body10.24, label %for.cond7.23
for.cond7.23: ; preds = %for.body10.23
%indvars.iv.next.23 = add nuw nsw i64 %indvars.iv.23, 1
%exitcond.23.not = icmp eq i64 %indvars.iv.next.23, %wide.trip.count
br i1 %exitcond.23.not, label %cleanup29, label %for.body10.23, !llvm.loop !11
for.body10.24: ; preds = %for.body10.23, %for.cond7.24
%indvars.iv.24 = phi i64 [ %indvars.iv.next.24, %for.cond7.24 ], [ 0, %for.body10.23 ]
%arrayidx14.24 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.24
%53 = load i8, ptr %arrayidx14.24, align 1, !tbaa !13
%idxprom16.24 = sext i8 %53 to i64
%arrayidx17.24 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.24
%54 = load i32, ptr %arrayidx17.24, align 4, !tbaa !5
%cmp18.24 = icmp eq i32 %54, 121
br i1 %cmp18.24, label %for.body10.25, label %for.cond7.24
for.cond7.24: ; preds = %for.body10.24
%indvars.iv.next.24 = add nuw nsw i64 %indvars.iv.24, 1
%exitcond.24.not = icmp eq i64 %indvars.iv.next.24, %wide.trip.count
br i1 %exitcond.24.not, label %cleanup29, label %for.body10.24, !llvm.loop !11
for.body10.25: ; preds = %for.body10.24, %for.cond7.25
%indvars.iv.25 = phi i64 [ %indvars.iv.next.25, %for.cond7.25 ], [ 0, %for.body10.24 ]
%arrayidx14.25 = getelementptr inbounds i8, ptr %call3, i64 %indvars.iv.25
%55 = load i8, ptr %arrayidx14.25, align 1, !tbaa !13
%idxprom16.25 = sext i8 %55 to i64
%arrayidx17.25 = getelementptr inbounds i32, ptr %4, i64 %idxprom16.25
%56 = load i32, ptr %arrayidx17.25, align 4, !tbaa !5
%cmp18.25 = icmp eq i32 %56, 122
br i1 %cmp18.25, label %cleanup29, label %for.cond7.25
for.cond7.25: ; preds = %for.body10.25
%indvars.iv.next.25 = add nuw nsw i64 %indvars.iv.25, 1
%exitcond.25.not = icmp eq i64 %indvars.iv.next.25, %wide.trip.count
br i1 %exitcond.25.not, label %cleanup29, label %for.body10.25, !llvm.loop !11
cleanup29: ; preds = %for.cond7, %for.cond7.1, %for.cond7.2, %for.cond7.3, %for.cond7.4, %for.cond7.5, %for.cond7.6, %for.cond7.7, %for.cond7.8, %for.cond7.9, %for.cond7.10, %for.cond7.11, %for.cond7.12, %for.cond7.13, %for.cond7.14, %for.cond7.15, %for.cond7.16, %for.cond7.17, %for.cond7.18, %for.cond7.19, %for.cond7.20, %for.cond7.21, %for.cond7.22, %for.cond7.23, %for.cond7.24, %for.cond7.25, %for.body10.25, %if.end, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.end ], [ @.str.3, %for.body10.25 ], [ @.str.1, %for.cond7.25 ], [ @.str.1, %for.cond7.24 ], [ @.str.1, %for.cond7.23 ], [ @.str.1, %for.cond7.22 ], [ @.str.1, %for.cond7.21 ], [ @.str.1, %for.cond7.20 ], [ @.str.1, %for.cond7.19 ], [ @.str.1, %for.cond7.18 ], [ @.str.1, %for.cond7.17 ], [ @.str.1, %for.cond7.16 ], [ @.str.1, %for.cond7.15 ], [ @.str.1, %for.cond7.14 ], [ @.str.1, %for.cond7.13 ], [ @.str.1, %for.cond7.12 ], [ @.str.1, %for.cond7.11 ], [ @.str.1, %for.cond7.10 ], [ @.str.1, %for.cond7.9 ], [ @.str.1, %for.cond7.8 ], [ @.str.1, %for.cond7.7 ], [ @.str.1, %for.cond7.6 ], [ @.str.1, %for.cond7.5 ], [ @.str.1, %for.cond7.4 ], [ @.str.1, %for.cond7.3 ], [ @.str.1, %for.cond7.2 ], [ @.str.1, %for.cond7.1 ], [ @.str.1, %for.cond7 ]
%call23.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() 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 @getc(ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
|
#include <stdio.h>
int main(){
char s[25];
scanf("%s",s);
s[5] = ' '; // Karakter ke 6 pasti koma
s[13] = ' ';// Karakter ke 14 pasti koma
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [25 x i8], align 16
call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx = getelementptr inbounds [25 x i8], ptr %s, i64 0, i64 5
store i8 32, ptr %arrayidx, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [25 x i8], ptr %s, i64 0, i64 13
store i8 32, ptr %arrayidx1, align 1, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int unused __attribute__((unused));
int i;
char s[20];
unused = scanf("%s", s);
for(i=0; i<19; i++){
if(s[i]==',') s[i] = ' ';
}
printf("%s", s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp1 = icmp eq i8 %0, 44
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %entry
store i8 32, ptr %s, align 16, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then
%arrayidx.1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp1.1 = icmp eq i8 %1, 44
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i8 32, ptr %arrayidx.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx.2 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%cmp1.2 = icmp eq i8 %2, 44
br i1 %cmp1.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i8 32, ptr %arrayidx.2, align 2, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx.3 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%cmp1.3 = icmp eq i8 %3, 44
br i1 %cmp1.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i8 32, ptr %arrayidx.3, align 1, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx.4 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 4
%4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%cmp1.4 = icmp eq i8 %4, 44
br i1 %cmp1.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i8 32, ptr %arrayidx.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx.5 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 5
%5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%cmp1.5 = icmp eq i8 %5, 44
br i1 %cmp1.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
store i8 32, ptr %arrayidx.5, align 1, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx.6 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 6
%6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%cmp1.6 = icmp eq i8 %6, 44
br i1 %cmp1.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
store i8 32, ptr %arrayidx.6, align 2, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx.7 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 7
%7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%cmp1.7 = icmp eq i8 %7, 44
br i1 %cmp1.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
store i8 32, ptr %arrayidx.7, align 1, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%arrayidx.8 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 8
%8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5
%cmp1.8 = icmp eq i8 %8, 44
br i1 %cmp1.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %for.inc.7
store i8 32, ptr %arrayidx.8, align 8, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%arrayidx.9 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 9
%9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5
%cmp1.9 = icmp eq i8 %9, 44
br i1 %cmp1.9, label %if.then.9, label %for.inc.9
if.then.9: ; preds = %for.inc.8
store i8 32, ptr %arrayidx.9, align 1, !tbaa !5
br label %for.inc.9
for.inc.9: ; preds = %if.then.9, %for.inc.8
%arrayidx.10 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 10
%10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5
%cmp1.10 = icmp eq i8 %10, 44
br i1 %cmp1.10, label %if.then.10, label %for.inc.10
if.then.10: ; preds = %for.inc.9
store i8 32, ptr %arrayidx.10, align 2, !tbaa !5
br label %for.inc.10
for.inc.10: ; preds = %if.then.10, %for.inc.9
%arrayidx.11 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 11
%11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5
%cmp1.11 = icmp eq i8 %11, 44
br i1 %cmp1.11, label %if.then.11, label %for.inc.11
if.then.11: ; preds = %for.inc.10
store i8 32, ptr %arrayidx.11, align 1, !tbaa !5
br label %for.inc.11
for.inc.11: ; preds = %if.then.11, %for.inc.10
%arrayidx.12 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 12
%12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5
%cmp1.12 = icmp eq i8 %12, 44
br i1 %cmp1.12, label %if.then.12, label %for.inc.12
if.then.12: ; preds = %for.inc.11
store i8 32, ptr %arrayidx.12, align 4, !tbaa !5
br label %for.inc.12
for.inc.12: ; preds = %if.then.12, %for.inc.11
%arrayidx.13 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 13
%13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5
%cmp1.13 = icmp eq i8 %13, 44
br i1 %cmp1.13, label %if.then.13, label %for.inc.13
if.then.13: ; preds = %for.inc.12
store i8 32, ptr %arrayidx.13, align 1, !tbaa !5
br label %for.inc.13
for.inc.13: ; preds = %if.then.13, %for.inc.12
%arrayidx.14 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 14
%14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5
%cmp1.14 = icmp eq i8 %14, 44
br i1 %cmp1.14, label %if.then.14, label %for.inc.14
if.then.14: ; preds = %for.inc.13
store i8 32, ptr %arrayidx.14, align 2, !tbaa !5
br label %for.inc.14
for.inc.14: ; preds = %if.then.14, %for.inc.13
%arrayidx.15 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 15
%15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5
%cmp1.15 = icmp eq i8 %15, 44
br i1 %cmp1.15, label %if.then.15, label %for.inc.15
if.then.15: ; preds = %for.inc.14
store i8 32, ptr %arrayidx.15, align 1, !tbaa !5
br label %for.inc.15
for.inc.15: ; preds = %if.then.15, %for.inc.14
%arrayidx.16 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 16
%16 = load i8, ptr %arrayidx.16, align 16, !tbaa !5
%cmp1.16 = icmp eq i8 %16, 44
br i1 %cmp1.16, label %if.then.16, label %for.inc.16
if.then.16: ; preds = %for.inc.15
store i8 32, ptr %arrayidx.16, align 16, !tbaa !5
br label %for.inc.16
for.inc.16: ; preds = %if.then.16, %for.inc.15
%arrayidx.17 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 17
%17 = load i8, ptr %arrayidx.17, align 1, !tbaa !5
%cmp1.17 = icmp eq i8 %17, 44
br i1 %cmp1.17, label %if.then.17, label %for.inc.17
if.then.17: ; preds = %for.inc.16
store i8 32, ptr %arrayidx.17, align 1, !tbaa !5
br label %for.inc.17
for.inc.17: ; preds = %if.then.17, %for.inc.16
%arrayidx.18 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 18
%18 = load i8, ptr %arrayidx.18, align 2, !tbaa !5
%cmp1.18 = icmp eq i8 %18, 44
br i1 %cmp1.18, label %if.then.18, label %for.inc.18
if.then.18: ; preds = %for.inc.17
store i8 32, ptr %arrayidx.18, align 2, !tbaa !5
br label %for.inc.18
for.inc.18: ; preds = %if.then.18, %for.inc.17
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
char n1[10];
char n2[10];
char n3[10];
scanf("%[^,]%*c", n1);
scanf("%[^,]%*c", n2);
scanf("%s", n3);
printf("%s %s %s\n", n1, n2, n3);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225644/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225644/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%[^,]%*c\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%s %s %s\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n1 = alloca [10 x i8], align 1
%n2 = alloca [10 x i8], align 1
%n3 = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %n1) #3
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %n2) #3
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %n3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n2)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n3)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %n3) #3
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %n2) #3
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %n1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main()
{
int i,j,k,l;
char trr[50];
scanf("%s",trr);
for(i=0;i<5;i++)
printf("%c",trr[i]);
if(trr[5]==',')
printf(" ");
else printf("%c",trr[5]);
for(i=6;i<=12;i++)
printf("%c",trr[i]);
if(trr[13]==',')
printf(" ");
else printf("%c",trr[13]);
for(i=14;i<19;i++)
printf("%c",trr[i]);
printf("\n");
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225701/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225701/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%trr = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %trr) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %trr)
%0 = load i8, ptr %trr, align 16, !tbaa !5
%conv = sext i8 %0 to i32
%putchar58 = call i32 @putchar(i32 %conv)
%arrayidx.1 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %1 to i32
%putchar58.1 = call i32 @putchar(i32 %conv.1)
%arrayidx.2 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%conv.2 = sext i8 %2 to i32
%putchar58.2 = call i32 @putchar(i32 %conv.2)
%arrayidx.3 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 3
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv.3 = sext i8 %3 to i32
%putchar58.3 = call i32 @putchar(i32 %conv.3)
%arrayidx.4 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 4
%4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%conv.4 = sext i8 %4 to i32
%putchar58.4 = call i32 @putchar(i32 %conv.4)
%arrayidx2 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 5
%5 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4 = icmp eq i8 %5, 44
%narrow = select i1 %cmp4, i8 32, i8 %5
%conv3.sink = sext i8 %narrow to i32
%putchar = call i32 @putchar(i32 %conv3.sink)
%arrayidx15 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 6
%6 = load i8, ptr %arrayidx15, align 2, !tbaa !5
%conv16 = sext i8 %6 to i32
%putchar57 = call i32 @putchar(i32 %conv16)
%arrayidx15.1 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 7
%7 = load i8, ptr %arrayidx15.1, align 1, !tbaa !5
%conv16.1 = sext i8 %7 to i32
%putchar57.1 = call i32 @putchar(i32 %conv16.1)
%arrayidx15.2 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 8
%8 = load i8, ptr %arrayidx15.2, align 8, !tbaa !5
%conv16.2 = sext i8 %8 to i32
%putchar57.2 = call i32 @putchar(i32 %conv16.2)
%arrayidx15.3 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 9
%9 = load i8, ptr %arrayidx15.3, align 1, !tbaa !5
%conv16.3 = sext i8 %9 to i32
%putchar57.3 = call i32 @putchar(i32 %conv16.3)
%arrayidx15.4 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 10
%10 = load i8, ptr %arrayidx15.4, align 2, !tbaa !5
%conv16.4 = sext i8 %10 to i32
%putchar57.4 = call i32 @putchar(i32 %conv16.4)
%arrayidx15.5 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 11
%11 = load i8, ptr %arrayidx15.5, align 1, !tbaa !5
%conv16.5 = sext i8 %11 to i32
%putchar57.5 = call i32 @putchar(i32 %conv16.5)
%arrayidx15.6 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 12
%12 = load i8, ptr %arrayidx15.6, align 4, !tbaa !5
%conv16.6 = sext i8 %12 to i32
%putchar57.6 = call i32 @putchar(i32 %conv16.6)
%arrayidx21 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 13
%13 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%cmp23 = icmp eq i8 %13, 44
%narrow65 = select i1 %cmp23, i8 32, i8 %13
%conv22.sink = sext i8 %narrow65 to i32
%putchar53 = call i32 @putchar(i32 %conv22.sink)
%arrayidx37 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 14
%14 = load i8, ptr %arrayidx37, align 2, !tbaa !5
%conv38 = sext i8 %14 to i32
%putchar56 = call i32 @putchar(i32 %conv38)
%arrayidx37.1 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 15
%15 = load i8, ptr %arrayidx37.1, align 1, !tbaa !5
%conv38.1 = sext i8 %15 to i32
%putchar56.1 = call i32 @putchar(i32 %conv38.1)
%arrayidx37.2 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 16
%16 = load i8, ptr %arrayidx37.2, align 16, !tbaa !5
%conv38.2 = sext i8 %16 to i32
%putchar56.2 = call i32 @putchar(i32 %conv38.2)
%arrayidx37.3 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 17
%17 = load i8, ptr %arrayidx37.3, align 1, !tbaa !5
%conv38.3 = sext i8 %17 to i32
%putchar56.3 = call i32 @putchar(i32 %conv38.3)
%arrayidx37.4 = getelementptr inbounds [50 x i8], ptr %trr, i64 0, i64 18
%18 = load i8, ptr %arrayidx37.4, align 2, !tbaa !5
%conv38.4 = sext i8 %18 to i32
%putchar56.4 = call i32 @putchar(i32 %conv38.4)
%putchar55 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %trr) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int t,L,l,r,i,v,j,count,k;
scanf("%d",&t);
for(i=0;i<t;i++)
{
count=0;
scanf("%d %d %d %d",&L,&v,&l,&r);
if(l==v||l%v==0)
j=l/v-1;
else
j=l/v;
k=L/v;
count=r/v;
j=j+k-count;
printf("%d\n",j);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22576/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22576/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%L = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end
%i.013 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %L, ptr noundef nonnull %v, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %l, align 4, !tbaa !5
%2 = load i32, ptr %v, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, %2
br i1 %cmp2, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%rem = srem i32 %1, %2
%div4 = sdiv i32 %1, %2
%cmp3 = icmp eq i32 %rem, 0
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false, %for.body
%div = sdiv i32 %1, %2
%sub = add nsw i32 %div, -1
br label %if.end
if.end: ; preds = %lor.lhs.false, %if.then
%j.0 = phi i32 [ %sub, %if.then ], [ %div4, %lor.lhs.false ]
%3 = load i32, ptr %L, align 4, !tbaa !5
%div5 = sdiv i32 %3, %2
%4 = load i32, ptr %r, align 4, !tbaa !5
%div6 = sdiv i32 %4, %2
%add = add nsw i32 %div5, %j.0
%sub7 = sub i32 %add, %div6
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub7)
%inc = add nuw nsw i32 %i.013, 1
%5 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int n,e[100001] = {0},in[100001] = {0},ans = 0,anspos = 0,ansarr[100001] = {0};
short map[100001] = {0};
int main()
{
int i,now,tans,fn,top;
scanf("%d",&n);
for(i=1;i<=n;i++) scanf("%hd",&map[i]);
for(i=1;i<=n;i++)
{
scanf("%d",&fn);
e[i] = fn;
in[fn]++;
}
for(i=1;i<=n;i++)
{
if(map[i]&&!in[i])
{
tans = 1;
now = i;
while(!map[e[now]]&&in[e[now]]<2&&e[now])
{
now = e[now];
tans++;
}
if(tans>ans)
{
ans = tans;
anspos = i;
}
}
}
printf("%d\n",ans);
now = anspos;
ansarr[1] = now;
top = 1;
while(!map[e[now]]&&in[e[now]]<2&&e[now])
{
now = e[now];
top++;
ansarr[top] = now;
}
for(i=top;i;i--) printf("%d ",ansarr[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22581/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22581/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@e = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@in = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global i32 0, align 4
@anspos = dso_local local_unnamed_addr global i32 0, align 4
@ansarr = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@map = dso_local global [100001 x i16] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%hd\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%fn = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %fn) #3
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not110 = icmp slt i32 %0, 1
br i1 %cmp.not110, label %for.cond14.preheader.thread, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not112 = icmp slt i32 %1, 1
br i1 %cmp3.not112, label %for.cond14.preheader.thread, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond14.preheader.thread: ; preds = %for.cond2.preheader, %entry
%ans.promoted155 = load i32, ptr @ans, align 4, !tbaa !5
br label %for.end46
for.cond14.preheader: ; preds = %for.body4
%ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
%cmp15.not125 = icmp slt i32 %6, 1
br i1 %cmp15.not125, label %for.end46, label %for.body16.preheader
for.body16.preheader: ; preds = %for.cond14.preheader
%3 = add nuw i32 %6, 1
%wide.trip.count = zext i32 %3 to i64
br label %for.body16
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv140 = phi i64 [ %indvars.iv.next141, %for.body4 ], [ 1, %for.cond2.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %fn)
%4 = load i32, ptr %fn, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [100001 x i32], ptr @e, i64 0, i64 %indvars.iv140
store i32 %4, ptr %arrayidx7, align 4, !tbaa !5
%idxprom8 = sext i32 %4 to i64
%arrayidx9 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%inc10 = add nsw i32 %5, 1
store i32 %inc10, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%6 = load i32, ptr @n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv140, %7
br i1 %cmp3.not.not, label %for.body4, label %for.cond14.preheader, !llvm.loop !11
for.body16: ; preds = %for.body16.preheader, %for.inc44
%indvars.iv143 = phi i64 [ 1, %for.body16.preheader ], [ %indvars.iv.next144, %for.inc44 ]
%tans.0.lcssa124126 = phi i32 [ %ans.promoted, %for.body16.preheader ], [ %tans.0.lcssa123, %for.inc44 ]
%arrayidx18 = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %indvars.iv143
%8 = load i16, ptr %arrayidx18, align 2, !tbaa !12
%tobool.not = icmp eq i16 %8, 0
br i1 %tobool.not, label %for.inc44, label %land.lhs.true
land.lhs.true: ; preds = %for.body16
%arrayidx20 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %indvars.iv143
%9 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%tobool21.not = icmp eq i32 %9, 0
br i1 %tobool21.not, label %while.cond.preheader, label %for.inc44
while.cond.preheader: ; preds = %land.lhs.true
%arrayidx23115 = getelementptr inbounds [100001 x i32], ptr @e, i64 0, i64 %indvars.iv143
%10 = load i32, ptr %arrayidx23115, align 4, !tbaa !5
%idxprom24116 = sext i32 %10 to i64
%arrayidx25117 = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %idxprom24116
%11 = load i16, ptr %arrayidx25117, align 2, !tbaa !12
%tobool26.not118 = icmp eq i16 %11, 0
br i1 %tobool26.not118, label %land.lhs.true27, label %while.end
land.lhs.true27: ; preds = %while.cond.preheader, %while.body
%idxprom24120 = phi i64 [ %idxprom24, %while.body ], [ %idxprom24116, %while.cond.preheader ]
%12 = phi i32 [ %14, %while.body ], [ %10, %while.cond.preheader ]
%tans.0119 = phi i32 [ %inc39, %while.body ], [ 1, %while.cond.preheader ]
%arrayidx31 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %idxprom24120
%13 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %13, 1
%tobool36.not = icmp eq i32 %12, 0
%or.cond = or i1 %tobool36.not, %cmp32
br i1 %or.cond, label %while.end, label %while.body
while.body: ; preds = %land.lhs.true27
%inc39 = add nuw nsw i32 %tans.0119, 1
%idxprom22 = sext i32 %12 to i64
%arrayidx23 = getelementptr inbounds [100001 x i32], ptr @e, i64 0, i64 %idxprom22
%14 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%idxprom24 = sext i32 %14 to i64
%arrayidx25 = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %idxprom24
%15 = load i16, ptr %arrayidx25, align 2, !tbaa !12
%tobool26.not = icmp eq i16 %15, 0
br i1 %tobool26.not, label %land.lhs.true27, label %while.end, !llvm.loop !14
while.end: ; preds = %while.body, %land.lhs.true27, %while.cond.preheader
%tans.0.lcssa = phi i32 [ 1, %while.cond.preheader ], [ %tans.0119, %land.lhs.true27 ], [ %inc39, %while.body ]
%cmp40 = icmp sgt i32 %tans.0.lcssa, %tans.0.lcssa124126
br i1 %cmp40, label %if.then42, label %for.inc44
if.then42: ; preds = %while.end
store i32 %tans.0.lcssa, ptr @ans, align 4, !tbaa !5
%16 = trunc i64 %indvars.iv143 to i32
store i32 %16, ptr @anspos, align 4, !tbaa !5
br label %for.inc44
for.inc44: ; preds = %for.body16, %land.lhs.true, %if.then42, %while.end
%tans.0.lcssa123 = phi i32 [ %tans.0.lcssa124126, %for.body16 ], [ %tans.0.lcssa124126, %land.lhs.true ], [ %tans.0.lcssa, %if.then42 ], [ %tans.0.lcssa124126, %while.end ]
%indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
%exitcond.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count
br i1 %exitcond.not, label %for.end46, label %for.body16, !llvm.loop !15
for.end46: ; preds = %for.inc44, %for.cond14.preheader.thread, %for.cond14.preheader
%17 = phi i32 [ %ans.promoted, %for.cond14.preheader ], [ %ans.promoted155, %for.cond14.preheader.thread ], [ %tans.0.lcssa123, %for.inc44 ]
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%18 = load i32, ptr @anspos, align 4, !tbaa !5
store i32 %18, ptr getelementptr inbounds ([100001 x i32], ptr @ansarr, i64 0, i64 1), align 4, !tbaa !5
%idxprom49128 = sext i32 %18 to i64
%arrayidx50129 = getelementptr inbounds [100001 x i32], ptr @e, i64 0, i64 %idxprom49128
%19 = load i32, ptr %arrayidx50129, align 4, !tbaa !5
%idxprom51130 = sext i32 %19 to i64
%arrayidx52131 = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %idxprom51130
%20 = load i16, ptr %arrayidx52131, align 2, !tbaa !12
%tobool53.not132 = icmp eq i16 %20, 0
br i1 %tobool53.not132, label %land.lhs.true54, label %for.body75.preheader
land.lhs.true54: ; preds = %for.end46, %while.body66
%indvars.iv146 = phi i64 [ %indvars.iv.next147, %while.body66 ], [ 1, %for.end46 ]
%idxprom51134 = phi i64 [ %idxprom51, %while.body66 ], [ %idxprom51130, %for.end46 ]
%21 = phi i32 [ %23, %while.body66 ], [ %19, %for.end46 ]
%arrayidx58 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %idxprom51134
%22 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %22, 1
%tobool64.not = icmp eq i32 %21, 0
%or.cond109 = or i1 %tobool64.not, %cmp59
br i1 %or.cond109, label %while.end72.loopexit, label %while.body66
while.body66: ; preds = %land.lhs.true54
%indvars.iv.next147 = add nuw i64 %indvars.iv146, 1
%arrayidx71 = getelementptr inbounds [100001 x i32], ptr @ansarr, i64 0, i64 %indvars.iv.next147
store i32 %21, ptr %arrayidx71, align 4, !tbaa !5
%idxprom49 = sext i32 %21 to i64
%arrayidx50 = getelementptr inbounds [100001 x i32], ptr @e, i64 0, i64 %idxprom49
%23 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%idxprom51 = sext i32 %23 to i64
%arrayidx52 = getelementptr inbounds [100001 x i16], ptr @map, i64 0, i64 %idxprom51
%24 = load i16, ptr %arrayidx52, align 2, !tbaa !12
%tobool53.not = icmp eq i16 %24, 0
br i1 %tobool53.not, label %land.lhs.true54, label %while.end72.loopexit, !llvm.loop !16
while.end72.loopexit: ; preds = %land.lhs.true54, %while.body66
%top.0.lcssa.ph.in = phi i64 [ %indvars.iv.next147, %while.body66 ], [ %indvars.iv146, %land.lhs.true54 ]
%sext = shl i64 %top.0.lcssa.ph.in, 32
%25 = ashr exact i64 %sext, 32
br label %for.body75.preheader
for.body75.preheader: ; preds = %while.end72.loopexit, %for.end46
%indvars.iv149.ph = phi i64 [ %25, %while.end72.loopexit ], [ 1, %for.end46 ]
br label %for.body75
for.body75: ; preds = %for.body75.preheader, %for.body75
%indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body75 ], [ %indvars.iv149.ph, %for.body75.preheader ]
%arrayidx77 = getelementptr inbounds [100001 x i32], ptr @ansarr, i64 0, i64 %indvars.iv149
%26 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %26)
%indvars.iv.next150 = add nsw i64 %indvars.iv149, -1
%27 = and i64 %indvars.iv.next150, 4294967295
%tobool74.not = icmp eq i64 %27, 0
br i1 %tobool74.not, label %for.end80, label %for.body75, !llvm.loop !17
for.end80: ; preds = %for.body75
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %fn) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(void)
{
char str1[32];
scanf("%s",str1);
str1[5]=' ';
str1[13]=' ';
printf("%s",str1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str1 = alloca [32 x i8], align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %str1) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1)
%arrayidx = getelementptr inbounds [32 x i8], ptr %str1, i64 0, i64 5
store i8 32, ptr %arrayidx, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [32 x i8], ptr %str1, i64 0, i64 13
store i8 32, ptr %arrayidx1, align 1, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %str1)
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %str1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void){
char s[100];
int len;
int i;
scanf("%s",s);
len = strlen(s);
for(i=0;i<len;i++){
if(i==5 || i==13){
printf(" ");
}else{
printf("%c",s[i]);
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225918/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225918/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call2 to i32
%cmp18 = icmp sgt i32 %conv, 0
br i1 %cmp18, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%0 = and i64 %indvars.iv, 2147483639
%or.cond = icmp eq i64 %0, 5
br i1 %or.cond, label %for.inc, label %if.else
if.else: ; preds = %for.body
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv9 = sext i8 %1 to i32
br label %for.inc
for.inc: ; preds = %for.body, %if.else
%.sink = phi i32 [ %conv9, %if.else ], [ 32, %for.body ]
%putchar17 = call i32 @putchar(i32 %.sink)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int A,B,C,D;
scanf("%d %d %d",&A,&B,&C);
if(C-A-B<=1)
{
D=C+B;
printf("%d",D);
}
else{
D=A+B+1+B;
printf("%d",D);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225961/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225961/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%0 = load i32, ptr %C, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%2 = load i32, ptr %B, align 4, !tbaa !5
%3 = add i32 %2, %1
%sub1 = sub i32 %0, %3
%cmp = icmp slt i32 %sub1, 2
%add4 = add i32 %2, 1
%add5 = add i32 %add4, %3
%add = add nsw i32 %2, %0
%add5.sink = select i1 %cmp, i32 %add, i32 %add5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b, c;
int count = 0;
//int flag = 1;
scanf("%d %d %d",&a,&b,&c);
if(c > a){
count = a;
c = c - a;
if(c > b){
count = count + 2*b + 1;
}
else{
count = count + b + c;
}
}
else{
count = c + b;
}
printf("%d",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226010/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226010/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else6
if.then: ; preds = %entry
%sub = sub nsw i32 %0, %1
store i32 %sub, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %sub, %2
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%mul = shl nsw i32 %2, 1
%add = add nsw i32 %1, 1
%add3 = add i32 %add, %mul
br label %if.end8
if.else: ; preds = %if.then
%add5 = add i32 %2, %0
br label %if.end8
if.else6: ; preds = %entry
%3 = load i32, ptr %b, align 4, !tbaa !5
%add7 = add nsw i32 %3, %0
br label %if.end8
if.end8: ; preds = %if.then2, %if.else, %if.else6
%count.0 = phi i32 [ %add3, %if.then2 ], [ %add5, %if.else ], [ %add7, %if.else6 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
int cnt=0;
scanf("%d %d %d",&a,&b,&c);
if((a+b)>=c){
cnt = b+c;
}else{
cnt = a+b+b+1;
}
printf("%d\n",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226054/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226054/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp.not = icmp slt i32 %add, %2
%add1 = add nsw i32 %2, %1
%add3 = add i32 %1, 1
%add4 = add i32 %add3, %add
%cnt.0 = select i1 %cmp.not, i32 %add4, i32 %add1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#define N 32
const int k_operafan[ ]
= { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 3, 6, 10, 19, 34,
62, 113, 207, 381, 701, 1288, 2369, 4357, 8014, 14740 };
/** Application main entry point. */
int main (
int argc,
char * argv[ ]
)
{
for ( ; ; )
{
int n;
scanf ( "%d", &n );
if ( !( n ) ) break ;
printf ( "%d\n", k_operafan[ n ] );
}
return ( 0 );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226126/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226126/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@k_operafan = dso_local local_unnamed_addr constant [31 x i32] [i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 2, i32 3, i32 6, i32 10, i32 19, i32 34, i32 62, i32 113, i32 207, i32 381, i32 701, i32 1288, i32 2369, i32 4357, i32 8014, i32 14740], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not5 = icmp eq i32 %0, 0
br i1 %tobool.not5, label %for.end, label %cleanup
cleanup: ; preds = %entry, %cleanup
%1 = phi i32 [ %3, %cleanup ], [ %0, %entry ]
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [31 x i32], ptr @k_operafan, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
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)
%3 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %for.end, label %cleanup
for.end: ; 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: 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 N,C,p[100]={},j,i,goukei=0;
scanf("%d %d",&N,&C);
for(i=0;i<C;i++){
scanf("%d",&p[i]);
goukei+=p[i];
}
j=goukei/(N+1);
if(goukei%(N+1)!=0)printf("%d\n",j+1);
else printf("%d\n",j);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226191/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226191/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%C = alloca i32, align 4
%p = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %p, i8 0, i64 400, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %C)
%0 = load i32, ptr %C, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%goukei.018 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %p, 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, %goukei.018
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%goukei.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %N, align 4, !tbaa !5
%add4 = add nsw i32 %4, 1
%div = sdiv i32 %goukei.0.lcssa, %add4
%rem = srem i32 %goukei.0.lcssa, %add4
%cmp6.not = icmp ne i32 %rem, 0
%add7 = zext i1 %cmp6.not to i32
%div.sink = add nsw i32 %div, %add7
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.sink)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n,h,w;
scanf("%d",&n);
scanf("%d",&h);
scanf("%d",&w);
printf("%d",(n-h+1)*(n-w+1));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %h, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%2 = load i32, ptr %w, align 4, !tbaa !5
%add4 = sub i32 %sub, %2
%mul = mul nsw i32 %add4, %add
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
int t,n,i;
long long int a[31];
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
a[1]=2;
for(i=2;i<=n;i++)
a[i]=2*a[i-1];
long long int b=0,s=0,m;
if(n==2)
{
printf("%lld\n",a[2]-a[1]);
}
else
{
for(i=1;i<n/2;i++)
{
b=b+a[i];
}
b=b+a[n];
for(i=n/2;i<n;i++)
s=s+a[i];
if(s>b)
m=s-b;
else
m=b-s;
printf("%lld\n",m);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2263/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2263/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%t = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [31 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 248, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec65 = add nsw i32 %0, -1
store i32 %dec65, ptr %t, align 4, !tbaa !5
%tobool.not66 = icmp eq i32 %0, 0
br i1 %tobool.not66, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end37
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
store i64 2, ptr %arrayidx, align 8, !tbaa !9
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not54 = icmp slt i32 %1, 2
br i1 %cmp.not54, label %for.cond10.preheader.thread, label %for.body.preheader
for.cond10.preheader.thread: ; preds = %while.body
%div80 = sdiv i32 %1, 2
br label %for.end17
for.body.preheader: ; preds = %while.body
%2 = add nuw i32 %1, 1
%wide.trip.count = zext i32 %2 to i64
%3 = add nsw i64 %wide.trip.count, -2
%4 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %3, 3
%5 = icmp ult i64 %4, 3
br i1 %5, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %3, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%6 = phi i64 [ 2, %for.body.preheader.new ], [ %mul.3, %for.body ]
%indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = shl nsw i64 %6, 1
%arrayidx4 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv
store i64 %mul, ptr %arrayidx4, align 16, !tbaa !9
%indvars.iv.next = or i64 %indvars.iv, 1
%mul.1 = shl nsw i64 %6, 2
%arrayidx4.1 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv.next
store i64 %mul.1, ptr %arrayidx4.1, align 8, !tbaa !9
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = shl nsw i64 %6, 3
%arrayidx4.2 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv.next.1
store i64 %mul.2, ptr %arrayidx4.2, align 16, !tbaa !9
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = shl nsw i64 %6, 4
%arrayidx4.3 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv.next.2
store i64 %mul.3, ptr %arrayidx4.3, align 8, !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.end.unr-lcssa, label %for.body, !llvm.loop !11
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i64 [ 2, %for.body.preheader ], [ %mul.3, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.unr-lcssa, %for.body.epil
%7 = phi i64 [ %mul.epil, %for.body.epil ], [ %.unr, %for.end.unr-lcssa ]
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ]
%mul.epil = shl nsw i64 %7, 1
%arrayidx4.epil = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv.epil
store i64 %mul.epil, ptr %arrayidx4.epil, align 8, !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.end, label %for.body.epil, !llvm.loop !13
for.end: ; preds = %for.body.epil, %for.end.unr-lcssa
%cmp5 = icmp eq i32 %1, 2
br i1 %cmp5, label %if.then, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.end
%div = sdiv i32 %1, 2
%cmp1156 = icmp sgt i32 %1, 3
br i1 %cmp1156, label %for.body12.preheader, label %for.end17
for.body12.preheader: ; preds = %for.cond10.preheader
%smax = call i32 @llvm.smax.i32(i32 %div, i32 2)
%wide.trip.count72 = zext i32 %smax to i64
%8 = add nsw i64 %wide.trip.count72, -1
%min.iters.check87 = icmp ult i32 %smax, 5
br i1 %min.iters.check87, label %for.body12.preheader105, label %vector.ph88
vector.ph88: ; preds = %for.body12.preheader
%n.vec90 = and i64 %8, -4
%ind.end91 = or i64 %n.vec90, 1
br label %vector.body94
vector.body94: ; preds = %vector.body94, %vector.ph88
%index95 = phi i64 [ 0, %vector.ph88 ], [ %index.next101, %vector.body94 ]
%vec.phi96 = phi <2 x i64> [ zeroinitializer, %vector.ph88 ], [ %11, %vector.body94 ]
%vec.phi97 = phi <2 x i64> [ zeroinitializer, %vector.ph88 ], [ %12, %vector.body94 ]
%offset.idx98 = or i64 %index95, 1
%9 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %offset.idx98
%wide.load99 = load <2 x i64>, ptr %9, align 8, !tbaa !9
%10 = getelementptr inbounds i64, ptr %9, i64 2
%wide.load100 = load <2 x i64>, ptr %10, align 8, !tbaa !9
%11 = add <2 x i64> %wide.load99, %vec.phi96
%12 = add <2 x i64> %wide.load100, %vec.phi97
%index.next101 = add nuw i64 %index95, 4
%13 = icmp eq i64 %index.next101, %n.vec90
br i1 %13, label %middle.block85, label %vector.body94, !llvm.loop !15
middle.block85: ; preds = %vector.body94
%bin.rdx102 = add <2 x i64> %12, %11
%14 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx102)
%cmp.n93 = icmp eq i64 %8, %n.vec90
br i1 %cmp.n93, label %for.end17, label %for.body12.preheader105
for.body12.preheader105: ; preds = %for.body12.preheader, %middle.block85
%indvars.iv69.ph = phi i64 [ 1, %for.body12.preheader ], [ %ind.end91, %middle.block85 ]
%b.058.ph = phi i64 [ 0, %for.body12.preheader ], [ %14, %middle.block85 ]
br label %for.body12
if.then: ; preds = %for.end
%15 = load i64, ptr %arrayidx6, align 16, !tbaa !9
%16 = load i64, ptr %arrayidx, align 8, !tbaa !9
%sub8 = sub nsw i64 %15, %16
br label %if.end37
for.body12: ; preds = %for.body12.preheader105, %for.body12
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %for.body12 ], [ %indvars.iv69.ph, %for.body12.preheader105 ]
%b.058 = phi i64 [ %add, %for.body12 ], [ %b.058.ph, %for.body12.preheader105 ]
%arrayidx14 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv69
%17 = load i64, ptr %arrayidx14, align 8, !tbaa !9
%add = add nsw i64 %17, %b.058
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
br i1 %exitcond73.not, label %for.end17, label %for.body12, !llvm.loop !18
for.end17: ; preds = %for.body12, %middle.block85, %for.cond10.preheader.thread, %for.cond10.preheader
%div82 = phi i32 [ %div, %for.cond10.preheader ], [ %div80, %for.cond10.preheader.thread ], [ %div, %middle.block85 ], [ %div, %for.body12 ]
%b.0.lcssa = phi i64 [ 0, %for.cond10.preheader ], [ 0, %for.cond10.preheader.thread ], [ %14, %middle.block85 ], [ %add, %for.body12 ]
%idxprom18 = sext i32 %1 to i64
%arrayidx19 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %idxprom18
%18 = load i64, ptr %arrayidx19, align 8, !tbaa !9
%cmp2361 = icmp slt i32 %div82, %1
br i1 %cmp2361, label %for.body24.preheader, label %for.end30
for.body24.preheader: ; preds = %for.end17
%19 = sext i32 %div82 to i64
%20 = sub nsw i64 %idxprom18, %19
%min.iters.check = icmp ult i64 %20, 4
br i1 %min.iters.check, label %for.body24.preheader104, label %vector.ph
vector.ph: ; preds = %for.body24.preheader
%n.vec = and i64 %20, -4
%ind.end = add nsw i64 %n.vec, %19
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
%vec.phi83 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%offset.idx = add i64 %index, %19
%21 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %21, align 8, !tbaa !9
%22 = getelementptr inbounds i64, ptr %21, i64 2
%wide.load84 = load <2 x i64>, ptr %22, align 8, !tbaa !9
%23 = add <2 x i64> %wide.load, %vec.phi
%24 = add <2 x i64> %wide.load84, %vec.phi83
%index.next = add nuw i64 %index, 4
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %24, %23
%26 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %20, %n.vec
br i1 %cmp.n, label %for.end30, label %for.body24.preheader104
for.body24.preheader104: ; preds = %for.body24.preheader, %middle.block
%indvars.iv74.ph = phi i64 [ %19, %for.body24.preheader ], [ %ind.end, %middle.block ]
%s.063.ph = phi i64 [ 0, %for.body24.preheader ], [ %26, %middle.block ]
br label %for.body24
for.body24: ; preds = %for.body24.preheader104, %for.body24
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body24 ], [ %indvars.iv74.ph, %for.body24.preheader104 ]
%s.063 = phi i64 [ %add27, %for.body24 ], [ %s.063.ph, %for.body24.preheader104 ]
%arrayidx26 = getelementptr inbounds [31 x i64], ptr %a, i64 0, i64 %indvars.iv74
%27 = load i64, ptr %arrayidx26, align 8, !tbaa !9
%add27 = add nsw i64 %27, %s.063
%indvars.iv.next75 = add nsw i64 %indvars.iv74, 1
%exitcond78.not = icmp eq i64 %indvars.iv.next75, %idxprom18
br i1 %exitcond78.not, label %for.end30, label %for.body24, !llvm.loop !20
for.end30: ; preds = %for.body24, %middle.block, %for.end17
%s.0.lcssa = phi i64 [ 0, %for.end17 ], [ %26, %middle.block ], [ %add27, %for.body24 ]
%28 = add i64 %18, %b.0.lcssa
%sub33 = sub i64 %s.0.lcssa, %28
%m.0 = call i64 @llvm.abs.i64(i64 %sub33, i1 true)
br label %if.end37
if.end37: ; preds = %for.end30, %if.then
%m.0.sink = phi i64 [ %m.0, %for.end30 ], [ %sub8, %if.then ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %m.0.sink)
%29 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %29, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %29, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21
while.end: ; preds = %if.end37, %entry
call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12, !17, !16}
!19 = distinct !{!19, !12, !16, !17}
!20 = distinct !{!20, !12, !17, !16}
!21 = distinct !{!21, !12}
|
#include<stdio.h>
int main(void)
{
int p[30];
int n;
int count=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&p[i]);
}
for(int i=0;i<n-2;i++){
if((p[i]<p[i+1]&&p[i+1]<p[i+2])||(p[i+2]<p[i+1]&&p[i+1]<p[i])){
count++;
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226357/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226357/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%p = alloca [30 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 120, 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
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp453 = icmp sgt i32 %23, 2
br i1 %cmp453, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%sub = add i32 %23, -2
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %p, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %sub, 8
br i1 %min.iters.check, label %for.body6.preheader83, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load70, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %vector.body ]
%vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi73, %vector.body ]
%1 = or i64 %index, 1
%2 = getelementptr inbounds [30 x i32], ptr %p, i64 0, i64 %1
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load70 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load70, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = icmp sge <4 x i32> %4, %wide.load
%7 = icmp sge <4 x i32> %5, %wide.load70
%8 = or i64 %index, 2
%9 = getelementptr inbounds [30 x i32], ptr %p, i64 0, i64 %8
%wide.load71 = load <4 x i32>, ptr %9, align 8, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load72 = load <4 x i32>, ptr %10, align 8, !tbaa !5
%11 = icmp sge <4 x i32> %wide.load, %wide.load71
%12 = icmp sge <4 x i32> %wide.load70, %wide.load72
%.not75 = select <4 x i1> %6, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %11
%.not77 = select <4 x i1> %7, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %12
%13 = icmp sge <4 x i32> %wide.load71, %wide.load
%14 = icmp sge <4 x i32> %wide.load72, %wide.load70
%15 = icmp sge <4 x i32> %wide.load, %4
%16 = icmp sge <4 x i32> %wide.load70, %5
%.not79 = or <4 x i1> %15, %13
%.not81 = or <4 x i1> %16, %14
%17 = select <4 x i1> %.not75, <4 x i1> %.not79, <4 x i1> zeroinitializer
%18 = select <4 x i1> %.not77, <4 x i1> %.not81, <4 x i1> zeroinitializer
%not. = xor <4 x i1> %17, <i1 true, i1 true, i1 true, i1 true>
%19 = zext <4 x i1> %not. to <4 x i32>
%predphi = add <4 x i32> %vec.phi, %19
%not.82 = xor <4 x i1> %18, <i1 true, i1 true, i1 true, i1 true>
%20 = zext <4 x i1> %not.82 to <4 x i32>
%predphi73 = add <4 x i32> %vec.phi69, %20
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %predphi73, %predphi
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load70, i64 3
br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader83
for.body6.preheader83: ; preds = %for.body6.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body6.preheader ]
%indvars.iv59.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body6.preheader ]
%count.054.ph = phi i32 [ %22, %middle.block ], [ 0, %for.body6.preheader ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [30 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp = icmp slt i64 %indvars.iv.next, %24
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.cond.cleanup5: ; preds = %for.inc34, %middle.block, %entry, %for.cond3.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %22, %middle.block ], [ %count.1, %for.inc34 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %p) #4
ret i32 0
for.body6: ; preds = %for.body6.preheader83, %for.inc34
%scalar.recur = phi i32 [ %25, %for.inc34 ], [ %scalar.recur.ph, %for.body6.preheader83 ]
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.inc34 ], [ %indvars.iv59.ph, %for.body6.preheader83 ]
%count.054 = phi i32 [ %count.1, %for.inc34 ], [ %count.054.ph, %for.body6.preheader83 ]
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%arrayidx10 = getelementptr inbounds [30 x i32], ptr %p, i64 0, i64 %indvars.iv.next60
%25 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp slt i32 %scalar.recur, %25
%26 = add nuw nsw i64 %indvars.iv59, 2
%arrayidx17 = getelementptr inbounds [30 x i32], ptr %p, i64 0, i64 %26
%27 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp slt i32 %25, %27
%or.cond68 = select i1 %cmp11, i1 %cmp18, i1 false
br i1 %or.cond68, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body6
%cmp25 = icmp slt i32 %27, %25
%cmp32 = icmp slt i32 %25, %scalar.recur
%or.cond = and i1 %cmp32, %cmp25
br i1 %or.cond, label %if.then, label %for.inc34
if.then: ; preds = %for.body6, %lor.lhs.false
%inc33 = add nsw i32 %count.054, 1
br label %for.inc34
for.inc34: ; preds = %lor.lhs.false, %if.then
%count.1 = phi i32 [ %inc33, %if.then ], [ %count.054, %lor.lhs.false ]
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int maxi(int *a,int n);
int mini(int *a,int n);
int main()
{
int t,i,a,b;
int c[100];
int w[100];
int n,m;
scanf("%d",&n);
scanf("%d",&m);
for(i=0;i<n;i++)
scanf("%d",&c[i]);
for(i=0;i<m;i++)
scanf("%d",&w[i]);
a=maxi(c,n);
b=mini(c,n);
while(a<(2*b))
a=a+1;
t=mini(w,m);
if(t<=a)
printf("%d\n",-1);
else
printf("%d\n",a);
return 0;
}
int maxi(int *a,int n)
{
int i;
int maxi=a[0];
for(i=0;i<n;i++)
{
if(maxi<=a[i])
maxi=a[i];
}
return maxi;
}
int mini(int *a,int n)
{
int i;
int mini=a[0];
for(i=0;i<n;i++)
{
if(mini>=a[i])
mini=a[i];
}
return mini;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22640/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22640/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%c = alloca [100 x i32], align 16
%w = alloca [100 x i32], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp52 = icmp sgt i32 %0, 0
br i1 %cmp52, label %for.body, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp454 = icmp sgt i32 %2, 0
br i1 %cmp454, label %for.body5, label %for.end11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %indvars.iv58
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%5 = load i32, ptr %m, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4 = icmp slt i64 %indvars.iv.next59, %6
br i1 %cmp4, label %for.body5, label %for.end11.loopexit, !llvm.loop !11
for.end11.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end11
for.end11: ; preds = %for.end11.loopexit, %for.cond3.preheader
%7 = phi i32 [ %1, %for.cond3.preheader ], [ %.pre, %for.end11.loopexit ]
%.lcssa = phi i32 [ %2, %for.cond3.preheader ], [ %5, %for.end11.loopexit ]
%8 = load i32, ptr %c, align 16, !tbaa !5
%cmp11.i = icmp sgt i32 %7, 0
br i1 %cmp11.i, label %for.body.preheader.i, label %mini.exit
for.body.preheader.i: ; preds = %for.end11
%wide.trip.count.i = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %8, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ]
%vec.phi65 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ]
%9 = getelementptr inbounds i32, ptr %c, i64 %index
%wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load66 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi65, <4 x i32> %wide.load66)
%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 !12
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %11, <4 x i32> %12)
%14 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.body.preheader.i30, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%maxi.013.i.ph = phi i32 [ %8, %for.body.preheader.i ], [ %14, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%maxi.013.i = phi i32 [ %spec.select.i, %for.body.i ], [ %maxi.013.i.ph, %for.body.i.preheader ]
%arrayidx1.i = getelementptr inbounds i32, ptr %c, i64 %indvars.iv.i
%15 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smax.i32(i32 %maxi.013.i, i32 %15)
%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 %for.body.preheader.i30, label %for.body.i, !llvm.loop !15
for.body.preheader.i30: ; preds = %for.body.i, %middle.block
%spec.select.i.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select.i, %for.body.i ]
%min.iters.check69 = icmp ult i32 %7, 8
br i1 %min.iters.check69, label %for.body.i32.preheader, label %vector.ph70
vector.ph70: ; preds = %for.body.preheader.i30
%n.vec72 = and i64 %wide.trip.count.i, 4294967288
%minmax.ident.splatinsert79 = insertelement <4 x i32> poison, i32 %8, i64 0
%minmax.ident.splat80 = shufflevector <4 x i32> %minmax.ident.splatinsert79, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body75
vector.body75: ; preds = %vector.body75, %vector.ph70
%index76 = phi i64 [ 0, %vector.ph70 ], [ %index.next83, %vector.body75 ]
%vec.phi77 = phi <4 x i32> [ %minmax.ident.splat80, %vector.ph70 ], [ %18, %vector.body75 ]
%vec.phi78 = phi <4 x i32> [ %minmax.ident.splat80, %vector.ph70 ], [ %19, %vector.body75 ]
%16 = getelementptr inbounds i32, ptr %c, i64 %index76
%wide.load81 = load <4 x i32>, ptr %16, align 16, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
%wide.load82 = load <4 x i32>, ptr %17, align 16, !tbaa !5
%18 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi77, <4 x i32> %wide.load81)
%19 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi78, <4 x i32> %wide.load82)
%index.next83 = add nuw i64 %index76, 8
%20 = icmp eq i64 %index.next83, %n.vec72
br i1 %20, label %middle.block67, label %vector.body75, !llvm.loop !16
middle.block67: ; preds = %vector.body75
%rdx.minmax84 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %18, <4 x i32> %19)
%21 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax84)
%cmp.n74 = icmp eq i64 %n.vec72, %wide.trip.count.i
br i1 %cmp.n74, label %mini.exit, label %for.body.i32.preheader
for.body.i32.preheader: ; preds = %for.body.preheader.i30, %middle.block67
%indvars.iv.i33.ph = phi i64 [ 0, %for.body.preheader.i30 ], [ %n.vec72, %middle.block67 ]
%mini.013.i.ph = phi i32 [ %8, %for.body.preheader.i30 ], [ %21, %middle.block67 ]
br label %for.body.i32
for.body.i32: ; preds = %for.body.i32.preheader, %for.body.i32
%indvars.iv.i33 = phi i64 [ %indvars.iv.next.i36, %for.body.i32 ], [ %indvars.iv.i33.ph, %for.body.i32.preheader ]
%mini.013.i = phi i32 [ %spec.select.i35, %for.body.i32 ], [ %mini.013.i.ph, %for.body.i32.preheader ]
%arrayidx1.i34 = getelementptr inbounds i32, ptr %c, i64 %indvars.iv.i33
%22 = load i32, ptr %arrayidx1.i34, align 4, !tbaa !5
%spec.select.i35 = call i32 @llvm.smin.i32(i32 %mini.013.i, i32 %22)
%indvars.iv.next.i36 = add nuw nsw i64 %indvars.iv.i33, 1
%exitcond.not.i37 = icmp eq i64 %indvars.iv.next.i36, %wide.trip.count.i
br i1 %exitcond.not.i37, label %mini.exit, label %for.body.i32, !llvm.loop !17
mini.exit: ; preds = %for.body.i32, %middle.block67, %for.end11
%maxi.0.lcssa.i51 = phi i32 [ %8, %for.end11 ], [ %spec.select.i.lcssa, %middle.block67 ], [ %spec.select.i.lcssa, %for.body.i32 ]
%mini.0.lcssa.i = phi i32 [ %8, %for.end11 ], [ %21, %middle.block67 ], [ %spec.select.i35, %for.body.i32 ]
%23 = load i32, ptr %w, align 16, !tbaa !5
%cmp11.i38 = icmp sgt i32 %.lcssa, 0
br i1 %cmp11.i38, label %for.body.preheader.i40, label %mini.exit49
for.body.preheader.i40: ; preds = %mini.exit
%wide.trip.count.i41 = zext i32 %.lcssa to i64
%min.iters.check88 = icmp ult i32 %.lcssa, 8
br i1 %min.iters.check88, label %for.body.i42.preheader, label %vector.ph89
vector.ph89: ; preds = %for.body.preheader.i40
%n.vec91 = and i64 %wide.trip.count.i41, 4294967288
%minmax.ident.splatinsert98 = insertelement <4 x i32> poison, i32 %23, i64 0
%minmax.ident.splat99 = shufflevector <4 x i32> %minmax.ident.splatinsert98, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body94
vector.body94: ; preds = %vector.body94, %vector.ph89
%index95 = phi i64 [ 0, %vector.ph89 ], [ %index.next102, %vector.body94 ]
%vec.phi96 = phi <4 x i32> [ %minmax.ident.splat99, %vector.ph89 ], [ %26, %vector.body94 ]
%vec.phi97 = phi <4 x i32> [ %minmax.ident.splat99, %vector.ph89 ], [ %27, %vector.body94 ]
%24 = getelementptr inbounds i32, ptr %w, i64 %index95
%wide.load100 = load <4 x i32>, ptr %24, align 16, !tbaa !5
%25 = getelementptr inbounds i32, ptr %24, i64 4
%wide.load101 = load <4 x i32>, ptr %25, align 16, !tbaa !5
%26 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi96, <4 x i32> %wide.load100)
%27 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi97, <4 x i32> %wide.load101)
%index.next102 = add nuw i64 %index95, 8
%28 = icmp eq i64 %index.next102, %n.vec91
br i1 %28, label %middle.block86, label %vector.body94, !llvm.loop !18
middle.block86: ; preds = %vector.body94
%rdx.minmax103 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %26, <4 x i32> %27)
%29 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax103)
%cmp.n93 = icmp eq i64 %n.vec91, %wide.trip.count.i41
br i1 %cmp.n93, label %mini.exit49, label %for.body.i42.preheader
for.body.i42.preheader: ; preds = %for.body.preheader.i40, %middle.block86
%indvars.iv.i43.ph = phi i64 [ 0, %for.body.preheader.i40 ], [ %n.vec91, %middle.block86 ]
%mini.013.i44.ph = phi i32 [ %23, %for.body.preheader.i40 ], [ %29, %middle.block86 ]
br label %for.body.i42
for.body.i42: ; preds = %for.body.i42.preheader, %for.body.i42
%indvars.iv.i43 = phi i64 [ %indvars.iv.next.i47, %for.body.i42 ], [ %indvars.iv.i43.ph, %for.body.i42.preheader ]
%mini.013.i44 = phi i32 [ %spec.select.i46, %for.body.i42 ], [ %mini.013.i44.ph, %for.body.i42.preheader ]
%arrayidx1.i45 = getelementptr inbounds i32, ptr %w, i64 %indvars.iv.i43
%30 = load i32, ptr %arrayidx1.i45, align 4, !tbaa !5
%spec.select.i46 = call i32 @llvm.smin.i32(i32 %mini.013.i44, i32 %30)
%indvars.iv.next.i47 = add nuw nsw i64 %indvars.iv.i43, 1
%exitcond.not.i48 = icmp eq i64 %indvars.iv.next.i47, %wide.trip.count.i41
br i1 %exitcond.not.i48, label %mini.exit49, label %for.body.i42, !llvm.loop !19
mini.exit49: ; preds = %for.body.i42, %middle.block86, %mini.exit
%mini.0.lcssa.i39 = phi i32 [ %23, %mini.exit ], [ %29, %middle.block86 ], [ %spec.select.i46, %for.body.i42 ]
%mul = shl nsw i32 %mini.0.lcssa.i, 1
%smax = call i32 @llvm.smax.i32(i32 %maxi.0.lcssa.i51, i32 %mul)
%cmp18.not = icmp sgt i32 %mini.0.lcssa.i39, %smax
%smax. = select i1 %cmp18.not, i32 %smax, i32 -1
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %smax.)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %c) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @maxi(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %n, 0
br i1 %cmp11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader17, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi15 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load16 = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi15, <4 x i32> %wide.load16)
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %3, <4 x i32> %4)
%6 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader17
for.body.preheader17: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%maxi.013.ph = phi i32 [ %0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader17, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader17 ]
%maxi.013 = phi i32 [ %spec.select, %for.body ], [ %maxi.013.ph, %for.body.preheader17 ]
%arrayidx1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%7 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%spec.select = tail call i32 @llvm.smax.i32(i32 %maxi.013, i32 %7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21
for.end: ; preds = %for.body, %middle.block, %entry
%maxi.0.lcssa = phi i32 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i32 %maxi.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @mini(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %n, 0
br i1 %cmp11, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader17, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi15 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load16 = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi15, <4 x i32> %wide.load16)
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %3, <4 x i32> %4)
%6 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader17
for.body.preheader17: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%mini.013.ph = phi i32 [ %0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader17, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader17 ]
%mini.013 = phi i32 [ %spec.select, %for.body ], [ %mini.013.ph, %for.body.preheader17 ]
%arrayidx1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%7 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%spec.select = tail call i32 @llvm.smin.i32(i32 %mini.013, i32 %7)
%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 !23
for.end: ; preds = %for.body, %middle.block, %entry
%mini.0.lcssa = phi i32 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i32 %mini.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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10, !13, !14}
!17 = distinct !{!17, !10, !14, !13}
!18 = distinct !{!18, !10, !13, !14}
!19 = distinct !{!19, !10, !14, !13}
!20 = distinct !{!20, !10, !13, !14}
!21 = distinct !{!21, !10, !14, !13}
!22 = distinct !{!22, !10, !13, !14}
!23 = distinct !{!23, !10, !14, !13}
|
#include<stdio.h>
int main(void)
{
int i,n,p[21];
int cnt=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&p[i]);
}
for(i=2;i<n;i++)
{
if(p[i-1]<p[i] && p[i]<p[i+1])
{
cnt++;
}
if(p[i+1]<p[i] && p[i]<p[i-1])
{
cnt++;
}
}
printf("%d",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226443/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226443/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%p = alloca [21 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not52 = icmp slt i32 %0, 1
br i1 %cmp.not52, label %for.end34, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp354 = icmp sgt i32 %35, 2
br i1 %cmp354, label %for.body4.preheader, label %for.end34
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %35 to i64
%arrayidx6.phi.trans.insert = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 1
%1 = load <2 x i32>, ptr %arrayidx6.phi.trans.insert, align 4, !tbaa !5
%2 = add nsw i64 %wide.trip.count, -2
%min.iters.check = icmp ult i64 %2, 8
br i1 %min.iters.check, label %for.body4.preheader78, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 2
%3 = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 1>
%4 = shufflevector <2 x i32> %1, <2 x i32> poison, <4 x i32> <i32 poison, i32 poison, i32 poison, i32 0>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %3, %vector.ph ], [ %wide.load74, %vector.body ]
%vector.recur72 = phi <4 x i32> [ %4, %vector.ph ], [ %9, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %30, %vector.body ]
%vec.phi73 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
%5 = or i64 %index, 3
%6 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %5
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load74 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load74, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = shufflevector <4 x i32> %vector.recur72, <4 x i32> %8, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = shufflevector <4 x i32> %8, <4 x i32> %9, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%12 = icmp slt <4 x i32> %10, %8
%13 = icmp slt <4 x i32> %11, %9
%14 = icmp slt <4 x i32> %8, %wide.load
%15 = icmp slt <4 x i32> %9, %wide.load74
%16 = select <4 x i1> %12, <4 x i1> %14, <4 x i1> zeroinitializer
%17 = select <4 x i1> %13, <4 x i1> %15, <4 x i1> zeroinitializer
%18 = zext <4 x i1> %16 to <4 x i32>
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = add <4 x i32> %vec.phi, %18
%21 = add <4 x i32> %vec.phi73, %19
%22 = icmp slt <4 x i32> %wide.load, %8
%23 = icmp slt <4 x i32> %wide.load74, %9
%24 = icmp slt <4 x i32> %8, %10
%25 = icmp slt <4 x i32> %9, %11
%26 = and <4 x i1> %24, %22
%27 = and <4 x i1> %25, %23
%28 = zext <4 x i1> %26 to <4 x i32>
%29 = zext <4 x i1> %27 to <4 x i32>
%30 = add <4 x i32> %20, %28
%31 = add <4 x i32> %21, %29
%index.next = add nuw i64 %index, 8
%32 = icmp eq i64 %index.next, %n.vec
br i1 %32, label %middle.block, label %vector.body, !llvm.loop !9
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)
%cmp.n = icmp eq i64 %2, %n.vec
%34 = shufflevector <4 x i32> %wide.load74, <4 x i32> poison, <2 x i32> <i32 2, i32 3>
br i1 %cmp.n, label %for.end34, label %for.body4.preheader78
for.body4.preheader78: ; preds = %for.body4.preheader, %middle.block
%indvars.iv60.ph = phi i64 [ %ind.end, %middle.block ], [ 2, %for.body4.preheader ]
%cnt.056.ph = phi i32 [ %33, %middle.block ], [ 0, %for.body4.preheader ]
%.ph = phi <2 x i32> [ %34, %middle.block ], [ %1, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%35 = load i32, ptr %n, align 4, !tbaa !5
%36 = sext i32 %35 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %36
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader78, %for.body4
%indvars.iv60 = phi i64 [ %40, %for.body4 ], [ %indvars.iv60.ph, %for.body4.preheader78 ]
%cnt.056 = phi i32 [ %cnt.2, %for.body4 ], [ %cnt.056.ph, %for.body4.preheader78 ]
%37 = phi <2 x i32> [ %43, %for.body4 ], [ %.ph, %for.body4.preheader78 ]
%38 = extractelement <2 x i32> %37, i64 0
%39 = extractelement <2 x i32> %37, i64 1
%cmp9 = icmp slt i32 %38, %39
%40 = add nuw nsw i64 %indvars.iv60, 1
%arrayidx13 = getelementptr inbounds [21 x i32], ptr %p, i64 0, i64 %40
%41 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp slt i32 %39, %41
%narrow70 = select i1 %cmp9, i1 %cmp14, i1 false
%spec.select = zext i1 %narrow70 to i32
%cnt.1 = add nsw i32 %cnt.056, %spec.select
%cmp21 = icmp slt i32 %41, %39
%cmp28 = icmp slt i32 %39, %38
%narrow = and i1 %cmp28, %cmp21
%spec.select51 = zext i1 %narrow to i32
%cnt.2 = add nsw i32 %cnt.1, %spec.select51
%exitcond.not = icmp eq i64 %40, %wide.trip.count
%42 = shufflevector <2 x i32> %37, <2 x i32> poison, <2 x i32> <i32 1, i32 poison>
%43 = insertelement <2 x i32> %42, i32 %41, i64 1
br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !14
for.end34: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %33, %middle.block ], [ %cnt.2, %for.body4 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
#define LENGTH 20
int main(){
int p[LENGTH];
int n;
int result;
int i;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%d",&p[i]);
}
for(i=0; i<n-2; i++){
if((p[i+1] < p[i] && p[i+1]> p[i+2]) ||(p[i+1] > p[i] && p[i+1]<p[i+2]))
result ++;
}
printf("%d", result);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%p = alloca [20 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 80, 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
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.cond2.preheader
for.cond2.preheader.loopexit: ; preds = %for.body
%.pre.pre = load i32, ptr %p, align 16, !tbaa !5
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.cond2.preheader.loopexit, %entry
%.pre = phi i32 [ undef, %entry ], [ %.pre.pre, %for.cond2.preheader.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.cond2.preheader.loopexit ]
%sub = add nsw i32 %.lcssa, -2
%cmp352 = icmp sgt i32 %.lcssa, 2
call void @llvm.assume(i1 %cmp352)
%wide.trip.count = zext i32 %sub to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader.loopexit, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc32
%3 = phi i32 [ %.pre, %for.cond2.preheader ], [ %4, %for.inc32 ]
%indvars.iv58 = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next59, %for.inc32 ]
%result.053 = phi i32 [ undef, %for.cond2.preheader ], [ %result.1, %for.inc32 ]
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%arrayidx6 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv.next59
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp9 = icmp slt i32 %4, %3
br i1 %cmp9, label %land.lhs.true, label %lor.lhs.false
land.lhs.true: ; preds = %for.body4
%5 = add nuw nsw i64 %indvars.iv58, 2
%arrayidx15 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %5
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %4, %6
br i1 %cmp16, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %land.lhs.true, %for.body4
%cmp22 = icmp sgt i32 %4, %3
br i1 %cmp22, label %land.lhs.true23, label %for.inc32
land.lhs.true23: ; preds = %lor.lhs.false
%7 = add nuw nsw i64 %indvars.iv58, 2
%arrayidx29 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %7
%8 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp slt i32 %4, %8
br i1 %cmp30, label %if.then, label %for.inc32
if.then: ; preds = %land.lhs.true23, %land.lhs.true
%inc31 = add nsw i32 %result.053, 1
br label %for.inc32
for.inc32: ; preds = %lor.lhs.false, %land.lhs.true23, %if.then
%result.1 = phi i32 [ %inc31, %if.then ], [ %result.053, %land.lhs.true23 ], [ %result.053, %lor.lhs.false ]
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !11
for.end34: ; preds = %for.inc32
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %result.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int n,i,t;
int p[20];
int count=0;
scanf("%d\n",&n);
for(i=0;i<n;i++){
scanf("%d ",&p[i]);
}
for(i=0;i<=(n-3);i++){
if(p[i]<p[i+1]&&p[i+1]<p[i+2]){
count++;
}
else if(p[i]>p[i+1]&&p[i+1]>p[i+2]){
count++;
}
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%p = alloca [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %p) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.end37
for.cond2.preheader: ; preds = %for.body
%cmp3.not56 = icmp slt i32 %2, 3
br i1 %cmp3.not56, label %for.end37, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%1 = add nsw i32 %2, -2
%wide.trip.count = zext i32 %1 to i64
%.pre = load i32, ptr %p, align 16, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %for.inc35
%4 = phi i32 [ %.pre, %for.body4.preheader ], [ %5, %for.inc35 ]
%indvars.iv62 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next63, %for.inc35 ]
%count.058 = phi i32 [ 0, %for.body4.preheader ], [ %count.1, %for.inc35 ]
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%arrayidx8 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv.next63
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %4, %5
br i1 %cmp9, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %for.body4
%6 = add nuw nsw i64 %indvars.iv62, 2
%arrayidx15 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %6
%7 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp slt i32 %5, %7
br i1 %cmp16, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true
%inc17 = add nsw i32 %count.058, 1
br label %for.inc35
if.else: ; preds = %land.lhs.true, %for.body4
%cmp23 = icmp sgt i32 %4, %5
br i1 %cmp23, label %land.lhs.true24, label %for.inc35
land.lhs.true24: ; preds = %if.else
%8 = add nuw nsw i64 %indvars.iv62, 2
%arrayidx30 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %8
%9 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %5, %9
%inc33 = zext i1 %cmp31 to i32
%spec.select = add nsw i32 %count.058, %inc33
br label %for.inc35
for.inc35: ; preds = %land.lhs.true24, %if.then, %if.else
%count.1 = phi i32 [ %inc17, %if.then ], [ %count.058, %if.else ], [ %spec.select, %land.lhs.true24 ]
%exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
br i1 %exitcond.not, label %for.end37, label %for.body4, !llvm.loop !11
for.end37: ; preds = %for.inc35, %entry, %for.cond2.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1, %for.inc35 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
int main(){
int n;
int p[n];
scanf("%d",&n);
int x=0;
for(int i=0;i<n;i++){
scanf("%d",&p[i]);
}
for (int i=1;i<n-1;i++){
if((p[i-1]<p[i]&&p[i]<p[i+1])||(p[i+1]<p[i]&&p[i]<p[i-1])){
x=x+1;
// printf("%d",i);
}
}
printf("%d\n",x);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%vla66 = alloca [0 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%0 = tail call ptr @llvm.stacksave.p0()
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %1, 0
br i1 %cmp49, label %for.body, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla66, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup5, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.body, %entry
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n;
scanf("%d",&n);
int p[n];
int cnt=0;
for(int i=0;i<n;i++){
scanf("%d",&p[i]);
}
for(int i=1;i<n-1;i++){
if(p[i+1]>p[i-1]){
if((p[i+1]>p[i])&&(p[i]>p[i-1])){
cnt++;
}
}else if(p[i+1]<p[i-1]){
if((p[i-1]>p[i])&&(p[i]>p[i+1])){
cnt++;
}
}
}
printf("%d",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp80 = icmp sgt i32 %3, 0
br i1 %cmp80, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp482 = icmp sgt i32 %4, 2
br i1 %cmp482, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%sub = add nsw i32 %4, -1
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %vla, i64 -1
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.inc53, %entry, %for.cond3.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %cnt.1, %for.inc53 ]
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, 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.body6: ; preds = %for.body6.preheader, %for.inc53
%indvars.iv88 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next89, %for.inc53 ]
%cnt.083 = phi i32 [ 0, %for.body6.preheader ], [ %cnt.1, %for.inc53 ]
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next89
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv88
%7 = load i32, ptr %gep, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %6, %7
br i1 %cmp12, label %if.then, label %if.else
if.then: ; preds = %for.body6
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88
%8 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %6, %8
%cmp24 = icmp sgt i32 %8, %7
%or.cond = and i1 %cmp18, %cmp24
%inc26 = zext i1 %or.cond to i32
%spec.select = add nsw i32 %cnt.083, %inc26
br label %for.inc53
if.else: ; preds = %for.body6
%cmp33 = icmp slt i32 %6, %7
br i1 %cmp33, label %if.then34, label %for.inc53
if.then34: ; preds = %if.else
%arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88
%9 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %7, %9
%cmp47 = icmp sgt i32 %9, %6
%or.cond78 = and i1 %cmp40, %cmp47
%inc49 = zext i1 %or.cond78 to i32
%spec.select79 = add nsw i32 %cnt.083, %inc49
br label %for.inc53
for.inc53: ; preds = %if.then34, %if.then, %if.else
%cnt.1 = phi i32 [ %cnt.083, %if.else ], [ %spec.select, %if.then ], [ %spec.select79, %if.then34 ]
%exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int n,i,j,count;
count = 0;
int box[256];
scanf("%d",&n);
for (i = 0; i < n; i++){
scanf("%d",&box[i]);
}
for (i = 0; i < n - 2; i++){
if (box[i] < box[i + 1] && box[i + 1] < box[i + 2] || box[i] > box[i + 1] && box[i + 1] > box[i + 2]){
count++;
}
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226667/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226667/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%box = alloca [256 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %box) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end34
for.cond2.preheader: ; preds = %for.body
%cmp352 = icmp sgt i32 %1, 2
br i1 %cmp352, label %for.body4.preheader, label %for.end34
for.body4.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %1, -2
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %box, align 16, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [256 x i32], ptr %box, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %for.inc32
%3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc32 ]
%indvars.iv58 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next59, %for.inc32 ]
%count.054 = phi i32 [ 0, %for.body4.preheader ], [ %count.1, %for.inc32 ]
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%arrayidx8 = getelementptr inbounds [256 x i32], ptr %box, i64 0, i64 %indvars.iv.next59
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp slt i32 %3, %4
br i1 %cmp9, label %land.lhs.true, label %lor.lhs.false
land.lhs.true: ; preds = %for.body4
%5 = add nuw nsw i64 %indvars.iv58, 2
%arrayidx15 = getelementptr inbounds [256 x i32], ptr %box, i64 0, i64 %5
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp slt i32 %4, %6
br i1 %cmp16, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %land.lhs.true, %for.body4
%cmp22 = icmp sgt i32 %3, %4
br i1 %cmp22, label %land.lhs.true23, label %for.inc32
land.lhs.true23: ; preds = %lor.lhs.false
%7 = add nuw nsw i64 %indvars.iv58, 2
%arrayidx29 = getelementptr inbounds [256 x i32], ptr %box, i64 0, i64 %7
%8 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %4, %8
br i1 %cmp30, label %if.then, label %for.inc32
if.then: ; preds = %land.lhs.true23, %land.lhs.true
%inc31 = add nsw i32 %count.054, 1
br label %for.inc32
for.inc32: ; preds = %lor.lhs.false, %land.lhs.true23, %if.then
%count.1 = phi i32 [ %inc31, %if.then ], [ %count.054, %land.lhs.true23 ], [ %count.054, %lor.lhs.false ]
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !11
for.end34: ; preds = %for.inc32, %entry, %for.cond2.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1, %for.inc32 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %box) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int n, t, k, d, num1, num2;
scanf("%d %d %d %d", &n, &t, &k, &d);
int time1 = 0;
int time2 = 0;
if(n%k){
num1 = n/k + 1;
}else{
num1 = n/k;
}
time1 = num1 * t;
int ok = 0;
while(n > 0){
if(time2 % t == 0 && ok){
n -= k;
}
if(time2 > d && ok){
if((time2-d) % t == 0 && ok){
n -= k;
}
}
ok = 1;
time2++;
}
//printf("%d %d", time1, time2);
if(time2-1 < time1){
printf("YES");
}else{
printf("NO");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22671/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22671/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
%k = alloca i32, align 4
%d = 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 %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %k, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %while.body.peel.next, label %while.end
while.body.peel.next: ; preds = %entry
%3 = load i32, ptr %d, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.peel.next, %if.end19
%time2.041 = phi i32 [ 1, %while.body.peel.next ], [ %inc, %if.end19 ]
%sub173640 = phi i32 [ %0, %while.body.peel.next ], [ %sub1737, %if.end19 ]
%rem2 = srem i32 %time2.041, %2
%cmp3 = icmp eq i32 %rem2, 0
br i1 %cmp3, label %if.then5, label %if.end6
if.then5: ; preds = %while.body
%sub = sub nsw i32 %sub173640, %1
store i32 %sub, ptr %n, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %while.body
%sub1738 = phi i32 [ %sub, %if.then5 ], [ %sub173640, %while.body ]
%cmp7 = icmp sgt i32 %time2.041, %3
br i1 %cmp7, label %if.then10, label %if.end19
if.then10: ; preds = %if.end6
%sub11 = sub nsw i32 %time2.041, %3
%rem12 = srem i32 %sub11, %2
%cmp13 = icmp eq i32 %rem12, 0
br i1 %cmp13, label %if.then16, label %if.end19
if.then16: ; preds = %if.then10
%sub17 = sub nsw i32 %sub1738, %1
store i32 %sub17, ptr %n, align 4, !tbaa !5
br label %if.end19
if.end19: ; preds = %if.then10, %if.then16, %if.end6
%sub1737 = phi i32 [ %sub1738, %if.then10 ], [ %sub17, %if.then16 ], [ %sub1738, %if.end6 ]
%inc = add nuw nsw i32 %time2.041, 1
%cmp = icmp sgt i32 %sub1737, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end19, %entry
%time2.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %if.end19 ]
%div1 = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%tobool.not = icmp ne i32 %rem, 0
%add = zext i1 %tobool.not to i32
%num1.0 = add nsw i32 %div1, %add
%mul = mul nsw i32 %2, %num1.0
%cmp21.not = icmp sgt i32 %time2.0.lcssa, %mul
%.str.2..str.1 = select i1 %cmp21.not, ptr @.str.2, ptr @.str.1
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
printf(a+b>c+d?"Left":(a+b<c+d?"Right":"Balanced"));
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp4 = icmp slt i32 %add, %add1
%cond = select i1 %cmp4, ptr @.str.2, ptr @.str.3
%cond5 = select i1 %cmp, ptr @.str.1, ptr %cond
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b, c, d, x, y;
scanf("%d %d %d %d", &a, &b, &c, &d);
x = a + b;
y = c + d;
if(x > y)
printf("Left\n");
else if(x < y)
printf("Right\n");
else
printf("Balanced\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp3 = icmp slt i32 %add, %add1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a,b,c,k,t,n,d;
scanf("%d %d %d %d",&n,&t,&k,&d);
a=n/k;
if(n%k!=0) {
a=a+1;
}
b=a*t;
c=t+d;
if(n<=k) {
printf("NO\n");
}
else if(b<=c) {
printf("NO\n");
}
else if(b>c) {
printf("YES\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22684/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22684/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%t = alloca i32, align 4
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %k, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %0, %1
br i1 %cmp2.not, label %if.else, label %if.end14
if.else: ; preds = %entry
%rem = srem i32 %0, %1
%cmp.not = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %1
%add = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %add
%2 = load i32, ptr %t, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%mul = mul nsw i32 %spec.select, %2
%cmp5.not = icmp sgt i32 %mul, %add1
%str.str.3 = select i1 %cmp5.not, ptr @str, ptr @str.4
br label %if.end14
if.end14: ; preds = %if.else, %entry
%str.3.sink = phi ptr [ @str.4, %entry ], [ %str.str.3, %if.else ]
%puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if (a+b==c+d)
printf("Balanced\n");
else if (a+b<c+d)
printf("Right\n");
else
printf("Left\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226890/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Left\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.5 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp eq i32 %add, %add1
%cmp5 = icmp slt i32 %add, %add1
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int A, B, C, D;
int L, R;
scanf("%d %d %d %d", &A, &B, &C, &D);
L = A+B;
R = C+D;
if(L>R)
printf("Left\n");
else if(L==R)
printf("Balanced\n");
else
printf("Right\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.4 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp3 = icmp eq i32 %add, %add1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(a+b > c+d)
{
printf("Left\n");
}
else if(a+b == c+d)
{
printf("Balanced\n");
}
else
{
printf("Right\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226977/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226977/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"Right\00", align 1
@str.4 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp sgt i32 %add, %add1
%cmp5 = icmp eq i32 %add, %add1
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int N, A, B, C, D, amount_X, amount_Y;
scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);
if(N%A!=0) amount_X=(N/A+1)*B;
else amount_X=(N/A)*B;
if(N%C!=0) amount_Y=(N/C+1)*D;
else amount_Y=(N/C)*D;
if(amount_X>amount_Y){
printf("%d\n", amount_Y);
}
else printf("%d\n", amount_X);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227019/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227019/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp.not = icmp eq i32 %rem, 0
%div1 = sdiv i32 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%add = add nsw i32 %div1, 1
%2 = load i32, ptr %B, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
br label %if.end
if.else: ; preds = %entry
%3 = load i32, ptr %B, align 4, !tbaa !5
%mul2 = mul nsw i32 %3, %div1
br label %if.end
if.end: ; preds = %if.else, %if.then
%amount_X.0 = phi i32 [ %mul, %if.then ], [ %mul2, %if.else ]
%4 = load i32, ptr %C, align 4, !tbaa !5
%rem3 = srem i32 %0, %4
%cmp4.not = icmp eq i32 %rem3, 0
%div10 = sdiv i32 %0, %4
br i1 %cmp4.not, label %if.else9, label %if.then5
if.then5: ; preds = %if.end
%add7 = add nsw i32 %div10, 1
%5 = load i32, ptr %D, align 4, !tbaa !5
%mul8 = mul nsw i32 %add7, %5
br label %if.end12
if.else9: ; preds = %if.end
%6 = load i32, ptr %D, align 4, !tbaa !5
%mul11 = mul nsw i32 %6, %div10
br label %if.end12
if.end12: ; preds = %if.else9, %if.then5
%amount_Y.0 = phi i32 [ %mul8, %if.then5 ], [ %mul11, %if.else9 ]
%amount_Y.0.amount_X.0 = call i32 @llvm.smin.i32(i32 %amount_X.0, i32 %amount_Y.0)
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %amount_Y.0.amount_X.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
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.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int n,a,b,c,d,e=0,f=0,i=0,j=0;
scanf("%d %d %d %d %d",&n,&a,&b,&c,&d);
while(e<n)
{
e+=a;
i++;
}
while(f<n)
{
f+=c;
j++;
}
b=b*i;
d=d*j;
if(b<d)
printf("%d\n",b);
else
printf("%d\n",d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %while.body.lr.ph, label %while.end6
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
%smax = call i32 @llvm.smax.i32(i32 %1, i32 %0)
%2 = add i32 %smax, -1
%3 = udiv i32 %2, %1
%4 = add i32 %3, 1
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %while.body.preheader, label %vector.ph
vector.ph: ; preds = %while.body.lr.ph
%n.vec = and i32 %4, -8
%ind.end = mul i32 %n.vec, %1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi25 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%5 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1>
%6 = add <4 x i32> %vec.phi25, <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i32 %index, 8
%7 = icmp eq i32 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %6, %5
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %4, %n.vec
br i1 %cmp.n, label %while.cond1.preheader, label %while.body.preheader
while.body.preheader: ; preds = %while.body.lr.ph, %middle.block
%i.017.ph = phi i32 [ 0, %while.body.lr.ph ], [ %8, %middle.block ]
%e.016.ph = phi i32 [ 0, %while.body.lr.ph ], [ %ind.end, %middle.block ]
br label %while.body
while.cond1.preheader: ; preds = %while.body, %middle.block
%inc.lcssa = phi i32 [ %8, %middle.block ], [ %inc, %while.body ]
br i1 %cmp15, label %while.body3.lr.ph, label %while.end6
while.body3.lr.ph: ; preds = %while.cond1.preheader
%9 = load i32, ptr %c, align 4, !tbaa !5
%smax26 = call i32 @llvm.smax.i32(i32 %9, i32 %0)
%10 = add i32 %smax26, -1
%11 = udiv i32 %10, %9
%12 = add i32 %11, 1
%min.iters.check29 = icmp ult i32 %12, 8
br i1 %min.iters.check29, label %while.body3.preheader, label %vector.ph30
vector.ph30: ; preds = %while.body3.lr.ph
%n.vec32 = and i32 %12, -8
%ind.end33 = mul i32 %n.vec32, %9
br label %vector.body36
vector.body36: ; preds = %vector.body36, %vector.ph30
%index37 = phi i32 [ 0, %vector.ph30 ], [ %index.next40, %vector.body36 ]
%vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph30 ], [ %13, %vector.body36 ]
%vec.phi39 = phi <4 x i32> [ zeroinitializer, %vector.ph30 ], [ %14, %vector.body36 ]
%13 = add <4 x i32> %vec.phi38, <i32 1, i32 1, i32 1, i32 1>
%14 = add <4 x i32> %vec.phi39, <i32 1, i32 1, i32 1, i32 1>
%index.next40 = add nuw i32 %index37, 8
%15 = icmp eq i32 %index.next40, %n.vec32
br i1 %15, label %middle.block27, label %vector.body36, !llvm.loop !13
middle.block27: ; preds = %vector.body36
%bin.rdx41 = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx41)
%cmp.n35 = icmp eq i32 %12, %n.vec32
br i1 %cmp.n35, label %while.end6, label %while.body3.preheader
while.body3.preheader: ; preds = %while.body3.lr.ph, %middle.block27
%j.021.ph = phi i32 [ 0, %while.body3.lr.ph ], [ %16, %middle.block27 ]
%f.020.ph = phi i32 [ 0, %while.body3.lr.ph ], [ %ind.end33, %middle.block27 ]
br label %while.body3
while.body: ; preds = %while.body.preheader, %while.body
%i.017 = phi i32 [ %inc, %while.body ], [ %i.017.ph, %while.body.preheader ]
%e.016 = phi i32 [ %add, %while.body ], [ %e.016.ph, %while.body.preheader ]
%add = add nsw i32 %1, %e.016
%inc = add nuw nsw i32 %i.017, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.cond1.preheader, !llvm.loop !14
while.body3: ; preds = %while.body3.preheader, %while.body3
%j.021 = phi i32 [ %inc5, %while.body3 ], [ %j.021.ph, %while.body3.preheader ]
%f.020 = phi i32 [ %add4, %while.body3 ], [ %f.020.ph, %while.body3.preheader ]
%add4 = add nsw i32 %9, %f.020
%inc5 = add nuw nsw i32 %j.021, 1
%cmp2 = icmp slt i32 %add4, %0
br i1 %cmp2, label %while.body3, label %while.end6, !llvm.loop !15
while.end6: ; preds = %while.body3, %middle.block27, %entry, %while.cond1.preheader
%i.0.lcssa24 = phi i32 [ %inc.lcssa, %while.cond1.preheader ], [ 0, %entry ], [ %inc.lcssa, %middle.block27 ], [ %inc.lcssa, %while.body3 ]
%j.0.lcssa = phi i32 [ 0, %while.cond1.preheader ], [ 0, %entry ], [ %16, %middle.block27 ], [ %inc5, %while.body3 ]
%17 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %17, %i.0.lcssa24
store i32 %mul, ptr %b, align 4, !tbaa !5
%18 = load i32, ptr %d, align 4, !tbaa !5
%mul7 = mul nsw i32 %18, %j.0.lcssa
store i32 %mul7, ptr %d, align 4, !tbaa !5
%mul.mul7 = call i32 @llvm.smin.i32(i32 %mul, i32 %mul7)
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.mul7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
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.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !12, !11}
|
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
if(a>b){
c=a-b;
printf("%d\n",c);
}
else{
c=b-a;
printf("%d\n",c);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227112/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227112/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%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
%sub = sub nsw i32 %0, %1
%sub3.sink = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a,b,dragonfly;
scanf("%d%d",&a,&b);
if(a<b){
dragonfly=b-a;
}
else{
dragonfly=a-b;
}
printf("%d\n",dragonfly);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227156/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227156/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub1 = sub nsw i32 %0, %1
%dragonfly.0 = call i32 @llvm.abs.i32(i32 %sub1, i1 true)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %dragonfly.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(a*b%2==1) puts("Odd");
else puts("Even");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, -2147483647
%cmp = icmp eq i32 %2, 1
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int try_try(long long int a, long long int b)
{
long long int i = 0;
for(i = b - a ; i > 1 ; i--)
{
if(a % i == 0 && b % i == 0) return -1;
}
return 1;
}
int main()
{
long long int a = 0, b = 0, c = 0;
long long int l = 0, r = 0;
int flag = 0;
scanf("%lld%lld", &l, &r);
if(r - l <= 1) printf("-1");
else
{
for(a = l ; a < r - 1 ; a++)
{
for(b = a + 1 ; b < r ; b++)
{
if(try_try(a, b) == 1)
{
for(c = b + 1 ; c <= r ; c++)
{
if((try_try(b, c) == 1) && (try_try(a, c) == -1)) flag = 1;
if(flag == 1) break;
}
}
if(flag == 1) break;
}
if(flag == 1) break;
}
if(flag == 1)printf("%lld %lld %lld", a, b, c);
else printf("-1");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22725/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22725/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @try_try(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %b, %a
%cmp9 = icmp sgt i64 %sub, 1
br i1 %cmp9, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.inc
%i.010 = phi i64 [ %dec, %for.inc ], [ %sub, %entry ]
%rem = srem i64 %a, %i.010
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%rem2 = srem i64 %b, %i.010
%cmp3 = icmp eq i64 %rem2, 0
br i1 %cmp3, label %cleanup, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true
%dec = add nsw i64 %i.010, -1
%cmp = icmp sgt i64 %i.010, 2
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !5
cleanup: ; preds = %land.lhs.true, %for.inc, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ -1, %land.lhs.true ]
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:
%l = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4
store i64 0, ptr %l, align 8, !tbaa !7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
store i64 0, ptr %r, align 8, !tbaa !7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%0 = load i64, ptr %r, align 8, !tbaa !7
%1 = load i64, ptr %l, align 8, !tbaa !7
%sub = sub nsw i64 %0, %1
%cmp = icmp slt i64 %sub, 2
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub2 = add nsw i64 %0, -1
%cmp3139 = icmp slt i64 %1, %sub2
br i1 %cmp3139, label %for.body, label %if.else38
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end41
for.body: ; preds = %for.cond.preheader, %for.end28
%a.0140 = phi i64 [ %add, %for.end28 ], [ %1, %for.cond.preheader ]
%add = add nsw i64 %a.0140, 1
%cmp5111 = icmp slt i64 %add, %0
br i1 %cmp5111, label %for.body6, label %for.end28
for.body6: ; preds = %for.body, %for.inc26
%b.1112 = phi i64 [ %inc27.pre-phi, %for.inc26 ], [ %add, %for.body ]
%sub.i = sub nsw i64 %b.1112, %a.0140
%cmp9.i = icmp sgt i64 %sub.i, 1
br i1 %cmp9.i, label %for.body.i, label %for.body13.preheader
for.body.i: ; preds = %for.body6, %for.inc.i
%i.010.i = phi i64 [ %dec.i, %for.inc.i ], [ %sub.i, %for.body6 ]
%rem.i = srem i64 %a.0140, %i.010.i
%cmp1.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%rem2.i = srem i64 %b.1112, %i.010.i
%cmp3.i = icmp eq i64 %rem2.i, 0
br i1 %cmp3.i, label %for.inc26.loopexit120, label %for.inc.i
for.inc.i: ; preds = %land.lhs.true.i, %for.body.i
%dec.i = add nsw i64 %i.010.i, -1
%cmp.i = icmp sgt i64 %i.010.i, 2
br i1 %cmp.i, label %for.body.i, label %for.body13.preheader, !llvm.loop !5
for.body13.preheader: ; preds = %for.inc.i, %for.body6
%c.2108 = add nsw i64 %b.1112, 1
br label %for.body13
for.body13: ; preds = %for.body13.preheader, %for.inc
%c.2110 = phi i64 [ %c.2, %for.inc ], [ %c.2108, %for.body13.preheader ]
%sub.i59 = sub nsw i64 %c.2110, %b.1112
%cmp9.i60 = icmp sgt i64 %sub.i59, 1
br i1 %cmp9.i60, label %for.body.i62, label %land.lhs.true
for.body.i62: ; preds = %for.body13, %for.inc.i66
%i.010.i63 = phi i64 [ %dec.i67, %for.inc.i66 ], [ %sub.i59, %for.body13 ]
%rem.i64 = srem i64 %b.1112, %i.010.i63
%cmp1.i65 = icmp eq i64 %rem.i64, 0
br i1 %cmp1.i65, label %land.lhs.true.i69, label %for.inc.i66
land.lhs.true.i69: ; preds = %for.body.i62
%rem2.i70 = srem i64 %c.2110, %i.010.i63
%cmp3.i71 = icmp eq i64 %rem2.i70, 0
br i1 %cmp3.i71, label %for.inc, label %for.inc.i66
for.inc.i66: ; preds = %land.lhs.true.i69, %for.body.i62
%dec.i67 = add nsw i64 %i.010.i63, -1
%cmp.i68 = icmp sgt i64 %i.010.i63, 2
br i1 %cmp.i68, label %for.body.i62, label %land.lhs.true, !llvm.loop !5
land.lhs.true: ; preds = %for.inc.i66, %for.body13
%sub.i73 = sub nsw i64 %c.2110, %a.0140
%cmp9.i74 = icmp sgt i64 %sub.i73, 1
br i1 %cmp9.i74, label %for.body.i76, label %for.inc
for.body.i76: ; preds = %land.lhs.true, %for.inc.i80
%i.010.i77 = phi i64 [ %dec.i81, %for.inc.i80 ], [ %sub.i73, %land.lhs.true ]
%rem.i78 = srem i64 %a.0140, %i.010.i77
%cmp1.i79 = icmp eq i64 %rem.i78, 0
br i1 %cmp1.i79, label %land.lhs.true.i83, label %for.inc.i80
land.lhs.true.i83: ; preds = %for.body.i76
%rem2.i84 = srem i64 %c.2110, %i.010.i77
%cmp3.i85 = icmp eq i64 %rem2.i84, 0
br i1 %cmp3.i85, label %if.then36, label %for.inc.i80
for.inc.i80: ; preds = %land.lhs.true.i83, %for.body.i76
%dec.i81 = add nsw i64 %i.010.i77, -1
%cmp.i82 = icmp sgt i64 %i.010.i77, 2
br i1 %cmp.i82, label %for.body.i76, label %for.inc, !llvm.loop !5
for.inc: ; preds = %land.lhs.true.i69, %for.inc.i80, %land.lhs.true
%c.2 = add nsw i64 %c.2110, 1
%cmp12.not.not = icmp slt i64 %c.2110, %0
br i1 %cmp12.not.not, label %for.body13, label %for.inc26, !llvm.loop !11
for.inc26.loopexit120: ; preds = %land.lhs.true.i
%.pre = add nsw i64 %b.1112, 1
br label %for.inc26
for.inc26: ; preds = %for.inc, %for.inc26.loopexit120
%inc27.pre-phi = phi i64 [ %.pre, %for.inc26.loopexit120 ], [ %c.2108, %for.inc ]
%cmp5 = icmp slt i64 %inc27.pre-phi, %0
br i1 %cmp5, label %for.body6, label %for.end28, !llvm.loop !12
for.end28: ; preds = %for.inc26, %for.body
%cmp3 = icmp slt i64 %add, %sub2
br i1 %cmp3, label %for.body, label %if.else38, !llvm.loop !13
if.then36: ; preds = %land.lhs.true.i83
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %a.0140, i64 noundef %b.1112, i64 noundef %c.2110)
br label %if.end41
if.else38: ; preds = %for.end28, %for.cond.preheader
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end41
if.end41: ; preds = %if.then36, %if.else38, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char s[12];
char s1[6];
char s2[6];
fgets(s, 12, stdin);
sscanf(s, "%s %s", s1, s2);
int a= atoi(s1);
int b = atoi(s2);
if(a % 2 == 1 && b%2==1){
printf("Odd");
}else{
printf("Even");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227293/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227293/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [12 x i8], align 1
%s1 = alloca [6 x i8], align 1
%s2 = alloca [6 x i8], align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s1) #4
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %s2) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 12, ptr noundef %0)
%call4 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) #4
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %s1, ptr noundef null, i32 noundef 10) #4
%1 = and i64 %call.i, 2147483649
%cmp = icmp eq i64 %1, 1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%call.i13 = call i64 @strtol(ptr nocapture noundef nonnull %s2, ptr noundef null, i32 noundef 10) #4
%2 = and i64 %call.i13, 2147483649
%cmp10 = icmp eq i64 %2, 1
br i1 %cmp10, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s2) #4
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %s1) #4
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, 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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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"}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int a,b,res=0;
scanf("%d%d",&a,&b);
if(a*b%2)
{
printf("Odd");
return 0;
}
printf("Even");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227336/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227336/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%.str.2..str.1 = select i1 %tobool.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct
{
int a;
int b;
} abc086a_t;
int product (const abc086a_t * given_data)
{
return (* given_data).a * (* given_data).b;
}
bool isProdEven (const abc086a_t * given_data)
{
return ( ( product(given_data) % 2 ) == 0 );
}
void ABC086A (const abc086a_t * given_data)
{
if ( isProdEven(given_data) ) printf( "Even\n" );
else printf( "Odd\n" );
}
int main (void)
{
// variables for `main`
abc086a_t given_data;
int retval_scanf;
// STEP.01
// read out the given data
retval_scanf = scanf("%d %d", &given_data.a, &given_data.b);
// STEP.02
// calculate & output the answer
ABC086A(& given_data);
// STEP.END
return EXIT_SUCCESS;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227422/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227422/source.c"
target datalayout = "e-m:e-p270: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.abc086a_t = type { i32, i32 }
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @product(ptr nocapture noundef readonly %given_data) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %given_data, align 4, !tbaa !5
%b = getelementptr inbounds %struct.abc086a_t, ptr %given_data, i64 0, i32 1
%1 = load i32, ptr %b, align 4, !tbaa !10
%mul = mul nsw i32 %1, %0
ret i32 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local zeroext i1 @isProdEven(ptr nocapture noundef readonly %given_data) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %given_data, align 4, !tbaa !5
%b.i = getelementptr inbounds %struct.abc086a_t, ptr %given_data, i64 0, i32 1
%1 = load i32, ptr %b.i, align 4, !tbaa !10
%mul.i = mul nsw i32 %1, %0
%2 = and i32 %mul.i, 1
%cmp = icmp eq i32 %2, 0
ret i1 %cmp
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @ABC086A(ptr nocapture noundef readonly %given_data) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %given_data, align 4, !tbaa !5
%b.i.i = getelementptr inbounds %struct.abc086a_t, ptr %given_data, i64 0, i32 1
%1 = load i32, ptr %b.i.i, align 4, !tbaa !10
%mul.i.i = mul nsw i32 %1, %0
%2 = and i32 %mul.i.i, 1
%cmp.i = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp.i, ptr @str.3, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%given_data = alloca %struct.abc086a_t, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %given_data) #5
%b = getelementptr inbounds %struct.abc086a_t, ptr %given_data, i64 0, i32 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %given_data, ptr noundef nonnull %b)
%0 = load i32, ptr %given_data, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !10
%mul.i.i.i = mul nsw i32 %1, %0
%2 = and i32 %mul.i.i.i, 1
%cmp.i.i = icmp eq i32 %2, 0
%str.3.str.i = select i1 %cmp.i.i, ptr @str.3, ptr @str
%puts.i = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %given_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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
|
#include <stdio.h>
int main() {
int a, b;
scanf("%d %d", &a, &b);
int product = a * b;
if (product % 2 == 0)
{
printf("Even");
}
else {
printf("Odd");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227466/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227466/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d", &a);
scanf("%d", &b);
int ans = 0;
ans = a*b;
if(ans%2 == 0){
printf("Even");
}else{
printf("Odd");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227509/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227509/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if((a*b)%2==0)printf("Even\n");
else printf("Odd\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d %d",&a,&b);
c=a*b;
if(c%2==1){
printf("Odd\n");
}
else if(c%2==0){
printf("Even\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%rem = srem i32 %mul, 2
switch i32 %rem, label %if.end6 [
i32 1, label %if.end6.sink.split
i32 0, label %if.then4
]
if.then4: ; preds = %entry
br label %if.end6.sink.split
if.end6.sink.split: ; preds = %entry, %if.then4
%str.sink = phi ptr [ @str, %if.then4 ], [ @str.3, %entry ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %if.end6
if.end6: ; preds = %if.end6.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2 == 0){
printf("Even\n");
}else{
printf("Odd\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227639/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227639/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
int x=a*b;
if(x%2 != 0)
{printf("Odd");}
else
{printf("Even");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp.not = icmp eq i32 %2, 0
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
c = a * b;
if(c % 2 == 1){
printf("Odd\n");
}else{
printf("Even\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227725/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227725/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, -2147483647
%cmp = icmp eq i32 %2, 1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2==0){
printf("Even\n");
}
else{
printf("Odd\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227776/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227776/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b);
if((a * b) % 2){
printf("Odd\n");
}else{
printf("Even\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,x;
scanf("%d%d",&a,&b);
x=a*b;
if(x%2==1)
printf("Odd\n");
else
printf("Even\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, -2147483647
%cmp = icmp eq i32 %2, 1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
long a, b;
scanf("%ld %ld", &a, &b);
if ((a*b)%2 == 0)
puts("Even");
else
puts("Odd");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = and i64 %mul, 1
%cmp = icmp eq i64 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
double x, y, z, r;
} Coord;
// typedef struct {
// int parent, rank;
// } Node;
typedef struct {
int from, to;
double weight;
} Edge;
Coord coord[ 100 ];
// Node node[ 100 ];
int node[ 100 ];
Edge edge[ 4950 ];
int compare( const void *a, const void *b ) {
double at = (*(Edge *)a).weight, bt = (*(Edge *)b).weight;
if ( at < bt )
return -1;
if ( at > bt )
return 1;
return 0;
}
int find( int x ) {
if ( node[ x ] == x )
return x;
else
return node[ x ] = find( node[ x ] );
}
int uniteSame( int x, int y ) {
int xSet = find( x ), ySet = find( y );
if ( xSet == ySet )
return 0;
node[ ySet ] = xSet;
return 1;
}
double kruskal( int v, int e ) {
int i;
double sum;
qsort( edge, e, sizeof(Edge), &compare );
for ( i = 0; i < v; i++ )
node[ i ] = i;
sum = 0.0;
for ( i = 0; i < e; i++ )
if ( uniteSame( edge[ i ].from, edge[ i ].to ) )
sum += edge[ i ].weight;
return sum;
}
int main( void ) {
int i, j;
int n, cnt;
while ( scanf( "%d", &n ), n ) {
for ( i = 0; i < n; i++ )
scanf( "%lf %lf %lf %lf", &coord[ i ].x, &coord[ i ].y, &coord[ i ].z, &coord[ i ].r );
cnt = 0;
for ( i = 0; i < n; i++ )
for ( j = i + 1; j < n; j++ ) {
edge[ cnt ].from = i;
edge[ cnt ].to = j;
edge[ cnt ].weight = fmax( sqrt( ( coord[ i ].x - coord[ j ].x ) * ( coord[ i ].x - coord[ j ].x ) + ( coord[ i ].y - coord[ j ].y ) * ( coord[ i ].y - coord[ j ].y ) + ( coord[ i ].z - coord[ j ].z ) * ( coord[ i ].z - coord[ j ].z ) ) - coord[ i ].r - coord[ j ].r, 0.0 );
cnt++;
}
printf( "%.3f\n", kruskal( n, n * ( n - 1 ) / 2 ) );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227949/source.c"
target datalayout = "e-m:e-p270: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.Edge = type { i32, i32, double }
%struct.Coord = type { double, double, double, double }
@node = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@edge = dso_local global [4950 x %struct.Edge] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1
@coord = dso_local global [100 x %struct.Coord] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%.3f\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%weight = getelementptr inbounds %struct.Edge, ptr %a, i64 0, i32 2
%0 = load double, ptr %weight, align 8, !tbaa !5
%weight1 = getelementptr inbounds %struct.Edge, ptr %b, i64 0, i32 2
%1 = load double, ptr %weight1, align 8, !tbaa !5
%cmp = fcmp olt double %0, %1
%cmp2 = fcmp ogt double %0, %1
%. = zext i1 %cmp2 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @find(i32 noundef %x) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !11
%cmp = icmp eq i32 %0, %x
br i1 %cmp, label %common.ret9, label %if.else
common.ret9: ; preds = %entry, %if.else
%common.ret9.op = phi i32 [ %call, %if.else ], [ %x, %entry ]
ret i32 %common.ret9.op
if.else: ; preds = %entry
%call = tail call i32 @find(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !11
br label %common.ret9
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @uniteSame(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%call = tail call i32 @find(i32 noundef %x)
%call1 = tail call i32 @find(i32 noundef %y)
%cmp = icmp eq i32 %call, %call1
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%idxprom = sext i32 %call1 to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %idxprom
store i32 %call, ptr %arrayidx, align 4, !tbaa !11
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 1, %if.end ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @kruskal(i32 noundef %v, i32 noundef %e) local_unnamed_addr #4 {
entry:
%conv = sext i32 %e to i64
tail call void @qsort(ptr noundef nonnull @edge, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @compare) #9
%cmp27 = icmp sgt i32 %v, 0
br i1 %cmp27, label %for.body.preheader, label %for.cond2.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %v to i64
%min.iters.check = icmp ult i32 %v, 8
br i1 %min.iters.check, label %for.body.preheader39, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !11
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader39
for.body.preheader39: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block, %entry
%cmp329 = icmp sgt i32 %e, 0
br i1 %cmp329, label %for.body5.preheader, label %for.end14
for.body5.preheader: ; preds = %for.cond2.preheader
%wide.trip.count36 = zext i32 %e to i64
br label %for.body5
for.body: ; preds = %for.body.preheader39, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader39 ]
%arrayidx = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %indvars.iv
%3 = trunc i64 %indvars.iv to i32
store i32 %3, ptr %arrayidx, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !16
for.body5: ; preds = %for.body5.preheader, %for.inc12
%indvars.iv33 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next34, %for.inc12 ]
%sum.031 = phi double [ 0.000000e+00, %for.body5.preheader ], [ %sum.1, %for.inc12 ]
%arrayidx7 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33
%4 = load i32, ptr %arrayidx7, align 16, !tbaa !17
%to = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33, i32 1
%5 = load i32, ptr %to, align 4, !tbaa !18
%call.i = tail call i32 @find(i32 noundef %4)
%call1.i = tail call i32 @find(i32 noundef %5)
%cmp.i = icmp eq i32 %call.i, %call1.i
br i1 %cmp.i, label %for.inc12, label %if.then
if.then: ; preds = %for.body5
%idxprom.i = sext i32 %call1.i to i64
%arrayidx.i = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %idxprom.i
store i32 %call.i, ptr %arrayidx.i, align 4, !tbaa !11
%weight = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33, i32 2
%6 = load double, ptr %weight, align 8, !tbaa !5
%add = fadd double %sum.031, %6
br label %for.inc12
for.inc12: ; preds = %for.body5, %if.then
%sum.1 = phi double [ %add, %if.then ], [ %sum.031, %for.body5 ]
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%exitcond37.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count36
br i1 %exitcond37.not, label %for.end14, label %for.body5, !llvm.loop !19
for.end14: ; preds = %for.inc12, %for.cond2.preheader
%sum.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ %sum.1, %for.inc12 ]
ret double %sum.0.lcssa
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%call122 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%tobool.not123 = icmp eq i32 %0, 0
br i1 %tobool.not123, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %kruskal.exit
%1 = phi i32 [ %77, %kruskal.exit ], [ %0, %entry ]
%cmp111 = icmp sgt i32 %1, 0
br i1 %cmp111, label %for.body, label %for.end77
for.cond8.preheader: ; preds = %for.body
%cmp9118 = icmp sgt i32 %3, 0
br i1 %cmp9118, label %for.body10.lr.ph, label %for.end77
for.body10.lr.ph: ; preds = %for.cond8.preheader
%2 = zext i32 %3 to i64
%wide.trip.count138 = zext i32 %3 to i64
br label %for.body10
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv
%y = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv, i32 1
%z = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv, i32 2
%r = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv, i32 3
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y, ptr noundef nonnull %z, ptr noundef nonnull %r)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !11
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !20
for.cond8.loopexit.loopexit: ; preds = %for.body13, %middle.block143
%indvars.iv.next127.lcssa = phi i64 [ %ind.end150, %middle.block143 ], [ %indvars.iv.next127, %for.body13 ]
%5 = trunc i64 %indvars.iv.next127.lcssa to i32
br label %for.cond8.loopexit
for.cond8.loopexit: ; preds = %for.cond8.loopexit.loopexit, %for.body10
%cnt.1.lcssa = phi i32 [ %cnt.0120, %for.body10 ], [ %5, %for.cond8.loopexit.loopexit ]
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%exitcond139.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count138
br i1 %exitcond139.not, label %for.end77, label %for.body10, !llvm.loop !21
for.body10: ; preds = %for.body10.lr.ph, %for.cond8.loopexit
%indvars.iv135 = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next136, %for.cond8.loopexit ]
%indvars.iv128 = phi i64 [ 1, %for.body10.lr.ph ], [ %indvars.iv.next129, %for.cond8.loopexit ]
%cnt.0120 = phi i32 [ 0, %for.body10.lr.ph ], [ %cnt.1.lcssa, %for.cond8.loopexit ]
%6 = xor i64 %indvars.iv135, -1
%7 = add nsw i64 %6, %wide.trip.count138
%indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
%cmp12113 = icmp ult i64 %indvars.iv.next136, %2
br i1 %cmp12113, label %for.body13.lr.ph, label %for.cond8.loopexit
for.body13.lr.ph: ; preds = %for.body10
%arrayidx19 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv135
%8 = load double, ptr %arrayidx19, align 16, !tbaa !22
%y33 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv135, i32 1
%9 = load double, ptr %y33, align 8, !tbaa !24
%z48 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv135, i32 2
%10 = load double, ptr %z48, align 16, !tbaa !25
%r63 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv135, i32 3
%11 = load double, ptr %r63, align 8, !tbaa !26
%12 = sext i32 %cnt.0120 to i64
%13 = trunc i64 %indvars.iv135 to i32
%min.iters.check145 = icmp ult i64 %7, 2
br i1 %min.iters.check145, label %for.body13.preheader, label %vector.ph146
vector.ph146: ; preds = %for.body13.lr.ph
%n.vec148 = and i64 %7, -2
%ind.end = add i64 %indvars.iv128, %n.vec148
%ind.end150 = add i64 %n.vec148, %12
%broadcast.splatinsert = insertelement <2 x double> poison, double %8, i64 0
%broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert157 = insertelement <2 x double> poison, double %9, i64 0
%broadcast.splat158 = shufflevector <2 x double> %broadcast.splatinsert157, <2 x double> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert159 = insertelement <2 x double> poison, double %10, i64 0
%broadcast.splat160 = shufflevector <2 x double> %broadcast.splatinsert159, <2 x double> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert161 = insertelement <2 x double> poison, double %11, i64 0
%broadcast.splat162 = shufflevector <2 x double> %broadcast.splatinsert161, <2 x double> poison, <2 x i32> zeroinitializer
br label %vector.body153
vector.body153: ; preds = %vector.body153, %vector.ph146
%index154 = phi i64 [ 0, %vector.ph146 ], [ %index.next163, %vector.body153 ]
%offset.idx = add i64 %indvars.iv128, %index154
%14 = trunc i64 %offset.idx to i32
%15 = add i32 %14, 1
%offset.idx155 = add i64 %index154, %12
%16 = add i64 %offset.idx155, 1
%offset.idx156 = add i64 %indvars.iv128, %index154
%17 = add i64 %offset.idx156, 1
%18 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %offset.idx155
%19 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %16
store i32 %13, ptr %18, align 16, !tbaa !17
store i32 %13, ptr %19, align 16, !tbaa !17
%20 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %offset.idx155, i32 1
%21 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %16, i32 1
store i32 %14, ptr %20, align 4, !tbaa !18
store i32 %15, ptr %21, align 4, !tbaa !18
%22 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %offset.idx156
%23 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %17
%24 = load double, ptr %22, align 16, !tbaa !22
%25 = load double, ptr %23, align 16, !tbaa !22
%26 = insertelement <2 x double> poison, double %24, i64 0
%27 = insertelement <2 x double> %26, double %25, i64 1
%28 = fsub <2 x double> %broadcast.splat, %27
%29 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %offset.idx156, i32 1
%30 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %17, i32 1
%31 = load double, ptr %29, align 8, !tbaa !24
%32 = load double, ptr %30, align 8, !tbaa !24
%33 = insertelement <2 x double> poison, double %31, i64 0
%34 = insertelement <2 x double> %33, double %32, i64 1
%35 = fsub <2 x double> %broadcast.splat158, %34
%36 = fmul <2 x double> %35, %35
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %28, <2 x double> %28, <2 x double> %36)
%38 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %offset.idx156, i32 2
%39 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %17, i32 2
%40 = load double, ptr %38, align 16, !tbaa !25
%41 = load double, ptr %39, align 16, !tbaa !25
%42 = insertelement <2 x double> poison, double %40, i64 0
%43 = insertelement <2 x double> %42, double %41, i64 1
%44 = fsub <2 x double> %broadcast.splat160, %43
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %44, <2 x double> %44, <2 x double> %37)
%46 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %45)
%47 = fsub <2 x double> %46, %broadcast.splat162
%48 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %offset.idx156, i32 3
%49 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %17, i32 3
%50 = load double, ptr %48, align 8, !tbaa !26
%51 = load double, ptr %49, align 8, !tbaa !26
%52 = insertelement <2 x double> poison, double %50, i64 0
%53 = insertelement <2 x double> %52, double %51, i64 1
%54 = fsub <2 x double> %47, %53
%55 = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %54, <2 x double> zeroinitializer)
%56 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %offset.idx155, i32 2
%57 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %16, i32 2
%58 = extractelement <2 x double> %55, i64 0
store double %58, ptr %56, align 8, !tbaa !5
%59 = extractelement <2 x double> %55, i64 1
store double %59, ptr %57, align 8, !tbaa !5
%index.next163 = add nuw i64 %index154, 2
%60 = icmp eq i64 %index.next163, %n.vec148
br i1 %60, label %middle.block143, label %vector.body153, !llvm.loop !27
middle.block143: ; preds = %vector.body153
%cmp.n152 = icmp eq i64 %7, %n.vec148
br i1 %cmp.n152, label %for.cond8.loopexit.loopexit, label %for.body13.preheader
for.body13.preheader: ; preds = %for.body13.lr.ph, %middle.block143
%indvars.iv130.ph = phi i64 [ %indvars.iv128, %for.body13.lr.ph ], [ %ind.end, %middle.block143 ]
%indvars.iv126.ph = phi i64 [ %12, %for.body13.lr.ph ], [ %ind.end150, %middle.block143 ]
br label %for.body13
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.body13 ], [ %indvars.iv130.ph, %for.body13.preheader ]
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body13 ], [ %indvars.iv126.ph, %for.body13.preheader ]
%arrayidx15 = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv126
store i32 %13, ptr %arrayidx15, align 16, !tbaa !17
%to = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv126, i32 1
%61 = trunc i64 %indvars.iv130 to i32
store i32 %61, ptr %to, align 4, !tbaa !18
%arrayidx22 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv130
%62 = load double, ptr %arrayidx22, align 16, !tbaa !22
%sub = fsub double %8, %62
%y36 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv130, i32 1
%63 = load double, ptr %y36, align 8, !tbaa !24
%sub37 = fsub double %9, %63
%mul45 = fmul double %sub37, %sub37
%64 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul45)
%z51 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv130, i32 2
%65 = load double, ptr %z51, align 16, !tbaa !25
%sub52 = fsub double %10, %65
%66 = call double @llvm.fmuladd.f64(double %sub52, double %sub52, double %64)
%sqrt = call double @llvm.sqrt.f64(double %66)
%sub64 = fsub double %sqrt, %11
%r67 = getelementptr inbounds [100 x %struct.Coord], ptr @coord, i64 0, i64 %indvars.iv130, i32 3
%67 = load double, ptr %r67, align 8, !tbaa !26
%sub68 = fsub double %sub64, %67
%68 = call double @llvm.maxnum.f64(double %sub68, double 0.000000e+00)
%weight = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv126, i32 2
store double %68, ptr %weight, align 8, !tbaa !5
%indvars.iv.next127 = add nsw i64 %indvars.iv126, 1
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%exitcond.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count138
br i1 %exitcond.not, label %for.cond8.loopexit.loopexit, label %for.body13, !llvm.loop !28
for.end77: ; preds = %for.cond8.loopexit, %for.cond.preheader, %for.cond8.preheader
%cmp9118141 = phi i1 [ false, %for.cond8.preheader ], [ false, %for.cond.preheader ], [ %cmp9118, %for.cond8.loopexit ]
%69 = phi i32 [ %3, %for.cond8.preheader ], [ %1, %for.cond.preheader ], [ %3, %for.cond8.loopexit ]
%sub78 = add nsw i32 %69, -1
%mul = mul nsw i32 %sub78, %69
%div = sdiv i32 %mul, 2
%conv.i = sext i32 %div to i64
call void @qsort(ptr noundef nonnull @edge, i64 noundef %conv.i, i64 noundef 16, ptr noundef nonnull @compare) #9
br i1 %cmp9118141, label %for.body.preheader.i, label %for.cond2.preheader.i
for.body.preheader.i: ; preds = %for.end77
%wide.trip.count.i = zext i32 %69 to i64
%min.iters.check = icmp ult i32 %69, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%70 = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %70, align 16, !tbaa !11
%71 = getelementptr inbounds i32, ptr %70, i64 4
store <4 x i32> %step.add, ptr %71, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%72 = icmp eq i64 %index.next, %n.vec
br i1 %72, label %middle.block, label %vector.body, !llvm.loop !29
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond2.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
br label %for.body.i
for.cond2.preheader.i: ; preds = %for.body.i, %middle.block, %for.end77
%cmp329.i = icmp sgt i32 %mul, 1
br i1 %cmp329.i, label %for.body5.preheader.i, label %kruskal.exit
for.body5.preheader.i: ; preds = %for.cond2.preheader.i
%wide.trip.count36.i = zext i32 %div to i64
br label %for.body5.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %indvars.iv.i
%73 = trunc i64 %indvars.iv.i to i32
store i32 %73, ptr %arrayidx.i, align 4, !tbaa !11
%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 %for.cond2.preheader.i, label %for.body.i, !llvm.loop !30
for.body5.i: ; preds = %for.inc12.i, %for.body5.preheader.i
%indvars.iv33.i = phi i64 [ 0, %for.body5.preheader.i ], [ %indvars.iv.next34.i, %for.inc12.i ]
%sum.031.i = phi double [ 0.000000e+00, %for.body5.preheader.i ], [ %sum.1.i, %for.inc12.i ]
%arrayidx7.i = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33.i
%74 = load i32, ptr %arrayidx7.i, align 16, !tbaa !17
%to.i = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33.i, i32 1
%75 = load i32, ptr %to.i, align 4, !tbaa !18
%call.i.i = call i32 @find(i32 noundef %74)
%call1.i.i = call i32 @find(i32 noundef %75)
%cmp.i.i = icmp eq i32 %call.i.i, %call1.i.i
br i1 %cmp.i.i, label %for.inc12.i, label %if.then.i
if.then.i: ; preds = %for.body5.i
%idxprom.i.i = sext i32 %call1.i.i to i64
%arrayidx.i.i = getelementptr inbounds [100 x i32], ptr @node, i64 0, i64 %idxprom.i.i
store i32 %call.i.i, ptr %arrayidx.i.i, align 4, !tbaa !11
%weight.i = getelementptr inbounds [4950 x %struct.Edge], ptr @edge, i64 0, i64 %indvars.iv33.i, i32 2
%76 = load double, ptr %weight.i, align 8, !tbaa !5
%add.i = fadd double %sum.031.i, %76
br label %for.inc12.i
for.inc12.i: ; preds = %if.then.i, %for.body5.i
%sum.1.i = phi double [ %add.i, %if.then.i ], [ %sum.031.i, %for.body5.i ]
%indvars.iv.next34.i = add nuw nsw i64 %indvars.iv33.i, 1
%exitcond37.not.i = icmp eq i64 %indvars.iv.next34.i, %wide.trip.count36.i
br i1 %exitcond37.not.i, label %kruskal.exit, label %for.body5.i, !llvm.loop !19
kruskal.exit: ; preds = %for.inc12.i, %for.cond2.preheader.i
%sum.0.lcssa.i = phi double [ 0.000000e+00, %for.cond2.preheader.i ], [ %sum.1.i, %for.inc12.i ]
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %sum.0.lcssa.i)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%77 = load i32, ptr %n, align 4, !tbaa !11
%tobool.not = icmp eq i32 %77, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !31
while.end: ; preds = %kruskal.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #7
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !15, !14}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !7, i64 4}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!24 = !{!23, !10, i64 8}
!25 = !{!23, !10, i64 16}
!26 = !{!23, !10, i64 24}
!27 = distinct !{!27, !13, !14, !15}
!28 = distinct !{!28, !13, !15, !14}
!29 = distinct !{!29, !13, !14, !15}
!30 = distinct !{!30, !13, !15, !14}
!31 = distinct !{!31, !13}
|
#include<stdio.h>
int main(){
double data[8],vec[4],cross;
int i;
while(1){
for(i = 0; i < 8; i++){
if(i == 0){
if(scanf("%lf",&data[i]) == EOF) return 0;
}
else
scanf("%lf",&data[i]);
}
vec[0]=data[2]-data[0];
vec[1]=data[3]-data[1];
vec[2]=data[6]-data[4];
vec[3]=data[7]-data[5];
cross = vec[0] * vec[2] + vec[1] * vec[3];
if(cross == 0)
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227992/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227992/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = 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:
%data = alloca [8 x double], align 16
call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %data) #5
%arrayidx8 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 2
%arrayidx11 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 3
%arrayidx12 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 1
%arrayidx15 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 6
%arrayidx16 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 4
%arrayidx19 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 7
%arrayidx20 = getelementptr inbounds [8 x double], ptr %data, i64 0, i64 5
%call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data)
%cmp249 = icmp eq i32 %call48, -1
br i1 %cmp249, label %if.then3, label %for.inc.7
if.then3: ; preds = %for.inc.7, %entry
call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %data) #5
ret i32 0
for.inc.7: ; preds = %entry, %for.inc.7
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx12)
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx11)
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16)
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx20)
%call6.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15)
%call6.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19)
%.pre47 = load double, ptr %arrayidx20, align 8, !tbaa !5
%.pre46 = load double, ptr %arrayidx19, align 8, !tbaa !5
%.pre45 = load double, ptr %arrayidx16, align 16, !tbaa !5
%.pre44 = load double, ptr %arrayidx15, align 16, !tbaa !5
%.pre43 = load double, ptr %arrayidx12, align 8, !tbaa !5
%.pre42 = load double, ptr %arrayidx11, align 8, !tbaa !5
%.pre41 = load double, ptr %data, align 16, !tbaa !5
%.pre = load double, ptr %arrayidx8, align 16, !tbaa !5
%sub = fsub double %.pre, %.pre41
%sub13 = fsub double %.pre42, %.pre43
%sub17 = fsub double %.pre44, %.pre45
%sub21 = fsub double %.pre46, %.pre47
%mul27 = fmul double %sub13, %sub21
%0 = call double @llvm.fmuladd.f64(double %sub, double %sub17, double %mul27)
%cmp28 = fcmp oeq double %0, 0.000000e+00
%str.3.str = select i1 %cmp28, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data)
%cmp2 = icmp eq i32 %call, -1
br i1 %cmp2, label %if.then3, label %for.inc.7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* AOJ 0058 Orthogonal */
#include <stdio.h>
#include <math.h>
int
main(void)
{
double xA, yA, xB, yB, xC, yC, xD, yD;
while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf",
&xA, &yA, &xB, &yB, &xC, &yC, &xD, &yD) != EOF) {
if (fabs((xB - xA) * (xD - xC) + (yB - yA) * (yD - yC)) < 1e-10)
puts("YES");
else
puts("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228034/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228034/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [25 x i8] c"%lf%lf%lf%lf%lf%lf%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%xA = alloca double, align 8
%yA = alloca double, align 8
%xB = alloca double, align 8
%yB = alloca double, align 8
%xC = alloca double, align 8
%yC = alloca double, align 8
%xD = alloca double, align 8
%yD = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xA) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yA) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xB) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yB) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xC) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yC) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xD) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yD) #4
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %xA, ptr noundef nonnull %yA, ptr noundef nonnull %xB, ptr noundef nonnull %yB, ptr noundef nonnull %xC, ptr noundef nonnull %yC, ptr noundef nonnull %xD, ptr noundef nonnull %yD)
%cmp.not9 = icmp eq i32 %call8, -1
br i1 %cmp.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load double, ptr %xB, align 8, !tbaa !5
%1 = load double, ptr %xA, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %xD, align 8, !tbaa !5
%3 = load double, ptr %xC, align 8, !tbaa !5
%sub1 = fsub double %2, %3
%4 = load double, ptr %yB, align 8, !tbaa !5
%5 = load double, ptr %yA, align 8, !tbaa !5
%sub2 = fsub double %4, %5
%6 = load double, ptr %yD, align 8, !tbaa !5
%7 = load double, ptr %yC, align 8, !tbaa !5
%sub3 = fsub double %6, %7
%mul4 = fmul double %sub2, %sub3
%8 = call double @llvm.fmuladd.f64(double %sub, double %sub1, double %mul4)
%9 = call double @llvm.fabs.f64(double %8)
%cmp5 = fcmp olt double %9, 1.000000e-10
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %xA, ptr noundef nonnull %yA, ptr noundef nonnull %xB, ptr noundef nonnull %yB, ptr noundef nonnull %xC, ptr noundef nonnull %yC, ptr noundef nonnull %xD, ptr noundef nonnull %yD)
%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 8, ptr nonnull %yD) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xD) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yC) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xC) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yB) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xB) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yA) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xA) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #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 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#define _CRT_SECURE_NO_WARNINGS
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define true 1
#define false 0
typedef unsigned long long int ulli;
int Rep(int i, int num) {
}
int main() {
int h, w;
int n;
int a[10000];
int map[100][100];
scanf("%d %d %d", &h, &w, &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int color_num = 0;
int color_element = a[color_num];
int option = 1;
for (int i = 0; i < h; i++) {
for (int j = option ? 0 : w - 1; option ? j < w : j >= 0; option ? j++ : j--) {
while (color_element == 0) {
color_num++;
color_element = a[color_num];
}
map[i][j] = color_num + 1;
color_element--;
}
option = (option + 1) % 2;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w - 1; j++) {
printf("%d ", map[i][j]);
}
printf("%d\n", map[i][w - 1]);
}
printf("\n");
return 0;
}
/*
void MergeSort(int n, int x[], int y[]) {
int buffer[1000];
int buffer2[1000];
int i, j, k, m;
if (n <= 1) {
return;
}
m = n / 2;
MergeSort(m, x, y);
MergeSort(n - m, x + m, y + m);
for (i = 0; i < m; i++) {
buffer[i] = x[i];
buffer2[i] = y[i];
}
j = m;
i = k = 0;
while (i < m && j < n) {
if (buffer[i] <= x[j]) {
y[k] = buffer2[i];
x[k++] = buffer[i++];
}
else {
y[k] = y[j];
x[k++] = x[j++];
}
}
while (i < m) {
y[k] = buffer2[i];
x[k++] = buffer[i++];
}
return;
}*/ | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228078/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228078/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Rep(i32 noundef %i, i32 noundef %num) local_unnamed_addr #0 {
entry:
ret i32 undef
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [10000 x i32], align 16
%map = alloca [100 x [100 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %map) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp94 = icmp sgt i32 %0, 0
br i1 %cmp94, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%1 = load i32, ptr %h, align 4, !tbaa !5
%cmp6107 = icmp sgt i32 %1, 0
br i1 %cmp6107, label %for.body8.lr.ph, label %for.cond.cleanup47
for.body8.lr.ph: ; preds = %for.cond.cleanup
%2 = load i32, ptr %a, align 16, !tbaa !5
%3 = load i32, ptr %w, align 4
%sub = add nsw i32 %3, -1
%4 = sext i32 %3 to i64
%wide.trip.count = zext i32 %1 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 [10000 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
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond44.preheader: ; preds = %for.cond.cleanup19
br i1 %cmp6107, label %for.cond50.preheader, label %for.cond.cleanup47
for.body8: ; preds = %for.body8.lr.ph, %for.cond.cleanup19
%indvars.iv126 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next127, %for.cond.cleanup19 ]
%option.0110 = phi i32 [ 1, %for.body8.lr.ph ], [ %rem, %for.cond.cleanup19 ]
%color_element.0109 = phi i32 [ %2, %for.body8.lr.ph ], [ %color_element.1.lcssa, %for.cond.cleanup19 ]
%color_num.0108 = phi i32 [ 0, %for.body8.lr.ph ], [ %color_num.1.lcssa, %for.cond.cleanup19 ]
%tobool.not = icmp eq i32 %option.0110, 0
%cond = select i1 %tobool.not, i32 %sub, i32 0
%cmp1299 = icmp slt i32 %cond, %3
%cmp14100 = icmp sgt i32 %cond, -1
%cond17.in101 = select i1 %tobool.not, i1 %cmp14100, i1 %cmp1299
br i1 %cond17.in101, label %while.cond.preheader.lr.ph, label %for.cond.cleanup19
while.cond.preheader.lr.ph: ; preds = %for.body8
%j.1.v = select i1 %tobool.not, i64 -1, i64 1
%7 = sext i32 %cond to i64
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %while.end
%indvars.iv123 = phi i64 [ %7, %while.cond.preheader.lr.ph ], [ %indvars.iv.next124, %while.end ]
%color_element.1103 = phi i32 [ %color_element.0109, %while.cond.preheader.lr.ph ], [ %dec, %while.end ]
%color_num.1102 = phi i32 [ %color_num.0108, %while.cond.preheader.lr.ph ], [ %color_num.2.lcssa, %while.end ]
%cmp2196 = icmp eq i32 %color_element.1103, 0
br i1 %cmp2196, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %while.cond.preheader
%8 = sext i32 %color_num.1102 to i64
br label %while.body
for.cond.cleanup19: ; preds = %while.end, %for.body8
%color_num.1.lcssa = phi i32 [ %color_num.0108, %for.body8 ], [ %color_num.2.lcssa, %while.end ]
%color_element.1.lcssa = phi i32 [ %color_element.0109, %for.body8 ], [ %dec, %while.end ]
%9 = and i32 %option.0110, 1
%rem = xor i32 %9, 1
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%exitcond.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count
br i1 %exitcond.not, label %for.cond44.preheader, label %for.body8, !llvm.loop !11
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv120 = phi i64 [ %8, %while.body.preheader ], [ %indvars.iv.next121, %while.body ]
%indvars.iv.next121 = add i64 %indvars.iv120, 1
%arrayidx25 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next121
%10 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp21 = icmp eq i32 %10, 0
br i1 %cmp21, label %while.body, label %while.end.loopexit, !llvm.loop !12
while.end.loopexit: ; preds = %while.body
%11 = trunc i64 %indvars.iv.next121 to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %while.cond.preheader
%color_num.2.lcssa = phi i32 [ %color_num.1102, %while.cond.preheader ], [ %11, %while.end.loopexit ]
%color_element.2.lcssa = phi i32 [ %color_element.1103, %while.cond.preheader ], [ %10, %while.end.loopexit ]
%add = add nsw i32 %color_num.2.lcssa, 1
%arrayidx29 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv126, i64 %indvars.iv123
store i32 %add, ptr %arrayidx29, align 4, !tbaa !5
%dec = add nsw i32 %color_element.2.lcssa, -1
%indvars.iv.next124 = add i64 %indvars.iv123, %j.1.v
%cmp12 = icmp slt i64 %indvars.iv.next124, %4
%cmp14 = icmp sgt i64 %indvars.iv.next124, -1
%cond17.in = select i1 %tobool.not, i1 %cmp14, i1 %cmp12
br i1 %cond17.in, label %while.cond.preheader, label %for.cond.cleanup19, !llvm.loop !13
for.cond50.preheader: ; preds = %for.cond44.preheader, %for.cond.cleanup54
%indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.cond.cleanup54 ], [ 0, %for.cond44.preheader ]
%12 = load i32, ptr %w, align 4, !tbaa !5
%cmp52113 = icmp sgt i32 %12, 1
br i1 %cmp52113, label %for.body55, label %for.cond50.preheader.for.cond.cleanup54_crit_edge
for.cond50.preheader.for.cond.cleanup54_crit_edge: ; preds = %for.cond50.preheader
%sub51112 = add nsw i32 %12, -1
%.pre = sext i32 %sub51112 to i64
br label %for.cond.cleanup54
for.cond.cleanup47: ; preds = %for.cond.cleanup54, %for.cond.cleanup, %for.cond44.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %map) #5
call void @llvm.lifetime.end.p0(i64 40000, 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 %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
for.cond.cleanup54: ; preds = %for.body55, %for.cond50.preheader.for.cond.cleanup54_crit_edge
%idxprom67.pre-phi = phi i64 [ %.pre, %for.cond50.preheader.for.cond.cleanup54_crit_edge ], [ %18, %for.body55 ]
%arrayidx68 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv132, i64 %idxprom67.pre-phi
%13 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13)
%indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
%14 = load i32, ptr %h, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp45 = icmp slt i64 %indvars.iv.next133, %15
br i1 %cmp45, label %for.cond50.preheader, label %for.cond.cleanup47, !llvm.loop !14
for.body55: ; preds = %for.cond50.preheader, %for.body55
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.body55 ], [ 0, %for.cond50.preheader ]
%arrayidx59 = getelementptr inbounds [100 x [100 x i32]], ptr %map, i64 0, i64 %indvars.iv132, i64 %indvars.iv129
%16 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%17 = load i32, ptr %w, align 4, !tbaa !5
%sub51 = add nsw i32 %17, -1
%18 = sext i32 %sub51 to i64
%cmp52 = icmp slt i64 %indvars.iv.next130, %18
br i1 %cmp52, label %for.body55, label %for.cond.cleanup54, !llvm.loop !15
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void)
{
int N, a;
int min = 1001;
int max = -1;
scanf("%d", &N);
for(int i=1; i<=N; i++){
scanf("%d", &a);
if(min > a ) min=a;
if(max < a ) max=a;
}
printf("%d", max-min);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228120/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228120/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not11 = icmp slt i32 %0, 1
br i1 %cmp.not11, label %for.cond.cleanup, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = sub nsw i32 %max.1, %spec.select
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ -1002, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%max.013 = phi i32 [ %max.1, %for.body ], [ -1, %entry ]
%min.012 = phi i32 [ %spec.select, %for.body ], [ 1001, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.012, i32 %2)
%max.1 = call i32 @llvm.smax.i32(i32 %max.013, i32 %2)
%inc = add nuw nsw i32 %i.014, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.014, %3
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long long int ll;
void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
ll compare_asc(const void *a,const void *b){return *(ll*)a-*(ll*)b;}
ll compare_desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;}
ll max(ll x,ll y){return x>y?x:y;}
ll min(ll x,ll y){return x>y?y:x;}
/*void qsort(配列のアドレス,配列のサイズ,sizeof(配列の型),比較関数(昇順or降順)) */
int main(){
int n,a[200];
int min=9999,max=-1;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
if(min>a[i])min=a[i];
if(max<a[i])max=a[i];
}
printf("%d\n",max-min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228164/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228164/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
store i64 %1, ptr %x, align 8, !tbaa !5
store i64 %0, ptr %y, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @compare_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
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
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @compare_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
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
ret i64 %sub
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%a = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 800, 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 !9
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = sub nsw i32 %max.1, %spec.select
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ -10000, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%max.026 = phi i32 [ %max.1, %for.body ], [ -1, %entry ]
%min.025 = phi i32 [ %spec.select, %for.body ], [ 9999, %entry ]
%arrayidx = getelementptr inbounds [200 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !9
%spec.select = call i32 @llvm.smin.i32(i32 %min.025, i32 %2)
%max.1 = call i32 @llvm.smax.i32(i32 %max.026, i32 %2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !9
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #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: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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,a[101],i,min=1000,max=0,ans=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(min > a[i])
{
min = a[i];
}
if(max < a[i])
{
max = a[i];
}
}
ans = max - min;
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228214/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228214/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%max.027 = phi i32 [ %max.1, %for.body ], [ 0, %entry ]
%min.026 = phi i32 [ %spec.select, %for.body ], [ 1000, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.026, i32 %1)
%max.1 = call i32 @llvm.smax.i32(i32 %max.027, i32 %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = sub nsw i32 %max.1, %spec.select
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub = phi i32 [ -1000, %entry ], [ %4, %for.end.loopexit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int min,max;
min=10000;
max=-1;
int a;
int N;
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("%d",&a);
if(min>a)min=a;
if(max<a)max=a;
}
printf("%d",max-min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228258/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228258/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = sub nsw i32 %max.1, %spec.select
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ -10001, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%max.013 = phi i32 [ %max.1, %for.body ], [ -1, %entry ]
%min.012 = phi i32 [ %spec.select, %for.body ], [ 10000, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%2 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.012, i32 %2)
%max.1 = call i32 @llvm.smax.i32(i32 %max.013, i32 %2)
%inc = add nuw nsw i32 %i.014, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int cmp(const void *a, const void *b)
{
return *((int *)a) < *((int *)b);
}
int main(int argc, char *argv[])
{
int i, N;
int list[100], v;
int d = 0;
scanf("%d\n", &N);
for ( i = 0; i < N; i++ ){
scanf("%d\n", &v);
list[i] = v;
}
qsort(list, N, sizeof(int), cmp);
for ( i = 1; i < N; i++ ){
d += (list[i-1]-list[i]);
}
printf("%d\n", d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228308/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228308/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%list = alloca [100 x i32], align 16
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %list) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre34 = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [100 x i32], ptr %list, i64 0, i64 %indvars.iv
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre34, %entry.for.end_crit_edge ], [ %3, %for.body ]
call void @qsort(ptr noundef nonnull %list, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #6
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %4, 1
br i1 %cmp324, label %for.body5.preheader, label %for.end13
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %4 to i64
%.pre = load i32, ptr %list, align 16, !tbaa !5
%5 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body5.preheader37, label %vector.ph
vector.ph: ; preds = %for.body5.preheader
%n.vec = and i64 %5, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load36, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%vec.phi35 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds [100 x i32], ptr %list, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load36 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load36, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = add <4 x i32> %8, %vec.phi
%11 = add <4 x i32> %9, %vec.phi35
%12 = sub <4 x i32> %10, %wide.load
%13 = sub <4 x i32> %11, %wide.load36
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %5, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load36, i64 3
br i1 %cmp.n, label %for.end13, label %for.body5.preheader37
for.body5.preheader37: ; preds = %for.body5.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body5.preheader ]
%indvars.iv30.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body5.preheader ]
%d.026.ph = phi i32 [ %15, %middle.block ], [ 0, %for.body5.preheader ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader37, %for.body5
%scalar.recur = phi i32 [ %16, %for.body5 ], [ %scalar.recur.ph, %for.body5.preheader37 ]
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body5 ], [ %indvars.iv30.ph, %for.body5.preheader37 ]
%d.026 = phi i32 [ %add, %for.body5 ], [ %d.026.ph, %for.body5.preheader37 ]
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %list, i64 0, i64 %indvars.iv30
%16 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%sub10 = add i32 %scalar.recur, %d.026
%add = sub i32 %sub10, %16
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%exitcond.not = icmp eq i64 %indvars.iv.next31, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body5, !llvm.loop !14
for.end13: ; preds = %for.body5, %middle.block, %for.end
%d.0.lcssa = phi i32 [ 0, %for.end ], [ %15, %middle.block ], [ %add, %for.body5 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %d.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %list) #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: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define internal i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; 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>) #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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int counter = 0;
for (int i = n; i >= 1; i--) {
if (i % 2 == 1) {
int cnt = 1;
int half = i / 2;
//printf("%d %d\n", i, half);
for (int j = half; j >= 1; j--) {
if (i % j == 0) {
cnt++;
}
}
//printf("%d %d\n",i, cnt);
if (cnt == 8) {
counter++;
}
}
}
printf("%d", counter);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228359/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228359/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc14, %entry
%counter.0.lcssa = phi i32 [ 0, %entry ], [ %counter.2, %for.inc14 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %counter.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.inc14
%i.033 = phi i32 [ %dec15, %for.inc14 ], [ %0, %entry ]
%counter.032 = phi i32 [ %counter.2, %for.inc14 ], [ 0, %entry ]
%rem = and i32 %i.033, 1
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %for.inc14, label %if.then
if.then: ; preds = %for.body
%cmp328.not = icmp ult i32 %i.033, 2
br i1 %cmp328.not, label %for.cond.cleanup4, label %for.body5.preheader
for.body5.preheader: ; preds = %if.then
%div26 = lshr i32 %i.033, 1
br label %for.body5
for.cond.cleanup4: ; preds = %for.body5, %if.then
%cnt.0.lcssa = phi i32 [ 1, %if.then ], [ %spec.select27, %for.body5 ]
%cmp9 = icmp eq i32 %cnt.0.lcssa, 8
%inc11 = zext i1 %cmp9 to i32
%spec.select = add nsw i32 %counter.032, %inc11
br label %for.inc14
for.body5: ; preds = %for.body5.preheader, %for.body5
%j.030 = phi i32 [ %dec, %for.body5 ], [ %div26, %for.body5.preheader ]
%cnt.029 = phi i32 [ %spec.select27, %for.body5 ], [ 1, %for.body5.preheader ]
%rem6 = urem i32 %i.033, %j.030
%cmp7 = icmp eq i32 %rem6, 0
%inc = zext i1 %cmp7 to i32
%spec.select27 = add nuw nsw i32 %cnt.029, %inc
%dec = add nsw i32 %j.030, -1
%cmp3 = icmp ugt i32 %j.030, 1
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !9
for.inc14: ; preds = %for.body, %for.cond.cleanup4
%counter.2 = phi i32 [ %spec.select, %for.cond.cleanup4 ], [ %counter.032, %for.body ]
%dec15 = add nsw i32 %i.033, -1
%cmp = icmp sgt i32 %i.033, 1
br i1 %cmp, label %for.body, 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int n,i,j;
int eight_count = 0;
int tmp = 0;
scanf("%d",&n);
for(int i = 1; i <= n ; i++){
if(i%2 == 1){
for(j = 1; j <= i ; j++){ //約数の数を数える
if(i%j == 0) tmp++;
}
if(tmp == 8) eight_count++;
tmp = 0;
}
}
printf("%d\n",eight_count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228401/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228401/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not30 = icmp slt i32 %0, 1
br i1 %cmp.not30, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add i32 %0, 1
br label %for.body
for.cond.cleanup: ; preds = %for.inc15, %entry
%eight_count.0.lcssa = phi i32 [ 0, %entry ], [ %eight_count.2, %for.inc15 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %eight_count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %for.body.preheader, %for.inc15
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.inc15 ]
%indvars.iv = phi i32 [ 2, %for.body.preheader ], [ %indvars.iv.next, %for.inc15 ]
%i1.032 = phi i32 [ 1, %for.body.preheader ], [ %inc16, %for.inc15 ]
%eight_count.031 = phi i32 [ 0, %for.body.preheader ], [ %eight_count.2, %for.inc15 ]
%rem = and i32 %i1.032, 1
%cmp2.not = icmp eq i32 %rem, 0
br i1 %cmp2.not, label %for.inc15, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body
%xtraiter = and i32 %i1.032, 1
%2 = icmp eq i32 %indvar, 0
br i1 %2, label %for.end.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i32 %i1.032, 2147483646
br label %for.body5
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%tmp.129 = phi i32 [ 0, %for.body5.preheader.new ], [ %spec.select.1, %for.body5 ]
%j.028 = phi i32 [ 1, %for.body5.preheader.new ], [ %inc9.1, %for.body5 ]
%niter = phi i32 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ]
%rem6 = urem i32 %i1.032, %j.028
%cmp7 = icmp eq i32 %rem6, 0
%inc = zext i1 %cmp7 to i32
%spec.select = add nuw nsw i32 %tmp.129, %inc
%inc9 = add nuw i32 %j.028, 1
%rem6.1 = urem i32 %i1.032, %inc9
%cmp7.1 = icmp eq i32 %rem6.1, 0
%inc.1 = zext i1 %cmp7.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc9.1 = add nuw i32 %j.028, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body5, !llvm.loop !9
for.end.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body5.preheader ], [ %spec.select.1, %for.body5 ]
%tmp.129.unr = phi i32 [ 0, %for.body5.preheader ], [ %spec.select.1, %for.body5 ]
%j.028.unr = phi i32 [ 1, %for.body5.preheader ], [ %inc9.1, %for.body5 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body5.epil
for.body5.epil: ; preds = %for.end.unr-lcssa
%rem6.epil = urem i32 %i1.032, %j.028.unr
%cmp7.epil = icmp eq i32 %rem6.epil, 0
%inc.epil = zext i1 %cmp7.epil to i32
%spec.select.epil = add nuw nsw i32 %tmp.129.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body5.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.unr-lcssa ], [ %spec.select.epil, %for.body5.epil ]
%cmp10 = icmp eq i32 %spec.select.lcssa, 8
%inc12 = zext i1 %cmp10 to i32
%spec.select27 = add nsw i32 %eight_count.031, %inc12
br label %for.inc15
for.inc15: ; preds = %for.body, %for.end
%eight_count.2 = phi i32 [ %spec.select27, %for.end ], [ %eight_count.031, %for.body ]
%inc16 = add nuw nsw i32 %i1.032, 1
%indvars.iv.next = add nuw i32 %indvars.iv, 1
%exitcond33.not = icmp eq i32 %indvars.iv, %1
%indvar.next = add i32 %indvar, 1
br i1 %exitcond33.not, label %for.cond.cleanup, 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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define INT_MAX 2147483647
int main(void){
int N;
scanf("%d", &N);
int j;
int count = 0;
for(j=1; j<=N; j++) {
int H[201] = {0};
int x = j;
int i = 3;
while(i <= x && i != 1) {
if(i % 2 != 0) {
if(x % i == 0) {
H[i]++;
x = x / i;
}
else{
i++;
}
}
else{
i++;
}
}
int sum = 1;
for(i=1; i <= j; i++){
if(H[i] != 0) {
sum *= H[i] + 1;
}
}
if(j % 2 != 0 ) {
if(sum == 8) {
count++;
}
}
}
printf("%d\n", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228445/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228445/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%H = alloca [201 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not58 = icmp slt i32 %0, 1
br i1 %cmp.not58, label %for.end32, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 2
%wide.trip.count67 = zext i32 %1 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.end
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.end ]
%indvars.iv64 = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next65, %for.end ]
%count.060 = phi i32 [ 0, %for.body.preheader ], [ %spec.select, %for.end ]
%j.059 = phi i32 [ 1, %for.body.preheader ], [ %inc31, %for.end ]
%2 = add i64 %indvar, 1
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %H) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(804) %H, i8 0, i64 804, i1 false)
%cmp153 = icmp ugt i32 %j.059, 2
br i1 %cmp153, label %while.body, label %for.cond11.preheader
for.cond11.preheader: ; preds = %if.end10, %for.body
%min.iters.check = icmp ult i64 %2, 8
br i1 %min.iters.check, label %for.body13.preheader, label %vector.ph
vector.ph: ; preds = %for.cond11.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %7, %vector.body ]
%vec.phi69 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %8, %vector.body ]
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [201 x i32], ptr %H, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load70 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%6 = add nsw <4 x i32> %wide.load70, <i32 1, i32 1, i32 1, i32 1>
%7 = mul <4 x i32> %5, %vec.phi
%8 = mul <4 x i32> %6, %vec.phi69
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body13.preheader
for.body13.preheader: ; preds = %for.cond11.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.cond11.preheader ], [ %ind.end, %middle.block ]
%sum.057.ph = phi i32 [ 1, %for.cond11.preheader ], [ %10, %middle.block ]
br label %for.body13
while.body: ; preds = %for.body, %if.end10
%i.055 = phi i32 [ %i.1, %if.end10 ], [ 3, %for.body ]
%x.054 = phi i32 [ %x.1, %if.end10 ], [ %j.059, %for.body ]
%11 = and i32 %i.055, 1
%cmp3.not = icmp eq i32 %11, 0
br i1 %cmp3.not, label %if.else8, label %if.then
if.then: ; preds = %while.body
%rem4 = srem i32 %x.054, %i.055
%div = sdiv i32 %x.054, %i.055
%cmp5 = icmp eq i32 %rem4, 0
br i1 %cmp5, label %if.then6, label %if.else
if.then6: ; preds = %if.then
%idxprom = sext i32 %i.055 to i64
%arrayidx = getelementptr inbounds [201 x i32], ptr %H, i64 0, i64 %idxprom
%12 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %12, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
br label %if.end10
if.else: ; preds = %if.then
%inc7 = add nsw i32 %i.055, 1
br label %if.end10
if.else8: ; preds = %while.body
%inc9 = add nuw nsw i32 %i.055, 1
br label %if.end10
if.end10: ; preds = %if.then6, %if.else, %if.else8
%x.1 = phi i32 [ %div, %if.then6 ], [ %x.054, %if.else ], [ %x.054, %if.else8 ]
%i.1 = phi i32 [ %i.055, %if.then6 ], [ %inc7, %if.else ], [ %inc9, %if.else8 ]
%cmp1 = icmp sle i32 %i.1, %x.1
%cmp2 = icmp ne i32 %i.1, 1
%13 = and i1 %cmp1, %cmp2
br i1 %13, label %while.body, label %for.cond11.preheader, !llvm.loop !13
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ %indvars.iv.ph, %for.body13.preheader ]
%sum.057 = phi i32 [ %mul, %for.body13 ], [ %sum.057.ph, %for.body13.preheader ]
%arrayidx15 = getelementptr inbounds [201 x i32], ptr %H, i64 0, i64 %indvars.iv
%14 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%add = add nsw i32 %14, 1
%mul = mul nsw i32 %add, %sum.057
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv64
br i1 %exitcond.not, label %for.end, label %for.body13, !llvm.loop !14
for.end: ; preds = %for.body13, %middle.block
%mul.lcssa = phi i32 [ %10, %middle.block ], [ %mul, %for.body13 ]
%rem22 = and i32 %j.059, 1
%cmp23 = icmp ne i32 %rem22, 0
%cmp25 = icmp eq i32 %mul.lcssa, 8
%or.cond = select i1 %cmp23, i1 %cmp25, i1 false
%inc27 = zext i1 %or.cond to i32
%spec.select = add nuw nsw i32 %count.060, %inc27
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %H) #5
%inc31 = add nuw nsw i32 %j.059, 1
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
%indvar.next = add i64 %indvar, 1
br i1 %exitcond68.not, label %for.end32, label %for.body, !llvm.loop !15
for.end32: ; preds = %for.end, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.end ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main()
{
int n,i,j,ans=0,tmp=0;;
scanf("%d",&n);
for (i=1;i<=n;i++){
for(j=1;j<=i;j++){
if(i%j==0&&i%2==1){
tmp++;
}
}
if(tmp==8){
ans++;
}
tmp=0;
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228489/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228489/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %0, 1
br i1 %cmp.not26, label %for.end14, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%1 = add i32 %0, 1
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.end
%indvar = phi i32 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next, %for.end ]
%indvars.iv = phi i32 [ 2, %for.cond1.preheader.preheader ], [ %indvars.iv.next, %for.end ]
%ans.028 = phi i32 [ 0, %for.cond1.preheader.preheader ], [ %spec.select, %for.end ]
%i.027 = phi i32 [ 1, %for.cond1.preheader.preheader ], [ %inc13, %for.end ]
%2 = add i32 %indvar, 1
%rem5 = and i32 %i.027, 1
%cmp6.not = icmp ne i32 %rem5, 0
%xtraiter = and i32 %2, 1
%3 = icmp eq i32 %indvar, 0
br i1 %3, label %for.end.unr-lcssa, label %for.cond1.preheader.new
for.cond1.preheader.new: ; preds = %for.cond1.preheader
%unroll_iter = and i32 %2, -2
br label %for.body3
for.body3: ; preds = %for.body3, %for.cond1.preheader.new
%tmp.125 = phi i32 [ 0, %for.cond1.preheader.new ], [ %tmp.2.1, %for.body3 ]
%j.024 = phi i32 [ 1, %for.cond1.preheader.new ], [ %inc7.1, %for.body3 ]
%niter = phi i32 [ 0, %for.cond1.preheader.new ], [ %niter.next.1, %for.body3 ]
%rem = urem i32 %i.027, %j.024
%cmp4 = icmp eq i32 %rem, 0
%or.cond.not = and i1 %cmp6.not, %cmp4
%inc = zext i1 %or.cond.not to i32
%tmp.2 = add nuw nsw i32 %tmp.125, %inc
%inc7 = add nuw i32 %j.024, 1
%rem.1 = urem i32 %i.027, %inc7
%cmp4.1 = icmp eq i32 %rem.1, 0
%or.cond.not.1 = and i1 %cmp6.not, %cmp4.1
%inc.1 = zext i1 %or.cond.not.1 to i32
%tmp.2.1 = add nuw nsw i32 %tmp.2, %inc.1
%inc7.1 = add nuw i32 %j.024, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body3, !llvm.loop !9
for.end.unr-lcssa: ; preds = %for.body3, %for.cond1.preheader
%tmp.2.lcssa.ph = phi i32 [ undef, %for.cond1.preheader ], [ %tmp.2.1, %for.body3 ]
%tmp.125.unr = phi i32 [ 0, %for.cond1.preheader ], [ %tmp.2.1, %for.body3 ]
%j.024.unr = phi i32 [ 1, %for.cond1.preheader ], [ %inc7.1, %for.body3 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body3.epil
for.body3.epil: ; preds = %for.end.unr-lcssa
%rem.epil = urem i32 %i.027, %j.024.unr
%cmp4.epil = icmp eq i32 %rem.epil, 0
%or.cond.not.epil = and i1 %cmp6.not, %cmp4.epil
%inc.epil = zext i1 %or.cond.not.epil to i32
%tmp.2.epil = add nuw nsw i32 %tmp.125.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body3.epil
%tmp.2.lcssa = phi i32 [ %tmp.2.lcssa.ph, %for.end.unr-lcssa ], [ %tmp.2.epil, %for.body3.epil ]
%cmp8 = icmp eq i32 %tmp.2.lcssa, 8
%inc10 = zext i1 %cmp8 to i32
%spec.select = add nuw nsw i32 %ans.028, %inc10
%inc13 = add nuw nsw i32 %i.027, 1
%indvars.iv.next = add nuw i32 %indvars.iv, 1
%exitcond29.not = icmp eq i32 %indvars.iv, %1
%indvar.next = add i32 %indvar, 1
br i1 %exitcond29.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !11
for.end14: ; preds = %for.end, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.end ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int n,r=0,i,j,k,c;
scanf("%d",&n);
if(n<105) r=0;
else if(n==105) r=1;
else
{
r=1;
for(i=107;i<=n;i+=2)
{
c=0;
for(j=1;j*j<i;j++)
{
if(j*j==i) c+=1;
else if(i%j==0) c+=2;
}
if(c==8) r++;
}
}
printf("%d\n",r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228531/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228531/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.end24, label %if.else
if.else: ; preds = %entry
%cmp4.not41 = icmp ult i32 %0, 107
br i1 %cmp4.not41, label %if.end24, label %for.cond5.preheader
for.cond5.preheader: ; preds = %if.else, %for.end
%r.043 = phi i32 [ %spec.select38, %for.end ], [ 1, %if.else ]
%i.042 = phi i32 [ %add21, %for.end ], [ 107, %if.else ]
br label %if.else11
if.else11: ; preds = %for.cond5.preheader, %if.else11
%c.040 = phi i32 [ 0, %for.cond5.preheader ], [ %spec.select, %if.else11 ]
%j.039 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %if.else11 ]
%rem = urem i32 %i.042, %j.039
%cmp12 = icmp eq i32 %rem, 0
%add14 = add nsw i32 %c.040, 2
%spec.select = select i1 %cmp12, i32 %add14, i32 %c.040
%inc = add nuw nsw i32 %j.039, 1
%mul = mul nsw i32 %inc, %inc
%cmp6 = icmp ult i32 %mul, %i.042
br i1 %cmp6, label %if.else11, label %for.end, !llvm.loop !9
for.end: ; preds = %if.else11
%cmp16 = icmp eq i32 %spec.select, 8
%inc18 = zext i1 %cmp16 to i32
%spec.select38 = add nuw nsw i32 %r.043, %inc18
%add21 = add nuw nsw i32 %i.042, 2
%cmp4.not = icmp sgt i32 %add21, %0
br i1 %cmp4.not, label %if.end24, label %for.cond5.preheader, !llvm.loop !11
if.end24: ; preds = %for.end, %if.else, %entry
%r.2 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ %spec.select38, %for.end ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int n, c = 0;
scanf( "%d", &n );
//scanf( "%d", &b );
if ( n < 105 ){
printf( "0\n" );
return 0;
}
if ( n == 105 ){
printf( "1\n" );
return 0;
}
int i, j;
c = 1;
for ( i = n; i > 105; i-- ){
int num = 0;
if ( i % 2 == 0 ) continue;
for ( j = 1; j <= i/* / 2 + 1*/; j += 2 ){
if ( i % j == 0 ){
num++;
}
}
if ( num == 8 ){
c++;
}
}
printf( "%d\n", c );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228575/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228575/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts36 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup26
if.end: ; preds = %entry
%cmp2 = icmp eq i32 %0, 105
br i1 %cmp2, label %if.then3, label %for.body
if.then3: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup26
for.body: ; preds = %if.end, %cleanup
%i.043 = phi i32 [ %dec, %cleanup ], [ %0, %if.end ]
%c.042 = phi i32 [ %c.2, %cleanup ], [ 1, %if.end ]
%rem = and i32 %i.043, 1
%cmp7 = icmp eq i32 %rem, 0
br i1 %cmp7, label %cleanup, label %for.body12
for.body12: ; preds = %for.body, %for.body12
%num.040 = phi i32 [ %spec.select, %for.body12 ], [ 0, %for.body ]
%j.039 = phi i32 [ %add, %for.body12 ], [ 1, %for.body ]
%rem13 = urem i32 %i.043, %j.039
%cmp14 = icmp eq i32 %rem13, 0
%inc = zext i1 %cmp14 to i32
%spec.select = add nuw nsw i32 %num.040, %inc
%add = add nuw nsw i32 %j.039, 2
%cmp11.not = icmp ugt i32 %add, %i.043
br i1 %cmp11.not, label %for.end, label %for.body12, !llvm.loop !9
for.end: ; preds = %for.body12
%cmp17 = icmp eq i32 %spec.select, 8
%inc19 = zext i1 %cmp17 to i32
%spec.select37 = add nsw i32 %c.042, %inc19
br label %cleanup
cleanup: ; preds = %for.body, %for.end
%c.2 = phi i32 [ %spec.select37, %for.end ], [ %c.042, %for.body ]
%dec = add nsw i32 %i.043, -1
%cmp6 = icmp sgt i32 %i.043, 106
br i1 %cmp6, label %for.body, label %for.end22, !llvm.loop !11
for.end22: ; preds = %cleanup
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %c.2)
br label %cleanup26
cleanup26: ; preds = %for.end22, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
if(n<105){
puts("0");
return 0;
}
if(n<135){
puts("1");
return 0;
}
if(n<165){
puts("2");
return 0;
}
if(n<189){
puts("3");
return 0;
}
if(n<195){
puts("4");
return 0;
}
puts("5");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228625/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228625/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\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 [2 x i8] c"4\00", align 1
@.str.6 = private unnamed_addr constant [2 x i8] c"5\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 = icmp slt i32 %0, 105
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp2 = icmp ult i32 %0, 135
br i1 %cmp2, label %cleanup, label %if.end5
if.end5: ; preds = %if.end
%cmp6 = icmp ult i32 %0, 165
br i1 %cmp6, label %cleanup, label %if.end9
if.end9: ; preds = %if.end5
%cmp10 = icmp ult i32 %0, 189
br i1 %cmp10, label %cleanup, label %if.end13
if.end13: ; preds = %if.end9
%cmp14 = icmp ult i32 %0, 195
%.str.5..str.6 = select i1 %cmp14, ptr @.str.5, ptr @.str.6
br label %cleanup
cleanup: ; preds = %if.end13, %if.end9, %if.end5, %if.end, %entry
%.str.6.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.end ], [ @.str.3, %if.end5 ], [ @.str.4, %if.end9 ], [ %.str.5..str.6, %if.end13 ]
%call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.6.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
int a, b, i;
char o[51], e[51], s[101];
scanf("%s%s",o,e);
a=strlen(o);
b=strlen(e);
for(i=0;i<a;i++){
s[i*2]=o[i];
s[i*2+1]=e[i];
}
s[a+b]='\0';
printf("%s\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228669/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228669/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%o = alloca [51 x i8], align 16
%e = alloca [51 x i8], align 16
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %o) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %e) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %o, ptr noundef nonnull %e)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %o) #6
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %e) #6
%cmp26 = icmp sgt i32 %conv, 0
br i1 %cmp26, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call3, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 16
br i1 %min.iters.check, label %for.body.preheader35, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call3, 15
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
%invariant.gep = getelementptr i8, ptr %s, i64 -1
%invariant.gep36 = getelementptr i8, ptr %s, i64 -1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds [51 x i8], ptr %o, i64 0, i64 %index
%wide.load = load <8 x i8>, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i8, ptr %0, i64 8
%wide.load31 = load <8 x i8>, ptr %1, align 8, !tbaa !5
%2 = shl nuw nsw i64 %index, 1
%3 = shl i64 %index, 1
%4 = getelementptr inbounds [51 x i8], ptr %e, i64 0, i64 %index
%wide.load32 = load <8 x i8>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i8, ptr %4, i64 8
%wide.load33 = load <8 x i8>, ptr %5, align 8, !tbaa !5
%6 = or i64 %2, 1
%7 = or i64 %3, 17
%gep = getelementptr [101 x i8], ptr %invariant.gep, i64 0, i64 %6
%gep37 = getelementptr [101 x i8], ptr %invariant.gep36, i64 0, i64 %7
%interleaved.vec = shufflevector <8 x i8> %wide.load, <8 x i8> %wide.load32, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec, ptr %gep, align 16, !tbaa !5
%interleaved.vec34 = shufflevector <8 x i8> %wide.load31, <8 x i8> %wide.load33, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec34, ptr %gep37, align 16, !tbaa !5
%index.next = add nuw i64 %index, 16
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %for.body.preheader35
for.body.preheader35: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader35, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader35 ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %o, i64 0, i64 %indvars.iv
%9 = load i8, ptr %arrayidx, align 1, !tbaa !5
%10 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx9 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %10
store i8 %9, ptr %arrayidx9, align 2, !tbaa !5
%arrayidx11 = getelementptr inbounds [51 x i8], ptr %e, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%12 = or i64 %10, 1
%arrayidx14 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %12
store i8 %11, ptr %arrayidx14, align 1, !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.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %middle.block, %entry
%add15 = add i64 %call5, %call3
%sext = shl i64 %add15, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom16
store i8 0, ptr %arrayidx17, align 1, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %e) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %o) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char *o = malloc(50 * sizeof(char)), *e = malloc(50 * sizeof(char));
scanf("%s", o);
scanf("%s", e);
for(int i = 0;i < strlen(o); ++i){
printf("%c",o[i]);
if (i < strlen(e)) printf("%c", e[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228711/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228711/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(50) ptr @malloc(i64 noundef 50) #5
%call1 = tail call noalias dereferenceable_or_null(50) ptr @malloc(i64 noundef 50) #5
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call)
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call1)
%char0 = load i8, ptr %call, align 1
%cmp26.not = icmp eq i8 %char0, 0
br i1 %cmp26.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
ret i32 0
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i8, ptr %call, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv6 = sext i8 %0 to i32
%putchar = tail call i32 @putchar(i32 %conv6)
%call9 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call1) #6
%cmp10 = icmp ugt i64 %call9, %indvars.iv
br i1 %cmp10, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx13 = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv
%1 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%conv14 = sext i8 %1 to i32
%putchar24 = tail call i32 @putchar(i32 %conv14)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #6
%cmp = icmp ugt i64 %call4, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @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 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 #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }
char o[55], e[55];
int main()
{
scanf("%s%s", o, e);
for (int i = 0; i < MAX(strlen(o), strlen(e)); i++)
{
putchar(o[i]);
if (e[i] == 0)
break;
putchar(e[i]);
}
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228755/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228755/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@o = dso_local global [55 x i8] zeroinitializer, align 16
@e = dso_local global [55 x i8] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #6
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6
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 @o, ptr noundef nonnull @e)
%call126 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @o) #7
%call227 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @e) #7
%0 = or i64 %call126, %call227
%cmp629.not = icmp eq i64 %0, 0
br i1 %cmp629.not, label %cleanup, label %for.body
for.body: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [55 x i8], ptr @o, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv8 = sext i8 %1 to i32
%2 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i = tail call noundef i32 @putc(i32 noundef %conv8, ptr noundef %2)
%arrayidx11 = getelementptr inbounds [55 x i8], ptr @e, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%cmp13 = icmp eq i8 %3, 0
br i1 %cmp13, label %cleanup, label %if.end
if.end: ; preds = %for.body
%conv12 = sext i8 %3 to i32
%4 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i24 = tail call noundef i32 @putc(i32 noundef %conv12, ptr noundef %4)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @o) #7
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @e) #7
%call1.call2 = tail call i64 @llvm.umax.i64(i64 %call1, i64 %call2)
%cmp6 = icmp ugt i64 %call1.call2, %indvars.iv.next
br i1 %cmp6, label %for.body, label %cleanup, !llvm.loop !12
cleanup: ; preds = %if.end, %for.body, %entry
%5 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i25 = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %5)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdint.h>
typedef void* flori_fexpr;
typedef int64_t flori_int;
flori_fexpr (*flori_new_fident)(char* s);
flori_fexpr (*flori_new_fseq)();
flori_fexpr (*flori_new_farray)();
flori_fexpr (*flori_new_flist)();
flori_fexpr (*flori_new_fblock)();
flori_fexpr (*flori_new_fintlit)(flori_int s);
flori_fexpr (*flori_new_fstrlit)(char* s);
flori_fexpr (*flori_parse_fexpr)(char* s);
flori_fexpr (*flori_print_fexpr)(char* s);
flori_int (*flori_length)(flori_fexpr fexpr);
void (*flori_push)(flori_fexpr fexpr, flori_fexpr son);
flori_int (*flori_kind)(flori_fexpr fexpr);
void (*flori_expect)(flori_fexpr fexpr, int kind);
void (*flori_error)(flori_fexpr fexpr, char* msg);
flori_fexpr (*flori_access)(flori_fexpr fexpr, flori_int i);
void (*flori_set)(flori_fexpr fexpr, flori_int i, flori_fexpr value);
char* (*flori_to_cs)(flori_fexpr fexpr);
char* (*flori_strval)(flori_fexpr fexpr);
flori_fexpr (*flori_gensym)();
#include "stdbool.h"
#include "stdint.h"
#include "stdint.h"
#include "stdint.h"
#include "stdint.h"
#include "stdint.h"
float core_prelude_slashGG_core_prelude_Int_core_prelude_Int(int64_t core_prelude_a, int64_t core_prelude_b) {
float core_prelude_tmpid0 = (((float)(core_prelude_a)) / ((float)(core_prelude_b)));
return core_prelude_tmpid0;
}
uint32_t core_prelude_uint32GG_core_prelude_Int(int64_t core_prelude_x) {
uint32_t core_prelude_tmpid1 = ((uint32_t)(core_prelude_x));
return core_prelude_tmpid1;
}
int64_t core_prelude_intGG_core_prelude_UInt32(uint32_t core_prelude_x) {
int64_t core_prelude_tmpid2 = ((int64_t)(core_prelude_x));
return core_prelude_tmpid2;
}
float core_prelude_floatGG_core_prelude_Int(int64_t core_prelude_x) {
float core_prelude_tmpid3 = ((float)(core_prelude_x));
return core_prelude_tmpid3;
}
float core_prelude_floatGG_core_prelude_UInt32(uint32_t core_prelude_x) {
float core_prelude_tmpid4 = ((float)(core_prelude_x));
return core_prelude_tmpid4;
}
uint8_t core_prelude_uint8GG_core_prelude_Int(int64_t core_prelude_x) {
uint8_t core_prelude_tmpid5 = ((uint8_t)(core_prelude_x));
return core_prelude_tmpid5;
}
int64_t core_prelude_intGG_core_prelude_UInt8(uint8_t core_prelude_x) {
int64_t core_prelude_tmpid6 = ((int64_t)(core_prelude_x));
return core_prelude_tmpid6;
}
bool core_prelude_true;
bool core_prelude_false;
bool core_prelude_notGG_core_prelude_Bool(bool core_prelude_b) {
bool __floritmp0;
if (core_prelude_b) {
__floritmp0 = core_prelude_false;
} else {
__floritmp0 = core_prelude_true;
}bool core_prelude_tmpid7 = __floritmp0;
return core_prelude_tmpid7;
}
#include "string.h"
bool core_prelude_eqeqGG_core_prelude_CString_core_prelude_CString(char* core_prelude_a, char* core_prelude_b) {
bool __floritmp1;
if ((strcmp(core_prelude_a, core_prelude_b) == 0)) {
__floritmp1 = core_prelude_true;
} else {
__floritmp1 = core_prelude_false;
}bool core_prelude_tmpid8 = __floritmp1;
return core_prelude_tmpid8;
}
bool core_prelude_excleqGG_core_prelude_CString_core_prelude_CString(char* core_prelude_a, char* core_prelude_b) {
bool core_prelude_tmpid9 = core_prelude_notGG_core_prelude_Bool(core_prelude_eqeqGG_core_prelude_CString_core_prelude_CString(core_prelude_a, core_prelude_b));
return core_prelude_tmpid9;
}
#include "time.h"
#include "time.h"
float core_prelude_slashGG_core_prelude_Clock_core_prelude_Int(clock_t core_prelude_a, int64_t core_prelude_b) {
float core_prelude_tmpid10 = (((float)(core_prelude_a)) / ((float)(core_prelude_b)));
return core_prelude_tmpid10;
}
#include "stdio.h"
#include "stdio.h"
#include "stdio.h"
void core_io_printGG_core_prelude_Char(char core_io_x) {
printf("%c", core_io_x);
}
#include "stdio.h"
void core_io_printGG_core_prelude_Int(int64_t core_io_x) {
printf("%d", core_io_x);
}
#include "stdio.h"
void core_io_printGG_core_prelude_UInt8(uint8_t core_io_x) {
printf("%d", core_io_x);
}
#include "stdio.h"
void core_io_printGG_core_prelude_Float(float core_io_x) {
printf("%f", core_io_x);
}
void core_io_printGG_core_prelude_Bool(bool core_io_x) {
if (core_io_x) {
printf("true");
} else {
printf("false");
};
}
#include "stdio.h"
void core_io_printGG_core_prelude_Clock(clock_t core_io_x) {
printf("%lld", core_io_x);
}
#include "stdlib.h"
#include "stdlib.h"
#include "stdlib.h"
#include "string.h"
void* core_pointer_nullGG_() {
void* core_pointer_tmpid11 = ((void*)(0));
return core_pointer_tmpid11;
}
void* core_pointer_null;
int core_macros_FEXPR_IDENT;
int core_macros_FEXPR_PREFIX;
int core_macros_FEXPR_INFIX;
int core_macros_FEXPR_QUOTE;
int core_macros_FEXPR_SYMBOL;
int core_macros_FEXPR_INTLIT;
int core_macros_FEXPR_STRLIT;
int core_macros_FEXPR_SEQ;
int core_macros_FEXPR_ARRAY;
int core_macros_FEXPR_LIST;
int core_macros_FEXPR_BLOCK;
int64_t core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(flori_fexpr core_macros_fexpr, flori_fexpr core_macros_args, int64_t core_macros_count) {
int64_t core_macros_i = 0;
while ((core_macros_i < flori_length(core_macros_fexpr))) {
int core_macros_k = flori_kind(flori_access(core_macros_fexpr, core_macros_i));
if ((core_macros_k == core_macros_FEXPR_QUOTE)) {
flori_set(core_macros_fexpr, core_macros_i, flori_access(core_macros_args, core_macros_count));
(core_macros_count += 1);
} else {
}if ((((core_macros_k == core_macros_FEXPR_SEQ)) || (((core_macros_k == core_macros_FEXPR_ARRAY)) || (((core_macros_k == core_macros_FEXPR_LIST)) || ((core_macros_k == core_macros_FEXPR_BLOCK)))))) {
core_macros_count = core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(flori_access(core_macros_fexpr, core_macros_i), core_macros_args, core_macros_count);
} else {
}(core_macros_i += 1);
};
int64_t core_macros_tmpid12 = core_macros_count;
return core_macros_tmpid12;
}
flori_fexpr core_macros_quote_expandGG_core_macros_FExpr_core_macros_FExpr(flori_fexpr core_macros_fexpr, flori_fexpr core_macros_args) {
int64_t core_macros_count = 0;
int64_t __floritmp5 = core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(core_macros_fexpr, core_macros_args, core_macros_count);
__floritmp5;
flori_fexpr core_macros_tmpid13 = core_macros_fexpr;
return core_macros_tmpid13;
}
#include "string.h"
struct core_string_String {
char* p;
int64_t len;
};
char* core_pointer_allocGcore_prelude_CharG_core_prelude_Int(int64_t core_pointer_len) {
char* core_pointer_tmpid40 = ((char*)(malloc((sizeof(char) * core_pointer_len))));
return core_pointer_tmpid40;
}
void core_pointer_memcpyGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(char* core_pointer_dest, char* core_pointer_src, int64_t core_pointer_len) {
memcpy(((void*)(core_pointer_dest)), ((void*)(core_pointer_src)), (sizeof(char) * core_pointer_len));
}
char* core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(char* core_pointer_p, int64_t core_pointer_i) {
char* core_pointer_tmpid41 = ((char*)((((int64_t)(core_pointer_p)) + core_pointer_i)));
return core_pointer_tmpid41;
}
struct core_string_String core_string_stringGG_core_prelude_CString(char* core_string_cs) {
int64_t core_string_len = strlen(core_string_cs);
struct core_string_String core_string_s = (struct core_string_String){core_pointer_allocGcore_prelude_CharG_core_prelude_Int((core_string_len + 1)), core_string_len};
core_pointer_memcpyGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_string_s.p, ((char*)(core_string_cs)), core_string_len);
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_s.p), core_string_len))) = ((char)(0));
struct core_string_String core_string_tmpid42 = core_string_s;
return core_string_tmpid42;
}
struct core_string_String core_string_stringGG_core_prelude_Int(int64_t core_string_len) {
struct core_string_String core_string_s = (struct core_string_String){core_pointer_allocGcore_prelude_CharG_core_prelude_Int((core_string_len + 1)), core_string_len};
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_s.p), core_string_len))) = ((char)(0));
struct core_string_String core_string_tmpid43 = core_string_s;
return core_string_tmpid43;
}
char core_string_getGG_core_string_String_core_prelude_Int(struct core_string_String core_string_s, int64_t core_string_i) {
char core_string_tmpid44 = (*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_s.p), core_string_i)));
return core_string_tmpid44;
}
char* core_string_to_csGG_core_string_String(struct core_string_String core_string_s) {
char* core_string_tmpid45 = ((char*)(core_string_s.p));
return core_string_tmpid45;
}
int64_t core_string_lengthGG_core_string_String(struct core_string_String core_string_s) {
int64_t core_string_tmpid46 = core_string_s.len;
return core_string_tmpid46;
}
char* core_pointer_reallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(char* core_pointer_ptr, int64_t core_pointer_len) {
char* core_pointer_tmpid47 = ((char*)(realloc(((void*)(core_pointer_ptr)), (sizeof(char) * core_pointer_len))));
return core_pointer_tmpid47;
}
void core_string_pushGG_core_string_String_core_prelude_CString(struct core_string_String* core_string_dest, char* core_string_src) {
int64_t core_string_len = (core_string_lengthGG_core_string_String(*core_string_dest) + strlen(core_string_src));
(core_string_dest->p) = core_pointer_reallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_string_dest->p, (core_string_len + 1));
core_pointer_memcpyGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_lengthGG_core_string_String(*core_string_dest)), ((char*)(core_string_src)), strlen(core_string_src));
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_len))) = ((char)(0));
(core_string_dest->len) = core_string_len;
}
void core_string_pushGG_core_string_String_core_string_String(struct core_string_String* core_string_dest, struct core_string_String core_string_src) {
int64_t core_string_len = (core_string_lengthGG_core_string_String(*core_string_dest) + core_string_lengthGG_core_string_String(core_string_src));
(core_string_dest->p) = core_pointer_reallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_string_dest->p, (core_string_len + 1));
core_pointer_memcpyGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_lengthGG_core_string_String(*core_string_dest)), core_string_src.p, core_string_lengthGG_core_string_String(core_string_src));
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_len))) = ((char)(0));
(core_string_dest->len) = core_string_len;
}
void core_string_pushGG_core_string_String_core_prelude_Char(struct core_string_String* core_string_dest, char core_string_c) {
int64_t core_string_len = (core_string_lengthGG_core_string_String(*core_string_dest) + 1);
(core_string_dest->p) = core_pointer_reallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(core_string_dest->p, (core_string_len + 1));
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_lengthGG_core_string_String(*core_string_dest)))) = core_string_c;
(*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int((core_string_dest->p), core_string_len))) = ((char)(0));
(core_string_dest->len) = core_string_len;
}
void core_string_printGG_core_string_String(struct core_string_String core_string_s) {
printf(((char*)(core_string_s.p)));
}
void core_pointer_deallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char(char* core_pointer_ptr) {
free(((void*)(core_pointer_ptr)));
}
void core_string_destructGG_core_string_String(struct core_string_String core_string_s) {
core_pointer_deallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char(core_string_s.p);
}
struct core_string_String core_string_andGG_core_string_String_core_string_String(struct core_string_String core_string_a, struct core_string_String core_string_b) {
struct core_string_String core_string_ret = core_string_stringGG_core_prelude_CString("");
core_string_pushGG_core_string_String_core_string_String(&core_string_ret, core_string_a);
core_string_pushGG_core_string_String_core_string_String(&core_string_ret, core_string_b);
struct core_string_String core_string_tmpid48 = core_string_ret;
return core_string_tmpid48;
}
struct core_string_String core_string_reverseGG_core_string_String(struct core_string_String core_string_a) {
struct core_string_String core_string_ret = core_string_stringGG_core_prelude_CString("");
int64_t core_string_i = 0;
while ((core_string_i <= (core_string_lengthGG_core_string_String(core_string_a) - 1))) {
core_string_pushGG_core_string_String_core_prelude_Char(&core_string_ret, core_string_getGG_core_string_String_core_prelude_Int(core_string_a, (((core_string_lengthGG_core_string_String(core_string_a) - core_string_i)) - 1)));
;
(core_string_i += 1);
};
;
;
struct core_string_String core_string_tmpid49 = core_string_ret;
return core_string_tmpid49;
}
struct core_string_String core_string_to_sGG_core_prelude_Int(int64_t core_string_val) {
int64_t core_string_x = core_string_val;
struct core_string_String core_string_str = core_string_stringGG_core_prelude_CString("");
if ((core_string_x == 0)) {
core_string_pushGG_core_string_String_core_prelude_Char(&core_string_str, ((char)(48)));
} else {
}while ((core_string_x > 0)) {
core_string_pushGG_core_string_String_core_prelude_Char(&core_string_str, ((char)((48 + ((core_string_x % 10))))));
core_string_x = ((int64_t)(core_prelude_slashGG_core_prelude_Int_core_prelude_Int(core_string_x, 10)));
};
struct core_string_String core_string_tmpid50 = core_string_reverseGG_core_string_String(core_string_str);
core_string_destructGG_core_string_String(core_string_str);
return core_string_tmpid50;
}
char core_string_cr;
char core_string_lf;
char core_string_getGG_core_prelude_CString_core_prelude_Int(char* core_string_cs, int64_t core_string_i) {
char core_string_tmpid51 = (*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(((char*)(core_string_cs)), core_string_i)));
return core_string_tmpid51;
}
struct core_string_String core_string_replaceGG_core_prelude_CString_core_prelude_Char_core_prelude_CString(char* core_string_s, char core_string_dst, char* core_string_src) {
struct core_string_String core_string_newstr = core_string_stringGG_core_prelude_CString("");
int64_t core_string_i = 0;
while ((core_string_i <= (strlen(core_string_s) - 1))) {
if ((core_string_getGG_core_prelude_CString_core_prelude_Int(core_string_s, core_string_i) == core_string_dst)) {
core_string_pushGG_core_string_String_core_prelude_CString(&core_string_newstr, core_string_src);
} else {
core_string_pushGG_core_string_String_core_prelude_Char(&core_string_newstr, core_string_getGG_core_prelude_CString_core_prelude_Int(core_string_s, core_string_i));
};
;
(core_string_i += 1);
};
;
;
struct core_string_String core_string_tmpid52 = core_string_newstr;
return core_string_tmpid52;
}
#include "stdio.h"
#include "stdio.h"
int64_t stdio_read_intGG_() {
int64_t stdio_ret;
scanf("%d", &stdio_ret);
int64_t stdio_tmpid56 = stdio_ret;
return stdio_tmpid56;
}
struct Array10240_core_prelude_Char { char data[10240]; };
#include "stdio.h"
struct core_string_String stdio_read_stringGG_() {
struct Array10240_core_prelude_Char stdio_s;
scanf("%s", &((&stdio_s)->data[0]));
struct core_string_String stdio_tmpid57 = core_string_stringGG_core_prelude_CString(((char*)(&((&stdio_s)->data[0]))));
return stdio_tmpid57;
}
void core_io_printlnGcore_string_StringG_core_string_String(struct core_string_String core_io_x) {
core_string_printGG_core_string_String(core_io_x);
printf("\n");
}
void a2_mainGG_() {
struct core_string_String a2_o = stdio_read_stringGG_();
struct core_string_String a2_e = stdio_read_stringGG_();
struct core_string_String a2_s = core_string_stringGG_core_prelude_CString("");
int64_t a2_i = 0;
while ((a2_i <= (core_string_lengthGG_core_string_String(a2_o) - 1))) {
core_string_pushGG_core_string_String_core_prelude_Char(&a2_s, core_string_getGG_core_string_String_core_prelude_Int(a2_o, a2_i));
if ((a2_i < core_string_lengthGG_core_string_String(a2_e))) {
core_string_pushGG_core_string_String_core_prelude_Char(&a2_s, core_string_getGG_core_string_String_core_prelude_Int(a2_e, a2_i));
} else {
};
;
(a2_i += 1);
};
;
;
core_io_printlnGcore_string_StringG_core_string_String(a2_s);
core_string_destructGG_core_string_String(a2_s);
core_string_destructGG_core_string_String(a2_e);
core_string_destructGG_core_string_String(a2_o);
}
void flori_main() {
core_prelude_true = ((bool)(1));
core_prelude_false = ((bool)(0));
core_pointer_null = core_pointer_nullGG_();
core_macros_FEXPR_IDENT = ((int)(0));
core_macros_FEXPR_PREFIX = ((int)(1));
core_macros_FEXPR_INFIX = ((int)(2));
core_macros_FEXPR_QUOTE = ((int)(3));
core_macros_FEXPR_SYMBOL = ((int)(4));
core_macros_FEXPR_INTLIT = ((int)(5));
core_macros_FEXPR_STRLIT = ((int)(6));
core_macros_FEXPR_SEQ = ((int)(7));
core_macros_FEXPR_ARRAY = ((int)(8));
core_macros_FEXPR_LIST = ((int)(9));
core_macros_FEXPR_BLOCK = ((int)(10));
;
;
;
;
;
;
core_string_cr = ((char)(13));
core_string_lf = ((char)(10));
a2_mainGG_();
}
int main(int argc, char** argv) { flori_main(); }
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228799/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228799/source.c"
target datalayout = "e-m:e-p270: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.Array10240_core_prelude_Char = type { [10240 x i8] }
@core_prelude_false = dso_local local_unnamed_addr global i8 0, align 1
@core_prelude_true = dso_local local_unnamed_addr global i8 0, 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"%f\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"true\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"false\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@flori_length = dso_local local_unnamed_addr global ptr null, align 8
@flori_kind = dso_local local_unnamed_addr global ptr null, align 8
@flori_access = dso_local local_unnamed_addr global ptr null, align 8
@core_macros_FEXPR_QUOTE = dso_local local_unnamed_addr global i32 0, align 4
@flori_set = dso_local local_unnamed_addr global ptr null, align 8
@core_macros_FEXPR_SEQ = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_ARRAY = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_LIST = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_BLOCK = dso_local local_unnamed_addr global i32 0, align 4
@.str.7 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@core_pointer_null = dso_local local_unnamed_addr global ptr null, align 8
@core_macros_FEXPR_IDENT = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_PREFIX = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_INFIX = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_SYMBOL = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_INTLIT = dso_local local_unnamed_addr global i32 0, align 4
@core_macros_FEXPR_STRLIT = dso_local local_unnamed_addr global i32 0, align 4
@core_string_cr = dso_local local_unnamed_addr global i8 0, align 1
@core_string_lf = dso_local local_unnamed_addr global i8 0, align 1
@flori_new_fident = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_fseq = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_farray = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_flist = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_fblock = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_fintlit = dso_local local_unnamed_addr global ptr null, align 8
@flori_new_fstrlit = dso_local local_unnamed_addr global ptr null, align 8
@flori_parse_fexpr = dso_local local_unnamed_addr global ptr null, align 8
@flori_print_fexpr = dso_local local_unnamed_addr global ptr null, align 8
@flori_push = dso_local local_unnamed_addr global ptr null, align 8
@flori_expect = dso_local local_unnamed_addr global ptr null, align 8
@flori_error = dso_local local_unnamed_addr global ptr null, align 8
@flori_to_cs = dso_local local_unnamed_addr global ptr null, align 8
@flori_strval = dso_local local_unnamed_addr global ptr null, align 8
@flori_gensym = dso_local local_unnamed_addr global ptr null, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local float @core_prelude_slashGG_core_prelude_Int_core_prelude_Int(i64 noundef %core_prelude_a, i64 noundef %core_prelude_b) local_unnamed_addr #0 {
entry:
%conv = sitofp i64 %core_prelude_a to float
%conv1 = sitofp i64 %core_prelude_b to float
%div = fdiv float %conv, %conv1
ret float %div
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @core_prelude_uint32GG_core_prelude_Int(i64 noundef %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = trunc i64 %core_prelude_x to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @core_prelude_intGG_core_prelude_UInt32(i32 noundef %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = zext i32 %core_prelude_x to i64
ret i64 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local float @core_prelude_floatGG_core_prelude_Int(i64 noundef %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = sitofp i64 %core_prelude_x to float
ret float %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local float @core_prelude_floatGG_core_prelude_UInt32(i32 noundef %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = uitofp i32 %core_prelude_x to float
ret float %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i8 @core_prelude_uint8GG_core_prelude_Int(i64 noundef %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = trunc i64 %core_prelude_x to i8
ret i8 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @core_prelude_intGG_core_prelude_UInt8(i8 noundef zeroext %core_prelude_x) local_unnamed_addr #0 {
entry:
%conv = zext i8 %core_prelude_x to i64
ret i64 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @core_prelude_notGG_core_prelude_Bool(i1 noundef zeroext %core_prelude_b) local_unnamed_addr #2 {
entry:
%core_prelude_false.val = load i8, ptr @core_prelude_false, align 1
%core_prelude_true.val = load i8, ptr @core_prelude_true, align 1
%__floritmp0.0 = select i1 %core_prelude_b, i8 %core_prelude_false.val, i8 %core_prelude_true.val
%tobool5 = icmp ne i8 %__floritmp0.0, 0
ret i1 %tobool5
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @core_prelude_eqeqGG_core_prelude_CString_core_prelude_CString(ptr nocapture noundef readonly %core_prelude_a, ptr nocapture noundef readonly %core_prelude_b) local_unnamed_addr #3 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %core_prelude_a, ptr noundef nonnull dereferenceable(1) %core_prelude_b) #20
%cmp = icmp eq i32 %call, 0
%core_prelude_true.val = load i8, ptr @core_prelude_true, align 1
%core_prelude_false.val = load i8, ptr @core_prelude_false, align 1
%__floritmp1.0 = select i1 %cmp, i8 %core_prelude_true.val, i8 %core_prelude_false.val
%tobool3 = icmp ne i8 %__floritmp1.0, 0
ret i1 %tobool3
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local zeroext i1 @core_prelude_excleqGG_core_prelude_CString_core_prelude_CString(ptr nocapture noundef readonly %core_prelude_a, ptr nocapture noundef readonly %core_prelude_b) local_unnamed_addr #3 {
entry:
%call.i = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %core_prelude_a, ptr noundef nonnull dereferenceable(1) %core_prelude_b) #20
%cmp.i = icmp eq i32 %call.i, 0
%core_prelude_true.val.i = load i8, ptr @core_prelude_true, align 1
%core_prelude_false.val.i = load i8, ptr @core_prelude_false, align 1
%__floritmp1.0.i = select i1 %cmp.i, i8 %core_prelude_true.val.i, i8 %core_prelude_false.val.i
%tobool3.i.not = icmp eq i8 %__floritmp1.0.i, 0
%__floritmp0.0.i = select i1 %tobool3.i.not, i8 %core_prelude_true.val.i, i8 %core_prelude_false.val.i
%tobool5.i = icmp ne i8 %__floritmp0.0.i, 0
ret i1 %tobool5.i
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local float @core_prelude_slashGG_core_prelude_Clock_core_prelude_Int(i64 noundef %core_prelude_a, i64 noundef %core_prelude_b) local_unnamed_addr #0 {
entry:
%conv = sitofp i64 %core_prelude_a to float
%conv1 = sitofp i64 %core_prelude_b to float
%div = fdiv float %conv, %conv1
ret float %div
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_Char(i8 noundef signext %core_io_x) local_unnamed_addr #5 {
entry:
%conv = sext i8 %core_io_x to i32
%putchar = tail call i32 @putchar(i32 %conv)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_Int(i64 noundef %core_io_x) local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %core_io_x)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_UInt8(i8 noundef zeroext %core_io_x) local_unnamed_addr #5 {
entry:
%conv = zext i8 %core_io_x to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_Float(float noundef %core_io_x) local_unnamed_addr #5 {
entry:
%conv = fpext float %core_io_x to double
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %conv)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_Bool(i1 noundef zeroext %core_io_x) local_unnamed_addr #5 {
entry:
%.str.3..str.4 = select i1 %core_io_x, ptr @.str.3, ptr @.str.4
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.4)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printGG_core_prelude_Clock(i64 noundef %core_io_x) local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %core_io_x)
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noalias ptr @core_pointer_nullGG_() local_unnamed_addr #0 {
entry:
ret ptr null
}
; Function Attrs: nounwind uwtable
define dso_local i64 @core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(ptr noundef %core_macros_fexpr, ptr noundef %core_macros_args, i64 noundef %core_macros_count) local_unnamed_addr #7 {
entry:
%0 = load ptr, ptr @flori_length, align 8, !tbaa !5
%call39 = tail call i64 %0(ptr noundef %core_macros_fexpr) #21
%cmp40 = icmp sgt i64 %call39, 0
br i1 %cmp40, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end20
%core_macros_count.addr.042 = phi i64 [ %core_macros_count.addr.2, %if.end20 ], [ %core_macros_count, %entry ]
%core_macros_i.041 = phi i64 [ %add21, %if.end20 ], [ 0, %entry ]
%1 = load ptr, ptr @flori_kind, align 8, !tbaa !5
%2 = load ptr, ptr @flori_access, align 8, !tbaa !5
%call1 = tail call ptr %2(ptr noundef %core_macros_fexpr, i64 noundef %core_macros_i.041) #21
%call2 = tail call i64 %1(ptr noundef %call1) #21
%conv = trunc i64 %call2 to i32
%3 = load i32, ptr @core_macros_FEXPR_QUOTE, align 4, !tbaa !9
%cmp3 = icmp eq i32 %3, %conv
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %while.body
%4 = load ptr, ptr @flori_set, align 8, !tbaa !5
%5 = load ptr, ptr @flori_access, align 8, !tbaa !5
%call5 = tail call ptr %5(ptr noundef %core_macros_args, i64 noundef %core_macros_count.addr.042) #21
tail call void %4(ptr noundef %core_macros_fexpr, i64 noundef %core_macros_i.041, ptr noundef %call5) #21
%add = add nsw i64 %core_macros_count.addr.042, 1
br label %if.end
if.end: ; preds = %while.body, %if.then
%core_macros_count.addr.1 = phi i64 [ %add, %if.then ], [ %core_macros_count.addr.042, %while.body ]
%6 = load i32, ptr @core_macros_FEXPR_SEQ, align 4, !tbaa !9
%cmp6 = icmp eq i32 %6, %conv
%7 = load i32, ptr @core_macros_FEXPR_ARRAY, align 4
%cmp8 = icmp eq i32 %7, %conv
%or.cond = select i1 %cmp6, i1 true, i1 %cmp8
%8 = load i32, ptr @core_macros_FEXPR_LIST, align 4
%cmp11 = icmp eq i32 %8, %conv
%or.cond37 = select i1 %or.cond, i1 true, i1 %cmp11
%9 = load i32, ptr @core_macros_FEXPR_BLOCK, align 4
%cmp14 = icmp eq i32 %9, %conv
%or.cond38 = select i1 %or.cond37, i1 true, i1 %cmp14
br i1 %or.cond38, label %if.then16, label %if.end20
if.then16: ; preds = %if.end
%10 = load ptr, ptr @flori_access, align 8, !tbaa !5
%call17 = tail call ptr %10(ptr noundef %core_macros_fexpr, i64 noundef %core_macros_i.041) #21
%call18 = tail call i64 @core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(ptr noundef %call17, ptr noundef %core_macros_args, i64 noundef %core_macros_count.addr.1)
br label %if.end20
if.end20: ; preds = %if.end, %if.then16
%core_macros_count.addr.2 = phi i64 [ %call18, %if.then16 ], [ %core_macros_count.addr.1, %if.end ]
%add21 = add nuw nsw i64 %core_macros_i.041, 1
%11 = load ptr, ptr @flori_length, align 8, !tbaa !5
%call = tail call i64 %11(ptr noundef %core_macros_fexpr) #21
%cmp = icmp slt i64 %add21, %call
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %if.end20, %entry
%core_macros_count.addr.0.lcssa = phi i64 [ %core_macros_count, %entry ], [ %core_macros_count.addr.2, %if.end20 ]
ret i64 %core_macros_count.addr.0.lcssa
}
; Function Attrs: nounwind uwtable
define dso_local ptr @core_macros_quote_expandGG_core_macros_FExpr_core_macros_FExpr(ptr noundef returned %core_macros_fexpr, ptr noundef %core_macros_args) local_unnamed_addr #7 {
entry:
%call = tail call i64 @core_macros_quote_expand_insideGG_core_macros_FExpr_core_macros_FExpr_core_prelude_Int(ptr noundef %core_macros_fexpr, ptr noundef %core_macros_args, i64 noundef 0)
ret ptr %core_macros_fexpr
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @core_pointer_allocGcore_prelude_CharG_core_prelude_Int(i64 noundef %core_pointer_len) local_unnamed_addr #8 {
entry:
%call = tail call noalias ptr @malloc(i64 noundef %core_pointer_len) #22
ret ptr %call
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #9
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @core_pointer_memcpyGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(ptr nocapture noundef writeonly %core_pointer_dest, ptr nocapture noundef readonly %core_pointer_src, i64 noundef %core_pointer_len) local_unnamed_addr #10 {
entry:
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %core_pointer_dest, ptr align 1 %core_pointer_src, i64 %core_pointer_len, i1 false)
ret void
}
; 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) #11
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local ptr @core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(ptr noundef %core_pointer_p, i64 noundef %core_pointer_i) local_unnamed_addr #0 {
entry:
%0 = ptrtoint ptr %core_pointer_p to i64
%add = add nsw i64 %0, %core_pointer_i
%1 = inttoptr i64 %add to ptr
ret ptr %1
}
; Function Attrs: mustprogress nofree nounwind willreturn uwtable
define dso_local { ptr, i64 } @core_string_stringGG_core_prelude_CString(ptr nocapture noundef readonly %core_string_cs) local_unnamed_addr #12 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_cs) #20
%add = add nsw i64 %call, 1
%call.i = tail call noalias ptr @malloc(i64 noundef %add) #22
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call.i, ptr align 1 %core_string_cs, i64 %call, i1 false)
%0 = ptrtoint ptr %call.i to i64
%add.i = add nsw i64 %call, %0
%1 = inttoptr i64 %add.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %call.i, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 %call, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, inaccessiblemem: readwrite) uwtable
define dso_local { ptr, i64 } @core_string_stringGG_core_prelude_Int(i64 noundef %core_string_len) local_unnamed_addr #13 {
entry:
%add = add nsw i64 %core_string_len, 1
%call.i = tail call noalias ptr @malloc(i64 noundef %add) #22
%0 = ptrtoint ptr %call.i to i64
%add.i = add nsw i64 %0, %core_string_len
%1 = inttoptr i64 %add.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %call.i, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 %core_string_len, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local signext i8 @core_string_getGG_core_string_String_core_prelude_Int(ptr %core_string_s.coerce0, i64 %core_string_s.coerce1, i64 noundef %core_string_i) local_unnamed_addr #14 {
entry:
%0 = ptrtoint ptr %core_string_s.coerce0 to i64
%add.i = add nsw i64 %0, %core_string_i
%1 = inttoptr i64 %add.i to ptr
%2 = load i8, ptr %1, align 1, !tbaa !13
ret i8 %2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local ptr @core_string_to_csGG_core_string_String(ptr readnone returned %core_string_s.coerce0, i64 %core_string_s.coerce1) local_unnamed_addr #0 {
entry:
ret ptr %core_string_s.coerce0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @core_string_lengthGG_core_string_String(ptr nocapture readnone %core_string_s.coerce0, i64 returned %core_string_s.coerce1) local_unnamed_addr #0 {
entry:
ret i64 %core_string_s.coerce1
}
; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @core_pointer_reallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(ptr nocapture noundef %core_pointer_ptr, i64 noundef %core_pointer_len) local_unnamed_addr #15 {
entry:
%call = tail call ptr @realloc(ptr noundef %core_pointer_ptr, i64 noundef %core_pointer_len) #23
ret ptr %call
}
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #16
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @core_string_pushGG_core_string_String_core_prelude_CString(ptr nocapture noundef %core_string_dest, ptr nocapture noundef readonly %core_string_src) local_unnamed_addr #17 {
entry:
%0 = getelementptr inbounds { ptr, i64 }, ptr %core_string_dest, i64 0, i32 1
%1 = load i64, ptr %0, align 8
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_src) #20
%add = add i64 %call1, %1
%2 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%add2 = add nsw i64 %add, 1
%call.i = tail call noalias ptr @realloc(ptr noundef %2, i64 noundef %add2) #23
store ptr %call.i, ptr %core_string_dest, align 8, !tbaa !14
%3 = load i64, ptr %0, align 8
%4 = ptrtoint ptr %call.i to i64
%add.i = add nsw i64 %3, %4
%5 = inttoptr i64 %add.i to ptr
%call8 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_src) #20
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %5, ptr align 1 %core_string_src, i64 %call8, i1 false)
%6 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%7 = ptrtoint ptr %6 to i64
%add.i21 = add nsw i64 %add, %7
%8 = inttoptr i64 %add.i21 to ptr
store i8 0, ptr %8, align 1, !tbaa !13
store i64 %add, ptr %0, align 8, !tbaa !17
ret void
}
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @core_string_pushGG_core_string_String_core_string_String(ptr nocapture noundef %core_string_dest, ptr nocapture readonly %core_string_src.coerce0, i64 %core_string_src.coerce1) local_unnamed_addr #17 {
entry:
%0 = getelementptr inbounds { ptr, i64 }, ptr %core_string_dest, i64 0, i32 1
%1 = load i64, ptr %0, align 8
%add = add nsw i64 %1, %core_string_src.coerce1
%2 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%add2 = add nsw i64 %add, 1
%call.i = tail call noalias ptr @realloc(ptr noundef %2, i64 noundef %add2) #23
store ptr %call.i, ptr %core_string_dest, align 8, !tbaa !14
%3 = load i64, ptr %0, align 8
%4 = ptrtoint ptr %call.i to i64
%add.i = add nsw i64 %3, %4
%5 = inttoptr i64 %add.i to ptr
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %5, ptr align 1 %core_string_src.coerce0, i64 %core_string_src.coerce1, i1 false)
%6 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%7 = ptrtoint ptr %6 to i64
%add.i23 = add nsw i64 %add, %7
%8 = inttoptr i64 %add.i23 to ptr
store i8 0, ptr %8, align 1, !tbaa !13
store i64 %add, ptr %0, align 8, !tbaa !17
ret void
}
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @core_string_pushGG_core_string_String_core_prelude_Char(ptr nocapture noundef %core_string_dest, i8 noundef signext %core_string_c) local_unnamed_addr #17 {
entry:
%0 = getelementptr inbounds { ptr, i64 }, ptr %core_string_dest, i64 0, i32 1
%1 = load i64, ptr %0, align 8
%add = add nsw i64 %1, 1
%2 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%add1 = add nsw i64 %1, 2
%call.i = tail call noalias ptr @realloc(ptr noundef %2, i64 noundef %add1) #23
store ptr %call.i, ptr %core_string_dest, align 8, !tbaa !14
%3 = load i64, ptr %0, align 8
%4 = ptrtoint ptr %call.i to i64
%add.i = add nsw i64 %3, %4
%5 = inttoptr i64 %add.i to ptr
store i8 %core_string_c, ptr %5, align 1, !tbaa !13
%6 = load ptr, ptr %core_string_dest, align 8, !tbaa !14
%7 = ptrtoint ptr %6 to i64
%add.i17 = add nsw i64 %add, %7
%8 = inttoptr i64 %add.i17 to ptr
store i8 0, ptr %8, align 1, !tbaa !13
store i64 %add, ptr %0, align 8, !tbaa !17
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_string_printGG_core_string_String(ptr nocapture readonly %core_string_s.coerce0, i64 %core_string_s.coerce1) local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %core_string_s.coerce0)
ret void
}
; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local void @core_pointer_deallocGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char(ptr nocapture noundef %core_pointer_ptr) local_unnamed_addr #15 {
entry:
tail call void @free(ptr noundef %core_pointer_ptr) #21
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #18
; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable
define dso_local void @core_string_destructGG_core_string_String(ptr nocapture %core_string_s.coerce0, i64 %core_string_s.coerce1) local_unnamed_addr #15 {
entry:
tail call void @free(ptr noundef %core_string_s.coerce0) #21
ret void
}
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local { ptr, i64 } @core_string_andGG_core_string_String_core_string_String(ptr nocapture readonly %core_string_a.coerce0, i64 %core_string_a.coerce1, ptr nocapture readonly %core_string_b.coerce0, i64 %core_string_b.coerce1) local_unnamed_addr #17 {
entry:
%call.i.i = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i, align 1, !tbaa !13
%add2.i = add nsw i64 %core_string_a.coerce1, 1
%call.i.i2 = tail call noalias ptr @realloc(ptr noundef nonnull %call.i.i, i64 noundef %add2.i) #23
%0 = ptrtoint ptr %call.i.i2 to i64
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call.i.i2, ptr align 1 %core_string_a.coerce0, i64 %core_string_a.coerce1, i1 false)
%add.i23.i = add nsw i64 %0, %core_string_a.coerce1
%1 = inttoptr i64 %add.i23.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
%add.i4 = add nsw i64 %core_string_b.coerce1, %core_string_a.coerce1
%add2.i5 = add nsw i64 %add.i4, 1
%call.i.i6 = tail call noalias ptr @realloc(ptr noundef %call.i.i2, i64 noundef %add2.i5) #23
%2 = ptrtoint ptr %call.i.i6 to i64
%add.i.i7 = add nsw i64 %2, %core_string_a.coerce1
%3 = inttoptr i64 %add.i.i7 to ptr
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %3, ptr align 1 %core_string_b.coerce0, i64 %core_string_b.coerce1, i1 false)
%add.i23.i8 = add nsw i64 %add.i4, %2
%4 = inttoptr i64 %add.i23.i8 to ptr
store i8 0, ptr %4, align 1, !tbaa !13
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %call.i.i6, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 %add.i4, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: nounwind uwtable
define dso_local { ptr, i64 } @core_string_reverseGG_core_string_String(ptr %core_string_a.coerce0, i64 %core_string_a.coerce1) local_unnamed_addr #7 {
entry:
%call.i.i = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i, align 1, !tbaa !13
%cmp.not.not19 = icmp sgt i64 %core_string_a.coerce1, 0
br i1 %cmp.not.not19, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%0 = ptrtoint ptr %core_string_a.coerce0 to i64
%sub4 = add i64 %0, %core_string_a.coerce1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%core_string_i.022 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ]
%core_string_ret.sroa.0.021 = phi ptr [ %call.i.i, %while.body.lr.ph ], [ %call.i.i14, %while.body ]
%1 = xor i64 %core_string_i.022, -1
%add.i.i12 = add i64 %sub4, %1
%2 = inttoptr i64 %add.i.i12 to ptr
%3 = load i8, ptr %2, align 1, !tbaa !13
%add = add nuw nsw i64 %core_string_i.022, 1
%add1.i = add nuw nsw i64 %core_string_i.022, 2
%call.i.i14 = tail call noalias ptr @realloc(ptr noundef %core_string_ret.sroa.0.021, i64 noundef %add1.i) #23
%4 = ptrtoint ptr %call.i.i14 to i64
%add.i.i15 = add nsw i64 %core_string_i.022, %4
%5 = inttoptr i64 %add.i.i15 to ptr
store i8 %3, ptr %5, align 1, !tbaa !13
%add.i17.i = add nsw i64 %add, %4
%6 = inttoptr i64 %add.i17.i to ptr
store i8 0, ptr %6, align 1, !tbaa !13
%exitcond.not = icmp eq i64 %add, %core_string_a.coerce1
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !18
while.end: ; preds = %while.body, %entry
%core_string_ret.sroa.7.0.lcssa = phi i64 [ 0, %entry ], [ %core_string_a.coerce1, %while.body ]
%core_string_ret.sroa.0.0.lcssa = phi ptr [ %call.i.i, %entry ], [ %call.i.i14, %while.body ]
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %core_string_ret.sroa.0.0.lcssa, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 %core_string_ret.sroa.7.0.lcssa, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: nounwind uwtable
define dso_local { ptr, i64 } @core_string_to_sGG_core_prelude_Int(i64 noundef %core_string_val) local_unnamed_addr #7 {
entry:
%call.i.i = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i, align 1, !tbaa !13
%cmp = icmp eq i64 %core_string_val, 0
br i1 %cmp, label %if.end.thread, label %if.end
if.end.thread: ; preds = %entry
%call.i.i9 = tail call noalias dereferenceable_or_null(2) ptr @realloc(ptr noundef nonnull %call.i.i, i64 noundef 2) #23
%0 = ptrtoint ptr %call.i.i9 to i64
store i8 48, ptr %call.i.i9, align 1, !tbaa !13
%add.i17.i = add nsw i64 %0, 1
%1 = inttoptr i64 %add.i17.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
br label %while.body.lr.ph.i
if.end: ; preds = %entry
%cmp129 = icmp sgt i64 %core_string_val, 0
br i1 %cmp129, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%core_string_x.032 = phi i64 [ %conv3, %while.body ], [ %core_string_val, %if.end ]
%core_string_str.sroa.0.131 = phi ptr [ %call.i.i13, %while.body ], [ %call.i.i, %if.end ]
%core_string_str.sroa.11.130 = phi i64 [ %add.i11, %while.body ], [ 0, %if.end ]
%rem = urem i64 %core_string_x.032, 10
%2 = trunc i64 %rem to i8
%conv = or i8 %2, 48
%add.i11 = add nuw nsw i64 %core_string_str.sroa.11.130, 1
%add1.i12 = add nuw nsw i64 %core_string_str.sroa.11.130, 2
%call.i.i13 = tail call noalias ptr @realloc(ptr noundef %core_string_str.sroa.0.131, i64 noundef %add1.i12) #23
%3 = ptrtoint ptr %call.i.i13 to i64
%add.i.i14 = add nsw i64 %core_string_str.sroa.11.130, %3
%4 = inttoptr i64 %add.i.i14 to ptr
store i8 %conv, ptr %4, align 1, !tbaa !13
%add.i17.i15 = add nsw i64 %add.i11, %3
%5 = inttoptr i64 %add.i17.i15 to ptr
store i8 0, ptr %5, align 1, !tbaa !13
%conv.i = sitofp i64 %core_string_x.032 to float
%div.i = fdiv float %conv.i, 1.000000e+01
%conv3 = fptosi float %div.i to i64
%cmp1 = icmp sgt i64 %conv3, 0
br i1 %cmp1, label %while.body, label %while.body.lr.ph.i, !llvm.loop !19
while.end: ; preds = %if.end
%call.i.i.i = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i.i, align 1, !tbaa !13
br label %core_string_reverseGG_core_string_String.exit
while.body.lr.ph.i: ; preds = %while.body, %if.end.thread
%core_string_str.sroa.11.1.lcssa.ph = phi i64 [ 1, %if.end.thread ], [ %add.i11, %while.body ]
%core_string_str.sroa.0.1.lcssa.ph = phi ptr [ %call.i.i9, %if.end.thread ], [ %call.i.i13, %while.body ]
%call.i.i.i39 = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i.i39, align 1, !tbaa !13
%6 = ptrtoint ptr %core_string_str.sroa.0.1.lcssa.ph to i64
%sub4.i = add i64 %core_string_str.sroa.11.1.lcssa.ph, %6
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.lr.ph.i
%core_string_i.022.i = phi i64 [ 0, %while.body.lr.ph.i ], [ %add.i18, %while.body.i ]
%core_string_ret.sroa.0.021.i = phi ptr [ %call.i.i.i39, %while.body.lr.ph.i ], [ %call.i.i14.i, %while.body.i ]
%7 = xor i64 %core_string_i.022.i, -1
%add.i.i12.i = add i64 %sub4.i, %7
%8 = inttoptr i64 %add.i.i12.i to ptr
%9 = load i8, ptr %8, align 1, !tbaa !13
%add.i18 = add nuw nsw i64 %core_string_i.022.i, 1
%add1.i.i = add nuw nsw i64 %core_string_i.022.i, 2
%call.i.i14.i = tail call noalias ptr @realloc(ptr noundef %core_string_ret.sroa.0.021.i, i64 noundef %add1.i.i) #23
%10 = ptrtoint ptr %call.i.i14.i to i64
%add.i.i15.i = add nsw i64 %core_string_i.022.i, %10
%11 = inttoptr i64 %add.i.i15.i to ptr
store i8 %9, ptr %11, align 1, !tbaa !13
%add.i17.i.i = add nsw i64 %add.i18, %10
%12 = inttoptr i64 %add.i17.i.i to ptr
store i8 0, ptr %12, align 1, !tbaa !13
%exitcond.not.i = icmp eq i64 %add.i18, %core_string_str.sroa.11.1.lcssa.ph
br i1 %exitcond.not.i, label %core_string_reverseGG_core_string_String.exit, label %while.body.i, !llvm.loop !18
core_string_reverseGG_core_string_String.exit: ; preds = %while.body.i, %while.end
%core_string_str.sroa.0.1.lcssa43 = phi ptr [ %call.i.i, %while.end ], [ %core_string_str.sroa.0.1.lcssa.ph, %while.body.i ]
%core_string_ret.sroa.7.0.lcssa.i = phi i64 [ 0, %while.end ], [ %core_string_str.sroa.11.1.lcssa.ph, %while.body.i ]
%core_string_ret.sroa.0.0.lcssa.i = phi ptr [ %call.i.i.i, %while.end ], [ %call.i.i14.i, %while.body.i ]
%.fca.0.insert.i16 = insertvalue { ptr, i64 } poison, ptr %core_string_ret.sroa.0.0.lcssa.i, 0
%.fca.1.insert.i17 = insertvalue { ptr, i64 } %.fca.0.insert.i16, i64 %core_string_ret.sroa.7.0.lcssa.i, 1
tail call void @free(ptr noundef %core_string_str.sroa.0.1.lcssa43) #21
ret { ptr, i64 } %.fca.1.insert.i17
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local signext i8 @core_string_getGG_core_prelude_CString_core_prelude_Int(ptr noundef %core_string_cs, i64 noundef %core_string_i) local_unnamed_addr #14 {
entry:
%0 = ptrtoint ptr %core_string_cs to i64
%add.i = add nsw i64 %0, %core_string_i
%1 = inttoptr i64 %add.i to ptr
%2 = load i8, ptr %1, align 1, !tbaa !13
ret i8 %2
}
; Function Attrs: nounwind uwtable
define dso_local { ptr, i64 } @core_string_replaceGG_core_prelude_CString_core_prelude_Char_core_prelude_CString(ptr noundef %core_string_s, i8 noundef signext %core_string_dst, ptr nocapture noundef readonly %core_string_src) local_unnamed_addr #7 {
entry:
%call.i.i = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i, align 1, !tbaa !13
%0 = ptrtoint ptr %core_string_s to i64
br label %while.body
while.body: ; preds = %entry, %if.end
%core_string_i.031 = phi i64 [ 0, %entry ], [ %add, %if.end ]
%core_string_newstr.sroa.0.030 = phi ptr [ %call.i.i, %entry ], [ %core_string_newstr.sroa.0.1, %if.end ]
%core_string_newstr.sroa.10.029 = phi i64 [ 0, %entry ], [ %core_string_newstr.sroa.10.1, %if.end ]
%add.i.i12 = add nsw i64 %core_string_i.031, %0
%1 = inttoptr i64 %add.i.i12 to ptr
%2 = load i8, ptr %1, align 1, !tbaa !13
%cmp4 = icmp eq i8 %2, %core_string_dst
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %while.body
%call1.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_src) #20
%add.i13 = add i64 %call1.i, %core_string_newstr.sroa.10.029
%add2.i = add nsw i64 %add.i13, 1
%call.i.i14 = tail call noalias ptr @realloc(ptr noundef %core_string_newstr.sroa.0.030, i64 noundef %add2.i) #23
%3 = ptrtoint ptr %call.i.i14 to i64
%add.i.i15 = add nsw i64 %core_string_newstr.sroa.10.029, %3
%4 = inttoptr i64 %add.i.i15 to ptr
%call8.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_src) #20
tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %4, ptr align 1 %core_string_src, i64 %call8.i, i1 false)
%add.i21.i = add nsw i64 %add.i13, %3
br label %if.end
if.else: ; preds = %while.body
%add.i17 = add nsw i64 %core_string_newstr.sroa.10.029, 1
%add1.i = add nsw i64 %core_string_newstr.sroa.10.029, 2
%call.i.i18 = tail call noalias ptr @realloc(ptr noundef %core_string_newstr.sroa.0.030, i64 noundef %add1.i) #23
%5 = ptrtoint ptr %call.i.i18 to i64
%add.i.i19 = add nsw i64 %core_string_newstr.sroa.10.029, %5
%6 = inttoptr i64 %add.i.i19 to ptr
store i8 %2, ptr %6, align 1, !tbaa !13
%add.i17.i = add nsw i64 %add.i17, %5
br label %if.end
if.end: ; preds = %if.else, %if.then
%add.i17.i.sink = phi i64 [ %add.i17.i, %if.else ], [ %add.i21.i, %if.then ]
%core_string_newstr.sroa.10.1 = phi i64 [ %add.i17, %if.else ], [ %add.i13, %if.then ]
%core_string_newstr.sroa.0.1 = phi ptr [ %call.i.i18, %if.else ], [ %call.i.i14, %if.then ]
%7 = inttoptr i64 %add.i17.i.sink to ptr
store i8 0, ptr %7, align 1, !tbaa !13
%add = add nuw nsw i64 %core_string_i.031, 1
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %core_string_s) #20
%sub = add i64 %call1, -1
%cmp.not.not = icmp ult i64 %core_string_i.031, %sub
br i1 %cmp.not.not, label %while.body, label %while.end, !llvm.loop !20
while.end: ; preds = %if.end
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %core_string_newstr.sroa.0.1, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 %core_string_newstr.sroa.10.1, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @stdio_read_intGG_() local_unnamed_addr #5 {
entry:
%stdio_ret = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %stdio_ret) #21
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %stdio_ret)
%0 = load i64, ptr %stdio_ret, align 8, !tbaa !21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %stdio_ret) #21
ret i64 %0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local { ptr, i64 } @stdio_read_stringGG_() local_unnamed_addr #5 {
entry:
%stdio_s = alloca %struct.Array10240_core_prelude_Char, align 1
call void @llvm.lifetime.start.p0(i64 10240, ptr nonnull %stdio_s) #21
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %stdio_s)
%call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %stdio_s) #20
%add.i = add nsw i64 %call.i, 1
%call.i.i = call noalias ptr @malloc(i64 noundef %add.i) #22
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call.i.i, ptr nonnull align 1 %stdio_s, i64 %call.i, i1 false)
%0 = ptrtoint ptr %call.i.i to i64
%add.i.i = add nsw i64 %call.i, %0
%1 = inttoptr i64 %add.i.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
%.fca.0.insert.i = insertvalue { ptr, i64 } poison, ptr %call.i.i, 0
%.fca.1.insert.i = insertvalue { ptr, i64 } %.fca.0.insert.i, i64 %call.i, 1
call void @llvm.lifetime.end.p0(i64 10240, ptr nonnull %stdio_s) #21
ret { ptr, i64 } %.fca.1.insert.i
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @core_io_printlnGcore_string_StringG_core_string_String(ptr nocapture readonly %core_io_x.coerce0, i64 %core_io_x.coerce1) local_unnamed_addr #5 {
entry:
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %core_io_x.coerce0)
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @a2_mainGG_() local_unnamed_addr #7 {
entry:
%stdio_s.i20 = alloca %struct.Array10240_core_prelude_Char, align 1
%stdio_s.i = alloca %struct.Array10240_core_prelude_Char, align 1
call void @llvm.lifetime.start.p0(i64 10240, ptr nonnull %stdio_s.i) #21
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %stdio_s.i)
%call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %stdio_s.i) #20
%add.i.i = add nsw i64 %call.i.i, 1
%call.i.i.i = call noalias ptr @malloc(i64 noundef %add.i.i) #22
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call.i.i.i, ptr nonnull align 1 %stdio_s.i, i64 %call.i.i, i1 false)
%0 = ptrtoint ptr %call.i.i.i to i64
%add.i.i.i = add nsw i64 %call.i.i, %0
%1 = inttoptr i64 %add.i.i.i to ptr
store i8 0, ptr %1, align 1, !tbaa !13
call void @llvm.lifetime.end.p0(i64 10240, ptr nonnull %stdio_s.i) #21
call void @llvm.lifetime.start.p0(i64 10240, ptr nonnull %stdio_s.i20) #21
%call.i21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %stdio_s.i20)
%call.i.i22 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %stdio_s.i20) #20
%add.i.i23 = add nsw i64 %call.i.i22, 1
%call.i.i.i24 = call noalias ptr @malloc(i64 noundef %add.i.i23) #22
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %call.i.i.i24, ptr nonnull align 1 %stdio_s.i20, i64 %call.i.i22, i1 false)
%2 = ptrtoint ptr %call.i.i.i24 to i64
%add.i.i.i25 = add nsw i64 %call.i.i22, %2
%3 = inttoptr i64 %add.i.i.i25 to ptr
store i8 0, ptr %3, align 1, !tbaa !13
call void @llvm.lifetime.end.p0(i64 10240, ptr nonnull %stdio_s.i20) #21
%call.i.i29 = call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #22
store i8 0, ptr %call.i.i29, align 1, !tbaa !13
%cmp.not.not52 = icmp sgt i64 %call.i.i, 0
br i1 %cmp.not.not52, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%a2_i.055 = phi i64 [ %add, %if.end ], [ 0, %entry ]
%a2_s.sroa.0.054 = phi ptr [ %a2_s.sroa.0.1, %if.end ], [ %call.i.i29, %entry ]
%a2_s.sroa.11.053 = phi i64 [ %a2_s.sroa.11.1, %if.end ], [ 0, %entry ]
%add.i.i31 = add nsw i64 %a2_i.055, %0
%4 = inttoptr i64 %add.i.i31 to ptr
%5 = load i8, ptr %4, align 1, !tbaa !13
%add.i32 = add nsw i64 %a2_s.sroa.11.053, 1
%add1.i = add nsw i64 %a2_s.sroa.11.053, 2
%call.i.i33 = call noalias ptr @realloc(ptr noundef %a2_s.sroa.0.054, i64 noundef %add1.i) #23
%6 = ptrtoint ptr %call.i.i33 to i64
%add.i.i34 = add nsw i64 %a2_s.sroa.11.053, %6
%7 = inttoptr i64 %add.i.i34 to ptr
store i8 %5, ptr %7, align 1, !tbaa !13
%add.i17.i = add nsw i64 %add.i32, %6
%8 = inttoptr i64 %add.i17.i to ptr
store i8 0, ptr %8, align 1, !tbaa !13
%cmp6 = icmp slt i64 %a2_i.055, %call.i.i22
br i1 %cmp6, label %if.then, label %if.end
if.then: ; preds = %while.body
%add.i.i35 = add nsw i64 %a2_i.055, %2
%9 = inttoptr i64 %add.i.i35 to ptr
%10 = load i8, ptr %9, align 1, !tbaa !13
%add1.i37 = add nsw i64 %a2_s.sroa.11.053, 3
%call.i.i38 = call noalias ptr @realloc(ptr noundef %call.i.i33, i64 noundef %add1.i37) #23
%11 = ptrtoint ptr %call.i.i38 to i64
%add.i.i39 = add nsw i64 %add.i32, %11
%12 = inttoptr i64 %add.i.i39 to ptr
store i8 %10, ptr %12, align 1, !tbaa !13
%add.i17.i40 = add nsw i64 %add1.i, %11
%13 = inttoptr i64 %add.i17.i40 to ptr
store i8 0, ptr %13, align 1, !tbaa !13
br label %if.end
if.end: ; preds = %while.body, %if.then
%a2_s.sroa.11.1 = phi i64 [ %add1.i, %if.then ], [ %add.i32, %while.body ]
%a2_s.sroa.0.1 = phi ptr [ %call.i.i38, %if.then ], [ %call.i.i33, %while.body ]
%add = add nuw nsw i64 %a2_i.055, 1
%exitcond.not = icmp eq i64 %add, %call.i.i
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !22
while.end: ; preds = %if.end, %entry
%a2_s.sroa.0.0.lcssa = phi ptr [ %call.i.i29, %entry ], [ %a2_s.sroa.0.1, %if.end ]
%call.i.i41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %a2_s.sroa.0.0.lcssa)
%putchar.i = call i32 @putchar(i32 10)
call void @free(ptr noundef %a2_s.sroa.0.0.lcssa) #21
call void @free(ptr noundef %call.i.i.i24) #21
call void @free(ptr noundef %call.i.i.i) #21
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @flori_main() local_unnamed_addr #7 {
entry:
store i8 1, ptr @core_prelude_true, align 1, !tbaa !23
store i8 0, ptr @core_prelude_false, align 1, !tbaa !23
store ptr null, ptr @core_pointer_null, align 8, !tbaa !5
store i32 0, ptr @core_macros_FEXPR_IDENT, align 4, !tbaa !9
store i32 1, ptr @core_macros_FEXPR_PREFIX, align 4, !tbaa !9
store i32 2, ptr @core_macros_FEXPR_INFIX, align 4, !tbaa !9
store i32 3, ptr @core_macros_FEXPR_QUOTE, align 4, !tbaa !9
store i32 4, ptr @core_macros_FEXPR_SYMBOL, align 4, !tbaa !9
store i32 5, ptr @core_macros_FEXPR_INTLIT, align 4, !tbaa !9
store i32 6, ptr @core_macros_FEXPR_STRLIT, align 4, !tbaa !9
store i32 7, ptr @core_macros_FEXPR_SEQ, align 4, !tbaa !9
store i32 8, ptr @core_macros_FEXPR_ARRAY, align 4, !tbaa !9
store i32 9, ptr @core_macros_FEXPR_LIST, align 4, !tbaa !9
store i32 10, ptr @core_macros_FEXPR_BLOCK, align 4, !tbaa !9
store i8 13, ptr @core_string_cr, align 1, !tbaa !13
store i8 10, ptr @core_string_lf, align 1, !tbaa !13
tail call void @a2_mainGG_()
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #7 {
entry:
store i8 1, ptr @core_prelude_true, align 1, !tbaa !23
store i8 0, ptr @core_prelude_false, align 1, !tbaa !23
store ptr null, ptr @core_pointer_null, align 8, !tbaa !5
store i32 0, ptr @core_macros_FEXPR_IDENT, align 4, !tbaa !9
store i32 1, ptr @core_macros_FEXPR_PREFIX, align 4, !tbaa !9
store i32 2, ptr @core_macros_FEXPR_INFIX, align 4, !tbaa !9
store i32 3, ptr @core_macros_FEXPR_QUOTE, align 4, !tbaa !9
store i32 4, ptr @core_macros_FEXPR_SYMBOL, align 4, !tbaa !9
store i32 5, ptr @core_macros_FEXPR_INTLIT, align 4, !tbaa !9
store i32 6, ptr @core_macros_FEXPR_STRLIT, align 4, !tbaa !9
store i32 7, ptr @core_macros_FEXPR_SEQ, align 4, !tbaa !9
store i32 8, ptr @core_macros_FEXPR_ARRAY, align 4, !tbaa !9
store i32 9, ptr @core_macros_FEXPR_LIST, align 4, !tbaa !9
store i32 10, ptr @core_macros_FEXPR_BLOCK, align 4, !tbaa !9
store i8 13, ptr @core_string_cr, align 1, !tbaa !13
store i8 10, ptr @core_string_lf, align 1, !tbaa !13
tail call void @a2_mainGG_()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #19
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind willreturn memory(inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 #10 = { 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 #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { mustprogress nofree nounwind willreturn memory(write, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { 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 #15 = { mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #16 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #17 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #18 = { 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 #19 = { nofree nounwind }
attributes #20 = { nounwind willreturn memory(read) }
attributes #21 = { nounwind }
attributes #22 = { nounwind allocsize(0) }
attributes #23 = { nounwind allocsize(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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"core_string_String", !6, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !16, i64 8}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!16, !16, i64 0}
!22 = distinct !{!22, !12}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
|
#include <stdio.h>
#include <string.h>
int main()
{
int i;
char O[51],E[51];
scanf("%s %s",O,E);
for(i=0;i<strlen(O);i++){
printf("%c",O[i]);
if(E[i]!='\0') printf("%c",E[i]);
}
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228841/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228841/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%O = alloca [51 x i8], align 16
%E = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %O) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %E) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %O, ptr noundef nonnull %E)
%char0 = load i8, ptr %O, align 16
%cmp24.not = icmp eq i8 %char0, 0
br i1 %cmp24.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv5 = sext i8 %0 to i32
%putchar21 = call i32 @putchar(i32 %conv5)
%arrayidx8 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10.not = icmp eq i8 %1, 0
br i1 %cmp10.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%conv9 = sext i8 %1 to i32
%putchar22 = call i32 @putchar(i32 %conv9)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %O) #6
%cmp = icmp ugt i64 %call3, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %E) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %O) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int n;
char arr[300001];
int num[3];
int main()
{
int pos = 0;
scanf("%d", &n);
scanf("%s", arr);
for (int i = 0; i < n; i++)
{
num[arr[i] - '0']++;
}
if (num[0] < n / 3)
{
for (int i = 0; i < n; i++)
{
if (arr[i] != '0' && num[0] < n / 3)
{
if (num[arr[i] - '0'] > n / 3)
{
num[arr[i] - '0']--;
num[0]++;
arr[i] = '0';
}
}
}
}
else if(num[0] > n / 3)
{
for (int i = n - 1; i >= 0; i--)
{
if (arr[i] == '0' && num[0] > n / 3)
{
if (num[2] < n / 3)
{
arr[i] = '2';
num[0]--;
num[2]++;
}
else
{
arr[i] = '1';
num[0]--;
num[1]++;
}
}
}
}
if (num[1] < n / 3)
{
for (int i = 0; i < n; i++)
{
if (arr[i] == '2')
{
if (num[2] > n / 3)
{
arr[i] = '1';
num[2]--;
num[1]++;
}
}
}
}
else if (num[1] > n / 3)
{
for (int i = n - 1; i >= 0; i--)
{
if (arr[i] == '1')
{
if (num[2] < n / 3)
{
arr[i] = '2';
num[1]--;
num[2]++;
}
}
}
}
printf("%s", arr);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2289/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2289/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@arr = dso_local global [300001 x i8] zeroinitializer, align 16
@num = dso_local local_unnamed_addr global [3 x i32] zeroinitializer, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @arr)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp173 = icmp slt i32 %0, 1
br i1 %cmp173, label %for.cond.cleanup.thread, label %for.body.preheader
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.cond.cleanup.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.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.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa
%arrayidx.epil = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%conv.epil = sext i8 %2 to i64
%sub.epil = add nsw i64 %conv.epil, -48
%arrayidx3.epil = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %sub.epil
%3 = load i32, ptr %arrayidx3.epil, align 4, !tbaa !5
%inc.epil = add nsw i32 %3, 1
store i32 %inc.epil, ptr %arrayidx3.epil, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil
%4 = load i32, ptr @num, align 4
%div = sdiv i32 %0, 3
%cmp5 = icmp slt i32 %4, %div
br i1 %cmp5, label %for.cond8.preheader, label %if.else
for.cond.cleanup.thread: ; preds = %entry
%.nonneg = sub i32 0, %0
%div236246 = udiv i32 %.nonneg, 3
%div236246.neg = sub nsw i32 0, %div236246
br label %if.end85
for.cond8.preheader: ; preds = %for.cond.cleanup
br i1 %cmp173, label %if.end85, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond8.preheader
%wide.trip.count224 = zext i32 %0 to i64
br label %for.body12
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 [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !9
%conv = sext i8 %5 to i64
%sub = add nsw i64 %conv, -48
%arrayidx3 = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %sub
%6 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%conv.1 = sext i8 %7 to i64
%sub.1 = add nsw i64 %conv.1, -48
%arrayidx3.1 = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %sub.1
%8 = load i32, ptr %arrayidx3.1, align 4, !tbaa !5
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx3.1, align 4, !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.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !10
for.body12: ; preds = %for.body12.preheader, %for.inc42
%9 = phi i32 [ %4, %for.body12.preheader ], [ %13, %for.inc42 ]
%indvars.iv220 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next221, %for.inc42 ]
%arrayidx14 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv220
%10 = load i8, ptr %arrayidx14, align 1, !tbaa !9
%cmp16.not = icmp ne i8 %10, 48
%cmp19 = icmp slt i32 %9, %div
%or.cond = select i1 %cmp16.not, i1 %cmp19, i1 false
br i1 %or.cond, label %if.then21, label %for.inc42
if.then21: ; preds = %for.body12
%conv15 = sext i8 %10 to i64
%sub25 = add nsw i64 %conv15, -48
%arrayidx27 = getelementptr inbounds [3 x i32], ptr @num, i64 0, i64 %sub25
%11 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %11, %div
br i1 %cmp29, label %if.then31, label %for.inc42
if.then31: ; preds = %if.then21
%dec = add nsw i32 %11, -1
store i32 %dec, ptr %arrayidx27, align 4, !tbaa !5
%12 = load i32, ptr @num, align 4, !tbaa !5
%inc38 = add nsw i32 %12, 1
store i32 %inc38, ptr @num, align 4, !tbaa !5
store i8 48, ptr %arrayidx14, align 1, !tbaa !9
br label %for.inc42
for.inc42: ; preds = %for.body12, %if.then31, %if.then21
%13 = phi i32 [ %9, %for.body12 ], [ %inc38, %if.then31 ], [ %9, %if.then21 ]
%indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1
%exitcond225.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count224
br i1 %exitcond225.not, label %if.end85, label %for.body12, !llvm.loop !12
if.else: ; preds = %for.cond.cleanup
%cmp46 = icmp sle i32 %4, %div
%brmerge = or i1 %cmp46, %cmp173
br i1 %brmerge, label %if.end85, label %for.body55.preheader
for.body55.preheader: ; preds = %if.else
%.promoted179 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
%.promoted = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%14 = zext i32 %0 to i64
br label %for.body55
for.body55: ; preds = %for.body55.preheader, %for.inc81
%indvars.iv217 = phi i64 [ %14, %for.body55.preheader ], [ %indvars.iv.next218, %for.inc81 ]
%dec77176186 = phi i32 [ %4, %for.body55.preheader ], [ %dec77175, %for.inc81 ]
%inc73178185 = phi i32 [ %.promoted, %for.body55.preheader ], [ %inc73177, %for.inc81 ]
%inc78181184 = phi i32 [ %.promoted179, %for.body55.preheader ], [ %inc78180, %for.inc81 ]
%indvars.iv.next218 = add nsw i64 %indvars.iv217, -1
%idxprom56 = and i64 %indvars.iv.next218, 4294967295
%arrayidx57 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %idxprom56
%15 = load i8, ptr %arrayidx57, align 1, !tbaa !9
%cmp59 = icmp eq i8 %15, 48
%cmp63 = icmp sgt i32 %dec77176186, %div
%or.cond211 = select i1 %cmp59, i1 %cmp63, i1 false
br i1 %or.cond211, label %if.then65, label %for.inc81
if.then65: ; preds = %for.body55
%cmp67 = icmp slt i32 %inc73178185, %div
%dec72 = add nsw i32 %dec77176186, -1
br i1 %cmp67, label %if.then69, label %if.else74
if.then69: ; preds = %if.then65
store i8 50, ptr %arrayidx57, align 1, !tbaa !9
store i32 %dec72, ptr @num, align 4, !tbaa !5
%inc73 = add nsw i32 %inc73178185, 1
store i32 %inc73, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
br label %for.inc81
if.else74: ; preds = %if.then65
store i8 49, ptr %arrayidx57, align 1, !tbaa !9
store i32 %dec72, ptr @num, align 4, !tbaa !5
%inc78 = add nsw i32 %inc78181184, 1
store i32 %inc78, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc81
for.inc81: ; preds = %for.body55, %if.else74, %if.then69
%inc78180 = phi i32 [ %inc78181184, %for.body55 ], [ %inc78, %if.else74 ], [ %inc78181184, %if.then69 ]
%inc73177 = phi i32 [ %inc73178185, %for.body55 ], [ %inc73178185, %if.else74 ], [ %inc73, %if.then69 ]
%dec77175 = phi i32 [ %dec77176186, %for.body55 ], [ %dec72, %if.else74 ], [ %dec72, %if.then69 ]
%cmp52 = icmp ugt i64 %indvars.iv217, 1
br i1 %cmp52, label %for.body55, label %if.end85, !llvm.loop !13
if.end85: ; preds = %for.inc81, %for.inc42, %for.cond.cleanup.thread, %if.else, %for.cond8.preheader
%div240 = phi i32 [ %div, %for.cond8.preheader ], [ %div, %if.else ], [ %div236246.neg, %for.cond.cleanup.thread ], [ %div, %for.inc42 ], [ %div, %for.inc81 ]
%16 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
%cmp87 = icmp slt i32 %16, %div240
br i1 %cmp87, label %for.cond91.preheader, label %if.else115
for.cond91.preheader: ; preds = %if.end85
br i1 %cmp173, label %if.end147, label %for.body95.preheader
for.body95.preheader: ; preds = %for.cond91.preheader
%.promoted201 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%wide.trip.count234 = zext i32 %0 to i64
%xtraiter255 = and i64 %wide.trip.count234, 1
%17 = icmp eq i32 %0, 1
br i1 %17, label %if.end147.loopexit.unr-lcssa, label %for.body95.preheader.new
for.body95.preheader.new: ; preds = %for.body95.preheader
%unroll_iter257 = and i64 %wide.trip.count234, 4294967294
br label %for.body95
for.body95: ; preds = %for.inc112.1, %for.body95.preheader.new
%indvars.iv230 = phi i64 [ 0, %for.body95.preheader.new ], [ %indvars.iv.next231.1, %for.inc112.1 ]
%dec108203209 = phi i32 [ %.promoted201, %for.body95.preheader.new ], [ %dec108202.1, %for.inc112.1 ]
%inc109206208 = phi i32 [ %16, %for.body95.preheader.new ], [ %inc109205.1, %for.inc112.1 ]
%niter258 = phi i64 [ 0, %for.body95.preheader.new ], [ %niter258.next.1, %for.inc112.1 ]
%arrayidx97 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv230
%18 = load i8, ptr %arrayidx97, align 2, !tbaa !9
%cmp99 = icmp eq i8 %18, 50
%cmp103 = icmp sgt i32 %dec108203209, %div240
%or.cond212 = select i1 %cmp99, i1 %cmp103, i1 false
br i1 %or.cond212, label %if.then105, label %for.inc112
if.then105: ; preds = %for.body95
store i8 49, ptr %arrayidx97, align 2, !tbaa !9
%dec108 = add nsw i32 %dec108203209, -1
store i32 %dec108, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%inc109 = add nsw i32 %inc109206208, 1
store i32 %inc109, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc112
for.inc112: ; preds = %for.body95, %if.then105
%inc109205 = phi i32 [ %inc109206208, %for.body95 ], [ %inc109, %if.then105 ]
%dec108202 = phi i32 [ %dec108203209, %for.body95 ], [ %dec108, %if.then105 ]
%indvars.iv.next231 = or i64 %indvars.iv230, 1
%arrayidx97.1 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv.next231
%19 = load i8, ptr %arrayidx97.1, align 1, !tbaa !9
%cmp99.1 = icmp eq i8 %19, 50
%cmp103.1 = icmp sgt i32 %dec108202, %div240
%or.cond212.1 = select i1 %cmp99.1, i1 %cmp103.1, i1 false
br i1 %or.cond212.1, label %if.then105.1, label %for.inc112.1
if.then105.1: ; preds = %for.inc112
store i8 49, ptr %arrayidx97.1, align 1, !tbaa !9
%dec108.1 = add nsw i32 %dec108202, -1
store i32 %dec108.1, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%inc109.1 = add nsw i32 %inc109205, 1
store i32 %inc109.1, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc112.1
for.inc112.1: ; preds = %if.then105.1, %for.inc112
%inc109205.1 = phi i32 [ %inc109205, %for.inc112 ], [ %inc109.1, %if.then105.1 ]
%dec108202.1 = phi i32 [ %dec108202, %for.inc112 ], [ %dec108.1, %if.then105.1 ]
%indvars.iv.next231.1 = add nuw nsw i64 %indvars.iv230, 2
%niter258.next.1 = add i64 %niter258, 2
%niter258.ncmp.1 = icmp eq i64 %niter258.next.1, %unroll_iter257
br i1 %niter258.ncmp.1, label %if.end147.loopexit.unr-lcssa, label %for.body95, !llvm.loop !14
if.else115: ; preds = %if.end85
%cmp117 = icmp sle i32 %16, %div240
%brmerge250 = or i1 %cmp117, %cmp173
br i1 %brmerge250, label %if.end147, label %for.body126.preheader
for.body126.preheader: ; preds = %if.else115
%.promoted190 = load i32, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%20 = zext i32 %0 to i64
br label %for.body126
for.body126: ; preds = %for.body126.preheader, %for.inc143
%indvars.iv226 = phi i64 [ %20, %for.body126.preheader ], [ %indvars.iv.next227, %for.inc143 ]
%inc140192199 = phi i32 [ %.promoted190, %for.body126.preheader ], [ %inc140191, %for.inc143 ]
%dec139195198 = phi i32 [ %16, %for.body126.preheader ], [ %dec139194, %for.inc143 ]
%indvars.iv.next227 = add nsw i64 %indvars.iv226, -1
%idxprom127 = and i64 %indvars.iv.next227, 4294967295
%arrayidx128 = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %idxprom127
%21 = load i8, ptr %arrayidx128, align 1, !tbaa !9
%cmp130 = icmp eq i8 %21, 49
%cmp134 = icmp slt i32 %inc140192199, %div240
%or.cond213 = select i1 %cmp130, i1 %cmp134, i1 false
br i1 %or.cond213, label %if.then136, label %for.inc143
if.then136: ; preds = %for.body126
store i8 50, ptr %arrayidx128, align 1, !tbaa !9
%dec139 = add nsw i32 %dec139195198, -1
store i32 %dec139, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
%inc140 = add nsw i32 %inc140192199, 1
store i32 %inc140, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
br label %for.inc143
for.inc143: ; preds = %for.body126, %if.then136
%dec139194 = phi i32 [ %dec139195198, %for.body126 ], [ %dec139, %if.then136 ]
%inc140191 = phi i32 [ %inc140192199, %for.body126 ], [ %inc140, %if.then136 ]
%cmp123 = icmp ugt i64 %indvars.iv226, 1
br i1 %cmp123, label %for.body126, label %if.end147, !llvm.loop !15
if.end147.loopexit.unr-lcssa: ; preds = %for.inc112.1, %for.body95.preheader
%indvars.iv230.unr = phi i64 [ 0, %for.body95.preheader ], [ %indvars.iv.next231.1, %for.inc112.1 ]
%dec108203209.unr = phi i32 [ %.promoted201, %for.body95.preheader ], [ %dec108202.1, %for.inc112.1 ]
%inc109206208.unr = phi i32 [ %16, %for.body95.preheader ], [ %inc109205.1, %for.inc112.1 ]
%lcmp.mod256.not = icmp eq i64 %xtraiter255, 0
br i1 %lcmp.mod256.not, label %if.end147, label %for.body95.epil
for.body95.epil: ; preds = %if.end147.loopexit.unr-lcssa
%arrayidx97.epil = getelementptr inbounds [300001 x i8], ptr @arr, i64 0, i64 %indvars.iv230.unr
%22 = load i8, ptr %arrayidx97.epil, align 1, !tbaa !9
%cmp99.epil = icmp eq i8 %22, 50
%cmp103.epil = icmp sgt i32 %dec108203209.unr, %div240
%or.cond212.epil = select i1 %cmp99.epil, i1 %cmp103.epil, i1 false
br i1 %or.cond212.epil, label %if.then105.epil, label %if.end147
if.then105.epil: ; preds = %for.body95.epil
store i8 49, ptr %arrayidx97.epil, align 1, !tbaa !9
%dec108.epil = add nsw i32 %dec108203209.unr, -1
store i32 %dec108.epil, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 2), align 4, !tbaa !5
%inc109.epil = add nsw i32 %inc109206208.unr, 1
store i32 %inc109.epil, ptr getelementptr inbounds ([3 x i32], ptr @num, i64 0, i64 1), align 4, !tbaa !5
br label %if.end147
if.end147: ; preds = %for.inc143, %if.end147.loopexit.unr-lcssa, %if.then105.epil, %for.body95.epil, %if.else115, %for.cond91.preheader
%call148 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @arr)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!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>
int main ()
{
char S[100];
int a;
scanf ("%d %s",&a,S);
if (a>=3200)
printf ("%s\n",S);
else
printf ("red\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228942/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228942/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %S)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%S.str = select i1 %cmp, ptr %S, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#define lop(i, n) for(i=0; i<n; i++)
int main()
{
int a;
char s[10];
scanf("%d", &a);
scanf("%s", s);
if(a>=3200){ printf("%s", s); }
else { printf("red"); }
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228986/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228986/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,i;
char s[100];
scanf("%d",&a);
scanf("%s",s);
if(a<3200)
printf("red\n");
else
printf("%s\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229028/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229028/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.s = select i1 %cmp, ptr @str, ptr %s
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.s)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a;
char words[10];
scanf ("%d",&a);
scanf ("%s",words);
if (a < 3200){
printf("red\n");
}
else{
printf ("%s\n",words);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%words = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %words) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %words)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.words = select i1 %cmp, ptr @str, ptr %words
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.words)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %words) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a;
char s[10];
scanf("%d", &a);
scanf("%s", &s);
if(a >= 3200)
printf("%s", s);
else if(a<3200)
printf("red");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229121/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229121/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.then4
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end6
if.then4: ; preds = %entry
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end6
if.end6: ; preds = %if.then4, %if.then
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a;
char b[11];
scanf("%d %s",&a,b);
if(a<3200)
printf("red\n");
else
printf("%s\n",b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229172/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229172/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.b = select i1 %cmp, ptr @str, ptr %b
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.b)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
char s[256];
char buf[256];
char buf2[256];
fgets(buf, 255, stdin);
fgets(buf2,225,stdin);
sscanf(buf, "%d\n",&a);
sscanf(buf2, "%s",&s);
if(a >= 3200){
printf("%s", s);
}else {
printf("%s", "red");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229215/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229215/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [256 x i8], align 16
%buf = alloca [256 x i8], align 16
%buf2 = alloca [256 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %buf) #3
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %buf2) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 255, ptr noundef %0)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = call ptr @fgets(ptr noundef nonnull %buf2, i32 noundef 225, ptr noundef %1)
%call4 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %a) #3
%call6 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf2, ptr noundef nonnull @.str.1, ptr noundef nonnull %s) #3
%2 = load i32, ptr %a, align 4, !tbaa !9
%cmp = icmp sgt i32 %2, 3199
%s..str.2 = select i1 %cmp, ptr %s, ptr @.str.2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s..str.2)
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %buf2) #3
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %buf) #3
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main(){
int a;
char s[11];
scanf("%d",&a);
scanf("%s",s);
if(a>=3200){
printf("%s\n",s);
}
else {
printf("red\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229259/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229259/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a;
char s[20];
scanf("%d%s", &a,s);
if (a >=3200){
printf("%s\n",s);
}else{
printf("red\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229301/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229301/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
char s[11];
scanf("%d %s",&a,s);
if(a>=3200){
printf("%s\n",s);
}else{
printf("red\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229345/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int K;
scanf("%d", &K);
int i, j, d = 0, X[100] = {1};
for (i = 1; i < K; i++) {
for (j = 0; j < d; j++) if (X[j] != 9 && X[j] <= X[j+1]) break;
if (j < d || X[j] != 9) {
for (X[j--]++; j >= 0; j--) X[j] = (X[j+1] > 0)? X[j+1] - 1: 0;
} else {
X[++d] = 1;
for (j = 0; j < d; j++) X[j] = 0;
}
}
for (i = d; i >= 0; i--) printf("%d", X[i]);
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229396/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229396/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%X = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %X) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %X, i8 0, i64 400, i1 false)
store i32 1, ptr %X, align 16
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp91 = icmp sgt i32 %0, 1
br i1 %cmp91, label %for.cond1.preheader, label %for.body50.preheader
for.cond1.preheader: ; preds = %entry, %for.inc45
%d.093 = phi i32 [ %d.1, %for.inc45 ], [ 0, %entry ]
%i.092 = phi i32 [ %inc46, %for.inc45 ], [ 1, %entry ]
%cmp285 = icmp sgt i32 %d.093, 0
br i1 %cmp285, label %for.body3.preheader, label %lor.lhs.false
for.body3.preheader: ; preds = %for.cond1.preheader
%wide.trip.count = zext i32 %d.093 to i64
br label %for.body3
for.cond48.preheader: ; preds = %for.inc45
%cmp4995 = icmp sgt i32 %d.1, -1
br i1 %cmp4995, label %for.body50.preheader, label %for.end56
for.body50.preheader: ; preds = %entry, %for.cond48.preheader
%d.0.lcssa115 = phi i32 [ %d.1, %for.cond48.preheader ], [ 0, %entry ]
%1 = zext i32 %d.0.lcssa115 to i64
br label %for.body50
for.body3: ; preds = %for.body3.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %.pre112, %for.inc ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp4.not = icmp eq i32 %2, 9
%.pre112 = add nuw nsw i64 %indvars.iv, 1
br i1 %cmp4.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body3
%arrayidx8 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %.pre112
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp sgt i32 %2, %3
br i1 %cmp9.not, label %for.inc, label %if.then14.loopexit
for.inc: ; preds = %for.body3, %land.lhs.true
%exitcond.not = icmp eq i64 %.pre112, %wide.trip.count
br i1 %exitcond.not, label %lor.lhs.false, label %for.body3, !llvm.loop !9
lor.lhs.false: ; preds = %for.inc, %for.cond1.preheader
%j.0.lcssa = phi i32 [ 0, %for.cond1.preheader ], [ %d.093, %for.inc ]
%idxprom11 = zext i32 %j.0.lcssa to i64
%arrayidx12 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13.not = icmp eq i32 %4, 9
br i1 %cmp13.not, label %if.else, label %if.then14
if.then14.loopexit: ; preds = %land.lhs.true
%5 = trunc i64 %indvars.iv to i32
%.pre = and i64 %indvars.iv, 4294967295
%arrayidx16.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %.pre
%.pre111 = load i32, ptr %arrayidx16.phi.trans.insert, align 4, !tbaa !5
br label %if.then14
if.then14: ; preds = %if.then14.loopexit, %lor.lhs.false
%6 = phi i32 [ %.pre111, %if.then14.loopexit ], [ %4, %lor.lhs.false ]
%idxprom15.pre-phi = phi i64 [ %.pre, %if.then14.loopexit ], [ %idxprom11, %lor.lhs.false ]
%j.084 = phi i32 [ %5, %if.then14.loopexit ], [ %j.0.lcssa, %lor.lhs.false ]
%arrayidx16 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %idxprom15.pre-phi
%inc17 = add nsw i32 %6, 1
store i32 %inc17, ptr %arrayidx16, align 4, !tbaa !5
%cmp1989 = icmp sgt i32 %j.084, 0
br i1 %cmp1989, label %for.body20, label %for.inc45
for.body20: ; preds = %if.then14, %for.body20
%7 = phi i32 [ %spec.select, %for.body20 ], [ %inc17, %if.then14 ]
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body20 ], [ %idxprom15.pre-phi, %if.then14 ]
%indvars.iv.next102 = add nsw i64 %indvars.iv101, -1
%cmp24 = icmp sgt i32 %7, 0
%sub = add nsw i32 %7, -1
%spec.select = select i1 %cmp24, i32 %sub, i32 0
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %indvars.iv.next102
store i32 %spec.select, ptr %arrayidx29, align 4, !tbaa !5
%cmp19 = icmp ugt i64 %indvars.iv101, 1
br i1 %cmp19, label %for.body20, label %for.inc45, !llvm.loop !11
if.else: ; preds = %lor.lhs.false
%inc33 = add i32 %d.093, 1
%idxprom34 = sext i32 %inc33 to i64
%arrayidx35 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %idxprom34
store i32 1, ptr %arrayidx35, align 4, !tbaa !5
%cmp37.not87 = icmp slt i32 %d.093, 0
br i1 %cmp37.not87, label %for.inc45, label %for.body38.preheader
for.body38.preheader: ; preds = %if.else
%8 = zext i32 %inc33 to i64
%9 = shl nuw nsw i64 %8, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %X, i8 0, i64 %9, i1 false), !tbaa !5
br label %for.inc45
for.inc45: ; preds = %for.body20, %for.body38.preheader, %if.else, %if.then14
%d.1 = phi i32 [ %d.093, %if.then14 ], [ %inc33, %if.else ], [ %inc33, %for.body38.preheader ], [ %d.093, %for.body20 ]
%inc46 = add nuw nsw i32 %i.092, 1
%exitcond107.not = icmp eq i32 %inc46, %0
br i1 %exitcond107.not, label %for.cond48.preheader, label %for.cond1.preheader, !llvm.loop !12
for.body50: ; preds = %for.body50.preheader, %for.body50
%indvars.iv108 = phi i64 [ %1, %for.body50.preheader ], [ %indvars.iv.next109, %for.body50 ]
%arrayidx52 = getelementptr inbounds [100 x i32], ptr %X, i64 0, i64 %indvars.iv108
%10 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%indvars.iv.next109 = add nsw i64 %indvars.iv108, -1
%cmp49.not = icmp eq i64 %indvars.iv108, 0
br i1 %cmp49.not, label %for.end56, label %for.body50, !llvm.loop !13
for.end56: ; preds = %for.body50, %for.cond48.preheader
%11 = load ptr, ptr @stdout, align 8, !tbaa !14
%call57 = call i32 @fflush(ptr noundef %11)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %X) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.