Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <string.h>
#define MAX 101
int main(void)
{
int n, len, len_t, len_h, pt=0, ph=0, i, j;
char card[3][MAX];
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%s%s", card[0], card[1]);
len_t = strlen(card[0]);
len_h = strlen(card[1]);
len = (len_t > len_h) ? len_t : len_h;
for(j=0; j<len; j++){
if(strcmp(card[0], card[1]) == 0){
pt += 1;
ph += 1;
break;
}else if(card[0][j] > card[1][j]){
pt += 3;
break;
}else if(card[0][j] < card[1][j]){
ph += 3;
break;
}
}
}
printf("%d %d\n", pt, ph);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200768/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200768/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%card = alloca [3 x [101 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 303, ptr nonnull %card) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp69 = icmp sgt i32 %0, 0
br i1 %cmp69, label %for.body.lr.ph, label %for.end53
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x [101 x i8]], ptr %card, i64 0, i64 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc51
%i.072 = phi i32 [ 0, %for.body.lr.ph ], [ %inc52, %for.inc51 ]
%ph.071 = phi i32 [ 0, %for.body.lr.ph ], [ %ph.1, %for.inc51 ]
%pt.070 = phi i32 [ 0, %for.body.lr.ph ], [ %pt.1, %for.inc51 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %card, ptr noundef nonnull %arrayidx1)
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %card) #6
%conv = trunc i64 %call6 to i32
%call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx1) #6
%conv10 = trunc i64 %call9 to i32
%cond = call i32 @llvm.smax.i32(i32 %conv, i32 %conv10)
%cmp1467 = icmp sgt i32 %cond, 0
br i1 %cmp1467, label %for.body16.lr.ph, label %for.inc51
for.body16.lr.ph: ; preds = %for.body
%call21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %card, ptr noundef nonnull dereferenceable(1) %arrayidx1) #6
%cmp22 = icmp eq i32 %call21, 0
br i1 %cmp22, label %if.then, label %for.body16.preheader
for.body16.preheader: ; preds = %for.body16.lr.ph
%wide.trip.count = zext i32 %cond to i64
br label %for.body16
for.cond13: ; preds = %if.else36
%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.inc51, label %for.body16, !llvm.loop !9
for.body16: ; preds = %for.body16.preheader, %for.cond13
%indvars.iv = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next, %for.cond13 ]
%arrayidx26 = getelementptr inbounds [101 x i8], ptr %card, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx26, align 1, !tbaa !11
%arrayidx30 = getelementptr inbounds [3 x [101 x i8]], ptr %card, i64 0, i64 1, i64 %indvars.iv
%2 = load i8, ptr %arrayidx30, align 1, !tbaa !11
%cmp32 = icmp sgt i8 %1, %2
br i1 %cmp32, label %if.then34, label %if.else36
if.then: ; preds = %for.body16.lr.ph
%add = add nsw i32 %pt.070, 1
%add24 = add nsw i32 %ph.071, 1
br label %for.inc51
if.then34: ; preds = %for.body16
%add35 = add nsw i32 %pt.070, 3
br label %for.inc51
if.else36: ; preds = %for.body16
%cmp45 = icmp slt i8 %1, %2
br i1 %cmp45, label %if.then47, label %for.cond13
if.then47: ; preds = %if.else36
%add48 = add nsw i32 %ph.071, 3
br label %for.inc51
for.inc51: ; preds = %for.cond13, %for.body, %if.then, %if.then34, %if.then47
%pt.1 = phi i32 [ %add, %if.then ], [ %add35, %if.then34 ], [ %pt.070, %if.then47 ], [ %pt.070, %for.body ], [ %pt.070, %for.cond13 ]
%ph.1 = phi i32 [ %add24, %if.then ], [ %ph.071, %if.then34 ], [ %add48, %if.then47 ], [ %ph.071, %for.body ], [ %ph.071, %for.cond13 ]
%inc52 = add nuw nsw i32 %i.072, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc52, %3
br i1 %cmp, label %for.body, label %for.end53, !llvm.loop !12
for.end53: ; preds = %for.inc51, %entry
%pt.0.lcssa = phi i32 [ 0, %entry ], [ %pt.1, %for.inc51 ]
%ph.0.lcssa = phi i32 [ 0, %entry ], [ %ph.1, %for.inc51 ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %pt.0.lcssa, i32 noundef %ph.0.lcssa)
call void @llvm.lifetime.end.p0(i64 303, ptr nonnull %card) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
//int lenth(char str[]);
int judge(char str1[], char str2[], int index);
int main(void)
{
int n;
int i;
int taro_PT = 0;
int hanako_PT = 0;
char taro[1000][1000];
char hanako[1000][1000];
int CASE;
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%s %s", taro[i], hanako[i]);
}
for(i=0; i<n; i++)
{
CASE = judge(taro[i], hanako[i], 0);
switch(CASE)
{
case 0:
taro_PT += 3;
break;
case 1:
hanako_PT += 3;
break;
case 2:
taro_PT += 1;
hanako_PT += 1;
break;
}
}
printf("%d %d\n", taro_PT, hanako_PT);
return 0;
}
int judge(char str1[], char str2[], int index)
{
int lenth1, lenth2;
int x;
//Taro Win
if(str1[index] > str2[index])
{
return 0;
}
//Hanako Win
else if(str1[index] < str2[index])
{
return 1;
}
//Same
else if(str1[index] == str2[index])
{
if(str1[index] == '\0' && str2[index] == '\0')
{
return 2;
}
else
{
return judge(str1, str2, index+1);
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200810/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200810/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%taro = alloca [1000 x [1000 x i8]], align 16
%hanako = alloca [1000 x [1000 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %taro) #4
call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %hanako) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body, label %for.end22
for.cond5.preheader: ; preds = %for.body
%cmp640 = icmp sgt i32 %1, 0
br i1 %cmp640, label %for.body7.preheader, label %for.end22
for.body7.preheader: ; preds = %for.cond5.preheader
%wide.trip.count = zext i32 %1 to i64
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x [1000 x i8]], ptr %taro, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x [1000 x i8]], ptr %hanako, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.body7: ; preds = %for.body7.preheader, %for.inc20
%indvars.iv48 = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next49, %for.inc20 ]
%hanako_PT.042 = phi i32 [ 0, %for.body7.preheader ], [ %hanako_PT.1, %for.inc20 ]
%taro_PT.041 = phi i32 [ 0, %for.body7.preheader ], [ %taro_PT.1, %for.inc20 ]
%arrayidx9 = getelementptr inbounds [1000 x [1000 x i8]], ptr %taro, i64 0, i64 %indvars.iv48
%arrayidx12 = getelementptr inbounds [1000 x [1000 x i8]], ptr %hanako, i64 0, i64 %indvars.iv48
%3 = load i8, ptr %arrayidx9, align 8, !tbaa !11
%4 = load i8, ptr %arrayidx12, align 8, !tbaa !11
%cmp59.i = icmp sgt i8 %3, %4
br i1 %cmp59.i, label %sw.bb, label %if.else.i
tailrecurse.i: ; preds = %if.else14.i
%indvars.iv.next.i = add i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx9, i64 %indvars.iv.next.i
%5 = load i8, ptr %arrayidx.i, align 1, !tbaa !11
%arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx12, i64 %indvars.iv.next.i
%6 = load i8, ptr %arrayidx2.i, align 1, !tbaa !11
%cmp.i = icmp sgt i8 %5, %6
br i1 %cmp.i, label %sw.bb, label %if.else.i
if.else.i: ; preds = %for.body7, %tailrecurse.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %tailrecurse.i ], [ 0, %for.body7 ]
%7 = phi i8 [ %6, %tailrecurse.i ], [ %4, %for.body7 ]
%8 = phi i8 [ %5, %tailrecurse.i ], [ %3, %for.body7 ]
%cmp11.i = icmp slt i8 %8, %7
br i1 %cmp11.i, label %sw.bb15, label %if.else14.i
if.else14.i: ; preds = %if.else.i
%cmp21.i = icmp ne i8 %8, %7
%or.cond.i = icmp eq i8 %7, 0
%or.cond = or i1 %or.cond.i, %cmp21.i
br i1 %or.cond, label %sw.bb17, label %tailrecurse.i
sw.bb: ; preds = %tailrecurse.i, %for.body7
%add = add nsw i32 %taro_PT.041, 3
br label %for.inc20
sw.bb15: ; preds = %if.else.i
%add16 = add nsw i32 %hanako_PT.042, 3
br label %for.inc20
sw.bb17: ; preds = %if.else14.i
%add18 = add nsw i32 %taro_PT.041, 1
%add19 = add nsw i32 %hanako_PT.042, 1
br label %for.inc20
for.inc20: ; preds = %sw.bb, %sw.bb15, %sw.bb17
%taro_PT.1 = phi i32 [ %add18, %sw.bb17 ], [ %taro_PT.041, %sw.bb15 ], [ %add, %sw.bb ]
%hanako_PT.1 = phi i32 [ %add19, %sw.bb17 ], [ %add16, %sw.bb15 ], [ %hanako_PT.042, %sw.bb ]
%indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
%exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
br i1 %exitcond.not, label %for.end22, label %for.body7, !llvm.loop !12
for.end22: ; preds = %for.inc20, %entry, %for.cond5.preheader
%taro_PT.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %taro_PT.1, %for.inc20 ]
%hanako_PT.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %hanako_PT.1, %for.inc20 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro_PT.0.lcssa, i32 noundef %hanako_PT.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %hanako) #4
call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %taro) #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 norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @judge(ptr nocapture noundef readonly %str1, ptr nocapture noundef readonly %str2, i32 noundef %index) local_unnamed_addr #3 {
entry:
%idxprom56 = sext i32 %index to i64
%arrayidx57 = getelementptr inbounds i8, ptr %str1, i64 %idxprom56
%0 = load i8, ptr %arrayidx57, align 1, !tbaa !11
%arrayidx258 = getelementptr inbounds i8, ptr %str2, i64 %idxprom56
%1 = load i8, ptr %arrayidx258, align 1, !tbaa !11
%cmp59 = icmp sgt i8 %0, %1
br i1 %cmp59, label %cleanup, label %if.else
tailrecurse: ; preds = %if.then23
%indvars.iv.next = add i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %str1, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !11
%arrayidx2 = getelementptr inbounds i8, ptr %str2, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !11
%cmp = icmp sgt i8 %2, %3
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry, %tailrecurse
%indvars.iv = phi i64 [ %indvars.iv.next, %tailrecurse ], [ %idxprom56, %entry ]
%4 = phi i8 [ %3, %tailrecurse ], [ %1, %entry ]
%5 = phi i8 [ %2, %tailrecurse ], [ %0, %entry ]
%cmp11 = icmp slt i8 %5, %4
br i1 %cmp11, label %cleanup, label %if.else14
if.else14: ; preds = %if.else
%cmp21 = icmp eq i8 %5, %4
br i1 %cmp21, label %if.then23, label %cleanup
if.then23: ; preds = %if.else14
%or.cond = icmp eq i8 %4, 0
br i1 %or.cond, label %cleanup, label %tailrecurse
cleanup: ; preds = %tailrecurse, %if.else, %if.then23, %if.else14, %entry
%retval.0 = phi i32 [ 0, %entry ], [ undef, %if.else14 ], [ 2, %if.then23 ], [ 1, %if.else ], [ 0, %tailrecurse ]
ret i32 %retval.0
}
; 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 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <string.h>
#define WORD_SIZE_MAX 100
int dict_compare(const char *s1, const char *s2) {
while (*s1 == *s2) {
if (*s1 == '\0')
return 0;
s1++;
s2++;
}
return *s1 - *s2;
}
int main(void) {
int n;
scanf("%d", &n);
int score[2] = {0, 0}; // ?????????¨???±????????????.
int i;
for (i = 0; i < n; i++) {
char words[2][WORD_SIZE_MAX]; // ?????????¨???±????????????.
scanf("%s %s", words[0], words[1]);
int result = dict_compare(words[0], words[1]);
if (result == 0) {
score[0] += 1;
score[1] += 1;
} else if (result > 0) {
score[0] += 3;
} else {
score[1] += 3;
}
}
printf("%d %d\n", score[0], score[1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200861/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200861/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @dict_compare(ptr nocapture noundef readonly %s1, ptr nocapture noundef readonly %s2) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %s1, align 1, !tbaa !5
%1 = load i8, ptr %s2, align 1, !tbaa !5
%cmp17 = icmp eq i8 %0, %1
br i1 %cmp17, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%2 = phi i8 [ %3, %if.end ], [ %0, %entry ]
%s2.addr.019 = phi ptr [ %incdec.ptr6, %if.end ], [ %s2, %entry ]
%s1.addr.018 = phi ptr [ %incdec.ptr, %if.end ], [ %s1, %entry ]
%cmp4 = icmp eq i8 %2, 0
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %while.body
%incdec.ptr = getelementptr inbounds i8, ptr %s1.addr.018, i64 1
%incdec.ptr6 = getelementptr inbounds i8, ptr %s2.addr.019, i64 1
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !5
%4 = load i8, ptr %incdec.ptr6, align 1, !tbaa !5
%cmp = icmp eq i8 %3, %4
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !8
while.end: ; preds = %if.end, %entry
%.lcssa15 = phi i8 [ %0, %entry ], [ %3, %if.end ]
%.lcssa = phi i8 [ %1, %entry ], [ %4, %if.end ]
%conv = sext i8 %.lcssa15 to i32
%conv1 = sext i8 %.lcssa to i32
%sub = sub nsw i32 %conv, %conv1
br label %return
return: ; preds = %while.body, %while.end
%retval.0 = phi i32 [ %sub, %while.end ], [ 0, %while.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%words = alloca [2 x [100 x i8]], align 16
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 !10
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [2 x [100 x i8]], ptr %words, i64 0, i64 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end20
%score.sroa.0.038 = phi i32 [ 0, %for.body.lr.ph ], [ %score.sroa.0.1, %if.end20 ]
%i.037 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %if.end20 ]
%score.sroa.8.036 = phi i32 [ 0, %for.body.lr.ph ], [ %score.sroa.8.1, %if.end20 ]
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %words) #4
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %words, ptr noundef nonnull %arrayidx1)
%1 = load i8, ptr %words, align 16, !tbaa !5
%2 = load i8, ptr %arrayidx1, align 4, !tbaa !5
%cmp17.i = icmp eq i8 %1, %2
br i1 %cmp17.i, label %while.body.i, label %dict_compare.exit
while.body.i: ; preds = %for.body, %if.end.i
%3 = phi i8 [ %4, %if.end.i ], [ %1, %for.body ]
%s2.addr.019.i = phi ptr [ %incdec.ptr6.i, %if.end.i ], [ %arrayidx1, %for.body ]
%s1.addr.018.i = phi ptr [ %incdec.ptr.i, %if.end.i ], [ %words, %for.body ]
%cmp4.i = icmp eq i8 %3, 0
br i1 %cmp4.i, label %if.then, label %if.end.i
if.end.i: ; preds = %while.body.i
%incdec.ptr.i = getelementptr inbounds i8, ptr %s1.addr.018.i, i64 1
%incdec.ptr6.i = getelementptr inbounds i8, ptr %s2.addr.019.i, i64 1
%4 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !5
%5 = load i8, ptr %incdec.ptr6.i, align 1, !tbaa !5
%cmp.i = icmp eq i8 %4, %5
br i1 %cmp.i, label %while.body.i, label %dict_compare.exit, !llvm.loop !8
dict_compare.exit: ; preds = %if.end.i, %for.body
%.lcssa15.i = phi i8 [ %1, %for.body ], [ %4, %if.end.i ]
%.lcssa.i = phi i8 [ %2, %for.body ], [ %5, %if.end.i ]
%cmp9 = icmp eq i8 %.lcssa15.i, %.lcssa.i
br i1 %cmp9, label %if.then, label %if.else
if.then: ; preds = %while.body.i, %dict_compare.exit
%add = add nsw i32 %score.sroa.0.038, 1
%add12 = add nsw i32 %score.sroa.8.036, 1
br label %if.end20
if.else: ; preds = %dict_compare.exit
%cmp13 = icmp sgt i8 %.lcssa15.i, %.lcssa.i
br i1 %cmp13, label %if.then14, label %if.else17
if.then14: ; preds = %if.else
%add16 = add nsw i32 %score.sroa.0.038, 3
br label %if.end20
if.else17: ; preds = %if.else
%add19 = add nsw i32 %score.sroa.8.036, 3
br label %if.end20
if.end20: ; preds = %if.then14, %if.else17, %if.then
%score.sroa.8.1 = phi i32 [ %add12, %if.then ], [ %score.sroa.8.036, %if.then14 ], [ %add19, %if.else17 ]
%score.sroa.0.1 = phi i32 [ %add, %if.then ], [ %add16, %if.then14 ], [ %score.sroa.0.038, %if.else17 ]
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %words) #4
%inc = add nuw nsw i32 %i.037, 1
%6 = load i32, ptr %n, align 4, !tbaa !10
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %if.end20, %entry
%score.sroa.8.0.lcssa = phi i32 [ 0, %entry ], [ %score.sroa.8.1, %if.end20 ]
%score.sroa.0.0.lcssa = phi i32 [ 0, %entry ], [ %score.sroa.0.1, %if.end20 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %score.sroa.0.0.lcssa, i32 noundef %score.sroa.8.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
attributes #0 = { 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 #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
|
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,k,n;
int a=0,b=0;
char x[1000];
char y[1000];
scanf("%d",&n);
getchar();
while(n--)
{
scanf("%s",x);
scanf("%s",y);
if(strcmp(x,y)==0)
{
a=a+1,b=b+1;
}
if(strcmp(x,y)<0)
{
b=b+3;
}
if(strcmp(x,y)>0)
{
a=a+3;
}
}
printf("%d %d\n",a,b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200911/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200911/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca [1000 x i8], align 16
%y = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !9
%dec28 = add nsw i32 %1, -1
store i32 %dec28, ptr %n, align 4, !tbaa !9
%tobool.not29 = icmp eq i32 %1, 0
br i1 %tobool.not29, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%b.031 = phi i32 [ %b.2, %while.body ], [ 0, %entry ]
%a.030 = phi i32 [ %a.2, %while.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %y)
%call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %x, ptr noundef nonnull dereferenceable(1) %y) #5
%cmp = icmp eq i32 %call7, 0
%add = zext i1 %cmp to i32
%a.1 = add nsw i32 %a.030, %add
%b.1 = add nsw i32 %b.031, %add
%cmp12 = icmp slt i32 %call7, 0
%add14 = add nsw i32 %b.1, 3
%b.2 = select i1 %cmp12, i32 %add14, i32 %b.1
%cmp19 = icmp sgt i32 %call7, 0
%add21 = add nsw i32 %a.1, 3
%a.2 = select i1 %cmp19, i32 %add21, i32 %a.1
%2 = load i32, ptr %n, align 4, !tbaa !9
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %n, align 4, !tbaa !9
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%a.0.lcssa = phi i32 [ 0, %entry ], [ %a.2, %while.body ]
%b.0.lcssa = phi i32 [ 0, %entry ], [ %b.2, %while.body ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a.0.lcssa, i32 noundef %b.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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 memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int i,j,n,m=0,l=0;
char T[101],H[101];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s %s",T,H);
for(j=0;;j++){
if(T[j]>H[j]){
m+=3;
break;
}
else if(T[j]<H[j]){
l+=3;
break;
}
else if(T[j]+H[j]==0){
m++;
l++;
break;
}
}
}
printf("%d %d\n",m,l);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200955/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200955/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%T = alloca [101 x i8], align 16
%H = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %H) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.end36
for.body: ; preds = %entry, %for.inc34
%l.058 = phi i32 [ %l.1, %for.inc34 ], [ 0, %entry ]
%m.057 = phi i32 [ %m.1, %for.inc34 ], [ 0, %entry ]
%i.056 = phi i32 [ %inc35, %for.inc34 ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %T, ptr noundef nonnull %H)
%1 = load i8, ptr %T, align 16, !tbaa !9
%2 = load i8, ptr %H, align 16, !tbaa !9
%cmp751 = icmp sgt i8 %1, %2
br i1 %cmp751, label %if.then, label %if.else
for.cond3: ; preds = %if.else19
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %T, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
%arrayidx5 = getelementptr inbounds [101 x i8], ptr %H, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp sgt i8 %3, %4
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.cond3, %for.body
%add = add nsw i32 %m.057, 3
br label %for.inc34
if.else: ; preds = %for.body, %for.cond3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond3 ], [ 0, %for.body ]
%5 = phi i8 [ %4, %for.cond3 ], [ %2, %for.body ]
%6 = phi i8 [ %3, %for.cond3 ], [ %1, %for.body ]
%cmp15 = icmp slt i8 %6, %5
br i1 %cmp15, label %if.then17, label %if.else19
if.then17: ; preds = %if.else
%add18 = add nsw i32 %l.058, 3
br label %for.inc34
if.else19: ; preds = %if.else
%conv53 = sext i8 %6 to i32
%conv654 = sext i8 %5 to i32
%add26 = sub nsw i32 0, %conv654
%cmp27 = icmp eq i32 %conv53, %add26
br i1 %cmp27, label %if.then29, label %for.cond3
if.then29: ; preds = %if.else19
%inc = add nsw i32 %m.057, 1
%inc30 = add nsw i32 %l.058, 1
br label %for.inc34
for.inc34: ; preds = %if.then, %if.then17, %if.then29
%m.1 = phi i32 [ %add, %if.then ], [ %m.057, %if.then17 ], [ %inc, %if.then29 ]
%l.1 = phi i32 [ %l.058, %if.then ], [ %add18, %if.then17 ], [ %inc30, %if.then29 ]
%inc35 = add nuw nsw i32 %i.056, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc35, %7
br i1 %cmp, label %for.body, label %for.end36, !llvm.loop !10
for.end36: ; preds = %for.inc34, %entry
%m.0.lcssa = phi i32 [ 0, %entry ], [ %m.1, %for.inc34 ]
%l.0.lcssa = phi i32 [ 0, %entry ], [ %l.1, %for.inc34 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %m.0.lcssa, i32 noundef %l.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 101, 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
#define STRINGLENGTH 101
int main (void){
int n, scorep1 = 0, scorep2 = 0;
char cardp1[STRINGLENGTH], cardp2[STRINGLENGTH];
scanf("%d",&n);
for (int i = 0; i < n; i++)
{
scanf("%s",cardp1);
scanf("%s",cardp2);
if ( strcmp(cardp1, cardp2) == 0 ){scorep1++;scorep2++;}
else if ( strcmp(cardp1, cardp2) > 0 ){scorep1+=3;}
else if ( strcmp(cardp1, cardp2) < 0 ){scorep2+=3;}
}
printf("%d %d\n",scorep1,scorep2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%cardp1 = alloca [101 x i8], align 16
%cardp2 = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %cardp1) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %cardp2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%scorep1.0.lcssa = phi i32 [ 0, %entry ], [ %scorep1.1, %for.inc ]
%scorep2.0.lcssa = phi i32 [ 0, %entry ], [ %scorep2.1, %for.inc ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %scorep1.0.lcssa, i32 noundef %scorep2.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %cardp2) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %cardp1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.033 = phi i32 [ %inc23, %for.inc ], [ 0, %entry ]
%scorep2.032 = phi i32 [ %scorep2.1, %for.inc ], [ 0, %entry ]
%scorep1.031 = phi i32 [ %scorep1.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cardp1)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cardp2)
%call6 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %cardp1, ptr noundef nonnull dereferenceable(1) %cardp2) #5
%cmp7 = icmp eq i32 %call6, 0
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %scorep1.031, 1
%inc8 = add nsw i32 %scorep2.032, 1
br label %for.inc
if.else: ; preds = %for.body
%cmp12 = icmp sgt i32 %call6, 0
br i1 %cmp12, label %if.then13, label %if.then19
if.then13: ; preds = %if.else
%add = add nsw i32 %scorep1.031, 3
br label %for.inc
if.then19: ; preds = %if.else
%add20 = add nsw i32 %scorep2.032, 3
br label %for.inc
for.inc: ; preds = %if.then, %if.then19, %if.then13
%scorep1.1 = phi i32 [ %inc, %if.then ], [ %add, %if.then13 ], [ %scorep1.031, %if.then19 ]
%scorep2.1 = phi i32 [ %inc8, %if.then ], [ %scorep2.032, %if.then13 ], [ %add20, %if.then19 ]
%inc23 = add nuw nsw i32 %i.033, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc23, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int i,j,n,taro_p=0,hana_p=0;
char taro[101], hana[101];
scanf("%d", &n);
for(i=0;i<n;i++){
scanf("%s %s", taro, hana);
for(j=0;;j++){
if(taro[j] > hana[j]){
taro_p += 3;
break;
}else if(taro[j] < hana[j]){
hana_p += 3;
break;
}else if(taro[j] + hana[j] == 0){
hana_p++;
taro_p++;
break;
}
}
}
printf("%d %d\n", taro_p , hana_p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201091/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201091/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%taro = alloca [101 x i8], align 16
%hana = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %taro) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %hana) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.end36
for.body: ; preds = %entry, %for.inc34
%hana_p.058 = phi i32 [ %hana_p.1, %for.inc34 ], [ 0, %entry ]
%taro_p.057 = phi i32 [ %taro_p.1, %for.inc34 ], [ 0, %entry ]
%i.056 = phi i32 [ %inc35, %for.inc34 ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %taro, ptr noundef nonnull %hana)
%1 = load i8, ptr %taro, align 16, !tbaa !9
%2 = load i8, ptr %hana, align 16, !tbaa !9
%cmp751 = icmp sgt i8 %1, %2
br i1 %cmp751, label %if.then, label %if.else
for.cond3: ; preds = %if.else19
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %taro, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
%arrayidx5 = getelementptr inbounds [101 x i8], ptr %hana, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp sgt i8 %3, %4
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.cond3, %for.body
%add = add nsw i32 %taro_p.057, 3
br label %for.inc34
if.else: ; preds = %for.body, %for.cond3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond3 ], [ 0, %for.body ]
%5 = phi i8 [ %4, %for.cond3 ], [ %2, %for.body ]
%6 = phi i8 [ %3, %for.cond3 ], [ %1, %for.body ]
%cmp15 = icmp slt i8 %6, %5
br i1 %cmp15, label %if.then17, label %if.else19
if.then17: ; preds = %if.else
%add18 = add nsw i32 %hana_p.058, 3
br label %for.inc34
if.else19: ; preds = %if.else
%conv53 = sext i8 %6 to i32
%conv654 = sext i8 %5 to i32
%add26 = sub nsw i32 0, %conv654
%cmp27 = icmp eq i32 %conv53, %add26
br i1 %cmp27, label %if.then29, label %for.cond3
if.then29: ; preds = %if.else19
%inc = add nsw i32 %hana_p.058, 1
%inc30 = add nsw i32 %taro_p.057, 1
br label %for.inc34
for.inc34: ; preds = %if.then, %if.then17, %if.then29
%taro_p.1 = phi i32 [ %add, %if.then ], [ %taro_p.057, %if.then17 ], [ %inc30, %if.then29 ]
%hana_p.1 = phi i32 [ %hana_p.058, %if.then ], [ %add18, %if.then17 ], [ %inc, %if.then29 ]
%inc35 = add nuw nsw i32 %i.056, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc35, %7
br i1 %cmp, label %for.body, label %for.end36, !llvm.loop !10
for.end36: ; preds = %for.inc34, %entry
%taro_p.0.lcssa = phi i32 [ 0, %entry ], [ %taro_p.1, %for.inc34 ]
%hana_p.0.lcssa = phi i32 [ 0, %entry ], [ %hana_p.1, %for.inc34 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro_p.0.lcssa, i32 noundef %hana_p.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %hana) #3
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %taro) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int dic(char c1[],char c2[]){
int a=0,i=0;
while(1){
if(c1[i]<c2[i])return 1;
if(c1[i]>c2[i])return 2;
if(c1[i]=='\0'&&c2[i]=='\0')return 0;
if(c1[i]=='\0')return 1;
if(c2[i]=='\0')return 2;
i++;
}
return 0;
}
int main(){
int n,p1=0,p2=0,i,a;
char c1[102],c2[102];
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%s",&c1);
scanf("%s",&c2);
a=dic(c1,c2);
if(a==0){
p1+=1;
p2+=1;
}else if(a==1)p2+=3;
else p1+=3;
}
printf("%d %d\n",p1,p2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201134/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201134/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @dic(ptr nocapture noundef readonly %c1, ptr nocapture noundef readonly %c2) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %c1, align 1, !tbaa !5
%1 = load i8, ptr %c2, align 1, !tbaa !5
%cmp61 = icmp slt i8 %0, %1
br i1 %cmp61, label %cleanup, label %if.end
while.cond: ; preds = %if.end14
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %c1, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds i8, ptr %c2, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp = icmp slt i8 %2, %3
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%4 = phi i8 [ %3, %while.cond ], [ %1, %entry ]
%5 = phi i8 [ %2, %while.cond ], [ %0, %entry ]
%cmp11 = icmp sgt i8 %5, %4
br i1 %cmp11, label %cleanup, label %if.end14
if.end14: ; preds = %if.end
%cmp18 = icmp eq i8 %5, 0
%cmp23 = icmp eq i8 %4, 0
%6 = or i8 %4, %5
%or.cond = icmp eq i8 %6, 0
%brmerge = or i1 %cmp18, %or.cond
%brmerge56 = or i1 %cmp23, %brmerge
br i1 %brmerge56, label %cleanup.split.loop.exit, label %while.cond
cleanup.split.loop.exit: ; preds = %if.end14
%not.or.cond.le = xor i1 %or.cond, true
%.mux.le = zext i1 %not.or.cond.le to i32
%.mux.mux.le = select i1 %brmerge, i32 %.mux.le, i32 2
br label %cleanup
cleanup: ; preds = %while.cond, %if.end, %entry, %cleanup.split.loop.exit
%retval.0 = phi i32 [ %.mux.mux.le, %cleanup.split.loop.exit ], [ 1, %entry ], [ 2, %if.end ], [ 1, %while.cond ]
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:
%n = alloca i32, align 4
%c1 = alloca [102 x i8], align 16
%c2 = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %c1) #4
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %c2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !8
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%p1.030 = phi i32 [ %p1.1, %for.inc ], [ 0, %entry ]
%i.029 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%p2.028 = phi i32 [ %p2.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c1)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c2)
%1 = load i8, ptr %c1, align 16, !tbaa !5
%2 = load i8, ptr %c2, align 16, !tbaa !5
%cmp61.i = icmp slt i8 %1, %2
br i1 %cmp61.i, label %if.then8, label %if.end.i
while.cond.i: ; preds = %if.end14.i
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %c1, i64 %indvars.iv.next.i
%3 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%arrayidx2.i = getelementptr inbounds i8, ptr %c2, i64 %indvars.iv.next.i
%4 = load i8, ptr %arrayidx2.i, align 1, !tbaa !5
%cmp.i = icmp slt i8 %3, %4
br i1 %cmp.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %for.body, %while.cond.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body ]
%5 = phi i8 [ %4, %while.cond.i ], [ %2, %for.body ]
%6 = phi i8 [ %3, %while.cond.i ], [ %1, %for.body ]
%cmp11.i = icmp sgt i8 %6, %5
br i1 %cmp11.i, label %if.else10, label %if.end14.i
if.end14.i: ; preds = %if.end.i
%cmp18.i = icmp eq i8 %6, 0
%cmp23.i = icmp eq i8 %5, 0
%7 = or i8 %6, %5
%or.cond.i = icmp eq i8 %7, 0
%brmerge.i = or i1 %cmp18.i, %or.cond.i
%brmerge56.i = or i1 %cmp23.i, %brmerge.i
br i1 %brmerge56.i, label %cleanup.split.loop.exit.i, label %while.cond.i
cleanup.split.loop.exit.i: ; preds = %if.end14.i
br i1 %brmerge.i, label %dic.exit, label %if.else10
dic.exit: ; preds = %cleanup.split.loop.exit.i
br i1 %or.cond.i, label %if.then, label %if.then8
if.then: ; preds = %dic.exit
%add = add nsw i32 %p1.030, 1
%add6 = add nsw i32 %p2.028, 1
br label %for.inc
if.then8: ; preds = %while.cond.i, %dic.exit, %for.body
%add9 = add nsw i32 %p2.028, 3
br label %for.inc
if.else10: ; preds = %if.end.i, %cleanup.split.loop.exit.i
%add11 = add nsw i32 %p1.030, 3
br label %for.inc
for.inc: ; preds = %if.then, %if.else10, %if.then8
%p2.1 = phi i32 [ %add6, %if.then ], [ %add9, %if.then8 ], [ %p2.028, %if.else10 ]
%p1.1 = phi i32 [ %add, %if.then ], [ %p1.030, %if.then8 ], [ %add11, %if.else10 ]
%inc = add nuw nsw i32 %i.029, 1
%8 = load i32, ptr %n, align 4, !tbaa !8
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.inc, %entry
%p2.0.lcssa = phi i32 [ 0, %entry ], [ %p2.1, %for.inc ]
%p1.0.lcssa = phi i32 [ 0, %entry ], [ %p1.1, %for.inc ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p1.0.lcssa, i32 noundef %p2.0.lcssa)
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %c2) #4
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %c1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include<string.h>
int main()
{
int n,i,T=0,H=0,f;
char t[101],h[101];
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
scanf("%s%s",t,h);
f=strcmp(t,h);
if(f==0){T+=1;H+=1;}
else if(f>0)T+=3;
else H+=3;
}
printf("%d %d\n",T,H);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201178/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201178/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca [101 x i8], align 16
%h = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %h) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.024 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%H.023 = phi i32 [ %H.1, %for.inc ], [ 0, %entry ]
%T.022 = phi i32 [ %T.1, %for.inc ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %h)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %h) #5
%cmp6 = icmp eq i32 %call5, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add nsw i32 %T.022, 1
%add7 = add nsw i32 %H.023, 1
br label %for.inc
if.else: ; preds = %for.body
%cmp8 = icmp sgt i32 %call5, 0
br i1 %cmp8, label %if.then9, label %if.else11
if.then9: ; preds = %if.else
%add10 = add nsw i32 %T.022, 3
br label %for.inc
if.else11: ; preds = %if.else
%add12 = add nsw i32 %H.023, 3
br label %for.inc
for.inc: ; preds = %if.then, %if.else11, %if.then9
%T.1 = phi i32 [ %add, %if.then ], [ %add10, %if.then9 ], [ %T.022, %if.else11 ]
%H.1 = phi i32 [ %add7, %if.then ], [ %H.023, %if.then9 ], [ %add12, %if.else11 ]
%inc = add nuw nsw i32 %i.024, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%T.0.lcssa = phi i32 [ 0, %entry ], [ %T.1, %for.inc ]
%H.0.lcssa = phi i32 [ 0, %entry ], [ %H.1, %for.inc ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %T.0.lcssa, i32 noundef %H.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
#define mod 1000000007
long long calc(long long a,long long b){
if(b == 0) return 1;
if(b%2 == 0){
long long d = calc(a,b/2);
return (d*d)%mod;
}
return (a*calc(a,b-1))%mod;
}
long long comb(long long n,long long r){
long long tmp = 1,ttmp = 1;
for(int i = n;i >= n-r+1;i--) tmp = (tmp*i)%mod;
for(int i = 1;i <= r;i++) ttmp = (ttmp*i)%mod;
return (tmp*calc(ttmp,mod-2))%mod;
}
int main(void){
int N,M;
scanf("%d%d",&N,&M);
int insu[100000];
for(int i = 0;i < 100000;i++) insu[i] = 0;
int cnt = 0;
for(int i = 2;i*i <= M;i++){
if(M%i == 0){
while(M%i == 0){
insu[cnt]++;
M /= i;
}
cnt++;
}
}
if(M > 1) insu[cnt]++;
long long ans = 1;
for(int i = 0;i <= cnt;i++){
ans *= comb(insu[i]+N-1,insu[i]);
ans %= mod;
}
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201257/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201257/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @calc(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i64 %b, 0
br i1 %cmp, label %common.ret14, label %if.end
if.end: ; preds = %entry
%0 = and i64 %b, 1
%cmp1 = icmp eq i64 %0, 0
br i1 %cmp1, label %if.then2, label %if.end4
common.ret14: ; preds = %entry, %if.end4, %if.then2
%common.ret14.op = phi i64 [ %rem3, %if.then2 ], [ %rem7, %if.end4 ], [ 1, %entry ]
ret i64 %common.ret14.op
if.then2: ; preds = %if.end
%div = sdiv i64 %b, 2
%call = tail call i64 @calc(i64 noundef %a, i64 noundef %div), !range !5
%mul = mul nsw i64 %call, %call
%rem3 = urem i64 %mul, 1000000007
br label %common.ret14
if.end4: ; preds = %if.end
%sub = add nsw i64 %b, -1
%call5 = tail call i64 @calc(i64 noundef %a, i64 noundef %sub), !range !5
%mul6 = mul nsw i64 %call5, %a
%rem7 = srem i64 %mul6, 1000000007
br label %common.ret14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @comb(i64 noundef %n, i64 noundef %r) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %n, %r
%sext = shl i64 %n, 32
%conv126 = ashr exact i64 %sext, 32
%cmp.not.not27 = icmp slt i64 %sub, %conv126
br i1 %cmp.not.not27, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%0 = add i64 %conv126, %r
%1 = sub i64 %0, %n
%2 = xor i64 %n, -1
%3 = add i64 %0, %2
%xtraiter = and i64 %1, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %for.cond5.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %1, -4
br label %for.body
for.cond5.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ %conv126, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%tmp.028.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond5.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond5.preheader.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond5.preheader.loopexit.unr-lcssa ]
%tmp.028.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %tmp.028.unr, %for.cond5.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond5.preheader.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %indvars.iv.epil, %tmp.028.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%indvars.iv.next.epil = add 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.cond5.preheader, label %for.body.epil, !llvm.loop !6
for.cond5.preheader: ; preds = %for.cond5.preheader.loopexit.unr-lcssa, %for.body.epil, %entry
%tmp.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond5.preheader.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%cmp7.not31 = icmp slt i64 %r, 1
br i1 %cmp7.not31, label %for.cond.cleanup9, label %for.body10.preheader
for.body10.preheader: ; preds = %for.cond5.preheader
%xtraiter41 = and i64 %r, 3
%5 = icmp ult i64 %r, 4
br i1 %5, label %for.cond.cleanup9.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter45 = and i64 %r, -4
br label %for.body10
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ %conv126, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%tmp.028 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %indvars.iv, %tmp.028
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%mul.1 = mul nsw i64 %indvars.iv.next, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
%mul.2 = mul nsw i64 %indvars.iv.next.1, %rem.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nsw i64 %indvars.iv, -3
%mul.3 = mul nsw i64 %indvars.iv.next.2, %rem.2
%rem.3 = srem i64 %mul.3, 1000000007
%indvars.iv.next.3 = add nsw i64 %indvars.iv, -4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3.not, label %for.cond5.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !8
for.cond.cleanup9.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%rem13.lcssa.ph = phi i64 [ undef, %for.body10.preheader ], [ %rem13.3, %for.body10 ]
%indvars.iv37.unr = phi i64 [ 1, %for.body10.preheader ], [ %indvars.iv.next38.3, %for.body10 ]
%ttmp.032.unr = phi i64 [ 1, %for.body10.preheader ], [ %rem13.3, %for.body10 ]
%lcmp.mod43.not = icmp eq i64 %xtraiter41, 0
br i1 %lcmp.mod43.not, label %for.cond.cleanup9, label %for.body10.epil
for.body10.epil: ; preds = %for.cond.cleanup9.loopexit.unr-lcssa, %for.body10.epil
%indvars.iv37.epil = phi i64 [ %indvars.iv.next38.epil, %for.body10.epil ], [ %indvars.iv37.unr, %for.cond.cleanup9.loopexit.unr-lcssa ]
%ttmp.032.epil = phi i64 [ %rem13.epil, %for.body10.epil ], [ %ttmp.032.unr, %for.cond.cleanup9.loopexit.unr-lcssa ]
%epil.iter42 = phi i64 [ %epil.iter42.next, %for.body10.epil ], [ 0, %for.cond.cleanup9.loopexit.unr-lcssa ]
%mul12.epil = mul nsw i64 %indvars.iv37.epil, %ttmp.032.epil
%rem13.epil = srem i64 %mul12.epil, 1000000007
%indvars.iv.next38.epil = add nuw nsw i64 %indvars.iv37.epil, 1
%epil.iter42.next = add i64 %epil.iter42, 1
%epil.iter42.cmp.not = icmp eq i64 %epil.iter42.next, %xtraiter41
br i1 %epil.iter42.cmp.not, label %for.cond.cleanup9, label %for.body10.epil, !llvm.loop !10
for.cond.cleanup9: ; preds = %for.cond.cleanup9.loopexit.unr-lcssa, %for.body10.epil, %for.cond5.preheader
%ttmp.0.lcssa = phi i64 [ 1, %for.cond5.preheader ], [ %rem13.lcssa.ph, %for.cond.cleanup9.loopexit.unr-lcssa ], [ %rem13.epil, %for.body10.epil ]
%call = tail call i64 @calc(i64 noundef %ttmp.0.lcssa, i64 noundef 1000000005), !range !5
%mul16 = mul nsw i64 %call, %tmp.0.lcssa
%rem17 = srem i64 %mul16, 1000000007
ret i64 %rem17
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv37 = phi i64 [ 1, %for.body10.preheader.new ], [ %indvars.iv.next38.3, %for.body10 ]
%ttmp.032 = phi i64 [ 1, %for.body10.preheader.new ], [ %rem13.3, %for.body10 ]
%niter46 = phi i64 [ 0, %for.body10.preheader.new ], [ %niter46.next.3, %for.body10 ]
%mul12 = mul nsw i64 %indvars.iv37, %ttmp.032
%rem13 = srem i64 %mul12, 1000000007
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%mul12.1 = mul nsw i64 %indvars.iv.next38, %rem13
%rem13.1 = srem i64 %mul12.1, 1000000007
%indvars.iv.next38.1 = add nuw nsw i64 %indvars.iv37, 2
%mul12.2 = mul nsw i64 %indvars.iv.next38.1, %rem13.1
%rem13.2 = srem i64 %mul12.2, 1000000007
%indvars.iv.next38.2 = add nuw nsw i64 %indvars.iv37, 3
%mul12.3 = mul nsw i64 %indvars.iv.next38.2, %rem13.2
%rem13.3 = srem i64 %mul12.3, 1000000007
%indvars.iv.next38.3 = add nuw nsw i64 %indvars.iv37, 4
%niter46.next.3 = add i64 %niter46, 4
%niter46.ncmp.3 = icmp eq i64 %niter46.next.3, %unroll_iter45
br i1 %niter46.ncmp.3, label %for.cond.cleanup9.loopexit.unr-lcssa, label %for.body10, !llvm.loop !11
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%insu = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %insu) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %insu, i8 0, i64 400000, i1 false), !tbaa !12
%M.promoted60 = load i32, ptr %M, align 4, !tbaa !12
%cmp3.not64 = icmp slt i32 %M.promoted60, 4
br i1 %cmp3.not64, label %for.cond.cleanup4, label %for.body5
for.cond.cleanup4: ; preds = %for.inc13, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %for.inc13 ]
%.lcssa = phi i32 [ %M.promoted60, %entry ], [ %div.lcssa61, %for.inc13 ]
%cmp16 = icmp sgt i32 %.lcssa, 1
br i1 %cmp16, label %if.then17, label %if.end21
for.body5: ; preds = %entry, %for.inc13
%i1.067 = phi i32 [ %inc14, %for.inc13 ], [ 2, %entry ]
%cnt.066 = phi i32 [ %cnt.1, %for.inc13 ], [ 0, %entry ]
%div.lcssa6365 = phi i32 [ %div.lcssa61, %for.inc13 ], [ %M.promoted60, %entry ]
%rem = srem i32 %div.lcssa6365, %i1.067
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %while.body.lr.ph, label %for.inc13
while.body.lr.ph: ; preds = %for.body5
%idxprom9 = sext i32 %cnt.066 to i64
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr %insu, i64 0, i64 %idxprom9
%arrayidx10.promoted = load i32, ptr %arrayidx10, align 4, !tbaa !12
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%inc1159 = phi i32 [ %arrayidx10.promoted, %while.body.lr.ph ], [ %inc11, %while.body ]
%div5558 = phi i32 [ %div.lcssa6365, %while.body.lr.ph ], [ %div, %while.body ]
%inc11 = add nsw i32 %inc1159, 1
%div = sdiv i32 %div5558, %i1.067
%rem7 = srem i32 %div, %i1.067
%cmp8 = icmp eq i32 %rem7, 0
br i1 %cmp8, label %while.body, label %while.end, !llvm.loop !16
while.end: ; preds = %while.body
store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !12
store i32 %div, ptr %M, align 4, !tbaa !12
%inc12 = add nsw i32 %cnt.066, 1
br label %for.inc13
for.inc13: ; preds = %for.body5, %while.end
%div.lcssa61 = phi i32 [ %div, %while.end ], [ %div.lcssa6365, %for.body5 ]
%cnt.1 = phi i32 [ %inc12, %while.end ], [ %cnt.066, %for.body5 ]
%inc14 = add nuw nsw i32 %i1.067, 1
%mul = mul nsw i32 %inc14, %inc14
%cmp3.not = icmp sgt i32 %mul, %div.lcssa61
br i1 %cmp3.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !17
if.then17: ; preds = %for.cond.cleanup4
%idxprom18 = sext i32 %cnt.0.lcssa to i64
%arrayidx19 = getelementptr inbounds [100000 x i32], ptr %insu, i64 0, i64 %idxprom18
%0 = load i32, ptr %arrayidx19, align 4, !tbaa !12
%inc20 = add nsw i32 %0, 1
store i32 %inc20, ptr %arrayidx19, align 4, !tbaa !12
br label %if.end21
if.end21: ; preds = %if.then17, %for.cond.cleanup4
%cmp24.not69 = icmp slt i32 %cnt.0.lcssa, 0
br i1 %cmp24.not69, label %for.cond.cleanup25, label %for.body26.lr.ph
for.body26.lr.ph: ; preds = %if.end21
%1 = load i32, ptr %N, align 4, !tbaa !12
%2 = add nuw i32 %cnt.0.lcssa, 1
%wide.trip.count = zext i32 %2 to i64
br label %for.body26
for.cond.cleanup25: ; preds = %comb.exit, %if.end21
%ans.0.lcssa = phi i64 [ 1, %if.end21 ], [ %rem34, %comb.exit ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %insu) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body26: ; preds = %for.body26.lr.ph, %comb.exit
%indvars.iv = phi i64 [ 0, %for.body26.lr.ph ], [ %indvars.iv.next, %comb.exit ]
%ans.070 = phi i64 [ 1, %for.body26.lr.ph ], [ %rem34, %comb.exit ]
%arrayidx28 = getelementptr inbounds [100000 x i32], ptr %insu, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx28, align 4, !tbaa !12
%add = add i32 %3, -1
%sub = add i32 %add, %1
%conv = sext i32 %sub to i64
%conv31 = sext i32 %3 to i64
%sub.i = sub nsw i64 %conv, %conv31
%cmp.not.not27.i = icmp sgt i32 %3, 0
br i1 %cmp.not.not27.i, label %for.body.i, label %comb.exit
for.cond5.preheader.i: ; preds = %for.body.i
%cmp7.not31.i = icmp slt i32 %3, 1
br i1 %cmp7.not31.i, label %comb.exit, label %for.body10.i.preheader
for.body10.i.preheader: ; preds = %for.cond5.preheader.i
%xtraiter = and i64 %conv31, 3
%4 = icmp ult i32 %3, 4
br i1 %4, label %comb.exit.loopexit.unr-lcssa, label %for.body10.i.preheader.new
for.body10.i.preheader.new: ; preds = %for.body10.i.preheader
%unroll_iter = and i64 %conv31, -4
br label %for.body10.i
for.body.i: ; preds = %for.body26, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %conv, %for.body26 ]
%tmp.028.i = phi i64 [ %rem.i, %for.body.i ], [ 1, %for.body26 ]
%mul.i = mul nsw i64 %tmp.028.i, %indvars.iv.i
%rem.i = srem i64 %mul.i, 1000000007
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%cmp.not.not.i = icmp slt i64 %sub.i, %indvars.iv.next.i
br i1 %cmp.not.not.i, label %for.body.i, label %for.cond5.preheader.i, !llvm.loop !8
for.body10.i: ; preds = %for.body10.i, %for.body10.i.preheader.new
%indvars.iv37.i = phi i64 [ 1, %for.body10.i.preheader.new ], [ %indvars.iv.next38.i.3, %for.body10.i ]
%ttmp.032.i = phi i64 [ 1, %for.body10.i.preheader.new ], [ %rem13.i.3, %for.body10.i ]
%niter = phi i64 [ 0, %for.body10.i.preheader.new ], [ %niter.next.3, %for.body10.i ]
%mul12.i = mul nsw i64 %ttmp.032.i, %indvars.iv37.i
%rem13.i = srem i64 %mul12.i, 1000000007
%indvars.iv.next38.i = add nuw nsw i64 %indvars.iv37.i, 1
%mul12.i.1 = mul nsw i64 %rem13.i, %indvars.iv.next38.i
%rem13.i.1 = srem i64 %mul12.i.1, 1000000007
%indvars.iv.next38.i.1 = add nuw nsw i64 %indvars.iv37.i, 2
%mul12.i.2 = mul nsw i64 %rem13.i.1, %indvars.iv.next38.i.1
%rem13.i.2 = srem i64 %mul12.i.2, 1000000007
%indvars.iv.next38.i.2 = add nuw nsw i64 %indvars.iv37.i, 3
%mul12.i.3 = mul nsw i64 %rem13.i.2, %indvars.iv.next38.i.2
%rem13.i.3 = srem i64 %mul12.i.3, 1000000007
%indvars.iv.next38.i.3 = add nuw nsw i64 %indvars.iv37.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %comb.exit.loopexit.unr-lcssa, label %for.body10.i, !llvm.loop !11
comb.exit.loopexit.unr-lcssa: ; preds = %for.body10.i, %for.body10.i.preheader
%rem13.i.lcssa.ph = phi i64 [ undef, %for.body10.i.preheader ], [ %rem13.i.3, %for.body10.i ]
%indvars.iv37.i.unr = phi i64 [ 1, %for.body10.i.preheader ], [ %indvars.iv.next38.i.3, %for.body10.i ]
%ttmp.032.i.unr = phi i64 [ 1, %for.body10.i.preheader ], [ %rem13.i.3, %for.body10.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %comb.exit, label %for.body10.i.epil
for.body10.i.epil: ; preds = %comb.exit.loopexit.unr-lcssa, %for.body10.i.epil
%indvars.iv37.i.epil = phi i64 [ %indvars.iv.next38.i.epil, %for.body10.i.epil ], [ %indvars.iv37.i.unr, %comb.exit.loopexit.unr-lcssa ]
%ttmp.032.i.epil = phi i64 [ %rem13.i.epil, %for.body10.i.epil ], [ %ttmp.032.i.unr, %comb.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body10.i.epil ], [ 0, %comb.exit.loopexit.unr-lcssa ]
%mul12.i.epil = mul nsw i64 %ttmp.032.i.epil, %indvars.iv37.i.epil
%rem13.i.epil = srem i64 %mul12.i.epil, 1000000007
%indvars.iv.next38.i.epil = add nuw nsw i64 %indvars.iv37.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %comb.exit, label %for.body10.i.epil, !llvm.loop !18
comb.exit: ; preds = %comb.exit.loopexit.unr-lcssa, %for.body10.i.epil, %for.body26, %for.cond5.preheader.i
%tmp.0.lcssa.i77 = phi i64 [ %rem.i, %for.cond5.preheader.i ], [ 1, %for.body26 ], [ %rem.i, %for.body10.i.epil ], [ %rem.i, %comb.exit.loopexit.unr-lcssa ]
%ttmp.0.lcssa.i = phi i64 [ 1, %for.cond5.preheader.i ], [ 1, %for.body26 ], [ %rem13.i.lcssa.ph, %comb.exit.loopexit.unr-lcssa ], [ %rem13.i.epil, %for.body10.i.epil ]
%call.i = call i64 @calc(i64 noundef %ttmp.0.lcssa.i, i64 noundef 1000000005), !range !5
%mul16.i = mul nsw i64 %call.i, %tmp.0.lcssa.i77
%rem17.i = srem i64 %mul16.i, 1000000007
%mul33 = mul nsw i64 %rem17.i, %ans.070
%rem34 = srem i64 %mul33, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup25, label %for.body26, !llvm.loop !19
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 -1000000006, i64 1000000007}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.unroll.disable"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !7}
!11 = distinct !{!11, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C/C++ TBAA"}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !9}
!18 = distinct !{!18, !7}
!19 = distinct !{!19, !9}
|
#include<stdio.h>
int main(void)
{
int k,n,a[200001],i,L[200001],g;
scanf("%d %d",&k,&n);
for(i = 1 ; i <= n ; i++)
{
scanf("%d",&a[i]);
}
for(i = 1 ; i <= n-1 ; i++)
{
L[i] = a[i+1] - a[i];
}
L[n] = a[1] + k - a[n];
g = L[1];
for(i = 1 ; i <= n ; i++)
{
if(L[i] > g)
{
g = L[i];
}
}
printf("%d\n",k - g);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [200001 x i32], align 16
%L = alloca [200001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %L) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not48 = icmp slt i32 %0, 1
br i1 %cmp.not48, label %for.cond2.preheader.for.end14_crit_edge, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not.not50 = icmp sgt i32 %12, 1
br i1 %cmp3.not.not50, label %for.body4.preheader, label %for.cond2.preheader.for.end14_crit_edge
for.cond2.preheader.for.end14_crit_edge: ; preds = %entry, %for.cond2.preheader
%.lcssa70 = phi i32 [ %12, %for.cond2.preheader ], [ %0, %entry ]
%arrayidx15.phi.trans.insert = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 1
%.pre66 = load i32, ptr %arrayidx15.phi.trans.insert, align 4, !tbaa !5
br label %for.end14
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %12 to i64
%arrayidx8.phi.trans.insert = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 1
%.pre = load i32, ptr %arrayidx8.phi.trans.insert, align 4, !tbaa !5
%1 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %12, 9
br i1 %min.iters.check, label %for.body4.preheader90, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %1, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load71, %vector.body ]
%offset.idx = or i64 %index, 1
%2 = or i64 %index, 2
%3 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %2
%wide.load = load <4 x i32>, ptr %3, align 8, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load71 = load <4 x i32>, ptr %4, align 8, !tbaa !5
%5 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load71, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%7 = sub nsw <4 x i32> %wide.load, %5
%8 = sub nsw <4 x i32> %wide.load71, %6
%9 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 %offset.idx
store <4 x i32> %7, ptr %9, align 4, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> %8, ptr %10, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %1, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load71, i64 3
br i1 %cmp.n, label %for.end14, label %for.body4.preheader90
for.body4.preheader90: ; preds = %for.body4.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body4.preheader ]
%indvars.iv58.ph = phi i64 [ %ind.end, %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 [200001 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
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %13
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader90, %for.body4
%scalar.recur = phi i32 [ %14, %for.body4 ], [ %scalar.recur.ph, %for.body4.preheader90 ]
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body4 ], [ %indvars.iv58.ph, %for.body4.preheader90 ]
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%arrayidx6 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv.next59
%14 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub9 = sub nsw i32 %14, %scalar.recur
%arrayidx11 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 %indvars.iv58
store i32 %sub9, ptr %arrayidx11, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %for.end14, label %for.body4, !llvm.loop !14
for.end14: ; preds = %for.body4, %middle.block, %for.cond2.preheader.for.end14_crit_edge
%.lcssa69 = phi i32 [ %.lcssa70, %for.cond2.preheader.for.end14_crit_edge ], [ %12, %middle.block ], [ %12, %for.body4 ]
%15 = phi i32 [ %.pre66, %for.cond2.preheader.for.end14_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body4 ]
%16 = load i32, ptr %k, align 4, !tbaa !5
%add16 = add nsw i32 %16, %15
%idxprom17 = sext i32 %.lcssa69 to i64
%arrayidx18 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %idxprom17
%17 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%sub19 = sub i32 %add16, %17
%arrayidx21 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 %idxprom17
store i32 %sub19, ptr %arrayidx21, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 1
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp24.not52 = icmp slt i32 %.lcssa69, 1
br i1 %cmp24.not52, label %for.end33, label %for.body25.preheader
for.body25.preheader: ; preds = %for.end14
%19 = add nuw i32 %.lcssa69, 1
%wide.trip.count64 = zext i32 %19 to i64
%20 = add nsw i64 %wide.trip.count64, -1
%min.iters.check74 = icmp ult i32 %.lcssa69, 8
br i1 %min.iters.check74, label %for.body25.preheader88, label %vector.ph75
vector.ph75: ; preds = %for.body25.preheader
%n.vec77 = and i64 %20, -8
%ind.end78 = or i64 %n.vec77, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %18, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body81
vector.body81: ; preds = %vector.body81, %vector.ph75
%index82 = phi i64 [ 0, %vector.ph75 ], [ %index.next87, %vector.body81 ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph75 ], [ %23, %vector.body81 ]
%vec.phi83 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph75 ], [ %24, %vector.body81 ]
%offset.idx84 = or i64 %index82, 1
%21 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 %offset.idx84
%wide.load85 = load <4 x i32>, ptr %21, align 4, !tbaa !5
%22 = getelementptr inbounds i32, ptr %21, i64 4
%wide.load86 = load <4 x i32>, ptr %22, align 4, !tbaa !5
%23 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load85, <4 x i32> %vec.phi)
%24 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load86, <4 x i32> %vec.phi83)
%index.next87 = add nuw i64 %index82, 8
%25 = icmp eq i64 %index.next87, %n.vec77
br i1 %25, label %middle.block72, label %vector.body81, !llvm.loop !15
middle.block72: ; preds = %vector.body81
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %23, <4 x i32> %24)
%26 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n80 = icmp eq i64 %20, %n.vec77
br i1 %cmp.n80, label %for.end33, label %for.body25.preheader88
for.body25.preheader88: ; preds = %for.body25.preheader, %middle.block72
%indvars.iv61.ph = phi i64 [ 1, %for.body25.preheader ], [ %ind.end78, %middle.block72 ]
%g.054.ph = phi i32 [ %18, %for.body25.preheader ], [ %26, %middle.block72 ]
br label %for.body25
for.body25: ; preds = %for.body25.preheader88, %for.body25
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body25 ], [ %indvars.iv61.ph, %for.body25.preheader88 ]
%g.054 = phi i32 [ %spec.select, %for.body25 ], [ %g.054.ph, %for.body25.preheader88 ]
%arrayidx27 = getelementptr inbounds [200001 x i32], ptr %L, i64 0, i64 %indvars.iv61
%27 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %27, i32 %g.054)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
br i1 %exitcond65.not, label %for.end33, label %for.body25, !llvm.loop !16
for.end33: ; preds = %for.body25, %middle.block72, %for.end14
%g.0.lcssa = phi i32 [ %18, %for.end14 ], [ %26, %middle.block72 ], [ %spec.select, %for.body25 ]
%sub34 = sub nsw i32 %16, %g.0.lcssa
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub34)
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %L) #4
call void @llvm.lifetime.end.p0(i64 800004, 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 %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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
|
#include <stdio.h>
int main(void)
{
int k,n;
scanf("%d",&k);
scanf("%d",&n);
int a[n],i,max;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
max=a[0]+(k-a[n-1]);
for(i=1;i<n;i++)
if(a[i]-a[i-1]>max)
max=a[i]-a[i-1];
printf("%d",k-max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%call1 = 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
%cmp37 = icmp sgt i32 %3, 0
br i1 %cmp37, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%6 = phi i32 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.end.loopexit ]
%7 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %.lcssa, -1
%idxprom4 = sext i32 %sub to i64
%arrayidx5 = getelementptr inbounds i32, ptr %vla, i64 %idxprom4
%8 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%sub6 = add i32 %7, %6
%add = sub i32 %sub6, %8
%cmp839 = icmp sgt i32 %.lcssa, 1
br i1 %cmp839, label %for.body9.preheader, label %for.end25
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %.lcssa to i64
%9 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %.lcssa, 9
br i1 %min.iters.check, label %for.body9.preheader53, label %vector.ph
vector.ph: ; preds = %for.body9.preheader
%n.vec = and i64 %9, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %6, i64 3
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %add, 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 ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load52, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %16, %vector.body ]
%vec.phi51 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %17, %vector.body ]
%offset.idx = or i64 %index, 1
%10 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load52 = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%13 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load52, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%14 = sub nsw <4 x i32> %wide.load, %12
%15 = sub nsw <4 x i32> %wide.load52, %13
%16 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %14, <4 x i32> %vec.phi)
%17 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %15, <4 x i32> %vec.phi51)
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %16, <4 x i32> %17)
%19 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %9, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load52, i64 3
br i1 %cmp.n, label %for.end25, label %for.body9.preheader53
for.body9.preheader53: ; preds = %for.body9.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %6, %for.body9.preheader ]
%indvars.iv45.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body9.preheader ]
%max.041.ph = phi i32 [ %19, %middle.block ], [ %add, %for.body9.preheader ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader53, %for.body9
%scalar.recur = phi i32 [ %20, %for.body9 ], [ %scalar.recur.ph, %for.body9.preheader53 ]
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body9 ], [ %indvars.iv45.ph, %for.body9.preheader53 ]
%max.041 = phi i32 [ %spec.select, %for.body9 ], [ %max.041.ph, %for.body9.preheader53 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv45
%20 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%sub15 = sub nsw i32 %20, %scalar.recur
%spec.select = call i32 @llvm.smax.i32(i32 %sub15, i32 %max.041)
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
br i1 %exitcond.not, label %for.end25, label %for.body9, !llvm.loop !14
for.end25: ; preds = %for.body9, %middle.block, %for.end
%max.0.lcssa = phi i32 [ %add, %for.end ], [ %19, %middle.block ], [ %spec.select, %for.body9 ]
%sub26 = sub nsw i32 %7, %max.0.lcssa
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub26)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main(void)
{
int k,n;
scanf("%d%d", &k, &n);
int a[n];
int i = 0;
while (i < n)
scanf("%d", &a[i++]);
int max = 0;
i = 1;
while (i < n)
{
if (a[i] - a[i - 1] > max)
max = a[i] - a[i - 1];
i++;
}
if (max < k - a[n - 1] + a[0])
max = k - a[n - 1] + a[0];
printf("%d", k - max);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201394/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201394/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, 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
%cmp45 = icmp sgt i32 %3, 0
br i1 %cmp45, label %while.body, label %while.cond2.preheader.while.end18_crit_edge
while.cond2.preheader: ; preds = %while.body
%cmp347 = icmp sgt i32 %15, 1
br i1 %cmp347, label %while.body4.preheader, label %while.cond2.preheader.while.end18_crit_edge
while.cond2.preheader.while.end18_crit_edge: ; preds = %entry, %while.cond2.preheader
%.lcssa61 = phi i32 [ %15, %while.cond2.preheader ], [ %3, %entry ]
%.pre57 = load i32, ptr %vla, align 16, !tbaa !5
br label %while.end18
while.body4.preheader: ; preds = %while.cond2.preheader
%wide.trip.count = zext i32 %15 to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%4 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %15, 9
br i1 %min.iters.check, label %while.body4.preheader64, label %vector.ph
vector.ph: ; preds = %while.body4.preheader
%n.vec = and i64 %4, -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.load63, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load63 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%8 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load63, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = sub nsw <4 x i32> %wide.load, %7
%10 = sub nsw <4 x i32> %wide.load63, %8
%11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %vec.phi)
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %10, <4 x i32> %vec.phi62)
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%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 %4, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load63, i64 3
br i1 %cmp.n, label %while.end18, label %while.body4.preheader64
while.body4.preheader64: ; preds = %while.body4.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %while.body4.preheader ]
%indvars.iv53.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %while.body4.preheader ]
%max.049.ph = phi i32 [ %14, %middle.block ], [ 0, %while.body4.preheader ]
br label %while.body4
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %while.body, label %while.cond2.preheader, !llvm.loop !13
while.body4: ; preds = %while.body4.preheader64, %while.body4
%scalar.recur = phi i32 [ %17, %while.body4 ], [ %scalar.recur.ph, %while.body4.preheader64 ]
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %while.body4 ], [ %indvars.iv53.ph, %while.body4.preheader64 ]
%max.049 = phi i32 [ %spec.select, %while.body4 ], [ %max.049.ph, %while.body4.preheader64 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv53
%17 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub9 = sub nsw i32 %17, %scalar.recur
%spec.select = call i32 @llvm.smax.i32(i32 %sub9, i32 %max.049)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
br i1 %exitcond.not, label %while.end18, label %while.body4, !llvm.loop !14
while.end18: ; preds = %while.body4, %middle.block, %while.cond2.preheader.while.end18_crit_edge
%.lcssa60 = phi i32 [ %.lcssa61, %while.cond2.preheader.while.end18_crit_edge ], [ %15, %middle.block ], [ %15, %while.body4 ]
%18 = phi i32 [ %.pre57, %while.cond2.preheader.while.end18_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %while.body4 ]
%max.0.lcssa = phi i32 [ 0, %while.cond2.preheader.while.end18_crit_edge ], [ %14, %middle.block ], [ %spec.select, %while.body4 ]
%19 = load i32, ptr %k, align 4, !tbaa !5
%sub19 = add nsw i32 %.lcssa60, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %idxprom20
%20 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%sub22 = sub i32 %19, %20
%add = add nsw i32 %sub22, %18
%spec.select44 = call i32 @llvm.smax.i32(i32 %max.0.lcssa, i32 %add)
%sub33 = sub nsw i32 %19, %spec.select44
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub33)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) {
return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) {
return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 200001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;
int main(void) {
int k, n;
scanf("%d %d", &k, &n);
int a[MAX];
rep(i, 0, n) scanf("%d", &a[i]);
int max = a[0] + (k - a[n-1]);
rep(i, 0, n-1) max = max(max, a[i+1] - a[i]);
printf("%d\n", k - max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201444/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201444/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !9
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !10
%1 = load ptr, ptr %b, align 8, !tbaa !10
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [200001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %a) #8
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%1 = phi i32 [ undef, %entry ], [ %.pre, %for.cond.cleanup.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %15, %for.cond.cleanup.loopexit ]
%2 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %.lcssa, -1
%idxprom3 = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %idxprom3
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub5 = add i32 %2, %1
%add = sub i32 %sub5, %3
%cmp941 = icmp sgt i32 %.lcssa, 1
br i1 %cmp941, label %for.body11.preheader, label %for.cond.cleanup10
for.body11.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %.lcssa, 9
br i1 %min.iters.check, label %for.body11.preheader54, label %vector.ph
vector.ph: ; preds = %for.body11.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %1, i64 3
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %add, 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 ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load53, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ]
%vec.phi52 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ]
%4 = or i64 %index, 1
%5 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %4
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load53 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%8 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load53, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = sub nsw <4 x i32> %wide.load, %7
%10 = sub nsw <4 x i32> %wide.load53, %8
%11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %9)
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi52, <4 x i32> %10)
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !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
%vector.recur.extract = extractelement <4 x i32> %wide.load53, i64 3
br i1 %cmp.n, label %for.cond.cleanup10, label %for.body11.preheader54
for.body11.preheader54: ; preds = %for.body11.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %1, %for.body11.preheader ]
%indvars.iv47.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body11.preheader ]
%max.042.ph = phi i32 [ %14, %middle.block ], [ %add, %for.body11.preheader ]
br label %for.body11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200001 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
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !16
for.cond.cleanup10: ; preds = %for.body11, %middle.block, %for.cond.cleanup
%max.0.lcssa = phi i32 [ %add, %for.cond.cleanup ], [ %14, %middle.block ], [ %max.0.sub17, %for.body11 ]
%sub28 = sub nsw i32 %2, %max.0.lcssa
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub28)
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #8
ret i32 0
for.body11: ; preds = %for.body11.preheader54, %for.body11
%scalar.recur = phi i32 [ %17, %for.body11 ], [ %scalar.recur.ph, %for.body11.preheader54 ]
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body11 ], [ %indvars.iv47.ph, %for.body11.preheader54 ]
%max.042 = phi i32 [ %max.0.sub17, %for.body11 ], [ %max.042.ph, %for.body11.preheader54 ]
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%arrayidx14 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv.next48
%17 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%sub17 = sub nsw i32 %17, %scalar.recur
%max.0.sub17 = call i32 @llvm.smax.i32(i32 %max.042, i32 %sub17)
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup10, label %for.body11, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!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}
!17 = distinct !{!17, !13, !15, !14}
|
/*隣接しているところに絶対行く。
間の距離を計算。
*/
#include<stdio.h>
int main(){
int K, N, i, dist;
scanf("%d %d", &K, &N);
int A[N], d[N];
for(i = 0; i < N; i++){
scanf("%d", &(A[i]));
};
for(i = 0; i < N - 1; i++){
d[i] = A[i+1] - A[i];
}
d[N-1] = (K - A[N-1]) + A[0];
/*d[i] は i と i+1の間の距離*/
dist = K;
for(i = 0; i < N; i++){
if(K - d[i] < dist){
dist = K - d[i];
}
}
printf("%d\n", dist);
/*printf("%d %d\n", K, N);
for(i = 0; i < N; i++){
printf("%d ", A[i]);
}*/
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201488/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201488/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%K = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp51 = icmp sgt i32 %3, 0
br i1 %cmp51, label %for.body, label %for.cond3.preheader.thread
for.cond3.preheader.thread: ; preds = %entry
%sub72 = add i32 %3, -1
br label %for.cond3.preheader.for.end15_crit_edge
for.cond3.preheader: ; preds = %for.body
%sub = add i32 %15, -1
%cmp453 = icmp sgt i32 %15, 1
br i1 %cmp453, label %for.body5.preheader, label %for.cond3.preheader.for.end15_crit_edge
for.cond3.preheader.for.end15_crit_edge: ; preds = %for.cond3.preheader.thread, %for.cond3.preheader
%sub77 = phi i32 [ %sub72, %for.cond3.preheader.thread ], [ %sub, %for.cond3.preheader ]
%.lcssa75 = phi i32 [ %3, %for.cond3.preheader.thread ], [ %15, %for.cond3.preheader ]
%.pre70 = load i32, ptr %vla, align 16, !tbaa !5
br label %for.end15
for.body5.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %15, 9
br i1 %min.iters.check, label %for.body5.preheader95, label %vector.ph
vector.ph: ; preds = %for.body5.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.load78, %vector.body ]
%5 = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %5
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load78 = 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.load78, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = sub nsw <4 x i32> %wide.load, %8
%11 = sub nsw <4 x i32> %wide.load78, %9
%12 = getelementptr inbounds i32, ptr %vla1, i64 %index
store <4 x i32> %10, ptr %12, align 16, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %11, ptr %13, align 16, !tbaa !5
%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 !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load78, i64 3
br i1 %cmp.n, label %for.end15, label %for.body5.preheader95
for.body5.preheader95: ; preds = %for.body5.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body5.preheader ]
%indvars.iv62.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body5.preheader ]
br label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%15 = load i32, ptr %N, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.body5: ; preds = %for.body5.preheader95, %for.body5
%scalar.recur = phi i32 [ %17, %for.body5 ], [ %scalar.recur.ph, %for.body5.preheader95 ]
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body5 ], [ %indvars.iv62.ph, %for.body5.preheader95 ]
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next63
%17 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%sub10 = sub nsw i32 %17, %scalar.recur
%arrayidx12 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv62
store i32 %sub10, ptr %arrayidx12, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body5, !llvm.loop !14
for.end15: ; preds = %for.body5, %middle.block, %for.cond3.preheader.for.end15_crit_edge
%sub76 = phi i32 [ %sub77, %for.cond3.preheader.for.end15_crit_edge ], [ %sub, %middle.block ], [ %sub, %for.body5 ]
%.lcssa74 = phi i32 [ %.lcssa75, %for.cond3.preheader.for.end15_crit_edge ], [ %15, %middle.block ], [ %15, %for.body5 ]
%18 = phi i32 [ %.pre70, %for.cond3.preheader.for.end15_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body5 ]
%19 = load i32, ptr %K, align 4, !tbaa !5
%idxprom17 = sext i32 %sub76 to i64
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17
%20 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%sub19 = sub i32 %19, %20
%add21 = add nsw i32 %sub19, %18
%arrayidx24 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom17
store i32 %add21, ptr %arrayidx24, align 4, !tbaa !5
%cmp2656 = icmp sgt i32 %.lcssa74, 0
br i1 %cmp2656, label %for.body27.preheader, label %for.end37
for.body27.preheader: ; preds = %for.end15
%wide.trip.count68 = zext i32 %.lcssa74 to i64
%min.iters.check81 = icmp ult i32 %.lcssa74, 8
br i1 %min.iters.check81, label %for.body27.preheader93, label %vector.ph82
vector.ph82: ; preds = %for.body27.preheader
%n.vec84 = and i64 %wide.trip.count68, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %19, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %19, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body87
vector.body87: ; preds = %vector.body87, %vector.ph82
%index88 = phi i64 [ 0, %vector.ph82 ], [ %index.next92, %vector.body87 ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph82 ], [ %25, %vector.body87 ]
%vec.phi89 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph82 ], [ %26, %vector.body87 ]
%21 = getelementptr inbounds i32, ptr %vla1, i64 %index88
%wide.load90 = load <4 x i32>, ptr %21, align 16, !tbaa !5
%22 = getelementptr inbounds i32, ptr %21, i64 4
%wide.load91 = load <4 x i32>, ptr %22, align 16, !tbaa !5
%23 = sub nsw <4 x i32> %broadcast.splat, %wide.load90
%24 = sub nsw <4 x i32> %broadcast.splat, %wide.load91
%25 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %23, <4 x i32> %vec.phi)
%26 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %24, <4 x i32> %vec.phi89)
%index.next92 = add nuw i64 %index88, 8
%27 = icmp eq i64 %index.next92, %n.vec84
br i1 %27, label %middle.block79, label %vector.body87, !llvm.loop !15
middle.block79: ; preds = %vector.body87
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %25, <4 x i32> %26)
%28 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n86 = icmp eq i64 %n.vec84, %wide.trip.count68
br i1 %cmp.n86, label %for.end37, label %for.body27.preheader93
for.body27.preheader93: ; preds = %for.body27.preheader, %middle.block79
%indvars.iv65.ph = phi i64 [ 0, %for.body27.preheader ], [ %n.vec84, %middle.block79 ]
%dist.057.ph = phi i32 [ %19, %for.body27.preheader ], [ %28, %middle.block79 ]
br label %for.body27
for.body27: ; preds = %for.body27.preheader93, %for.body27
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body27 ], [ %indvars.iv65.ph, %for.body27.preheader93 ]
%dist.057 = phi i32 [ %spec.select, %for.body27 ], [ %dist.057.ph, %for.body27.preheader93 ]
%arrayidx29 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv65
%29 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%sub30 = sub nsw i32 %19, %29
%spec.select = call i32 @llvm.smin.i32(i32 %sub30, i32 %dist.057)
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
br i1 %exitcond69.not, label %for.end37, label %for.body27, !llvm.loop !16
for.end37: ; preds = %for.body27, %middle.block79, %for.end15
%dist.0.lcssa = phi i32 [ %19, %for.end15 ], [ %28, %middle.block79 ], [ %spec.select, %for.body27 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %dist.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
|
#include<stdio.h>
int main()
{
int k = 0;
int n = 0;
int a[200000];
int max = 0;
int buf = 0;
scanf("%d %d",&k,&n);
for(int i = 0;i < n;i++)
{
scanf("%d",&a[i]);
}
max = k -a[n-1] + a[0];
for(int j = 0;j <( n -1);j++)
{
buf = a[j + 1]-a[j];
if (buf > max)
{
max = buf;
}
}
max = k-max;
printf("%d",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201530/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201530/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
store i32 0, ptr %k, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
store i32 0, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, 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.loopexit: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%1 = phi i32 [ undef, %entry ], [ %.pre, %for.cond.cleanup.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %15, %for.cond.cleanup.loopexit ]
%2 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %.lcssa, -1
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%sub4 = sub i32 %2, %3
%add = add nsw i32 %sub4, %1
%cmp833 = icmp sgt i32 %.lcssa, 1
br i1 %cmp833, label %for.body10.preheader, label %for.cond.cleanup9
for.body10.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %.lcssa, 9
br i1 %min.iters.check, label %for.body10.preheader46, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %1, i64 3
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %add, 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 ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load45, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ]
%vec.phi44 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ]
%4 = or i64 %index, 1
%5 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %4
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load45 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%8 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load45, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = sub nsw <4 x i32> %wide.load, %7
%10 = sub nsw <4 x i32> %wide.load45, %8
%11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %vec.phi)
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %10, <4 x i32> %vec.phi44)
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%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
%vector.recur.extract = extractelement <4 x i32> %wide.load45, i64 3
br i1 %cmp.n, label %for.cond.cleanup9, label %for.body10.preheader46
for.body10.preheader46: ; preds = %for.body10.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %1, %for.body10.preheader ]
%indvars.iv39.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body10.preheader ]
%max.034.ph = phi i32 [ %14, %middle.block ], [ %add, %for.body10.preheader ]
br label %for.body10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 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
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !13
for.cond.cleanup9: ; preds = %for.body10, %middle.block, %for.cond.cleanup
%max.0.lcssa = phi i32 [ %add, %for.cond.cleanup ], [ %14, %middle.block ], [ %spec.select, %for.body10 ]
%sub21 = sub nsw i32 %2, %max.0.lcssa
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub21)
call void @llvm.lifetime.end.p0(i64 800000, 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 %k) #4
ret i32 0
for.body10: ; preds = %for.body10.preheader46, %for.body10
%scalar.recur = phi i32 [ %17, %for.body10 ], [ %scalar.recur.ph, %for.body10.preheader46 ]
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body10 ], [ %indvars.iv39.ph, %for.body10.preheader46 ]
%max.034 = phi i32 [ %spec.select, %for.body10 ], [ %max.034.ph, %for.body10.preheader46 ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx13 = getelementptr inbounds [200000 x i32], ptr %a, i64 0, i64 %indvars.iv.next40
%17 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%sub16 = sub nsw i32 %17, %scalar.recur
%spec.select = call i32 @llvm.smax.i32(i32 %sub16, i32 %max.034)
%exitcond.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup9, label %for.body10, !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.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(){
int k, n;
int a[200005] = {0};
int min;
int i;
scanf("%d %d", &k, &n);
for(i=0; i<n; i++){
scanf("%d", a+i);
}
min = k - (k - a[n-1]) - a[0];
for(i=1; i<n; i++){
if(k - (a[i]- a[i-1]) < min){
min = k - (a[i] - a[i-1]);
}
}
printf("%d", min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201574/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201574/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [200005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800020) %a, i8 0, i64 800020, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub50 = add nsw i32 %0, -1
%idxprom51 = sext i32 %sub50 to i64
%arrayidx52 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %idxprom51
%1 = load i32, ptr %arrayidx52, align 4, !tbaa !5
br label %for.end26
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %idxprom
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub5 = sub nsw i32 %4, %.pre
%cmp739 = icmp sgt i32 %2, 1
br i1 %cmp739, label %for.body8.lr.ph, label %for.end26
for.body8.lr.ph: ; preds = %for.end
%5 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %2 to i64
%6 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %2, 9
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %6, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %sub5, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %5, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load56, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %15, %vector.body ]
%vec.phi55 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %16, %vector.body ]
%offset.idx = or i64 %index, 1
%7 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load56 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load56, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = sub <4 x i32> %broadcast.splat, %wide.load
%12 = sub <4 x i32> %broadcast.splat, %wide.load56
%13 = add <4 x i32> %11, %9
%14 = add <4 x i32> %12, %10
%15 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %13, <4 x i32> %vec.phi)
%16 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %14, <4 x i32> %vec.phi55)
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %15, <4 x i32> %16)
%18 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %6, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load56, i64 3
br i1 %cmp.n, label %for.end26, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body8.lr.ph ]
%indvars.iv45.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body8.lr.ph ]
%min.040.ph = phi i32 [ %18, %middle.block ], [ %sub5, %for.body8.lr.ph ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%scalar.recur = phi i32 [ %19, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ]
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body8 ], [ %indvars.iv45.ph, %for.body8.preheader ]
%min.040 = phi i32 [ %spec.select, %for.body8 ], [ %min.040.ph, %for.body8.preheader ]
%arrayidx10 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %indvars.iv45
%19 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%sub14.neg = sub i32 %5, %19
%sub15 = add i32 %sub14.neg, %scalar.recur
%spec.select = call i32 @llvm.smin.i32(i32 %sub15, i32 %min.040)
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
br i1 %exitcond.not, label %for.end26, label %for.body8, !llvm.loop !14
for.end26: ; preds = %for.body8, %middle.block, %for.end.thread, %for.end
%min.0.lcssa = phi i32 [ %sub5, %for.end ], [ %1, %for.end.thread ], [ %18, %middle.block ], [ %spec.select, %for.body8 ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800020, 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 %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !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 a,b;
scanf("%d%d",&a,&b);
printf(a%3&&b%3&&(a+b)%3?"Impossible":"Possible");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201617/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"Impossible\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"Possible\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
%rem = srem i32 %0, 3
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %land.end, label %land.lhs.true
land.lhs.true: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%tobool2.not = icmp eq i32 %rem1, 0
br i1 %tobool2.not, label %land.end, label %land.rhs
land.rhs: ; preds = %land.lhs.true
%add = add nsw i32 %1, %0
%rem3 = srem i32 %add, 3
%tobool4.not = icmp eq i32 %rem3, 0
%2 = select i1 %tobool4.not, ptr @.str.2, ptr @.str.1
br label %land.end
land.end: ; preds = %land.rhs, %land.lhs.true, %entry
%cond = phi ptr [ @.str.2, %land.lhs.true ], [ @.str.2, %entry ], [ %2, %land.rhs ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!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,ans=0;
scanf("%d %d",&A,&B);
if(A%3==0){
ans=1;
}else if(B%3==0){
ans=1;
}else if((A+B)%3==0){
ans=1;
}
if(ans==0){
printf("Impossible\n");
}else if(ans==1){
printf("Possible\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201668/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201668/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"Possible\00", align 1
@str.3 = private unnamed_addr constant [11 x i8] c"Impossible\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
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.then15, label %if.else
if.else: ; preds = %entry
%1 = load i32, ptr %B, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%cmp2 = icmp eq i32 %rem1, 0
br i1 %cmp2, label %if.then15, label %if.else4
if.else4: ; preds = %if.else
%add = add nsw i32 %1, %0
%rem5 = srem i32 %add, 3
%cmp6.not = icmp eq i32 %rem5, 0
br i1 %cmp6.not, label %if.then15, label %if.end18
if.then15: ; preds = %if.else4, %if.else, %entry
br label %if.end18
if.end18: ; preds = %if.else4, %if.then15
%str.sink = phi ptr [ @str, %if.then15 ], [ @str.3, %if.else4 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.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: 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%3&&b%3&&(a+b)%3){printf("Impossible\n");}else{printf("Possible\n");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201718/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201718/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"Possible\00", align 1
@str.3 = private unnamed_addr constant [11 x i8] c"Impossible\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
%rem = srem i32 %0, 3
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%tobool2.not = icmp eq i32 %rem1, 0
br i1 %tobool2.not, label %if.else, label %land.lhs.true3
land.lhs.true3: ; preds = %land.lhs.true
%add = add nsw i32 %1, %0
%rem4 = srem i32 %add, 3
%tobool5.not = icmp eq i32 %rem4, 0
br i1 %tobool5.not, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true3, %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true3, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.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: 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,c,d,e;
scanf("%d %d",&a,&b);
c=a+b;
if(a%3==0){
printf("Possible");
}else if(b%3==0){
printf("Possible");
}else if(c%3==0){
printf("Possible");
}else{
printf("Impossible");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\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
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
%rem2 = srem i32 %1, 3
%cmp3 = icmp eq i32 %rem2, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp3
br i1 %or.cond, label %if.end14, label %if.else6
if.else6: ; preds = %entry
%add = add nsw i32 %1, %0
%rem7 = srem i32 %add, 3
%cmp8 = icmp eq i32 %rem7, 0
%.str.1..str.2 = select i1 %cmp8, ptr @.str.1, ptr @.str.2
br label %if.end14
if.end14: ; preds = %if.else6, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ %.str.1..str.2, %if.else6 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int A, B;
int i = 0, j = 0, k = 0;
scanf("%d %d", &A, &B);
if(A % 3 != 0) i = 1;
if(B % 3 != 0) j = 1;
if((A+B) % 3 != 0) k = 1;
if(i == 1 && j == 1 && k == 1) {
printf("Impossible\n");
} else {
printf("Possible");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Impossible\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
%rem = srem i32 %0, 3
%cmp.not = icmp ne i32 %rem, 0
%1 = load i32, ptr %B, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%cmp2.not = icmp ne i32 %rem1, 0
%add = add nsw i32 %1, %0
%rem5 = srem i32 %add, 3
%cmp6.not = icmp ne i32 %rem5, 0
%or.cond = and i1 %cmp.not, %cmp2.not
%or.cond17 = and i1 %or.cond, %cmp6.not
br i1 %or.cond17, label %if.then13, label %if.else
if.then13: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end16
if.else: ; preds = %entry
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end16
if.end16: ; preds = %if.else, %if.then13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
do{
scanf("%d%d",&a,&b);
}while(a<1||b>100);
if(a%3==0 || b%3==0 || (a+b)%3==0){
printf("Possible\n");
}else{
printf("Impossible\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"Impossible\00", align 1
@str.3 = private unnamed_addr constant [9 x i8] c"Possible\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
br label %do.body
do.body: ; preds = %do.body, %entry
%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, 1
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 100
%2 = select i1 %cmp, i1 true, i1 %cmp1
br i1 %2, label %do.body, label %do.end, !llvm.loop !9
do.end: ; preds = %do.body
%rem = urem i32 %0, 3
%cmp2 = icmp eq i32 %rem, 0
%rem3 = srem i32 %1, 3
%cmp4 = icmp eq i32 %rem3, 0
%or.cond = select i1 %cmp2, i1 true, i1 %cmp4
br i1 %or.cond, label %if.end, label %lor.lhs.false5
lor.lhs.false5: ; preds = %do.end
%add = add nsw i32 %1, %0
%rem6 = srem i32 %add, 3
%cmp7 = icmp eq i32 %rem6, 0
%spec.select = select i1 %cmp7, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false5, %do.end
%str.sink = phi ptr [ @str.3, %do.end ], [ %spec.select, %lor.lhs.false5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void) {
int A, B;
int sum;
char buf[128];
fgets(buf,128,stdin);
sscanf(buf,"%d %d",&A,&B);
sum = A + B;
if(sum%3 == 0 || A%3 == 0 || B%3 == 0) {
printf("Possible");
} else {
printf("Impossible");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201905/source.c"
target datalayout = "e-m:e-p270: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"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\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
%buf = alloca [128 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %buf) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 128, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) #4
%1 = load i32, ptr %A, align 4, !tbaa !9
%2 = load i32, ptr %B, align 4, !tbaa !9
%add = add nsw i32 %2, %1
%rem = srem i32 %add, 3
%cmp = icmp eq i32 %rem, 0
%rem3 = srem i32 %1, 3
%cmp4 = icmp eq i32 %rem3, 0
%or.cond = or i1 %cmp4, %cmp
%rem6 = srem i32 %2, 3
%cmp7 = icmp eq i32 %rem6, 0
%or.cond11 = or i1 %cmp7, %or.cond
%.str.1..str.2 = select i1 %or.cond11, ptr @.str.1, ptr @.str.2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %buf) #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 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: 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 = !{!"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 n[5],i,m;
for(i=0;i<5;i++)scanf("%d",&n[i]);
if(n[0]<0){
n[0]-=(n[0]+n[0]);
m=n[2]*n[0]+n[3]+n[4]*n[1];
}
else m=n[4]*(n[1]-n[0]);
printf("%d\n",m);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201949/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca [5 x i32], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %n, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%0 = load i32, ptr %n, align 16, !tbaa !5
%cmp2 = icmp slt i32 %0, 0
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = sub i32 0, %0
store i32 %sub, ptr %n, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%mul = mul nsw i32 %1, %sub
%2 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%add9 = add nsw i32 %mul, %2
%3 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%mul12 = mul nsw i32 %4, %3
%add13 = add nsw i32 %add9, %mul12
br label %if.end
if.else: ; preds = %entry
%5 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%6 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub17 = sub nsw i32 %6, %0
%mul18 = mul nsw i32 %sub17, %5
br label %if.end
if.end: ; preds = %if.else, %if.then
%m.0 = phi i32 [ %add13, %if.then ], [ %mul18, %if.else ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
# include <stdio.h>
int main(int argc, char const *argv[])
{
int t;
scanf("%d", &t);
int rolls = 0;
for(int i=0; i<t; i++){
int x;
scanf("%d", &x);
rolls = x/7;
if(2<=(x%7)<=7){
rolls++;
}
printf("%d\n", rolls);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.010 = phi i32 [ %inc6, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%div = sdiv i32 %1, 7
%inc = add nsw i32 %div, 1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
%inc6 = add nuw nsw i32 %i.010, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc6, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n;
while (scanf("%d", &n) != EOF){
while (n > 39){
n -= 39;
}
printf("3C");
if (n < 10){
printf("0");
}
printf("%d\n", n);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202041/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202041/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"3C\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %while.end8, label %while.cond1thread-pre-split
while.cond1thread-pre-split: ; preds = %entry, %if.end
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %.pr, 39
br i1 %cmp29, label %while.body3.preheader, label %while.end
while.body3.preheader: ; preds = %while.cond1thread-pre-split
%0 = add nuw i32 %.pr, 38
%smin = call i32 @llvm.smin.i32(i32 %.pr, i32 78)
%1 = sub nuw i32 %0, %smin
%.fr = freeze i32 %1
%2 = urem i32 %.fr, 39
%.neg = sub i32 %2, %.fr
%3 = add nsw i32 %.pr, -39
%4 = add i32 %.neg, %3
store i32 %4, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.body3.preheader, %while.cond1thread-pre-split
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp slt i32 %5, 10
br i1 %cmp5, label %if.then, label %if.end
if.then: ; preds = %while.end
%putchar = call i32 @putchar(i32 48)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.end
%6 = phi i32 [ %.pre, %if.then ], [ %5, %while.end ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %6)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end8, label %while.cond1thread-pre-split, !llvm.loop !9
while.end8: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n;
while(scanf("%d",&n)!=-1)
printf("3C%s%d\n",(n%39?n%39:39)>9?"":"0",n%39?n%39:39);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"3C%s%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.3 = 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) #3
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 39
%tobool.not = icmp eq i32 %rem, 0
%spec.select = select i1 %tobool.not, i32 39, i32 %rem
%cmp2 = icmp sgt i32 %spec.select, 9
%cond3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %cond3, i32 noundef %spec.select)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(){
int a,l,x;
double s,in1,in2;
while(scanf("%d%d%d",&a,&l,&x) != EOF){
in1=4*l*l-a*a;
in2=x*x+2*x*l;
s=(double)a*sqrt(in1)/4 + (double)l*sqrt(in2)/2;
printf("%.10f\n",s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202164/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202164/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%.10f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%l = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %l, ptr noundef nonnull %x)
%cmp.not17 = icmp eq i32 %call16, -1
br i1 %cmp.not17, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %l, align 4, !tbaa !5
%mul = shl nsw i32 %0, 2
%mul1 = mul nsw i32 %mul, %0
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul2 = mul nsw i32 %1, %1
%sub = sub nsw i32 %mul1, %mul2
%conv = sitofp i32 %sub to double
%2 = load i32, ptr %x, align 4, !tbaa !5
%mul5 = shl i32 %0, 1
%reass.add = add i32 %mul5, %2
%reass.mul = mul i32 %reass.add, %2
%conv6 = sitofp i32 %reass.mul to double
%call8 = call double @sqrt(double noundef %conv) #4
%3 = load i32, ptr %l, align 4, !tbaa !5
%call11 = call double @sqrt(double noundef %conv6) #4
%4 = insertelement <2 x i32> poison, i32 %1, i64 0
%5 = insertelement <2 x i32> %4, i32 %3, i64 1
%6 = sitofp <2 x i32> %5 to <2 x double>
%7 = insertelement <2 x double> poison, double %call8, i64 0
%8 = insertelement <2 x double> %7, double %call11, i64 1
%9 = fmul <2 x double> %8, %6
%10 = fmul <2 x double> %9, <double 2.500000e-01, double 5.000000e-01>
%shift = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%11 = fadd <2 x double> %10, %shift
%add14 = extractelement <2 x double> %11, i64 0
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %add14)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %l, ptr noundef nonnull %x)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
//#include <string.h>
int main(void){
int a,b,c,d,e,k = 0;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
scanf("%d", &d);
scanf("%d", &e);
scanf("%d", &k);
if(k<e-a) printf(":(");
else printf("Yay!");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202236/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202236/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
store i32 0, ptr %k, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %e, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%cmp = icmp slt i32 %0, %sub
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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, s, i;
int flag1 , flag2, flag3;
int idx1, idx2, idx3;
char x[102];
scanf("%d",&T);
while(T--)
{
scanf("%s",x);
flag1=-1;
flag2 = -1;
flag3 = -1;
idx1= 0; idx2 =0; idx3 =0;
s = strlen(x);
for(i=0; i<s; i++)
{
if((x[i]- 'a' >= 0) && (x[i]- 'a' < 26))
{
idx1 ++;
flag1 = i;
}
else if((x[i]- 'A' >= 0) && (x[i]- 'A' < 26))
{
idx2 ++;
flag2 = i;
}
else if((x[i]- '0' >= 0) && (x[i]- '0' < 10))
{
idx3++;
flag3 = i;
}
}
if(flag1 == -1 && flag2 == -1)
{
x[0] = 'a';
x[1] = 'A';
}
else if(flag2 == -1 && flag3 == -1)
{
x[0] = '1';
x[1] = 'A';
}
else if(flag1 == -1 && flag3 == -1)
{
x[0] = 'a';
x[1] = '1';
}
else if(flag1 == -1)
{
if(idx2 >1)
x[flag2] = 'a';
else
x[flag3] = 'a';
}
else if(flag2 == -1)
{
if(idx1 >1)
x[flag1] = 'A';
else
x[flag3] = 'A';
}
else if(flag3 == -1)
{
if(idx2 >1)
x[flag2] = '1';
else
x[flag1] = '1';
}
printf("%s\n", x );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20228/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20228/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca i32, align 4
%x = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%dec164 = add nsw i32 %0, -1
store i32 %dec164, ptr %T, align 4, !tbaa !5
%tobool.not165 = icmp eq i32 %0, 0
br i1 %tobool.not165, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx73 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end118
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %x) #6
%conv = trunc i64 %call3 to i32
%cmp152 = icmp sgt i32 %conv, 0
br i1 %cmp152, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%wide.trip.count = and i64 %call3, 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 ]
%idx2.0158 = phi i32 [ 0, %for.body.preheader ], [ %idx2.1, %for.inc ]
%idx1.0157 = phi i32 [ 0, %for.body.preheader ], [ %idx1.1, %for.inc ]
%flag3.0156 = phi i32 [ -1, %for.body.preheader ], [ %flag3.1, %for.inc ]
%flag2.0155 = phi i32 [ -1, %for.body.preheader ], [ %flag2.1, %for.inc ]
%flag1.0154 = phi i32 [ -1, %for.body.preheader ], [ %flag1.1, %for.inc ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%2 = add i8 %1, -97
%or.cond148 = icmp ult i8 %2, 26
br i1 %or.cond148, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %idx1.0157, 1
%3 = trunc i64 %indvars.iv to i32
br label %for.inc
if.else: ; preds = %for.body
%4 = add i8 %1, -65
%or.cond149 = icmp ult i8 %4, 26
br i1 %or.cond149, label %if.then27, label %if.else29
if.then27: ; preds = %if.else
%inc28 = add nsw i32 %idx2.0158, 1
%5 = trunc i64 %indvars.iv to i32
br label %for.inc
if.else29: ; preds = %if.else
%6 = add i8 %1, -48
%or.cond150 = icmp ult i8 %6, 10
%7 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %or.cond150, i32 %7, i32 %flag3.0156
br label %for.inc
for.inc: ; preds = %if.else29, %if.then, %if.then27
%flag1.1 = phi i32 [ %3, %if.then ], [ %flag1.0154, %if.then27 ], [ %flag1.0154, %if.else29 ]
%flag2.1 = phi i32 [ %flag2.0155, %if.then ], [ %5, %if.then27 ], [ %flag2.0155, %if.else29 ]
%flag3.1 = phi i32 [ %flag3.0156, %if.then ], [ %flag3.0156, %if.then27 ], [ %spec.select, %if.else29 ]
%idx1.1 = phi i32 [ %inc, %if.then ], [ %idx1.0157, %if.then27 ], [ %idx1.0157, %if.else29 ]
%idx2.1 = phi i32 [ %idx2.0158, %if.then ], [ %inc28, %if.then27 ], [ %idx2.0158, %if.else29 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.inc, %while.body
%flag1.0.lcssa = phi i32 [ -1, %while.body ], [ %flag1.1, %for.inc ]
%flag2.0.lcssa = phi i32 [ -1, %while.body ], [ %flag2.1, %for.inc ]
%flag3.0.lcssa = phi i32 [ -1, %while.body ], [ %flag3.1, %for.inc ]
%idx1.0.lcssa = phi i32 [ 0, %while.body ], [ %idx1.1, %for.inc ]
%idx2.0.lcssa = phi i32 [ 0, %while.body ], [ %idx2.1, %for.inc ]
%cmp48 = icmp eq i32 %flag1.0.lcssa, -1
%cmp51 = icmp eq i32 %flag2.0.lcssa, -1
%or.cond = select i1 %cmp48, i1 %cmp51, i1 false
br i1 %or.cond, label %if.then53, label %if.else56
if.then53: ; preds = %for.end
store i8 97, ptr %x, align 16, !tbaa !9
store i8 65, ptr %arrayidx73, align 1, !tbaa !9
br label %if.end118
if.else56: ; preds = %for.end
%cmp60 = icmp eq i32 %flag3.0.lcssa, -1
%or.cond121 = select i1 %cmp51, i1 %cmp60, i1 false
br i1 %or.cond121, label %if.then62, label %if.else65
if.then62: ; preds = %if.else56
store i8 49, ptr %x, align 16, !tbaa !9
store i8 65, ptr %arrayidx73, align 1, !tbaa !9
br label %if.end118
if.else65: ; preds = %if.else56
%or.cond122 = select i1 %cmp48, i1 %cmp60, i1 false
br i1 %or.cond122, label %if.then71, label %if.else74
if.then71: ; preds = %if.else65
store i8 97, ptr %x, align 16, !tbaa !9
store i8 49, ptr %arrayidx73, align 1, !tbaa !9
br label %if.end118
if.else74: ; preds = %if.else65
br i1 %cmp48, label %if.then77, label %if.else87
if.then77: ; preds = %if.else74
%cmp78 = icmp sgt i32 %idx2.0.lcssa, 1
br i1 %cmp78, label %if.then80, label %if.else83
if.then80: ; preds = %if.then77
%idxprom81 = sext i32 %flag2.0.lcssa to i64
%arrayidx82 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom81
store i8 97, ptr %arrayidx82, align 1, !tbaa !9
br label %if.end118
if.else83: ; preds = %if.then77
%idxprom84 = sext i32 %flag3.0.lcssa to i64
%arrayidx85 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom84
store i8 97, ptr %arrayidx85, align 1, !tbaa !9
br label %if.end118
if.else87: ; preds = %if.else74
br i1 %cmp51, label %if.then90, label %if.else100
if.then90: ; preds = %if.else87
%cmp91 = icmp sgt i32 %idx1.0.lcssa, 1
br i1 %cmp91, label %if.then93, label %if.else96
if.then93: ; preds = %if.then90
%idxprom94 = sext i32 %flag1.0.lcssa to i64
%arrayidx95 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom94
store i8 65, ptr %arrayidx95, align 1, !tbaa !9
br label %if.end118
if.else96: ; preds = %if.then90
%idxprom97 = sext i32 %flag3.0.lcssa to i64
%arrayidx98 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom97
store i8 65, ptr %arrayidx98, align 1, !tbaa !9
br label %if.end118
if.else100: ; preds = %if.else87
br i1 %cmp60, label %if.then103, label %if.end118
if.then103: ; preds = %if.else100
%cmp104 = icmp sgt i32 %idx2.0.lcssa, 1
br i1 %cmp104, label %if.then106, label %if.else109
if.then106: ; preds = %if.then103
%idxprom107 = sext i32 %flag2.0.lcssa to i64
%arrayidx108 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom107
store i8 49, ptr %arrayidx108, align 1, !tbaa !9
br label %if.end118
if.else109: ; preds = %if.then103
%idxprom110 = sext i32 %flag1.0.lcssa to i64
%arrayidx111 = getelementptr inbounds [102 x i8], ptr %x, i64 0, i64 %idxprom110
store i8 49, ptr %arrayidx111, align 1, !tbaa !9
br label %if.end118
if.end118: ; preds = %if.then62, %if.else83, %if.then80, %if.else100, %if.else109, %if.then106, %if.then93, %if.else96, %if.then71, %if.then53
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %x)
%8 = load i32, ptr %T, align 4, !tbaa !5
%dec = add nsw i32 %8, -1
store i32 %dec, ptr %T, align 4, !tbaa !5
%tobool.not = icmp eq i32 %8, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end118, %entry
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 = !{!"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 a,b,c,d,e,k;
scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&k);
if(e-a>k){
printf(":(");
}else{
printf("Yay!");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202322/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202322/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%.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 %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
int ae[6],k,i,j;
for(i=0;i<5;i++){
scanf("%d",&ae[i]);
}
scanf("%d",&k);
for(i=0;i<4;i++){
for(j=i+1;j<5;j++){
if(k<(ae[j]-ae[i])){printf(":(\n");exit(0);}
}
}
printf("Yay!\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202366/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.body7.lr.ph:
%ae = alloca [6 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %ae) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ae)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %ae, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %ae, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %ae, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %ae, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4
%1 = load i32, ptr %ae, align 16, !tbaa !5
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
%cmp12 = icmp slt i32 %0, %sub
br i1 %cmp12, label %if.then, label %for.cond5
for.body7.lr.ph.1: ; preds = %for.cond5.254
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.1 = sub nsw i32 %4, %3
%cmp12.1 = icmp slt i32 %0, %sub.1
br i1 %cmp12.1, label %if.then, label %for.cond5.1
for.cond5.1: ; preds = %for.body7.lr.ph.1
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.1.1 = sub nsw i32 %5, %3
%cmp12.1.1 = icmp slt i32 %0, %sub.1.1
br i1 %cmp12.1.1, label %if.then, label %for.cond5.1.1
for.cond5.1.1: ; preds = %for.cond5.1
%6 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.1.2 = sub nsw i32 %6, %3
%cmp12.1.2 = icmp slt i32 %0, %sub.1.2
br i1 %cmp12.1.2, label %if.then, label %for.body7.lr.ph.2
for.body7.lr.ph.2: ; preds = %for.cond5.1.1
%7 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%8 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.2 = sub nsw i32 %8, %7
%cmp12.2 = icmp slt i32 %0, %sub.2
br i1 %cmp12.2, label %if.then, label %for.cond5.2
for.cond5.2: ; preds = %for.body7.lr.ph.2
%9 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.2.1 = sub nsw i32 %9, %7
%cmp12.2.1 = icmp slt i32 %0, %sub.2.1
br i1 %cmp12.2.1, label %if.then, label %for.body7.lr.ph.3
for.body7.lr.ph.3: ; preds = %for.cond5.2
%10 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.3 = sub nsw i32 %11, %10
%cmp12.3 = icmp slt i32 %0, %sub.3
br i1 %cmp12.3, label %if.then, label %for.cond2.loopexit.3
for.cond2.loopexit.3: ; preds = %for.body7.lr.ph.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %ae) #5
ret i32 0
for.cond5: ; preds = %for.body7.lr.ph
%12 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.146 = sub nsw i32 %12, %1
%cmp12.147 = icmp slt i32 %0, %sub.146
br i1 %cmp12.147, label %if.then, label %for.cond5.149
for.cond5.149: ; preds = %for.cond5
%13 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.251 = sub nsw i32 %13, %1
%cmp12.252 = icmp slt i32 %0, %sub.251
br i1 %cmp12.252, label %if.then, label %for.cond5.254
for.cond5.254: ; preds = %for.cond5.149
%14 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.356 = sub nsw i32 %14, %1
%cmp12.357 = icmp slt i32 %0, %sub.356
br i1 %cmp12.357, label %if.then, label %for.body7.lr.ph.1
if.then: ; preds = %for.body7.lr.ph.3, %for.body7.lr.ph.2, %for.cond5.2, %for.body7.lr.ph.1, %for.cond5.1, %for.cond5.1.1, %for.body7.lr.ph, %for.cond5, %for.cond5.149, %for.cond5.254
%puts29 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
call void @exit(i32 noundef 0) #6
unreachable
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 "no-trapping-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 = { 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"}
|
#include<stdio.h>
int main(){
int a,b,c,d,e,k;
scanf("%d\n%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e,&k);
if(e-a>k){
printf(":(");
}else{
printf("Yay!");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d\0A%d\0A%d\0A%d\0A%d\0A%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%.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 %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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)
{
// your code goes here
long long int l,r,i,num;
scanf("%I64d %I64d",&l,&r);
num=(r-l);//printf("%d ",(num+1)/2);
if(r>l&&num%2==1)
{
printf("YES\n");
for(i=0;i<(num+1);i+=2)
{
printf("%I64d %I64d\n",l+i,l+1+i);
}
}
else
printf("NO");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%I64d %I64d\00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"%I64d %I64d\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str = 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:
%l = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
%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 !5
%1 = load i64, ptr %l, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%cmp = icmp sgt i64 %0, %1
%2 = and i64 %sub, -9223372036854775807
%cmp1 = icmp eq i64 %2, 1
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %for.body.preheader, label %if.else
for.body.preheader: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%i.015 = phi i64 [ %add8, %for.body ], [ 0, %for.body.preheader ]
%3 = load i64, ptr %l, align 8, !tbaa !5
%add4 = add nsw i64 %3, %i.015
%add5 = or i64 %i.015, 1
%add6 = add i64 %add5, %3
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add4, i64 noundef %add6)
%add8 = add nuw nsw i64 %i.015, 2
%cmp3.not = icmp sgt i64 %add8, %sub
br i1 %cmp3.not, label %if.end, label %for.body, !llvm.loop !9
if.else: ; preds = %entry
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end
if.end: ; preds = %for.body, %if.else
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
long long f(long long n) {
return n == 0 ? 0 : n + f(n / 2);
}
int main() {
int t;
scanf("%d", &t);
while (t--) {
long long n;
scanf("%lld", &n);
printf("%lld\n", f(n));
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20251/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20251/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @f(i64 noundef %n) local_unnamed_addr #0 {
entry:
%cmp3 = icmp eq i64 %n, 0
br i1 %cmp3, label %cond.end, label %cond.false
cond.false: ; preds = %entry, %cond.false
%n.tr5 = phi i64 [ %div, %cond.false ], [ %n, %entry ]
%accumulator.tr4 = phi i64 [ %add, %cond.false ], [ 0, %entry ]
%div = sdiv i64 %n.tr5, 2
%add = add nsw i64 %n.tr5, %accumulator.tr4
%n.tr5.off = add i64 %n.tr5, 1
%cmp = icmp ult i64 %n.tr5.off, 3
br i1 %cmp, label %cond.end, label %cond.false
cond.end: ; preds = %cond.false, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %cond.false ]
ret i64 %accumulator.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%t = alloca i32, align 4
%n = alloca i64, align 8
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
%dec4 = add nsw i32 %0, -1
store i32 %dec4, ptr %t, align 4, !tbaa !5
%tobool.not5 = icmp eq i32 %0, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %f.exit
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%cmp3.i = icmp eq i64 %1, 0
br i1 %cmp3.i, label %f.exit, label %cond.false.i
cond.false.i: ; preds = %while.body, %cond.false.i
%n.tr5.i = phi i64 [ %div.i, %cond.false.i ], [ %1, %while.body ]
%accumulator.tr4.i = phi i64 [ %add.i, %cond.false.i ], [ 0, %while.body ]
%div.i = sdiv i64 %n.tr5.i, 2
%add.i = add nsw i64 %accumulator.tr4.i, %n.tr5.i
%n.tr5.off.i = add i64 %n.tr5.i, 1
%cmp.i = icmp ult i64 %n.tr5.off.i, 3
br i1 %cmp.i, label %f.exit, label %cond.false.i
f.exit: ; preds = %cond.false.i, %while.body
%accumulator.tr.lcssa.i = phi i64 [ 0, %while.body ], [ %add.i, %cond.false.i ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %accumulator.tr.lcssa.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %f.exit, %entry
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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"}
|
#include <stdio.h>
int main(){
int a[5],i,j,k;
for(i=0;i<5;i++){
scanf("%d",&a[i]);
}
scanf("%d",&k);
for(i=0;i<5;i++){
for(j=i+1;j<5;j++){
if(a[j]-a[i]>k){
printf(":(\n");
return 0;
}
}
}
printf("Yay!\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202553/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202553/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.body7.lr.ph:
%a = alloca [5 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #4
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 %a)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4
%1 = load i32, ptr %a, align 16, !tbaa !5
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
%cmp12 = icmp sgt i32 %sub, %0
br i1 %cmp12, label %if.then, label %for.cond5
for.body7.lr.ph.1: ; preds = %for.cond5.258
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.1 = sub nsw i32 %4, %3
%cmp12.1 = icmp sgt i32 %sub.1, %0
br i1 %cmp12.1, label %if.then, label %for.cond5.1
for.cond5.1: ; preds = %for.body7.lr.ph.1
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.1.1 = sub nsw i32 %5, %3
%cmp12.1.1 = icmp sgt i32 %sub.1.1, %0
br i1 %cmp12.1.1, label %if.then, label %for.cond5.1.1
for.cond5.1.1: ; preds = %for.cond5.1
%6 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.1.2 = sub nsw i32 %6, %3
%cmp12.1.2 = icmp sgt i32 %sub.1.2, %0
br i1 %cmp12.1.2, label %if.then, label %for.body7.lr.ph.2
for.body7.lr.ph.2: ; preds = %for.cond5.1.1
%7 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%8 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.2 = sub nsw i32 %8, %7
%cmp12.2 = icmp sgt i32 %sub.2, %0
br i1 %cmp12.2, label %if.then, label %for.cond5.2
for.cond5.2: ; preds = %for.body7.lr.ph.2
%9 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.2.1 = sub nsw i32 %9, %7
%cmp12.2.1 = icmp sgt i32 %sub.2.1, %0
br i1 %cmp12.2.1, label %if.then, label %for.body7.lr.ph.3
for.body7.lr.ph.3: ; preds = %for.cond5.2
%10 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.3 = sub nsw i32 %11, %10
%cmp12.3 = icmp sgt i32 %sub.3, %0
br i1 %cmp12.3, label %if.then, label %cleanup
for.cond5: ; preds = %for.body7.lr.ph
%12 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.150 = sub nsw i32 %12, %1
%cmp12.151 = icmp sgt i32 %sub.150, %0
br i1 %cmp12.151, label %if.then, label %for.cond5.153
for.cond5.153: ; preds = %for.cond5
%13 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.255 = sub nsw i32 %13, %1
%cmp12.256 = icmp sgt i32 %sub.255, %0
br i1 %cmp12.256, label %if.then, label %for.cond5.258
for.cond5.258: ; preds = %for.cond5.153
%14 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%sub.360 = sub nsw i32 %14, %1
%cmp12.361 = icmp sgt i32 %sub.360, %0
br i1 %cmp12.361, label %if.then, label %for.body7.lr.ph.1
if.then: ; preds = %for.body7.lr.ph.3, %for.body7.lr.ph.2, %for.cond5.2, %for.body7.lr.ph.1, %for.cond5.1, %for.cond5.1.1, %for.body7.lr.ph, %for.cond5, %for.cond5.153, %for.cond5.258
br label %cleanup
cleanup: ; preds = %for.body7.lr.ph.3, %if.then
%str.sink = phi ptr [ @str.3, %if.then ], [ @str, %for.body7.lr.ph.3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(void){
int a,b,c,d,e,k;
int da = 0;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);
scanf("%d",&k);
da=e-a;
if(da>k){
printf(":(");
//printf(“No”);
}else if(da<=k){
//printf(“Yes”);
printf("Yay!");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202597/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202597/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 tc;
int main() {
scanf("%d", &tc);
while (tc--) {
unsigned long long int a, b;
scanf("%lld %lld", &a, &b);
int result = 0;
if (a > b) {
while (a != b) {
if (a % 8 == 0 && a>>3 >=b)
a = a>>3;
else if (a % 4 == 0 && a>>2 >=b)
a = a>>2;
else if (a % 2 == 0 && a>>1 >=b)
a = a>>1;
else {
result = -1;
break;
}
result++;
}
}
else if (a == b) {
result = 0;
}
else {
while (a != b) {
if (a << 3 <= b)
a = a << 3;
else if (a << 2 <= b)
a = a << 2;
else if (a << 1 <= b)
a = a << 1;
else {
result = -1;
break;
}
result++;
}
}
printf("%d\n", result);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20264/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20264/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@tc = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @tc)
%0 = load i32, ptr @tc, align 4, !tbaa !5
%dec81 = add nsw i32 %0, -1
store i32 %dec81, ptr @tc, align 4, !tbaa !5
%tobool.not82 = icmp eq i32 %0, 0
br i1 %tobool.not82, label %while.end56, label %while.body
while.body: ; preds = %entry, %if.end54
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i64, ptr %a, align 8
%2 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp ugt i64 %1, %2
br i1 %cmp, label %while.body4, label %if.else27
while.body4: ; preds = %while.body, %if.end26
%result.077 = phi i32 [ %inc, %if.end26 ], [ 0, %while.body ]
%shr207376 = phi i64 [ %shr2074, %if.end26 ], [ %1, %while.body ]
%rem = and i64 %shr207376, 7
%cmp5 = icmp eq i64 %rem, 0
br i1 %cmp5, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %while.body4
%shr = lshr i64 %shr207376, 3
%cmp6.not = icmp ult i64 %shr, %2
br i1 %cmp6.not, label %if.else, label %if.then7
if.then7: ; preds = %land.lhs.true
store i64 %shr, ptr %a, align 8, !tbaa !9
br label %if.end26
if.else: ; preds = %land.lhs.true, %while.body4
%rem9 = and i64 %shr207376, 3
%cmp10 = icmp eq i64 %rem9, 0
br i1 %cmp10, label %land.lhs.true11, label %if.else16
land.lhs.true11: ; preds = %if.else
%shr12 = lshr i64 %shr207376, 2
%cmp13.not = icmp ult i64 %shr12, %2
br i1 %cmp13.not, label %if.else16, label %if.then14
if.then14: ; preds = %land.lhs.true11
store i64 %shr12, ptr %a, align 8, !tbaa !9
br label %if.end26
if.else16: ; preds = %land.lhs.true11, %if.else
%rem17 = and i64 %shr207376, 1
%cmp18 = icmp eq i64 %rem17, 0
br i1 %cmp18, label %land.lhs.true19, label %if.end54
land.lhs.true19: ; preds = %if.else16
%shr20 = lshr i64 %shr207376, 1
%cmp21.not = icmp ult i64 %shr20, %2
br i1 %cmp21.not, label %if.end54, label %if.then22
if.then22: ; preds = %land.lhs.true19
store i64 %shr20, ptr %a, align 8, !tbaa !9
br label %if.end26
if.end26: ; preds = %if.then14, %if.then22, %if.then7
%shr2074 = phi i64 [ %shr12, %if.then14 ], [ %shr20, %if.then22 ], [ %shr, %if.then7 ]
%inc = add nuw nsw i32 %result.077, 1
%cmp3.not = icmp eq i64 %shr2074, %2
br i1 %cmp3.not, label %if.end54, label %while.body4, !llvm.loop !11
if.else27: ; preds = %while.body
%cmp28 = icmp eq i64 %1, %2
br i1 %cmp28, label %if.end54, label %while.body33
while.body33: ; preds = %if.else27, %if.end50
%result.170 = phi i32 [ %inc51, %if.end50 ], [ 0, %if.else27 ]
%shl436669 = phi i64 [ %shl4367, %if.end50 ], [ %1, %if.else27 ]
%shl = shl i64 %shl436669, 3
%cmp34.not = icmp ugt i64 %shl, %2
br i1 %cmp34.not, label %if.else37, label %if.then35
if.then35: ; preds = %while.body33
store i64 %shl, ptr %a, align 8, !tbaa !9
br label %if.end50
if.else37: ; preds = %while.body33
%shl38 = shl i64 %shl436669, 2
%cmp39.not = icmp ugt i64 %shl38, %2
br i1 %cmp39.not, label %if.else42, label %if.then40
if.then40: ; preds = %if.else37
store i64 %shl38, ptr %a, align 8, !tbaa !9
br label %if.end50
if.else42: ; preds = %if.else37
%shl43 = shl i64 %shl436669, 1
%cmp44.not = icmp ugt i64 %shl43, %2
br i1 %cmp44.not, label %if.end54, label %if.then45
if.then45: ; preds = %if.else42
store i64 %shl43, ptr %a, align 8, !tbaa !9
br label %if.end50
if.end50: ; preds = %if.then40, %if.then45, %if.then35
%shl4367 = phi i64 [ %shl38, %if.then40 ], [ %shl43, %if.then45 ], [ %shl, %if.then35 ]
%inc51 = add nuw nsw i32 %result.170, 1
%cmp32.not = icmp eq i64 %shl4367, %2
br i1 %cmp32.not, label %if.end54, label %while.body33, !llvm.loop !13
if.end54: ; preds = %if.end50, %if.else42, %if.end26, %land.lhs.true19, %if.else16, %if.else27
%result.2 = phi i32 [ 0, %if.else27 ], [ %inc, %if.end26 ], [ -1, %land.lhs.true19 ], [ -1, %if.else16 ], [ %inc51, %if.end50 ], [ -1, %if.else42 ]
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %result.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
%3 = load i32, ptr @tc, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr @tc, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end56, label %while.body, !llvm.loop !14
while.end56: ; preds = %if.end54, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define repl(i,a,b) for(i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define max(x,y) x>y?x:y
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
typedef int bool;
#define true 1
#define false 0
int dd[]={-1,0,1,0,-1};
int h,w,c;
int p[11][11];
bool visc[11][11];
int cnt;
void cntc(int i,int j,int cc){
visc[i][j]=true;
cnt++;
int d;
rep(d,4){
int ni=i+dd[d],nj=j+dd[d+1];
if(ni>=0&&ni<h&&nj>=0&&nj<w&&p[ni][nj]==cc&&!visc[ni][nj])cntc(ni,nj,cc);
}
}
void change(int i,int j,int mc,int cc){
p[i][j]=cc;
visc[i][j]=true;
int d;
rep(d,4){
int ni=i+dd[d],nj=j+dd[d+1];
if(ni>=0&&ni<h&&nj>=0&&nj<w&&p[ni][nj]==mc&&!visc[ni][nj])change(ni,nj,mc,cc);
}
}
int dfs(int d){
if(d==5){
cnt=0;
memset(visc,0,sizeof(visc));
cntc(0,0,c);
return cnt;
}else{
int res=0;
int sav[11][11];
memcpy(sav,p,sizeof(p));
if(d==4){
memset(visc,0,sizeof(visc));
change(0,0,p[0][0],c);
maxch(res,dfs(d+1));
}else{
int i;
repl(i,1,6+1){
memset(visc,0,sizeof(visc));
change(0,0,p[0][0],i);
maxch(res,dfs(d+1));
memcpy(p,sav,sizeof(sav));
}
}
return res;
}
}
int main(){
//cin.sync_with_stdio(false);
while(1){
scanf("%d%d%d",&h,&w,&c);
if(h==0)break;
int i,j;
rep(i,h)rep(j,w)scanf("%d",&p[i][j]);
printf("%d\n", dfs(0));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202683/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202683/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dd = dso_local local_unnamed_addr global [5 x i32] [i32 -1, i32 0, i32 1, i32 0, i32 -1], align 16
@visc = dso_local local_unnamed_addr global [11 x [11 x i32]] zeroinitializer, align 16
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@h = dso_local global i32 0, align 4
@w = dso_local global i32 0, align 4
@p = dso_local global [11 x [11 x i32]] zeroinitializer, align 16
@c = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @cntc(i32 noundef %i, i32 noundef %j, i32 noundef %cc) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %land.lhs.true21.3, %entry
%i.tr = phi i32 [ %i, %entry ], [ %add.3, %land.lhs.true21.3 ]
%j.tr = phi i32 [ %j, %entry ], [ %add8.3, %land.lhs.true21.3 ]
%idxprom = sext i32 %i.tr to i64
%idxprom1 = sext i32 %j.tr to i64
%arrayidx2 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom, i64 %idxprom1
store i32 1, ptr %arrayidx2, align 4, !tbaa !5
%0 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%1 = load i32, ptr @dd, align 16, !tbaa !5
%add = add nsw i32 %1, %i.tr
%2 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 1), align 4, !tbaa !5
%add8 = add nsw i32 %2, %j.tr
%cmp9 = icmp sgt i32 %add, -1
br i1 %cmp9, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %tailrecurse
%3 = load i32, ptr @h, align 4, !tbaa !5
%cmp10 = icmp slt i32 %add, %3
%cmp12 = icmp sgt i32 %add8, -1
%or.cond = select i1 %cmp10, i1 %cmp12, i1 false
%4 = load i32, ptr @w, align 4
%cmp14 = icmp slt i32 %add8, %4
%or.cond41 = select i1 %or.cond, i1 %cmp14, i1 false
br i1 %or.cond41, label %land.lhs.true15, label %if.end
land.lhs.true15: ; preds = %land.lhs.true
%idxprom16 = zext i32 %add to i64
%idxprom18 = zext i32 %add8 to i64
%arrayidx19 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom16, i64 %idxprom18
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %5, %cc
br i1 %cmp20, label %land.lhs.true21, label %if.end
land.lhs.true21: ; preds = %land.lhs.true15
%arrayidx25 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom16, i64 %idxprom18
%6 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true21
tail call void @cntc(i32 noundef %add, i32 noundef %add8, i32 noundef %cc)
%.pre = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 1), align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %land.lhs.true21, %land.lhs.true15, %land.lhs.true, %tailrecurse
%7 = phi i32 [ %.pre, %if.then ], [ %2, %land.lhs.true21 ], [ %2, %land.lhs.true15 ], [ %2, %land.lhs.true ], [ %2, %tailrecurse ]
%add.1 = add nsw i32 %7, %i.tr
%8 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 2), align 8, !tbaa !5
%add8.1 = add nsw i32 %8, %j.tr
%cmp9.1 = icmp sgt i32 %add.1, -1
br i1 %cmp9.1, label %land.lhs.true.1, label %if.end.1
land.lhs.true.1: ; preds = %if.end
%9 = load i32, ptr @h, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %add.1, %9
%cmp12.1 = icmp sgt i32 %add8.1, -1
%or.cond.1 = select i1 %cmp10.1, i1 %cmp12.1, i1 false
%10 = load i32, ptr @w, align 4
%cmp14.1 = icmp slt i32 %add8.1, %10
%or.cond41.1 = select i1 %or.cond.1, i1 %cmp14.1, i1 false
br i1 %or.cond41.1, label %land.lhs.true15.1, label %if.end.1
land.lhs.true15.1: ; preds = %land.lhs.true.1
%idxprom16.1 = zext i32 %add.1 to i64
%idxprom18.1 = zext i32 %add8.1 to i64
%arrayidx19.1 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom16.1, i64 %idxprom18.1
%11 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5
%cmp20.1 = icmp eq i32 %11, %cc
br i1 %cmp20.1, label %land.lhs.true21.1, label %if.end.1
land.lhs.true21.1: ; preds = %land.lhs.true15.1
%arrayidx25.1 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom16.1, i64 %idxprom18.1
%12 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %12, 0
br i1 %tobool.not.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %land.lhs.true21.1
tail call void @cntc(i32 noundef %add.1, i32 noundef %add8.1, i32 noundef %cc)
%.pre44 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 2), align 8, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %land.lhs.true21.1, %land.lhs.true15.1, %land.lhs.true.1, %if.end
%13 = phi i32 [ %.pre44, %if.then.1 ], [ %8, %land.lhs.true21.1 ], [ %8, %land.lhs.true15.1 ], [ %8, %land.lhs.true.1 ], [ %8, %if.end ]
%add.2 = add nsw i32 %13, %i.tr
%14 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 3), align 4, !tbaa !5
%add8.2 = add nsw i32 %14, %j.tr
%cmp9.2 = icmp sgt i32 %add.2, -1
br i1 %cmp9.2, label %land.lhs.true.2, label %if.end.2
land.lhs.true.2: ; preds = %if.end.1
%15 = load i32, ptr @h, align 4, !tbaa !5
%cmp10.2 = icmp slt i32 %add.2, %15
%cmp12.2 = icmp sgt i32 %add8.2, -1
%or.cond.2 = select i1 %cmp10.2, i1 %cmp12.2, i1 false
%16 = load i32, ptr @w, align 4
%cmp14.2 = icmp slt i32 %add8.2, %16
%or.cond41.2 = select i1 %or.cond.2, i1 %cmp14.2, i1 false
br i1 %or.cond41.2, label %land.lhs.true15.2, label %if.end.2
land.lhs.true15.2: ; preds = %land.lhs.true.2
%idxprom16.2 = zext i32 %add.2 to i64
%idxprom18.2 = zext i32 %add8.2 to i64
%arrayidx19.2 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom16.2, i64 %idxprom18.2
%17 = load i32, ptr %arrayidx19.2, align 4, !tbaa !5
%cmp20.2 = icmp eq i32 %17, %cc
br i1 %cmp20.2, label %land.lhs.true21.2, label %if.end.2
land.lhs.true21.2: ; preds = %land.lhs.true15.2
%arrayidx25.2 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom16.2, i64 %idxprom18.2
%18 = load i32, ptr %arrayidx25.2, align 4, !tbaa !5
%tobool.not.2 = icmp eq i32 %18, 0
br i1 %tobool.not.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %land.lhs.true21.2
tail call void @cntc(i32 noundef %add.2, i32 noundef %add8.2, i32 noundef %cc)
%.pre45 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 3), align 4, !tbaa !5
br label %if.end.2
if.end.2: ; preds = %if.then.2, %land.lhs.true21.2, %land.lhs.true15.2, %land.lhs.true.2, %if.end.1
%19 = phi i32 [ %.pre45, %if.then.2 ], [ %14, %land.lhs.true21.2 ], [ %14, %land.lhs.true15.2 ], [ %14, %land.lhs.true.2 ], [ %14, %if.end.1 ]
%add.3 = add nsw i32 %19, %i.tr
%20 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 4), align 16, !tbaa !5
%add8.3 = add nsw i32 %20, %j.tr
%cmp9.3 = icmp sgt i32 %add.3, -1
br i1 %cmp9.3, label %land.lhs.true.3, label %if.end.3
land.lhs.true.3: ; preds = %if.end.2
%21 = load i32, ptr @h, align 4, !tbaa !5
%cmp10.3 = icmp slt i32 %add.3, %21
%cmp12.3 = icmp sgt i32 %add8.3, -1
%or.cond.3 = select i1 %cmp10.3, i1 %cmp12.3, i1 false
%22 = load i32, ptr @w, align 4
%cmp14.3 = icmp slt i32 %add8.3, %22
%or.cond41.3 = select i1 %or.cond.3, i1 %cmp14.3, i1 false
br i1 %or.cond41.3, label %land.lhs.true15.3, label %if.end.3
land.lhs.true15.3: ; preds = %land.lhs.true.3
%idxprom16.3 = zext i32 %add.3 to i64
%idxprom18.3 = zext i32 %add8.3 to i64
%arrayidx19.3 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom16.3, i64 %idxprom18.3
%23 = load i32, ptr %arrayidx19.3, align 4, !tbaa !5
%cmp20.3 = icmp eq i32 %23, %cc
br i1 %cmp20.3, label %land.lhs.true21.3, label %if.end.3
land.lhs.true21.3: ; preds = %land.lhs.true15.3
%arrayidx25.3 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom16.3, i64 %idxprom18.3
%24 = load i32, ptr %arrayidx25.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %24, 0
br i1 %tobool.not.3, label %tailrecurse, label %if.end.3
if.end.3: ; preds = %land.lhs.true21.3, %land.lhs.true15.3, %land.lhs.true.3, %if.end.2
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @change(i32 noundef %i, i32 noundef %j, i32 noundef %mc, i32 noundef %cc) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %land.lhs.true25.3, %entry
%i.tr = phi i32 [ %i, %entry ], [ %add.3, %land.lhs.true25.3 ]
%j.tr = phi i32 [ %j, %entry ], [ %add12.3, %land.lhs.true25.3 ]
%idxprom = sext i32 %i.tr to i64
%idxprom1 = sext i32 %j.tr to i64
%arrayidx2 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom, i64 %idxprom1
store i32 %cc, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom, i64 %idxprom1
store i32 1, ptr %arrayidx6, align 4, !tbaa !5
%0 = load i32, ptr @dd, align 16, !tbaa !5
%add = add nsw i32 %0, %i.tr
%1 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 1), align 4, !tbaa !5
%add12 = add nsw i32 %1, %j.tr
%cmp13 = icmp sgt i32 %add, -1
br i1 %cmp13, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %tailrecurse
%2 = load i32, ptr @h, align 4, !tbaa !5
%cmp14 = icmp slt i32 %add, %2
%cmp16 = icmp sgt i32 %add12, -1
%or.cond = select i1 %cmp14, i1 %cmp16, i1 false
%3 = load i32, ptr @w, align 4
%cmp18 = icmp slt i32 %add12, %3
%or.cond47 = select i1 %or.cond, i1 %cmp18, i1 false
br i1 %or.cond47, label %land.lhs.true19, label %if.end
land.lhs.true19: ; preds = %land.lhs.true
%idxprom20 = zext i32 %add to i64
%idxprom22 = zext i32 %add12 to i64
%arrayidx23 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom20, i64 %idxprom22
%4 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp eq i32 %4, %mc
br i1 %cmp24, label %land.lhs.true25, label %if.end
land.lhs.true25: ; preds = %land.lhs.true19
%arrayidx29 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom20, i64 %idxprom22
%5 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%tobool.not = icmp eq i32 %5, 0
br i1 %tobool.not, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true25
tail call void @change(i32 noundef %add, i32 noundef %add12, i32 noundef %mc, i32 noundef %cc)
%.pre = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 1), align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %land.lhs.true25, %land.lhs.true19, %land.lhs.true, %tailrecurse
%6 = phi i32 [ %.pre, %if.then ], [ %1, %land.lhs.true25 ], [ %1, %land.lhs.true19 ], [ %1, %land.lhs.true ], [ %1, %tailrecurse ]
%add.1 = add nsw i32 %6, %i.tr
%7 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 2), align 8, !tbaa !5
%add12.1 = add nsw i32 %7, %j.tr
%cmp13.1 = icmp sgt i32 %add.1, -1
br i1 %cmp13.1, label %land.lhs.true.1, label %if.end.1
land.lhs.true.1: ; preds = %if.end
%8 = load i32, ptr @h, align 4, !tbaa !5
%cmp14.1 = icmp slt i32 %add.1, %8
%cmp16.1 = icmp sgt i32 %add12.1, -1
%or.cond.1 = select i1 %cmp14.1, i1 %cmp16.1, i1 false
%9 = load i32, ptr @w, align 4
%cmp18.1 = icmp slt i32 %add12.1, %9
%or.cond47.1 = select i1 %or.cond.1, i1 %cmp18.1, i1 false
br i1 %or.cond47.1, label %land.lhs.true19.1, label %if.end.1
land.lhs.true19.1: ; preds = %land.lhs.true.1
%idxprom20.1 = zext i32 %add.1 to i64
%idxprom22.1 = zext i32 %add12.1 to i64
%arrayidx23.1 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom20.1, i64 %idxprom22.1
%10 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%cmp24.1 = icmp eq i32 %10, %mc
br i1 %cmp24.1, label %land.lhs.true25.1, label %if.end.1
land.lhs.true25.1: ; preds = %land.lhs.true19.1
%arrayidx29.1 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom20.1, i64 %idxprom22.1
%11 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %11, 0
br i1 %tobool.not.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %land.lhs.true25.1
tail call void @change(i32 noundef %add.1, i32 noundef %add12.1, i32 noundef %mc, i32 noundef %cc)
%.pre50 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 2), align 8, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %land.lhs.true25.1, %land.lhs.true19.1, %land.lhs.true.1, %if.end
%12 = phi i32 [ %.pre50, %if.then.1 ], [ %7, %land.lhs.true25.1 ], [ %7, %land.lhs.true19.1 ], [ %7, %land.lhs.true.1 ], [ %7, %if.end ]
%add.2 = add nsw i32 %12, %i.tr
%13 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 3), align 4, !tbaa !5
%add12.2 = add nsw i32 %13, %j.tr
%cmp13.2 = icmp sgt i32 %add.2, -1
br i1 %cmp13.2, label %land.lhs.true.2, label %if.end.2
land.lhs.true.2: ; preds = %if.end.1
%14 = load i32, ptr @h, align 4, !tbaa !5
%cmp14.2 = icmp slt i32 %add.2, %14
%cmp16.2 = icmp sgt i32 %add12.2, -1
%or.cond.2 = select i1 %cmp14.2, i1 %cmp16.2, i1 false
%15 = load i32, ptr @w, align 4
%cmp18.2 = icmp slt i32 %add12.2, %15
%or.cond47.2 = select i1 %or.cond.2, i1 %cmp18.2, i1 false
br i1 %or.cond47.2, label %land.lhs.true19.2, label %if.end.2
land.lhs.true19.2: ; preds = %land.lhs.true.2
%idxprom20.2 = zext i32 %add.2 to i64
%idxprom22.2 = zext i32 %add12.2 to i64
%arrayidx23.2 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom20.2, i64 %idxprom22.2
%16 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5
%cmp24.2 = icmp eq i32 %16, %mc
br i1 %cmp24.2, label %land.lhs.true25.2, label %if.end.2
land.lhs.true25.2: ; preds = %land.lhs.true19.2
%arrayidx29.2 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom20.2, i64 %idxprom22.2
%17 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
%tobool.not.2 = icmp eq i32 %17, 0
br i1 %tobool.not.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %land.lhs.true25.2
tail call void @change(i32 noundef %add.2, i32 noundef %add12.2, i32 noundef %mc, i32 noundef %cc)
%.pre51 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 3), align 4, !tbaa !5
br label %if.end.2
if.end.2: ; preds = %if.then.2, %land.lhs.true25.2, %land.lhs.true19.2, %land.lhs.true.2, %if.end.1
%18 = phi i32 [ %.pre51, %if.then.2 ], [ %13, %land.lhs.true25.2 ], [ %13, %land.lhs.true19.2 ], [ %13, %land.lhs.true.2 ], [ %13, %if.end.1 ]
%add.3 = add nsw i32 %18, %i.tr
%19 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @dd, i64 0, i64 4), align 16, !tbaa !5
%add12.3 = add nsw i32 %19, %j.tr
%cmp13.3 = icmp sgt i32 %add.3, -1
br i1 %cmp13.3, label %land.lhs.true.3, label %if.end.3
land.lhs.true.3: ; preds = %if.end.2
%20 = load i32, ptr @h, align 4, !tbaa !5
%cmp14.3 = icmp slt i32 %add.3, %20
%cmp16.3 = icmp sgt i32 %add12.3, -1
%or.cond.3 = select i1 %cmp14.3, i1 %cmp16.3, i1 false
%21 = load i32, ptr @w, align 4
%cmp18.3 = icmp slt i32 %add12.3, %21
%or.cond47.3 = select i1 %or.cond.3, i1 %cmp18.3, i1 false
br i1 %or.cond47.3, label %land.lhs.true19.3, label %if.end.3
land.lhs.true19.3: ; preds = %land.lhs.true.3
%idxprom20.3 = zext i32 %add.3 to i64
%idxprom22.3 = zext i32 %add12.3 to i64
%arrayidx23.3 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %idxprom20.3, i64 %idxprom22.3
%22 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5
%cmp24.3 = icmp eq i32 %22, %mc
br i1 %cmp24.3, label %land.lhs.true25.3, label %if.end.3
land.lhs.true25.3: ; preds = %land.lhs.true19.3
%arrayidx29.3 = getelementptr inbounds [11 x [11 x i32]], ptr @visc, i64 0, i64 %idxprom20.3, i64 %idxprom22.3
%23 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %23, 0
br i1 %tobool.not.3, label %tailrecurse, label %if.end.3
if.end.3: ; preds = %land.lhs.true25.3, %land.lhs.true19.3, %land.lhs.true.3, %if.end.2
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %d) local_unnamed_addr #2 {
entry:
%sav = alloca [11 x [11 x i32]], align 16
%cmp = icmp eq i32 %d, 5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
store i32 0, ptr @cnt, align 4, !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%0 = load i32, ptr @c, align 4, !tbaa !5
tail call void @cntc(i32 noundef 0, i32 noundef 0, i32 noundef %0)
%1 = load i32, ptr @cnt, align 4, !tbaa !5
br label %return
if.else: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %sav)
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %sav, ptr noundef nonnull align 16 dereferenceable(484) @p, i64 484, i1 false)
%cmp1 = icmp eq i32 %d, 4
br i1 %cmp1, label %if.then2, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%add8 = add nsw i32 %d, 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%2 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %2, i32 noundef 1)
%call9 = tail call i32 @dfs(i32 noundef %add8)
%cmp10 = icmp slt i32 %call9, 0
br i1 %cmp10, label %cond.end15, label %cond.false12
if.then2: ; preds = %if.else
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%3 = load i32, ptr @p, align 16, !tbaa !5
%4 = load i32, ptr @c, align 4, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %3, i32 noundef %4)
store i32 0, ptr @cnt, align 4, !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%5 = load i32, ptr @c, align 4, !tbaa !5
tail call void @cntc(i32 noundef 0, i32 noundef 0, i32 noundef %5)
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%cmp3 = icmp slt i32 %6, 0
br i1 %cmp3, label %if.end, label %cond.false
cond.false: ; preds = %if.then2
store i32 0, ptr @cnt, align 4, !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%7 = load i32, ptr @c, align 4, !tbaa !5
tail call void @cntc(i32 noundef 0, i32 noundef 0, i32 noundef %7)
%8 = load i32, ptr @cnt, align 4, !tbaa !5
br label %if.end
cond.false12: ; preds = %for.cond.preheader
%call14 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15
cond.end15: ; preds = %for.cond.preheader, %cond.false12
%cond16 = phi i32 [ %call14, %cond.false12 ], [ 0, %for.cond.preheader ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%9 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %9, i32 noundef 2)
%call9.1 = tail call i32 @dfs(i32 noundef %add8)
%cmp10.1 = icmp sgt i32 %cond16, %call9.1
br i1 %cmp10.1, label %cond.end15.1, label %cond.false12.1
cond.false12.1: ; preds = %cond.end15
%call14.1 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15.1
cond.end15.1: ; preds = %cond.false12.1, %cond.end15
%cond16.1 = phi i32 [ %call14.1, %cond.false12.1 ], [ %cond16, %cond.end15 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%10 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %10, i32 noundef 3)
%call9.2 = tail call i32 @dfs(i32 noundef %add8)
%cmp10.2 = icmp sgt i32 %cond16.1, %call9.2
br i1 %cmp10.2, label %cond.end15.2, label %cond.false12.2
cond.false12.2: ; preds = %cond.end15.1
%call14.2 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15.2
cond.end15.2: ; preds = %cond.false12.2, %cond.end15.1
%cond16.2 = phi i32 [ %call14.2, %cond.false12.2 ], [ %cond16.1, %cond.end15.1 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%11 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %11, i32 noundef 4)
%call9.3 = tail call i32 @dfs(i32 noundef %add8)
%cmp10.3 = icmp sgt i32 %cond16.2, %call9.3
br i1 %cmp10.3, label %cond.end15.3, label %cond.false12.3
cond.false12.3: ; preds = %cond.end15.2
%call14.3 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15.3
cond.end15.3: ; preds = %cond.false12.3, %cond.end15.2
%cond16.3 = phi i32 [ %call14.3, %cond.false12.3 ], [ %cond16.2, %cond.end15.2 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%12 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %12, i32 noundef 5)
%call9.4 = tail call i32 @dfs(i32 noundef %add8)
%cmp10.4 = icmp sgt i32 %cond16.3, %call9.4
br i1 %cmp10.4, label %cond.end15.4, label %cond.false12.4
cond.false12.4: ; preds = %cond.end15.3
%call14.4 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15.4
cond.end15.4: ; preds = %cond.false12.4, %cond.end15.3
%cond16.4 = phi i32 [ %call14.4, %cond.false12.4 ], [ %cond16.3, %cond.end15.3 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @visc, i8 0, i64 484, i1 false)
%13 = load i32, ptr @p, align 16, !tbaa !5
tail call void @change(i32 noundef 0, i32 noundef 0, i32 noundef %13, i32 noundef 6)
%call9.5 = tail call i32 @dfs(i32 noundef %add8)
%cmp10.5 = icmp sgt i32 %cond16.4, %call9.5
br i1 %cmp10.5, label %cond.end15.5, label %cond.false12.5
cond.false12.5: ; preds = %cond.end15.4
%call14.5 = tail call i32 @dfs(i32 noundef %add8)
br label %cond.end15.5
cond.end15.5: ; preds = %cond.false12.5, %cond.end15.4
%cond16.5 = phi i32 [ %call14.5, %cond.false12.5 ], [ %cond16.4, %cond.end15.4 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @p, ptr noundef nonnull align 16 dereferenceable(484) %sav, i64 484, i1 false)
br label %if.end
if.end: ; preds = %cond.end15.5, %cond.false, %if.then2
%res.1 = phi i32 [ %8, %cond.false ], [ 0, %if.then2 ], [ %cond16.5, %cond.end15.5 ]
call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %sav)
br label %return
return: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ %1, %if.then ], [ %res.1, %if.end ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%call21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @h, ptr noundef nonnull @w, ptr noundef nonnull @c)
%0 = load i32, ptr @h, align 4, !tbaa !5
%cmp22 = icmp eq i32 %0, 0
br i1 %cmp22, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%1 = phi i32 [ %11, %for.end10 ], [ %0, %entry ]
%cmp119 = icmp sgt i32 %1, 0
%2 = load i32, ptr @w, align 4
%3 = icmp sgt i32 %2, 0
%or.cond = select i1 %cmp119, i1 %3, i1 false
br i1 %or.cond, label %for.cond2.preheader, label %for.end10
for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc8
%4 = phi i32 [ %8, %for.inc8 ], [ %1, %for.cond.preheader ]
%5 = phi i32 [ %9, %for.inc8 ], [ %2, %for.cond.preheader ]
%indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %for.cond.preheader ]
%cmp317 = icmp sgt i32 %5, 0
br i1 %cmp317, label %for.body4, label %for.inc8
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [11 x [11 x i32]], ptr @p, i64 0, i64 %indvars.iv25, i64 %indvars.iv
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr @w, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp3, label %for.body4, label %for.inc8.loopexit, !llvm.loop !9
for.inc8.loopexit: ; preds = %for.body4
%.pre = load i32, ptr @h, align 4, !tbaa !5
br label %for.inc8
for.inc8: ; preds = %for.inc8.loopexit, %for.cond2.preheader
%8 = phi i32 [ %.pre, %for.inc8.loopexit ], [ %4, %for.cond2.preheader ]
%9 = phi i32 [ %6, %for.inc8.loopexit ], [ %5, %for.cond2.preheader ]
%indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1
%10 = sext i32 %8 to i64
%cmp1 = icmp slt i64 %indvars.iv.next26, %10
br i1 %cmp1, label %for.cond2.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.inc8, %for.cond.preheader
%call11 = tail call i32 @dfs(i32 noundef 0)
%call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call11)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @h, ptr noundef nonnull @w, ptr noundef nonnull @c)
%11 = load i32, ptr @h, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include<stdio.h>
int main(){
int month,day;
int sum;
int i;
scanf("%d %d",&month,&day);
while(month!=0){
sum=0;
//通算日数の計算
for(i=1;i<month;i++){
switch(i){
case 2:
sum=sum+29;
break;
case 4:
sum=sum+30;
break;
case 6:
sum=sum+30;
break;
case 9:
sum=sum+30;
break;
case 11:
sum=sum+30;
break;
default:
sum=sum+31;
break;
}
}
sum=sum+day;
//曜日の判定
switch(sum%7){
case 0:
printf("Wednesday\n");
break;
case 1:
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
}
scanf("%d %d",&month,&day);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202740/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202740/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@switch.table.main = private unnamed_addr constant [10 x i32] [i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30], align 4
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%day = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%0 = load i32, ptr %month, align 4, !tbaa !5
%cmp.not46 = icmp eq i32 %0, 0
br i1 %cmp.not46, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %sw.epilog26
%1 = phi i32 [ %13, %sw.epilog26 ], [ %0, %entry ]
%cmp143 = icmp sgt i32 %1, 1
br i1 %cmp143, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%2 = add i32 %1, -1
%xtraiter = and i32 %2, 1
%3 = icmp eq i32 %1, 2
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %2, -2
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%i.045 = phi i32 [ 1, %for.body.preheader.new ], [ %inc.1, %for.inc.1 ]
%sum.044 = phi i32 [ 0, %for.body.preheader.new ], [ %add.1, %for.inc.1 ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%switch.tableidx = add nsw i32 %i.045, -2
%4 = icmp ult i32 %switch.tableidx, 10
br i1 %4, label %switch.lookup, label %for.inc
switch.lookup: ; preds = %for.body
%5 = sext i32 %switch.tableidx to i64
%switch.gep = getelementptr inbounds [10 x i32], ptr @switch.table.main, i64 0, i64 %5
%switch.load = load i32, ptr %switch.gep, align 4
br label %for.inc
for.inc: ; preds = %for.body, %switch.lookup
%.sink = phi i32 [ %switch.load, %switch.lookup ], [ 31, %for.body ]
%add = add nuw nsw i32 %sum.044, %.sink
%6 = icmp ult i32 %i.045, 11
br i1 %6, label %switch.lookup.1, label %for.inc.1
switch.lookup.1: ; preds = %for.inc
%switch.tableidx.1 = add nsw i32 %i.045, -1
%7 = sext i32 %switch.tableidx.1 to i64
%switch.gep.1 = getelementptr inbounds [10 x i32], ptr @switch.table.main, i64 0, i64 %7
%switch.load.1 = load i32, ptr %switch.gep.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %switch.lookup.1, %for.inc
%.sink.1 = phi i32 [ %switch.load.1, %switch.lookup.1 ], [ 31, %for.inc ]
%add.1 = add nuw nsw i32 %add, %.sink.1
%inc.1 = add nuw nsw i32 %i.045, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add.1, %for.inc.1 ]
%i.045.unr = phi i32 [ -1, %for.body.preheader ], [ %i.045, %for.inc.1 ]
%sum.044.unr = phi i32 [ 0, %for.body.preheader ], [ %add.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%8 = icmp ult i32 %i.045.unr, 10
br i1 %8, label %switch.lookup.epil, label %for.inc.epil
switch.lookup.epil: ; preds = %for.body.epil
%9 = sext i32 %i.045.unr to i64
%switch.gep.epil = getelementptr inbounds [10 x i32], ptr @switch.table.main, i64 0, i64 %9
%switch.load.epil = load i32, ptr %switch.gep.epil, align 4
br label %for.inc.epil
for.inc.epil: ; preds = %switch.lookup.epil, %for.body.epil
%.sink.epil = phi i32 [ %switch.load.epil, %switch.lookup.epil ], [ 31, %for.body.epil ]
%add.epil = add nuw nsw i32 %sum.044.unr, %.sink.epil
br label %for.end
for.end: ; preds = %for.inc.epil, %for.end.loopexit.unr-lcssa, %for.cond.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.inc.epil ]
%10 = load i32, ptr %day, align 4, !tbaa !5
%add11 = add nsw i32 %10, %sum.0.lcssa
%rem = srem i32 %add11, 7
%11 = icmp ult i32 %rem, 7
br i1 %11, label %switch.lookup47, label %sw.epilog26
switch.lookup47: ; preds = %for.end
%12 = sext i32 %rem to i64
%reltable.shift = shl i64 %12, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog26
sw.epilog26: ; preds = %for.end, %switch.lookup47
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%13 = load i32, ptr %month, align 4, !tbaa !5
%cmp.not = icmp eq i32 %13, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11
while.end: ; preds = %sw.epilog26, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
int MONTH[]={31,29,31,30,31,30,31,31,30,31,30,31};
int main(){
int i;
int month,date,days,Wday;
while(scanf("%d %d",&month,&date)){
if(month==0) break;
days=0;
for(i=0;i<month-1;i++){
days+=MONTH[i];
}
days+=date;
Wday=days%7;
if(Wday==0) printf("Wednesday\n");
else if(Wday==1) printf("Thursday\n");
else if(Wday==2) printf("Friday\n");
else if(Wday==3) printf("Saturday\n");
else if(Wday==4) printf("Sunday\n");
else if(Wday==5) printf("Monday\n");
else printf("Tuesday\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202784/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202784/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@MONTH = dso_local local_unnamed_addr global [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%date = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %date) #6
%call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %date)
%tobool52 = icmp eq i32 %call51, 0
%0 = load i32, ptr %month, align 4
%cmp53 = icmp eq i32 %0, 0
%or.cond54 = select i1 %tobool52, i1 true, i1 %cmp53
br i1 %or.cond54, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end32
%1 = phi i32 [ %12, %if.end32 ], [ %0, %entry ]
%cmp148 = icmp sgt i32 %1, 1
br i1 %cmp148, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%sub = add nsw i32 %1, -1
%wide.trip.count = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %1, 9
br i1 %min.iters.check, label %for.body.preheader58, 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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%vec.phi56 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%2 = getelementptr inbounds [12 x i32], ptr @MONTH, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load57 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = add <4 x i32> %wide.load, %vec.phi
%5 = add <4 x i32> %wide.load57, %vec.phi56
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %5, %4
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader58
for.body.preheader58: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%days.049.ph = phi i32 [ 0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader58, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader58 ]
%days.049 = phi i32 [ %add, %for.body ], [ %days.049.ph, %for.body.preheader58 ]
%arrayidx = getelementptr inbounds [12 x i32], ptr @MONTH, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %8, %days.049
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%days.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %7, %middle.block ], [ %add, %for.body ]
%9 = load i32, ptr %date, align 4, !tbaa !5
%add2 = add nsw i32 %9, %days.0.lcssa
%rem = srem i32 %add2, 7
%10 = icmp ult i32 %rem, 6
br i1 %10, label %switch.lookup, label %if.end32
switch.lookup: ; preds = %for.end
%11 = sext i32 %rem to i64
%reltable.shift = shl i64 %11, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end32
if.end32: ; preds = %for.end, %switch.lookup
%str.12.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %for.end ]
%puts46 = call i32 @puts(ptr nonnull dereferenceable(1) %str.12.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %date)
%tobool = icmp eq i32 %call, 0
%12 = load i32, ptr %month, align 4
%cmp = icmp eq i32 %12, 0
%or.cond = select i1 %tobool, i1 true, i1 %cmp
br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !14
while.end: ; preds = %if.end32, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %date) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int m[]={0,31,29,31,30,31,30,31,31,30,31,30,31},s,a,b,i;
int main(){
scanf("%d%d",&a,&b);
while(a!=0 && b!=0){
s=0;
for(i=1;i<a;i++)s+=m[i];
s+=b;
if(s%7==0)printf("Wednesday\n");
if(s%7==1)printf("Thursday\n");
if(s%7==2)printf("Friday\n");
if(s%7==3)printf("Saturday\n");
if(s%7==4)printf("Sunday\n");
if(s%7==5)printf("Monday\n");
if(s%7==6)printf("Tuesday\n");
scanf("%d%d",&a,&b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202834/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202834/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@m = dso_local local_unnamed_addr global [13 x i32] [i32 0, i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@a = dso_local global i32 0, align 4
@b = dso_local global i32 0, align 4
@s = dso_local local_unnamed_addr global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@str = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@str.8 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.12 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.13 = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
%0 = load i32, ptr @a, align 4, !tbaa !5
%cmp47 = icmp ne i32 %0, 0
%1 = load i32, ptr @b, align 4
%cmp148 = icmp ne i32 %1, 0
%2 = select i1 %cmp47, i1 %cmp148, i1 false
br i1 %2, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end35
%3 = phi i32 [ %21, %if.end35 ], [ %1, %entry ]
%4 = phi i32 [ %20, %if.end35 ], [ %0, %entry ]
%cmp244 = icmp sgt i32 %4, 1
br i1 %cmp244, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body.preheader57, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %5, -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> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi55 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds [13 x i32], ptr @m, 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.load56 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = add <4 x i32> %vec.phi, %wide.load
%9 = add <4 x i32> %vec.phi55, %wide.load56
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %5, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader57
for.body.preheader57: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%add4345.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader57, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ]
%add4345 = phi i32 [ %add, %for.body ], [ %add4345.ph, %for.body.preheader57 ]
%arrayidx = getelementptr inbounds [13 x i32], ptr @m, i64 0, i64 %indvars.iv
%12 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %add4345, %12
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %while.body
%13 = phi i32 [ 0, %while.body ], [ %11, %middle.block ], [ %add, %for.body ]
%storemerge.lcssa = phi i32 [ 1, %while.body ], [ %4, %middle.block ], [ %4, %for.body ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%add3 = add nsw i32 %13, %3
store i32 %add3, ptr @s, align 4, !tbaa !5
%rem = srem i32 %add3, 7
%cmp4 = icmp eq i32 %rem, 0
br i1 %cmp4, label %if.then, label %if.end
if.then: ; preds = %for.end
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr @s, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.end
%14 = phi i32 [ %.pre, %if.then ], [ %add3, %for.end ]
%rem6 = srem i32 %14, 7
%cmp7 = icmp eq i32 %rem6, 1
br i1 %cmp7, label %if.then8, label %if.end10
if.then8: ; preds = %if.end
%puts37 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
%.pre50 = load i32, ptr @s, align 4, !tbaa !5
br label %if.end10
if.end10: ; preds = %if.then8, %if.end
%15 = phi i32 [ %.pre50, %if.then8 ], [ %14, %if.end ]
%rem11 = srem i32 %15, 7
%cmp12 = icmp eq i32 %rem11, 2
br i1 %cmp12, label %if.then13, label %if.end15
if.then13: ; preds = %if.end10
%puts38 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.9)
%.pre51 = load i32, ptr @s, align 4, !tbaa !5
br label %if.end15
if.end15: ; preds = %if.then13, %if.end10
%16 = phi i32 [ %.pre51, %if.then13 ], [ %15, %if.end10 ]
%rem16 = srem i32 %16, 7
%cmp17 = icmp eq i32 %rem16, 3
br i1 %cmp17, label %if.then18, label %if.end20
if.then18: ; preds = %if.end15
%puts39 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.10)
%.pre52 = load i32, ptr @s, align 4, !tbaa !5
br label %if.end20
if.end20: ; preds = %if.then18, %if.end15
%17 = phi i32 [ %.pre52, %if.then18 ], [ %16, %if.end15 ]
%rem21 = srem i32 %17, 7
%cmp22 = icmp eq i32 %rem21, 4
br i1 %cmp22, label %if.then23, label %if.end25
if.then23: ; preds = %if.end20
%puts40 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.11)
%.pre53 = load i32, ptr @s, align 4, !tbaa !5
br label %if.end25
if.end25: ; preds = %if.then23, %if.end20
%18 = phi i32 [ %.pre53, %if.then23 ], [ %17, %if.end20 ]
%rem26 = srem i32 %18, 7
%cmp27 = icmp eq i32 %rem26, 5
br i1 %cmp27, label %if.then28, label %if.end30
if.then28: ; preds = %if.end25
%puts41 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.12)
%.pre54 = load i32, ptr @s, align 4, !tbaa !5
br label %if.end30
if.end30: ; preds = %if.then28, %if.end25
%19 = phi i32 [ %.pre54, %if.then28 ], [ %18, %if.end25 ]
%rem31 = srem i32 %19, 7
%cmp32 = icmp eq i32 %rem31, 6
br i1 %cmp32, label %if.then33, label %if.end35
if.then33: ; preds = %if.end30
%puts42 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.13)
br label %if.end35
if.end35: ; preds = %if.then33, %if.end30
%call36 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
%20 = load i32, ptr @a, align 4, !tbaa !5
%cmp = icmp ne i32 %20, 0
%21 = load i32, ptr @b, align 4
%cmp1 = icmp ne i32 %21, 0
%22 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %22, label %while.body, label %while.end, !llvm.loop !14
while.end: ; preds = %if.end35, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; 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 = { nofree nounwind "no-trapping-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 }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define SIZ 100005
int main()
{
int n,s,t,i, ar[SIZ];
scanf ("%d%d%d", &n, &s, &t);
for (i=1; i<=n; i++)
scanf ("%d", &ar[i]);
if (s == t)
printf ("0\n");
else{
int curinx = ar[s];
ar[s] = -1;
int ans = 1;
int temp;
while (curinx != t){
if (curinx == -1){
ans = -1;
break;
}
temp = curinx;
curinx = ar[curinx];
ar[temp] = -1;
ans++;
}
printf ("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2029/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2029/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca i32, align 4
%t = alloca i32, align 4
%ar = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %ar) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not24 = icmp slt i32 %0, 1
br i1 %cmp.not24, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr %ar, 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
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%3 = load i32, ptr %s, align 4, !tbaa !5
%4 = load i32, ptr %t, align 4, !tbaa !5
%cmp2 = icmp eq i32 %3, %4
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end17
if.else: ; preds = %for.end
%idxprom4 = sext i32 %3 to i64
%arrayidx5 = getelementptr inbounds [100005 x i32], ptr %ar, i64 0, i64 %idxprom4
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx5, align 4, !tbaa !5
%cmp8.not26 = icmp eq i32 %5, %4
br i1 %cmp8.not26, label %while.end, label %while.body
while.body: ; preds = %if.else, %if.end
%ans.028 = phi i32 [ %inc15, %if.end ], [ 1, %if.else ]
%curinx.027 = phi i32 [ %6, %if.end ], [ %5, %if.else ]
%cmp9 = icmp eq i32 %curinx.027, -1
br i1 %cmp9, label %while.end, label %if.end
if.end: ; preds = %while.body
%idxprom11 = sext i32 %curinx.027 to i64
%arrayidx12 = getelementptr inbounds [100005 x i32], ptr %ar, i64 0, i64 %idxprom11
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
store i32 -1, ptr %arrayidx12, align 4, !tbaa !5
%inc15 = add nuw nsw i32 %ans.028, 1
%cmp8.not = icmp eq i32 %6, %4
br i1 %cmp8.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end, %while.body, %if.else
%ans.1 = phi i32 [ 1, %if.else ], [ -1, %while.body ], [ %inc15, %if.end ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ans.1)
br label %if.end17
if.end17: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %ar) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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>
const char dayName[ 7 ][ 7 ] = { "Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur" };
// int zeller( int, int );
int main(void){
int m, d;
for (;scanf("%d%d",&m,&d)*m;printf("%sday\n",dayName[(2488+(m<3?0:2)+((m+9)%12*13+47)/5+d)%7]));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202942/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202942/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dayName = dso_local constant [7 x [7 x i8]] [[7 x i8] c"Sun\00\00\00\00", [7 x i8] c"Mon\00\00\00\00", [7 x i8] c"Tues\00\00\00", [7 x i8] c"Wednes\00", [7 x i8] c"Thurs\00\00", [7 x i8] c"Fri\00\00\00\00", [7 x i8] c"Satur\00\00"], align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%sday\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%0 = load i32, ptr %m, align 4, !tbaa !5
%mul10 = mul nsw i32 %0, %call9
%tobool.not11 = icmp eq i32 %mul10, 0
br i1 %tobool.not11, label %for.end, label %for.inc
for.inc: ; preds = %entry, %for.inc
%1 = phi i32 [ %5, %for.inc ], [ %0, %entry ]
%cmp.inv = icmp sgt i32 %1, 2
%add = select i1 %cmp.inv, i32 2490, i32 2488
%add1 = add nsw i32 %1, 9
%rem = srem i32 %add1, 12
%2 = trunc i32 %rem to i16
%3 = mul nsw i16 %2, 13
%div.lhs.trunc = add nsw i16 %3, 47
%div8 = sdiv i16 %div.lhs.trunc, 5
%div.sext = sext i16 %div8 to i32
%add4 = add nsw i32 %add, %div.sext
%4 = load i32, ptr %d, align 4, !tbaa !5
%add5 = add nsw i32 %add4, %4
%rem6 = srem i32 %add5, 7
%idxprom = sext i32 %rem6 to i64
%arrayidx = getelementptr inbounds [7 x [7 x i8]], ptr @dayName, i64 0, i64 %idxprom
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %arrayidx)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%5 = load i32, ptr %m, align 4, !tbaa !5
%mul = mul nsw i32 %5, %call
%tobool.not = icmp eq i32 %mul, 0
br i1 %tobool.not, label %for.end, label %for.inc, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int month[12] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30};
int m, d;
int days;
while (1){
scanf("%d%d", &m, &d);
if (m == 0 || d == 0) break;
days = 0;
while (m-- > 0){
days += month[m];
}
days += d;
days %= 7;
//printf("%d\n", days);
switch (days){
case 1:
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
case 0:
printf("Wednesday\n");
break;
default:
break;
}
}
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202993/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202993/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.month = private unnamed_addr constant [12 x i32] [i32 0, i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30], align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@str.8 = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.10 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.11 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.12 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.13 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp35 = icmp eq i32 %0, 0
%1 = load i32, ptr %d, align 4
%cmp136 = icmp eq i32 %1, 0
%or.cond37 = select i1 %cmp35, i1 true, i1 %cmp136
br i1 %or.cond37, label %while.end19, label %while.cond2.preheader
while.cond2.preheader: ; preds = %entry, %sw.epilog
%2 = phi i32 [ %17, %sw.epilog ], [ %1, %entry ]
%3 = phi i32 [ %16, %sw.epilog ], [ %0, %entry ]
%dec29 = add i32 %3, -1
%cmp330 = icmp sgt i32 %3, 0
br i1 %cmp330, label %while.body4.preheader, label %while.end
while.body4.preheader: ; preds = %while.cond2.preheader
%4 = zext i32 %dec29 to i64
%5 = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %while.body4.preheader43, label %vector.ph
vector.ph: ; preds = %while.body4.preheader
%n.vec = and i64 %5, 4294967288
%ind.end = sub nsw i64 %4, %n.vec
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%offset.idx = sub i64 %4, %index
%6 = getelementptr inbounds [12 x i32], ptr @__const.main.month, i64 0, i64 %offset.idx
%7 = getelementptr inbounds i32, ptr %6, i64 -3
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%8 = getelementptr inbounds i32, ptr %6, i64 -7
%wide.load41 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%reverse42 = shufflevector <4 x i32> %wide.load41, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%9 = add <4 x i32> %reverse, %vec.phi
%10 = add <4 x i32> %reverse42, %vec.phi40
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %5
br i1 %cmp.n, label %while.end, label %while.body4.preheader43
while.body4.preheader43: ; preds = %while.body4.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %4, %while.body4.preheader ], [ %ind.end, %middle.block ]
%days.031.ph = phi i32 [ 0, %while.body4.preheader ], [ %12, %middle.block ]
br label %while.body4
while.body4: ; preds = %while.body4.preheader43, %while.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ %indvars.iv.ph, %while.body4.preheader43 ]
%days.031 = phi i32 [ %add, %while.body4 ], [ %days.031.ph, %while.body4.preheader43 ]
%arrayidx = getelementptr inbounds [12 x i32], ptr @__const.main.month, i64 0, i64 %indvars.iv
%13 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %13, %days.031
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp3.not = icmp eq i64 %indvars.iv, 0
br i1 %cmp3.not, label %while.end, label %while.body4, !llvm.loop !13
while.end: ; preds = %while.body4, %middle.block, %while.cond2.preheader
%dec.lcssa = phi i32 [ %dec29, %while.cond2.preheader ], [ -1, %middle.block ], [ -1, %while.body4 ]
%days.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %12, %middle.block ], [ %add, %while.body4 ]
store i32 %dec.lcssa, ptr %m, align 4, !tbaa !5
%add5 = add nsw i32 %days.0.lcssa, %2
%rem = srem i32 %add5, 7
%14 = icmp ult i32 %rem, 7
br i1 %14, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %while.end
%15 = sext i32 %rem to i64
%reltable.shift = shl i64 %15, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %while.end, %switch.lookup
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%16 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %16, 0
%17 = load i32, ptr %d, align 4
%cmp1 = icmp eq i32 %17, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end19, label %while.cond2.preheader
while.end19: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
long gcd(long a,long b){
if(a<b){
long w=a;
a=b;
b=w;
}
if(a%b!=0)return gcd(b,a%b);
else return b;
}
int main(void){
long a,b;
scanf("%ld%ld",&a,&b);
long ab=gcd(a,b);
// printf("%ld\n",ab);
long w=ab;
long c=0;
for(long q=2;q*q<=ab;q++){
if(w%q==0){//printf("%dを因子に持つ\n",q);
c++;
while(w%q==0){w/=q;
}
}
}
if(w>1)c++;
printf("%ld",c+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i64 [ %a, %entry ], [ %spec.select12, %tailrecurse ]
%b.tr = phi i64 [ %b, %entry ], [ %rem, %tailrecurse ]
%spec.select = tail call i64 @llvm.smax.i64(i64 %a.tr, i64 %b.tr)
%spec.select12 = tail call i64 @llvm.smin.i64(i64 %a.tr, i64 %b.tr)
%rem = srem i64 %spec.select, %spec.select12
%cmp1.not = icmp eq i64 %rem, 0
br i1 %cmp1.not, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i64 %spec.select12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%a.tr.i = phi i64 [ %0, %entry ], [ %spec.select12.i, %tailrecurse.i ]
%b.tr.i = phi i64 [ %1, %entry ], [ %rem.i, %tailrecurse.i ]
%spec.select.i = call i64 @llvm.smax.i64(i64 %a.tr.i, i64 %b.tr.i)
%spec.select12.i = call i64 @llvm.smin.i64(i64 %a.tr.i, i64 %b.tr.i)
%rem.i = srem i64 %spec.select.i, %spec.select12.i
%cmp1.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.not.i, label %for.cond.preheader, label %tailrecurse.i
for.cond.preheader: ; preds = %tailrecurse.i
%cmp.not25 = icmp slt i64 %spec.select12.i, 4
br i1 %cmp.not25, label %for.cond.cleanup, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc
%2 = add i64 %c.1, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %for.cond.preheader
%w.0.lcssa = phi i64 [ %spec.select12.i, %for.cond.preheader ], [ %w.2, %for.cond.cleanup.loopexit ]
%c.0.lcssa = phi i64 [ 1, %for.cond.preheader ], [ %2, %for.cond.cleanup.loopexit ]
%cmp6 = icmp sgt i64 %w.0.lcssa, 1
%inc8 = zext i1 %cmp6 to i64
%add = add i64 %c.0.lcssa, %inc8
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
for.body: ; preds = %for.cond.preheader, %for.inc
%q.028 = phi i64 [ %inc5, %for.inc ], [ 2, %for.cond.preheader ]
%c.027 = phi i64 [ %c.1, %for.inc ], [ 0, %for.cond.preheader ]
%w.026 = phi i64 [ %w.2, %for.inc ], [ %spec.select12.i, %for.cond.preheader ]
%rem = srem i64 %w.026, %q.028
%cmp2 = icmp eq i64 %rem, 0
br i1 %cmp2, label %while.body.preheader, label %for.inc
while.body.preheader: ; preds = %for.body
%inc = add nsw i64 %c.027, 1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%w.124 = phi i64 [ %div, %while.body ], [ %w.026, %while.body.preheader ]
%div = sdiv i64 %w.124, %q.028
%rem3 = srem i64 %div, %q.028
%cmp4 = icmp eq i64 %rem3, 0
br i1 %cmp4, label %while.body, label %for.inc, !llvm.loop !9
for.inc: ; preds = %while.body, %for.body
%w.2 = phi i64 [ %w.026, %for.body ], [ %div, %while.body ]
%c.1 = phi i64 [ %c.027, %for.body ], [ %inc, %while.body ]
%inc5 = add nuw nsw i64 %q.028, 1
%mul = mul nsw i64 %inc5, %inc5
%cmp.not = icmp sgt i64 %mul, %spec.select12.i
br i1 %cmp.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
long int gcd(long int x, long int y) {
if(x <= 0) return y;
return gcd(y%x, x);
}
int main() {
long int a, b;
scanf("%ld%ld", &a, &b);
long int g = gcd(a, b);
int ans = 1;
/*for (int i=1; i<=sqrt((double)g); i++) {
if(g%i!=0) continue;
int boo=1;
for (int j=2; j<=sqrt((double)i); j++) {
if(i%j!=0) continue;
boo = 0;
break;
}
if(boo) ans++;
int l=g/i;
if (l==i) continue;
boo=1;
for (int j=2; j<=sqrt((double)l); j++) {
if(l%j!=0) continue;
boo = 0;
break;
}
if(boo) ans++;
}*/
for (int i=2; i<=sqrt((double)g); i++) {
if (g%i!=0) continue;
ans++;
while (g%i==0) g/=i;
}
if(g>1) ans++;
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203079/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203079/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cmp4 = icmp slt i64 %x, 1
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%y.tr6 = phi i64 [ %x.tr5, %if.end ], [ %y, %entry ]
%x.tr5 = phi i64 [ %rem, %if.end ], [ %x, %entry ]
%rem = srem i64 %y.tr6, %x.tr5
%cmp = icmp slt i64 %rem, 1
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
%y.tr.lcssa = phi i64 [ %y, %entry ], [ %x.tr5, %if.end ]
ret i64 %y.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp4.i = icmp slt i64 %0, 1
br i1 %cmp4.i, label %gcd.exit, label %if.end.i
if.end.i: ; preds = %entry, %if.end.i
%y.tr6.i = phi i64 [ %x.tr5.i, %if.end.i ], [ %1, %entry ]
%x.tr5.i = phi i64 [ %rem.i, %if.end.i ], [ %0, %entry ]
%rem.i = srem i64 %y.tr6.i, %x.tr5.i
%cmp.i = icmp slt i64 %rem.i, 1
br i1 %cmp.i, label %gcd.exit, label %if.end.i
gcd.exit: ; preds = %if.end.i, %entry
%y.tr.lcssa.i = phi i64 [ %1, %entry ], [ %x.tr5.i, %if.end.i ]
%conv233 = sitofp i64 %y.tr.lcssa.i to double
%call334 = call double @sqrt(double noundef %conv233) #5
%cmp35 = fcmp ult double %call334, 2.000000e+00
br i1 %cmp35, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %gcd.exit
%g.0.lcssa = phi i64 [ %y.tr.lcssa.i, %gcd.exit ], [ %g.2, %for.inc ]
%ans.0.lcssa = phi i32 [ 1, %gcd.exit ], [ %ans.1, %for.inc ]
%cmp14 = icmp sgt i64 %g.0.lcssa, 1
%inc17 = zext i1 %cmp14 to i32
%spec.select = add nsw i32 %ans.0.lcssa, %inc17
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
for.body: ; preds = %gcd.exit, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 2, %gcd.exit ]
%ans.037 = phi i32 [ %ans.1, %for.inc ], [ 1, %gcd.exit ]
%g.036 = phi i64 [ %g.2, %for.inc ], [ %y.tr.lcssa.i, %gcd.exit ]
%rem = srem i64 %g.036, %indvars.iv
%cmp6.not = icmp eq i64 %rem, 0
br i1 %cmp6.not, label %while.body.preheader, label %for.inc
while.body.preheader: ; preds = %for.body
%inc = add nsw i32 %ans.037, 1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%g.132 = phi i64 [ %div, %while.body ], [ %g.036, %while.body.preheader ]
%div = sdiv i64 %g.132, %indvars.iv
%rem9 = srem i64 %div, %indvars.iv
%cmp10 = icmp eq i64 %rem9, 0
br i1 %cmp10, label %while.body, label %for.inc, !llvm.loop !9
for.inc: ; preds = %while.body, %for.body
%g.2 = phi i64 [ %g.036, %for.body ], [ %div, %while.body ]
%ans.1 = phi i32 [ %ans.037, %for.body ], [ %inc, %while.body ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%2 = trunc i64 %indvars.iv.next to i32
%conv = sitofp i32 %2 to double
%conv2 = sitofp i64 %g.2 to double
%call3 = call double @sqrt(double noundef %conv2) #5
%cmp = fcmp ult double %call3, %conv
br i1 %cmp, 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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
// Aizu 0270: Modular Query
// 2017.8.24 bal4u@uu
#include <stdio.h>
char tbl[300005];
int main()
{
int N, Q, i, k, q, max;
scanf("%d%d", &N, &Q);
tbl[0] = 1, max = 0; while (N-- > 0) {
scanf("%d", &k), tbl[k] = 1;
if (k > max) max = k;
tbl[k & 1] = 1, tbl[k & 3] = 1, tbl[k & 7] = 1;
}
while (Q-- > 0) {
scanf("%d", &q);
if (q > max) printf("%d\n", max);
else {
for (k = q-1; ; k--) {
for (i = k; i <= max; i += q)
if (tbl[i]) { printf("%d\n", k); goto Done; }
}
Done:;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@tbl = dso_local local_unnamed_addr global [300005 x i8] zeroinitializer, align 16
@.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
%Q = alloca i32, align 4
%k = alloca i32, align 4
%q = 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 %Q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Q)
store i8 1, ptr @tbl, align 16, !tbaa !5
%0 = load i32, ptr %N, align 4, !tbaa !8
%dec36 = add nsw i32 %0, -1
store i32 %dec36, ptr %N, align 4, !tbaa !8
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %while.body, label %while.cond11.preheader
while.cond11.preheader: ; preds = %while.body, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
%1 = load i32, ptr %Q, align 4, !tbaa !8
%dec1242 = add nsw i32 %1, -1
store i32 %dec1242, ptr %Q, align 4, !tbaa !8
%cmp1343 = icmp sgt i32 %1, 0
br i1 %cmp1343, label %while.body14.preheader, label %while.end29
while.body14.preheader: ; preds = %while.cond11.preheader
%2 = zext i32 %max.0.lcssa to i64
br label %while.body14
while.body: ; preds = %entry, %while.body
%max.038 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%3 = load i32, ptr %k, align 4, !tbaa !8
%idxprom = sext i32 %3 to i64
%arrayidx = getelementptr inbounds [300005 x i8], ptr @tbl, i64 0, i64 %idxprom
store i8 1, ptr %arrayidx, align 1, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %3, i32 %max.038)
%and = and i32 %3, 1
%idxprom3 = zext i32 %and to i64
%arrayidx4 = getelementptr inbounds [300005 x i8], ptr @tbl, i64 0, i64 %idxprom3
store i8 1, ptr %arrayidx4, align 1, !tbaa !5
%and5 = and i32 %3, 3
%idxprom6 = zext i32 %and5 to i64
%arrayidx7 = getelementptr inbounds [300005 x i8], ptr @tbl, i64 0, i64 %idxprom6
store i8 1, ptr %arrayidx7, align 1, !tbaa !5
%and8 = and i32 %3, 7
%idxprom9 = zext i32 %and8 to i64
%arrayidx10 = getelementptr inbounds [300005 x i8], ptr @tbl, i64 0, i64 %idxprom9
store i8 1, ptr %arrayidx10, align 1, !tbaa !5
%4 = load i32, ptr %N, align 4, !tbaa !8
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %N, align 4, !tbaa !8
%cmp = icmp sgt i32 %4, 0
br i1 %cmp, label %while.body, label %while.cond11.preheader, !llvm.loop !10
while.body14: ; preds = %while.body14.preheader, %if.end28
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%5 = load i32, ptr %q, align 4, !tbaa !8
%cmp16 = icmp sgt i32 %5, %max.0.lcssa
br i1 %cmp16, label %if.end28, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body14
%6 = add i32 %5, -1
%7 = sext i32 %6 to i64
%8 = sext i32 %5 to i64
br label %for.cond
for.cond.loopexit: ; preds = %for.cond19, %for.cond
%indvars.iv.next = add i64 %indvars.iv, -1
br label %for.cond
for.cond: ; preds = %for.cond.preheader, %for.cond.loopexit
%indvars.iv = phi i64 [ %7, %for.cond.preheader ], [ %indvars.iv.next, %for.cond.loopexit ]
%storemerge.in = phi i32 [ %5, %for.cond.preheader ], [ %storemerge, %for.cond.loopexit ]
%storemerge = add nsw i32 %storemerge.in, -1
%cmp20.not39 = icmp sgt i32 %storemerge, %max.0.lcssa
br i1 %cmp20.not39, label %for.cond.loopexit, label %for.body
for.cond19: ; preds = %for.body
%indvars.iv.next45 = add i64 %indvars.iv44, %8
%cmp20.not = icmp sgt i64 %indvars.iv.next45, %2
br i1 %cmp20.not, label %for.cond.loopexit, label %for.body, !llvm.loop !12
for.body: ; preds = %for.cond, %for.cond19
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.cond19 ], [ %indvars.iv, %for.cond ]
%arrayidx22 = getelementptr inbounds [300005 x i8], ptr @tbl, i64 0, i64 %indvars.iv44
%9 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%tobool.not = icmp eq i8 %9, 0
br i1 %tobool.not, label %for.cond19, label %if.then23
if.then23: ; preds = %for.body
store i32 %storemerge, ptr %k, align 4, !tbaa !8
br label %if.end28
if.end28: ; preds = %while.body14, %if.then23
%storemerge.lcssa.sink = phi i32 [ %storemerge, %if.then23 ], [ %max.0.lcssa, %while.body14 ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %storemerge.lcssa.sink)
%10 = load i32, ptr %Q, align 4, !tbaa !8
%dec12 = add nsw i32 %10, -1
store i32 %dec12, ptr %Q, align 4, !tbaa !8
%cmp13 = icmp sgt i32 %10, 0
br i1 %cmp13, label %while.body14, label %while.end29, !llvm.loop !13
while.end29: ; preds = %if.end28, %while.cond11.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
#define N 1000000
#define MD 998244353
int kk[N + 1];
void init() {
int i, j;
for (i = 1; i <= N; i++)
for (j = i; j <= N; j += i)
kk[j]++;
}
int main() {
int n, i, x, y;
init();
scanf("%d", &n);
x = y = 1;
for (i = 2; i <= n; i++)
y = (y + (x = (y + kk[i]) % MD)) % MD;
printf("%d\n", x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20318/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20318/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@kk = dso_local local_unnamed_addr global [1000001 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init() local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.inc4.1, %entry
%indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next.1, %for.inc4.1 ]
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv14 = phi i64 [ %indvars.iv, %for.cond1.preheader ], [ %indvars.iv.next15, %for.body3 ]
%arrayidx = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv14
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next15 = add nuw nsw i64 %indvars.iv14, %indvars.iv
%cmp2 = icmp ult i64 %indvars.iv.next15, 1000001
br i1 %cmp2, label %for.body3, label %for.inc4, !llvm.loop !9
for.inc4: ; preds = %for.body3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.body3.1
for.body3.1: ; preds = %for.body3.1, %for.inc4
%indvars.iv14.1 = phi i64 [ %indvars.iv.next, %for.inc4 ], [ %indvars.iv.next15.1, %for.body3.1 ]
%arrayidx.1 = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv14.1
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%inc.1 = add nsw i32 %1, 1
store i32 %inc.1, ptr %arrayidx.1, align 4, !tbaa !5
%indvars.iv.next15.1 = add nuw nsw i64 %indvars.iv14.1, %indvars.iv.next
%cmp2.1 = icmp ult i64 %indvars.iv.next15.1, 1000001
br i1 %cmp2.1, label %for.body3.1, label %for.inc4.1, !llvm.loop !9
for.inc4.1: ; preds = %for.body3.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 1000001
br i1 %exitcond.not.1, label %for.end6, label %for.cond1.preheader, !llvm.loop !11
for.end6: ; preds = %for.inc4.1
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
br label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %for.inc4.i.1, %entry
%indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i.1, %for.inc4.i.1 ]
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i, %for.cond1.preheader.i
%indvars.iv14.i = phi i64 [ %indvars.iv.i, %for.cond1.preheader.i ], [ %indvars.iv.next15.i, %for.body3.i ]
%arrayidx.i = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv14.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%inc.i = add nsw i32 %0, 1
store i32 %inc.i, ptr %arrayidx.i, align 4, !tbaa !5
%indvars.iv.next15.i = add nuw nsw i64 %indvars.iv14.i, %indvars.iv.i
%cmp2.i = icmp ult i64 %indvars.iv.next15.i, 1000001
br i1 %cmp2.i, label %for.body3.i, label %for.inc4.i, !llvm.loop !9
for.inc4.i: ; preds = %for.body3.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
br label %for.body3.i.1
for.body3.i.1: ; preds = %for.body3.i.1, %for.inc4.i
%indvars.iv14.i.1 = phi i64 [ %indvars.iv.next.i, %for.inc4.i ], [ %indvars.iv.next15.i.1, %for.body3.i.1 ]
%arrayidx.i.1 = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv14.i.1
%1 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
%inc.i.1 = add nsw i32 %1, 1
store i32 %inc.i.1, ptr %arrayidx.i.1, align 4, !tbaa !5
%indvars.iv.next15.i.1 = add nuw nsw i64 %indvars.iv14.i.1, %indvars.iv.next.i
%cmp2.i.1 = icmp ult i64 %indvars.iv.next15.i.1, 1000001
br i1 %cmp2.i.1, label %for.body3.i.1, label %for.inc4.i.1, !llvm.loop !9
for.inc4.i.1: ; preds = %for.body3.i.1
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, 1000001
br i1 %exitcond.not.i.1, label %init.exit, label %for.cond1.preheader.i, !llvm.loop !11
init.exit: ; preds = %for.inc4.i.1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not7 = icmp slt i32 %2, 2
br i1 %cmp.not7, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %init.exit
%3 = add nuw i32 %2, 1
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %3, 3
br i1 %4, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%5 = and i64 %wide.trip.count, 4294967294
%6 = add nsw i64 %5, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%y.09 = phi i32 [ 1, %for.body.preheader.new ], [ %rem2.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i32 %7, %y.09
%rem = srem i32 %add, 998244353
%add1 = add nsw i32 %rem, %y.09
%rem2 = srem i32 %add1, 998244353
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add.1 = add nsw i32 %8, %rem2
%rem.1 = srem i32 %add.1, 998244353
%add1.1 = add nsw i32 %rem.1, %rem2
%rem2.1 = srem i32 %add1.1, 998244353
%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, %6
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !12
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %rem.1, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%y.09.unr = phi i32 [ 1, %for.body.preheader ], [ %rem2.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [1000001 x i32], ptr @kk, i64 0, i64 %indvars.iv.unr
%9 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %9, %y.09.unr
%rem.epil = srem i32 %add.epil, 998244353
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %init.exit
%x.0.lcssa = phi i32 [ 1, %init.exit ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef long long llong;
struct edge {
int dst;
int prevedge;
} edges[200100];
int edgescnt;
struct node {
int l, r;
int lastedge;
} nodes[100100];
llong memo[100100][2];
llong maxbeauty(int p, int u, bool maxa) {
if (memo[u][maxa] != -1) return memo[u][maxa];
int a = nodes[u].l;
if (maxa) a = nodes[u].r;
llong sum = 0;
int e = nodes[u].lastedge;
while (e != -1) {
int v = edges[e].dst;
e = edges[e].prevedge;
if (v == p) continue;
llong s1 = abs(nodes[v].l - a) + maxbeauty(u, v, false);
llong s2 = abs(nodes[v].r - a) + maxbeauty(u, v, true);
sum += s1 < s2 ? s2 : s1;
}
memo[u][maxa] = sum;
return sum;
}
int main(void) {
int tc;
scanf("%d", &tc);
while (tc-- > 0) {
memset(memo, -1, sizeof(memo));
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &nodes[i].l, &nodes[i].r);
nodes[i].lastedge = -1;
}
edgescnt = 0;
for (int i = 1; i < n; i++) {
int u, v;
scanf("%d %d", &u, &v);
u--;
v--;
edges[edgescnt].dst = v;
edges[edgescnt].prevedge = nodes[u].lastedge;
nodes[u].lastedge = edgescnt;
edgescnt++;
edges[edgescnt].dst = u;
edges[edgescnt].prevedge = nodes[v].lastedge;
nodes[v].lastedge = edgescnt;
edgescnt++;
}
llong s1 = maxbeauty(-1, 0, false);
llong s2 = maxbeauty(-1, 0, true);
printf("%lld\n", s1 < s2 ? s2 : s1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20323/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20323/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, i32, i32 }
%struct.edge = type { i32, i32 }
@memo = dso_local local_unnamed_addr global [100100 x [2 x i64]] zeroinitializer, align 16
@nodes = dso_local global [100100 x %struct.node] zeroinitializer, align 16
@edges = dso_local local_unnamed_addr global [200100 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 [6 x i8] c"%d %d\00", align 1
@edgescnt = dso_local local_unnamed_addr global i32 0, align 4
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i64 @maxbeauty(i32 noundef %p, i32 noundef %u, i1 noundef zeroext %maxa) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %u to i64
%idxprom1 = zext i1 %maxa to i64
%arrayidx2 = getelementptr inbounds [100100 x [2 x i64]], ptr @memo, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%cmp.not = icmp eq i64 %0, -1
br i1 %cmp.not, label %if.end, label %return
if.end: ; preds = %entry
%arrayidx9 = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom
%r = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom, i32 1
%spec.select = select i1 %maxa, ptr %r, ptr %arrayidx9
%a.0 = load i32, ptr %spec.select, align 4, !tbaa !9
%lastedge = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom, i32 2
%1 = load i32, ptr %lastedge, align 4, !tbaa !11
%cmp17.not68 = icmp eq i32 %1, -1
br i1 %cmp17.not68, label %while.end, label %while.body
while.body: ; preds = %if.end, %cleanup
%sum.070 = phi i64 [ %sum.1, %cleanup ], [ 0, %if.end ]
%e.069 = phi i32 [ %3, %cleanup ], [ %1, %if.end ]
%idxprom18 = sext i32 %e.069 to i64
%arrayidx19 = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom18
%2 = load i32, ptr %arrayidx19, align 8, !tbaa !13
%prevedge = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom18, i32 1
%3 = load i32, ptr %prevedge, align 4, !tbaa !15
%cmp22 = icmp eq i32 %2, %p
br i1 %cmp22, label %cleanup, label %if.end24, !llvm.loop !16
if.end24: ; preds = %while.body
%idxprom25 = sext i32 %2 to i64
%arrayidx26 = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom25
%4 = load i32, ptr %arrayidx26, align 4, !tbaa !18
%sub = sub nsw i32 %4, %a.0
%5 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true)
%conv = zext i32 %5 to i64
%call = tail call i64 @maxbeauty(i32 noundef %u, i32 noundef %2, i1 noundef zeroext false)
%add = add nsw i64 %call, %conv
%r30 = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom25, i32 1
%6 = load i32, ptr %r30, align 4, !tbaa !19
%sub31 = sub nsw i32 %6, %a.0
%7 = tail call i32 @llvm.abs.i32(i32 %sub31, i1 true)
%conv32 = zext i32 %7 to i64
%call33 = tail call i64 @maxbeauty(i32 noundef %u, i32 noundef %2, i1 noundef zeroext true)
%add34 = add nsw i64 %call33, %conv32
%cond = tail call i64 @llvm.smax.i64(i64 %add, i64 %add34)
%add37 = add nsw i64 %cond, %sum.070
br label %cleanup
cleanup: ; preds = %while.body, %if.end24
%sum.1 = phi i64 [ %add37, %if.end24 ], [ %sum.070, %while.body ]
%cmp17.not = icmp eq i32 %3, -1
br i1 %cmp17.not, label %while.end, label %while.body
while.end: ; preds = %cleanup, %if.end
%sum.0.lcssa = phi i64 [ 0, %if.end ], [ %sum.1, %cleanup ]
store i64 %sum.0.lcssa, ptr %arrayidx2, align 8, !tbaa !5
br label %return
return: ; preds = %entry, %while.end
%retval.0 = phi i64 [ %sum.0.lcssa, %while.end ], [ %0, %entry ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%tc = alloca i32, align 4
%n = alloca i32, align 4
%u = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tc) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tc)
%0 = load i32, ptr %tc, align 4, !tbaa !9
%dec58 = add nsw i32 %0, -1
store i32 %dec58, ptr %tc, align 4, !tbaa !9
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, label %while.body, label %while.end
while.body: ; preds = %entry, %for.cond.cleanup11
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1601600) @memo, i8 -1, i64 1601600, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !9
%cmp254 = icmp sgt i32 %1, 0
br i1 %cmp254, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %while.body
store i32 0, ptr @edgescnt, align 4, !tbaa !9
br label %for.cond.cleanup11
for.cond.cleanup: ; preds = %for.body
store i32 0, ptr @edgescnt, align 4, !tbaa !9
%cmp1056 = icmp sgt i32 %2, 1
br i1 %cmp1056, label %for.body12, label %for.cond.cleanup11
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %indvars.iv
%r = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %indvars.iv, i32 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %r)
%lastedge = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %indvars.iv, i32 2
store i32 -1, ptr %lastedge, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !9
%3 = sext i32 %2 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp2, label %for.body, label %for.cond.cleanup, !llvm.loop !20
for.cond.cleanup11: ; preds = %for.body12, %for.cond.cleanup.thread, %for.cond.cleanup
%call43 = call i64 @maxbeauty(i32 noundef -1, i32 noundef 0, i1 noundef zeroext false)
%call44 = call i64 @maxbeauty(i32 noundef -1, i32 noundef 0, i1 noundef zeroext true)
%cond = call i64 @llvm.smax.i64(i64 %call43, i64 %call44)
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
%4 = load i32, ptr %tc, align 4, !tbaa !9
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %tc, align 4, !tbaa !9
%cmp = icmp sgt i32 %4, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !21
for.body12: ; preds = %for.cond.cleanup, %for.body12
%i8.057 = phi i32 [ %inc41, %for.body12 ], [ 1, %for.cond.cleanup ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %v)
%5 = load i32, ptr %u, align 4, !tbaa !9
%dec14 = add nsw i32 %5, -1
%6 = load i32, ptr %v, align 4, !tbaa !9
%dec15 = add nsw i32 %6, -1
%7 = load i32, ptr @edgescnt, align 4, !tbaa !9
%idxprom16 = sext i32 %7 to i64
%arrayidx17 = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom16
store i32 %dec15, ptr %arrayidx17, align 8, !tbaa !13
%idxprom18 = sext i32 %dec14 to i64
%lastedge20 = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom18, i32 2
%8 = load i32, ptr %lastedge20, align 4, !tbaa !11
%prevedge = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom16, i32 1
store i32 %8, ptr %prevedge, align 4, !tbaa !15
store i32 %7, ptr %lastedge20, align 4, !tbaa !11
%inc26 = add nsw i32 %7, 1
%idxprom27 = sext i32 %inc26 to i64
%arrayidx28 = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom27
store i32 %dec14, ptr %arrayidx28, align 8, !tbaa !13
%idxprom30 = sext i32 %dec15 to i64
%lastedge32 = getelementptr inbounds [100100 x %struct.node], ptr @nodes, i64 0, i64 %idxprom30, i32 2
%9 = load i32, ptr %lastedge32, align 4, !tbaa !11
%prevedge35 = getelementptr inbounds [200100 x %struct.edge], ptr @edges, i64 0, i64 %idxprom27, i32 1
store i32 %9, ptr %prevedge35, align 4, !tbaa !15
store i32 %inc26, ptr %lastedge32, align 4, !tbaa !11
%inc39 = add nsw i32 %7, 2
store i32 %inc39, ptr @edgescnt, align 4, !tbaa !9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #7
%inc41 = add nuw nsw i32 %i8.057, 1
%10 = load i32, ptr %n, align 4, !tbaa !9
%cmp10 = icmp slt i32 %inc41, %10
br i1 %cmp10, label %for.body12, label %for.cond.cleanup11, !llvm.loop !22
while.end: ; preds = %for.cond.cleanup11, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tc) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!12, !10, i64 8}
!12 = !{!"node", !10, i64 0, !10, i64 4, !10, i64 8}
!13 = !{!14, !10, i64 0}
!14 = !{!"edge", !10, i64 0, !10, i64 4}
!15 = !{!14, !10, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !10, i64 0}
!19 = !{!12, !10, i64 4}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
|
#include <stdio.h>
typedef struct _XY{
int x;
int y;
} XY;
int main(){
int n;
int i0;
int i,j,k,l;
int x,y;
XY P[3001];
int judR;
int judLen;
int Area2,Area2Max;
int trgtX,trgtY;
int trgtX2,trgtY2;
int jud1,jud2;
while(1){
scanf("%d\n",&n);
if(n==0)break;
Area2Max=0;
for(i0=0;i0<n;i0++){
scanf("%d %d\n",&x,&y);
P[i0].x=x;P[i0].y=y;
}
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
Area2=(P[i].x-P[j].x)*(P[i].x-P[j].x) + (P[i].y-P[j].y)*(P[i].y-P[j].y);
if(Area2%2==0 && Area2/2 >Area2Max){
trgtX=(P[i].x+P[j].x)+(P[j].y-P[i].y);
trgtY=(P[i].y+P[j].y)+(-P[j].x+P[i].x);
trgtX2=(P[i].x+P[j].x)-(P[j].y-P[i].y);
trgtY2=(P[i].y+P[j].y)-(-P[j].x+P[i].x);
if(trgtX2%2==0 && trgtY2%2==0 && trgtX2<10002 && trgtY2<10002 && trgtX2>0 && trgtY2>0){
if(trgtX%2==0 && trgtY%2==0 && trgtX<10002 && trgtY<10002 && trgtX>0 && trgtY>0){
trgtX/=2;trgtY/=2;
jud1=-1;
jud2=-1;
for(k=0;k<n;k++){
if(P[k].x==trgtX && P[k].y==trgtY){
jud1=k;
break;
}
}
if(jud1!=-1){
trgtX2/=2;trgtY2/=2;
for(k=0;k<n;k++){
if(P[k].x==trgtX2 && P[k].y==trgtY2){
jud2=k;
break;
}
}
}
if(jud1!=-1 && jud2!=-1){
Area2Max=Area2/2;
//printf("P[%d]=(%d,%d)\tP[%d]=(%d,%d)\tP[%d]=(%d,%d)\tP[%d]=(%d,%d)\n",i,P[i].x,P[i].y,j,P[j].x,P[j].y,jud1,P[jud1].x,P[jud1].y,jud2,P[jud2].x,P[jud2].y);
}
}
}
}
}
}
printf("%d\n",Area2Max);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203273/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203273/source.c"
target datalayout = "e-m:e-p270: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._XY = type { i32, i32 }
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%P = alloca [3001 x %struct._XY], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 24008, ptr nonnull %P) #3
%call287 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp288 = icmp eq i32 %0, 0
br i1 %cmp288, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end190
%1 = phi i32 [ %19, %for.end190 ], [ %0, %entry ]
%cmp1269 = icmp sgt i32 %1, 0
br i1 %cmp1269, label %for.body, label %for.end190
for.cond7.preheader: ; preds = %for.body
%cmp8283 = icmp sgt i32 %5, 0
br i1 %cmp8283, label %for.body9.preheader, label %for.end190
for.body9.preheader: ; preds = %for.cond7.preheader
%2 = zext i32 %5 to i64
%wide.trip.count310 = zext i32 %5 to i64
br label %for.body9
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%3 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv
store i32 %3, ptr %arrayidx, align 8, !tbaa !9
%4 = load i32, ptr %y, align 4, !tbaa !5
%y6 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv, i32 1
store i32 %4, ptr %y6, align 4, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp1, label %for.body, label %for.cond7.preheader, !llvm.loop !12
for.cond7.loopexit: ; preds = %for.inc185, %for.body9
%Area2Max.1.lcssa = phi i32 [ %Area2Max.0285, %for.body9 ], [ %Area2Max.2, %for.inc185 ]
%indvars.iv.next301 = add nuw nsw i64 %indvars.iv300, 1
%exitcond311.not = icmp eq i64 %indvars.iv.next308, %wide.trip.count310
br i1 %exitcond311.not, label %for.end190, label %for.body9, !llvm.loop !14
for.body9: ; preds = %for.body9.preheader, %for.cond7.loopexit
%indvars.iv307 = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next308, %for.cond7.loopexit ]
%indvars.iv300 = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next301, %for.cond7.loopexit ]
%Area2Max.0285 = phi i32 [ 0, %for.body9.preheader ], [ %Area2Max.1.lcssa, %for.cond7.loopexit ]
%indvars.iv.next308 = add nuw nsw i64 %indvars.iv307, 1
%cmp11279 = icmp ult i64 %indvars.iv.next308, %2
br i1 %cmp11279, label %for.body12.lr.ph, label %for.cond7.loopexit
for.body12.lr.ph: ; preds = %for.body9
%arrayidx14 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv307
%7 = load i32, ptr %arrayidx14, align 8, !tbaa !9
%y28 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv307, i32 1
%8 = load i32, ptr %y28, align 4, !tbaa !11
br label %for.body12
for.body12: ; preds = %for.body12.lr.ph, %for.inc185
%indvars.iv302 = phi i64 [ %indvars.iv300, %for.body12.lr.ph ], [ %indvars.iv.next303, %for.inc185 ]
%Area2Max.1281 = phi i32 [ %Area2Max.0285, %for.body12.lr.ph ], [ %Area2Max.2, %for.inc185 ]
%arrayidx17 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv302
%9 = load i32, ptr %arrayidx17, align 8, !tbaa !9
%sub = sub nsw i32 %7, %9
%mul = mul nsw i32 %sub, %sub
%y31 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv302, i32 1
%10 = load i32, ptr %y31, align 4, !tbaa !11
%sub32 = sub nsw i32 %8, %10
%mul40 = mul nsw i32 %sub32, %sub32
%add41 = add nuw nsw i32 %mul40, %mul
%rem = and i32 %add41, 1
%cmp42 = icmp eq i32 %rem, 0
br i1 %cmp42, label %land.lhs.true, label %for.inc185
land.lhs.true: ; preds = %for.body12
%div259 = lshr i32 %add41, 1
%cmp43 = icmp sgt i32 %div259, %Area2Max.1281
br i1 %cmp43, label %if.then44, label %for.inc185
if.then44: ; preds = %land.lhs.true
%add51 = add nsw i32 %9, %7
%sub58 = sub nsw i32 %10, %8
%add59 = add nsw i32 %sub58, %add51
%add66 = add nsw i32 %10, %8
%add75 = add nsw i32 %add66, %sub
%sub90 = sub nsw i32 %add51, %sub58
%sub106 = sub nsw i32 %add66, %sub
%11 = and i32 %sub90, 1
%cmp108 = icmp eq i32 %11, 0
br i1 %cmp108, label %land.lhs.true109, label %for.inc185
land.lhs.true109: ; preds = %if.then44
%12 = and i32 %sub106, 1
%cmp111 = icmp eq i32 %12, 0
%cmp113 = icmp slt i32 %sub90, 10002
%or.cond = and i1 %cmp113, %cmp111
%cmp115 = icmp slt i32 %sub106, 10002
%or.cond192 = select i1 %or.cond, i1 %cmp115, i1 false
%cmp117 = icmp sgt i32 %sub90, 0
%or.cond193 = and i1 %cmp117, %or.cond192
%cmp119 = icmp sgt i32 %sub106, 0
%or.cond194 = select i1 %or.cond193, i1 %cmp119, i1 false
%13 = and i32 %add59, 1
%cmp122 = icmp eq i32 %13, 0
%or.cond262 = select i1 %or.cond194, i1 %cmp122, i1 false
br i1 %or.cond262, label %land.lhs.true123, label %for.inc185
land.lhs.true123: ; preds = %land.lhs.true109
%14 = and i32 %add75, 1
%cmp125 = icmp eq i32 %14, 0
%cmp127 = icmp slt i32 %add59, 10002
%or.cond195 = select i1 %cmp125, i1 %cmp127, i1 false
%cmp129 = icmp slt i32 %add75, 10002
%or.cond196 = select i1 %or.cond195, i1 %cmp129, i1 false
%cmp131 = icmp sgt i32 %add59, 0
%or.cond197 = select i1 %or.cond196, i1 %cmp131, i1 false
%cmp133 = icmp sgt i32 %add75, 0
%or.cond198 = select i1 %or.cond197, i1 %cmp133, i1 false
br i1 %or.cond198, label %if.then134, label %for.inc185
if.then134: ; preds = %land.lhs.true123
%div135260 = lshr i32 %add59, 1
%div136263264265 = lshr i32 %add75, 1
br label %for.body139
for.body139: ; preds = %if.then134, %for.inc151
%indvars.iv293 = phi i64 [ 0, %if.then134 ], [ %indvars.iv.next294, %for.inc151 ]
%cmp138273 = phi i1 [ true, %if.then134 ], [ %cmp138, %for.inc151 ]
%arrayidx141 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv293
%15 = load i32, ptr %arrayidx141, align 8, !tbaa !9
%cmp143 = icmp eq i32 %15, %div135260
br i1 %cmp143, label %land.lhs.true144, label %for.inc151
land.lhs.true144: ; preds = %for.body139
%y147 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv293, i32 1
%16 = load i32, ptr %y147, align 4, !tbaa !11
%cmp148 = icmp eq i32 %16, %div136263264265
br i1 %cmp148, label %if.then155, label %for.inc151
for.inc151: ; preds = %for.body139, %land.lhs.true144
%indvars.iv.next294 = add nuw nsw i64 %indvars.iv293, 1
%cmp138 = icmp ult i64 %indvars.iv.next294, %2
%exitcond.not = icmp eq i64 %indvars.iv.next294, %wide.trip.count310
br i1 %exitcond.not, label %if.end175, label %for.body139, !llvm.loop !15
if.then155: ; preds = %land.lhs.true144
%div156261 = lshr i32 %sub90, 1
%div157 = sdiv i32 %sub106, 2
br label %for.body160
for.body160: ; preds = %if.then155, %for.inc172
%indvars.iv295 = phi i64 [ 0, %if.then155 ], [ %indvars.iv.next296, %for.inc172 ]
%arrayidx162 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv295
%17 = load i32, ptr %arrayidx162, align 8, !tbaa !9
%cmp164 = icmp eq i32 %17, %div156261
br i1 %cmp164, label %land.lhs.true165, label %for.inc172
land.lhs.true165: ; preds = %for.body160
%y168 = getelementptr inbounds [3001 x %struct._XY], ptr %P, i64 0, i64 %indvars.iv295, i32 1
%18 = load i32, ptr %y168, align 4, !tbaa !11
%cmp169 = icmp eq i32 %18, %div157
br i1 %cmp169, label %if.end175, label %for.inc172
for.inc172: ; preds = %for.body160, %land.lhs.true165
%indvars.iv.next296 = add nuw nsw i64 %indvars.iv295, 1
%exitcond299.not = icmp eq i64 %indvars.iv.next296, %wide.trip.count310
br i1 %exitcond299.not, label %if.end175, label %for.body160, !llvm.loop !16
if.end175: ; preds = %for.inc151, %for.inc172, %land.lhs.true165
%cmp138268 = phi i1 [ %cmp138273, %land.lhs.true165 ], [ %cmp138273, %for.inc172 ], [ %cmp138, %for.inc151 ]
%jud2.0 = phi i1 [ false, %for.inc172 ], [ true, %land.lhs.true165 ], [ false, %for.inc151 ]
%or.cond199 = and i1 %cmp138268, %jud2.0
%spec.select = select i1 %or.cond199, i32 %div259, i32 %Area2Max.1281
br label %for.inc185
for.inc185: ; preds = %if.end175, %for.body12, %land.lhs.true, %land.lhs.true123, %land.lhs.true109, %if.then44
%Area2Max.2 = phi i32 [ %Area2Max.1281, %land.lhs.true123 ], [ %Area2Max.1281, %land.lhs.true109 ], [ %Area2Max.1281, %if.then44 ], [ %Area2Max.1281, %land.lhs.true ], [ %Area2Max.1281, %for.body12 ], [ %spec.select, %if.end175 ]
%indvars.iv.next303 = add nuw nsw i64 %indvars.iv302, 1
%exitcond306.not = icmp eq i64 %indvars.iv.next303, %wide.trip.count310
br i1 %exitcond306.not, label %for.cond7.loopexit, label %for.body12, !llvm.loop !17
for.end190: ; preds = %for.cond7.loopexit, %for.cond.preheader, %for.cond7.preheader
%Area2Max.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ 0, %for.cond.preheader ], [ %Area2Max.1.lcssa, %for.cond7.loopexit ]
%call191 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %Area2Max.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %19, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end190, %entry
call void @llvm.lifetime.end.p0(i64 24008, ptr nonnull %P) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 = !{!10, !6, i64 0}
!10 = !{!"_XY", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include<stdio.h>
int main(){
int a,b,c,tmp,i,N,k[2048]={0};
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d%d%d",&a,&b,&c);
if(a<b){tmp=b;
b=a;
a=tmp;
}
if(a<c){tmp=c;
c=a;
a=tmp;
}
if(a*a==b*b+c*c)k[i]++;
}
for(i=0;i<N;i++){
if(k[i]==0)printf("NO\n");
else printf("YES\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%N = alloca i32, align 4
%k = alloca [2048 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %k) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8192) %k, i8 0, i64 8192, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end24
for.cond12.preheader: ; preds = %for.inc
%1 = icmp sgt i32 %10, 0
br i1 %1, label %for.body14, label %for.end24
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp slt i32 %2, %3
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%4 = phi i32 [ %2, %if.then ], [ %3, %for.body ]
%5 = phi i32 [ %3, %if.then ], [ %2, %for.body ]
%6 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp slt i32 %5, %6
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %5, ptr %c, align 4, !tbaa !5
store i32 %6, ptr %a, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%7 = phi i32 [ %5, %if.then4 ], [ %6, %if.end ]
%8 = phi i32 [ %6, %if.then4 ], [ %5, %if.end ]
%mul = mul nsw i32 %8, %8
%mul6 = mul nsw i32 %4, %4
%mul7 = mul nsw i32 %7, %7
%add = add nuw nsw i32 %mul7, %mul6
%cmp8 = icmp eq i32 %mul, %add
br i1 %cmp8, label %if.then9, label %for.inc
if.then9: ; preds = %if.end5
%arrayidx = getelementptr inbounds [2048 x i32], ptr %k, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %9, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end5, %if.then9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %N, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond12.preheader, !llvm.loop !9
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body14 ], [ 0, %for.cond12.preheader ]
%arrayidx16 = getelementptr inbounds [2048 x i32], ptr %k, i64 0, i64 %indvars.iv40
%12 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp eq i32 %12, 0
%str.4.str = select i1 %cmp17, ptr @str.4, ptr @str
%puts34 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp13 = icmp slt i64 %indvars.iv.next41, %14
br i1 %cmp13, label %for.body14, label %for.end24, !llvm.loop !11
for.end24: ; preds = %for.body14, %entry, %for.cond12.preheader
call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int i,a,b,c,N,l;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d %d %d",&a,&b,&c);
if(a>b){
l=b;
b=a;
a=l;
}
if(b>c){
l=c;
c=b;
b=l;
}
if(c*c==(b*b+a*a))
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203374/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203374/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end5
%i.020 = phi i32 [ %inc, %if.end5 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %1, ptr %b, align 4, !tbaa !5
store i32 %2, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%3 = phi i32 [ %2, %if.then ], [ %1, %for.body ]
%4 = phi i32 [ %1, %if.then ], [ %2, %for.body ]
%5 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %4, %5
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %4, ptr %c, align 4, !tbaa !5
store i32 %5, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%6 = phi i32 [ %5, %if.then4 ], [ %4, %if.end ]
%7 = phi i32 [ %4, %if.then4 ], [ %5, %if.end ]
%mul = mul nsw i32 %7, %7
%mul6 = mul nsw i32 %6, %6
%mul7 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul7, %mul6
%cmp8 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp8, ptr @str.4, ptr @str
%puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.020, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end5, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int i;
int N;
int a, b, c;
scanf("%d", &N);
for ( i = 0; i < N; i++){
scanf("%d%d%d", &a, &b, &c);
if( (a*a + b*b == c * c) || (b*b + c*c == a*a) || (c*c + a*a == b*b) )
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203417/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
%add7 = add nuw nsw i32 %mul3, %mul2
%cmp9 = icmp eq i32 %add7, %mul
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add13 = add nuw nsw i32 %mul3, %mul
%cmp15 = icmp eq i32 %add13, %mul2
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void) {
int a, b, c, n, i;
scanf("%d", &n);
for(i = 0; i < n; i++) {
scanf("%d%d%d", &a, &b, &c);
if((a*a == b*b + c*c) || (b*b == a*a + c*c) || (c*c == a*a + b*b)) {
puts("YES");
} else {
puts("NO");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203468/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.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
%n = 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 %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
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.021 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond19 = select i1 %or.cond, i1 true, i1 %cmp15
%.str.2..str.3 = select i1 %or.cond19, ptr @.str.2, ptr @.str.3
%call16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
%inc = add nuw nsw i32 %i.021, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
//Triangle
#include<stdio.h>
int main(void) {
int i,a,b,c,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d%d",&a,&b,&c);
if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203510/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203510/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
%add7 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %add7, %mul2
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add13 = add nuw nsw i32 %mul3, %mul2
%cmp15 = icmp eq i32 %add13, %mul
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *lhs, const void *rhs) {
return *(int*)lhs - *(int*)rhs;
}
int main () {
int data[3];
scanf("%d", &data[0]);
while(scanf("%d %d %d", &data[0], &data[1], &data[2]) != EOF ) {
qsort(data, 3, sizeof(int), cmp);
if ( data[0] * data[0] + data[1] * data[1] == data[2] * data[2] )
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %lhs, ptr nocapture noundef readonly %rhs) #0 {
entry:
%0 = load i32, ptr %lhs, align 4, !tbaa !5
%1 = load i32, ptr %rhs, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%data = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %data) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data)
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 2
%call417 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %data, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not18 = icmp eq i32 %call417, -1
br i1 %cmp.not18, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @qsort(ptr noundef nonnull %data, i64 noundef 3, i64 noundef 4, ptr noundef nonnull @cmp) #6
%0 = load i32, ptr %data, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%mul9 = mul nsw i32 %1, %1
%add = add nuw nsw i32 %mul9, %mul
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%mul12 = mul nsw i32 %2, %2
%cmp13 = icmp eq i32 %add, %mul12
%str.4.str = select i1 %cmp13, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %data, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not = icmp eq i32 %call4, -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 12, ptr nonnull %data) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int N=0, data[3] ,c,i;
scanf("%d",&N);
char *judge[N];
for (i=0; i<N; i++) {
scanf("%d %d %d",&data[0],&data[1],&data[2]);
if (data[0]<data[1]) {
c=data[1];
data[1]=data[0];
data[0]=c;
}
if (data[0]<data[2]) {
c=data[2];
data[2]=data[0];
data[0]=c;
}
if (data[0]*data[0]==(data[1]*data[1]+data[2]*data[2])) {
judge[i]="YES";
}
else
judge[i]="NO";
}
for (i=0; i<N; i++) {
printf("%s\n",judge[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%data = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %data) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca ptr, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %3, 0
br i1 %cmp53, label %for.body.lr.ph, label %for.end42
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 2
br label %for.body
for.cond34.preheader: ; preds = %if.end19
%4 = icmp sgt i32 %13, 0
br i1 %4, label %for.body36, label %for.end42
for.body: ; preds = %for.body.lr.ph, %if.end19
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end19 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %data, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%5 = load i32, ptr %data, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp6 = icmp slt i32 %5, %6
br i1 %cmp6, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
store i32 %6, ptr %data, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%7 = phi i32 [ %5, %if.then ], [ %6, %for.body ]
%8 = phi i32 [ %6, %if.then ], [ %5, %for.body ]
%9 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp13 = icmp slt i32 %8, %9
br i1 %cmp13, label %if.then14, label %if.end19
if.then14: ; preds = %if.end
store i32 %8, ptr %arrayidx2, align 4, !tbaa !5
store i32 %9, ptr %data, align 4, !tbaa !5
br label %if.end19
if.end19: ; preds = %if.then14, %if.end
%10 = phi i32 [ %8, %if.then14 ], [ %9, %if.end ]
%11 = phi i32 [ %9, %if.then14 ], [ %8, %if.end ]
%mul = mul nsw i32 %11, %11
%mul24 = mul nsw i32 %7, %7
%mul27 = mul nsw i32 %10, %10
%add = add nuw nsw i32 %mul27, %mul24
%cmp28 = icmp eq i32 %mul, %add
%spec.select = select i1 %cmp28, ptr @.str.2, ptr @.str.3
%12 = getelementptr inbounds ptr, ptr %vla, i64 %indvars.iv
store ptr %spec.select, ptr %12, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond34.preheader, !llvm.loop !9
for.body36: ; preds = %for.cond34.preheader, %for.body36
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body36 ], [ 0, %for.cond34.preheader ]
%arrayidx38 = getelementptr inbounds ptr, ptr %vla, i64 %indvars.iv58
%15 = load ptr, ptr %arrayidx38, align 8, !tbaa !11
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %15)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%16 = load i32, ptr %N, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp35 = icmp slt i64 %indvars.iv.next59, %17
br i1 %cmp35, label %for.body36, label %for.end42, !llvm.loop !13
for.end42: ; preds = %for.body36, %entry, %for.cond34.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %data) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main (void) {
int N;
int i;
int a, b, c;
scanf("%d\n", &N);
for (i = 0; i < N; i++) {
scanf("%d %d %d", &a, &b, &c);
if (a > b && a > c) {
if (a*a == b*b + c*c) {
printf("YES\n");
} else printf("NO\n");
}
else if(b > a && b > c) {
if(b*b == a*a + c*c) {
printf("YES\n");
} else printf("NO\n");
}
else
if(c*c == a*a + b*b) {
printf("YES\n");
} else printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203648/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203648/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %0, 0
br i1 %cmp49, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.050 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %1, %.pre.pre
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then, label %if.else10
if.then: ; preds = %for.body
%mul = mul nsw i32 %1, %1
%mul4 = mul nsw i32 %2, %2
%mul5 = mul nsw i32 %.pre.pre, %.pre.pre
%add = add nuw nsw i32 %mul5, %mul4
%cmp6 = icmp eq i32 %mul, %add
%str.8.str.7 = select i1 %cmp6, ptr @str.8, ptr @str.7
br label %for.inc
if.else10: ; preds = %for.body
%cmp11 = icmp sgt i32 %2, %1
%cmp13 = icmp sgt i32 %2, %.pre.pre
%or.cond51 = select i1 %cmp11, i1 %cmp13, i1 false
%mul16 = mul nsw i32 %1, %1
br i1 %or.cond51, label %if.then14, label %if.else25
if.then14: ; preds = %if.else10
%mul15 = mul nsw i32 %2, %2
%mul17 = mul nsw i32 %.pre.pre, %.pre.pre
%add18 = add nuw nsw i32 %mul17, %mul16
%cmp19 = icmp eq i32 %mul15, %add18
%str.6.str.5 = select i1 %cmp19, ptr @str.8, ptr @str.7
br label %for.inc
if.else25: ; preds = %if.else10
%mul26 = mul nsw i32 %.pre.pre, %.pre.pre
%mul28 = mul nsw i32 %2, %2
%add29 = add nuw nsw i32 %mul28, %mul16
%cmp30 = icmp eq i32 %mul26, %add29
%str.4.str = select i1 %cmp30, ptr @str.8, ptr @str.7
br label %for.inc
for.inc: ; preds = %if.else25, %if.then14, %if.then
%str.7.sink = phi ptr [ %str.8.str.7, %if.then ], [ %str.6.str.5, %if.then14 ], [ %str.4.str, %if.else25 ]
%puts47 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
%inc = add nuw nsw i32 %i.050, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
void swap(int *a, int *b){
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int check_triangle(int a, int b, int c){
int tmp;
if(b < c)
swap(&b,&c);
if(a < b)
swap(&a,&b);
if(a*a == b*b + c*c)
return 1;
return 0;
}
int main(void){
int i;
int N;
int *data;
scanf("%d",&N);
data = (int*)malloc(sizeof(int)*N*3);
if(data == NULL)
exit(1);
for(i=0;i<N;i++){
scanf("%d %d %d",&data[3*i],&data[3*i+1],&data[3*i+2]);
}
for (i=0;i<N;i++){
if(check_triangle(data[3*i],data[3*i+1],data[3*i+2]) == 1){
printf("YES\n");
}
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: 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 i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @check_triangle(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #2 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %b, i32 %c)
%spec.select15 = tail call i32 @llvm.smin.i32(i32 %b, i32 %c)
%a.addr.0 = tail call i32 @llvm.smax.i32(i32 %spec.select, i32 %a)
%b.addr.1 = tail call i32 @llvm.smin.i32(i32 %spec.select, i32 %a)
%mul = mul nsw i32 %a.addr.0, %a.addr.0
%mul4 = mul nsw i32 %b.addr.1, %b.addr.1
%mul5 = mul nsw i32 %spec.select15, %spec.select15
%add = add nuw nsw i32 %mul4, %mul5
%cmp6 = icmp eq i32 %mul, %add
%. = zext i1 %cmp6 to i32
ret i32 %.
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul1 = mul nsw i64 %conv, 12
%call2 = call noalias ptr @malloc(i64 noundef %mul1) #10
%cmp = icmp eq ptr %call2, null
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp456 = icmp sgt i32 %0, 0
br i1 %cmp456, label %for.body.preheader, label %for.end39
for.body.preheader: ; preds = %for.cond.preheader
%invariant.gep = getelementptr i32, ptr %call2, i64 1
%invariant.gep71 = getelementptr i32, ptr %call2, i64 2
br label %for.body
if.then: ; preds = %entry
call void @exit(i32 noundef 1) #11
unreachable
for.cond15.preheader: ; preds = %for.body
%1 = icmp sgt i32 %3, 0
br i1 %1, label %for.body18.preheader, label %for.end39
for.body18.preheader: ; preds = %for.cond15.preheader
%invariant.gep73 = getelementptr i32, ptr %call2, i64 1
%invariant.gep75 = getelementptr i32, ptr %call2, i64 2
br label %for.body18
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%2 = mul nuw nsw i64 %indvars.iv, 3
%arrayidx = getelementptr inbounds i32, ptr %call2, i64 %2
%gep = getelementptr i32, ptr %invariant.gep, i64 %2
%gep72 = getelementptr i32, ptr %invariant.gep71, i64 %2
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %gep, ptr noundef nonnull %gep72)
%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
%cmp4 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp4, label %for.body, label %for.cond15.preheader, !llvm.loop !9
for.body18: ; preds = %for.body18.preheader, %for.body18
%indvars.iv64 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next65, %for.body18 ]
%5 = mul nuw nsw i64 %indvars.iv64, 3
%arrayidx21 = getelementptr inbounds i32, ptr %call2, i64 %5
%6 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%gep74 = getelementptr i32, ptr %invariant.gep73, i64 %5
%7 = load i32, ptr %gep74, align 4, !tbaa !5
%gep76 = getelementptr i32, ptr %invariant.gep75, i64 %5
%8 = load i32, ptr %gep76, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smax.i32(i32 %7, i32 %8)
%spec.select15.i = call i32 @llvm.smin.i32(i32 %7, i32 %8)
%a.addr.0.i = call i32 @llvm.smax.i32(i32 %spec.select.i, i32 %6)
%b.addr.1.i = call i32 @llvm.smin.i32(i32 %spec.select.i, i32 %6)
%mul.i = mul nsw i32 %a.addr.0.i, %a.addr.0.i
%mul4.i = mul nsw i32 %b.addr.1.i, %b.addr.1.i
%mul5.i = mul nsw i32 %spec.select15.i, %spec.select15.i
%add.i = add nuw nsw i32 %mul4.i, %mul5.i
%cmp6.i.not = icmp eq i32 %mul.i, %add.i
%str.4.str = select i1 %cmp6.i.not, ptr @str.4, ptr @str
%puts55 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp16 = icmp slt i64 %indvars.iv.next65, %10
br i1 %cmp16, label %for.body18, label %for.end39, !llvm.loop !11
for.end39: ; preds = %for.body18, %for.cond.preheader, %for.cond15.preheader
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 #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main() {
int a, b, c, N;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d %d %d", &a, &b, &c);
if (a > b&&a > c) {
if (a*a == b * b + c * c)printf("YES\n");
else printf("NO\n");
}
else if (b > a&&b > c) {
if (b*b == a * a + c * c)printf("YES\n");
else printf("NO\n");
}
else if (c*c == a * a + b * b)printf("YES\n");
else printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203741/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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
%cmp49 = icmp sgt i32 %0, 0
br i1 %cmp49, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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
for.body: ; preds = %entry, %for.inc
%i.050 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %1, %.pre.pre
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then, label %if.else10
if.then: ; preds = %for.body
%mul = mul nsw i32 %1, %1
%mul4 = mul nsw i32 %2, %2
%mul5 = mul nsw i32 %.pre.pre, %.pre.pre
%add = add nuw nsw i32 %mul5, %mul4
%cmp6 = icmp eq i32 %mul, %add
%str.8.str.7 = select i1 %cmp6, ptr @str.8, ptr @str.7
br label %for.inc
if.else10: ; preds = %for.body
%cmp11 = icmp sgt i32 %2, %1
%cmp13 = icmp sgt i32 %2, %.pre.pre
%or.cond51 = select i1 %cmp11, i1 %cmp13, i1 false
%mul16 = mul nsw i32 %1, %1
br i1 %or.cond51, label %if.then14, label %if.else25
if.then14: ; preds = %if.else10
%mul15 = mul nsw i32 %2, %2
%mul17 = mul nsw i32 %.pre.pre, %.pre.pre
%add18 = add nuw nsw i32 %mul17, %mul16
%cmp19 = icmp eq i32 %mul15, %add18
%str.6.str.5 = select i1 %cmp19, ptr @str.8, ptr @str.7
br label %for.inc
if.else25: ; preds = %if.else10
%mul26 = mul nsw i32 %.pre.pre, %.pre.pre
%mul28 = mul nsw i32 %2, %2
%add29 = add nuw nsw i32 %mul28, %mul16
%cmp30 = icmp eq i32 %mul26, %add29
%str.4.str = select i1 %cmp30, ptr @str.8, ptr @str.7
br label %for.inc
for.inc: ; preds = %if.else25, %if.then14, %if.then
%str.7.sink = phi ptr [ %str.8.str.7, %if.then ], [ %str.6.str.5, %if.then14 ], [ %str.4.str, %if.else25 ]
%puts47 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
%inc = add nuw nsw i32 %i.050, 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, !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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c,n,N;
scanf("%d",&N);
for(n=1;n<=N;n++){
scanf("%d %d %d",&a,&b,&c);
if((a*a)+(b*b)==(c*c) || (a*a)+(c*c)==(b*b) || (b*b)+(c*c)==(a*a) )
{ printf("YES\n"); }
else
{ printf("NO\n"); }
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203806/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203806/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%n.022 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
%add7 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %add7, %mul2
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add13 = add nuw nsw i32 %mul3, %mul2
%cmp15 = icmp eq i32 %add13, %mul
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %n.022, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %n.022, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int Maxcheck(int *p,int *q,int *r)
{
int a,b,c;
a=*p;b=*q;c=*r;
int Max,m1,m2;
if (a>b & a>c)
{
Max=a;m1=b;m2=c;
}
else if (b>c & b>a)
{
Max=b;m1=c;m2=a;
}
else if (c>a & c>b)
{
Max=c;m1=a;m2=b;
}
else if (a==b & b==c)
{
Max=a;m1=b;m2=c;
}
else if (a==b)
{
if (a>c)
{
Max=a;m1=b;m2=c;
}
else
{
Max=c;m1=a;m2=b;
}
}
else if(b==c)
if (a>b)
{
Max=a;m1=b;m2=c;
}
else
{
Max=c;m1=a;m2=b;
}
else if(c==a)
if (a>b)
{
Max=a;m1=b;m2=c;
}
else
{
Max=b;m1=a;m2=b;
}
*p=Max;*q=m1;*r=m2;
}
int main(void)
{
int n,i,p,q,r;
scanf("%d",&n);
for(i=0;i!=n;i++)
{
scanf("%d %d %d",&p,&q,&r);
Maxcheck(&p,&q,&r);
if (p*p==q*q+r*r)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203871/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203871/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i32 @Maxcheck(ptr nocapture noundef %p, ptr nocapture noundef %q, ptr nocapture noundef %r) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = load i32, ptr %q, align 4, !tbaa !5
%2 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %2
%and121 = and i1 %cmp, %cmp1
br i1 %and121, label %if.end58, label %if.else
if.else: ; preds = %entry
%cmp3 = icmp sgt i32 %1, %2
%cmp5 = icmp sgt i32 %1, %0
%and7122 = and i1 %cmp5, %cmp3
br i1 %and7122, label %if.end58, label %if.else10
if.else10: ; preds = %if.else
%cmp11 = icmp sgt i32 %2, %0
%cmp13 = icmp sgt i32 %2, %1
%and15123 = and i1 %cmp11, %cmp13
br i1 %and15123, label %if.end58, label %if.else18
if.else18: ; preds = %if.else10
%cmp19 = icmp eq i32 %0, %1
%cmp21 = icmp eq i32 %1, %2
%and23124 = and i1 %cmp19, %cmp21
br i1 %and23124, label %if.end58, label %if.else26
if.else26: ; preds = %if.else18
br i1 %cmp19, label %if.then29, label %if.else34
if.then29: ; preds = %if.else26
%. = tail call i32 @llvm.smax.i32(i32 %0, i32 %2)
%.126 = tail call i32 @llvm.smin.i32(i32 %0, i32 %2)
br label %if.end58
if.else34: ; preds = %if.else26
br i1 %cmp21, label %if.then37, label %if.else43
if.then37: ; preds = %if.else34
%.127 = tail call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.128 = tail call i32 @llvm.smin.i32(i32 %0, i32 %1)
br label %if.end58
if.else43: ; preds = %if.else34
%cmp44 = icmp eq i32 %2, %0
br i1 %cmp44, label %if.then46, label %if.end58
if.then46: ; preds = %if.else43
%.130 = tail call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.131 = tail call i32 @llvm.smin.i32(i32 %0, i32 %1)
%.132 = tail call i32 @llvm.smax.i32(i32 %0, i32 %1)
br label %if.end58
if.end58: ; preds = %if.then46, %if.then37, %if.then29, %if.else18, %if.else10, %if.else, %entry, %if.else43
%Max.0 = phi i32 [ undef, %if.else43 ], [ %0, %entry ], [ %1, %if.else ], [ %2, %if.else10 ], [ %0, %if.else18 ], [ %., %if.then29 ], [ %.127, %if.then37 ], [ %.130, %if.then46 ]
%m1.0 = phi i32 [ undef, %if.else43 ], [ %1, %entry ], [ %2, %if.else ], [ %0, %if.else10 ], [ %0, %if.else18 ], [ %0, %if.then29 ], [ %.128, %if.then37 ], [ %.131, %if.then46 ]
%m2.0 = phi i32 [ undef, %if.else43 ], [ %2, %entry ], [ %0, %if.else ], [ %1, %if.else10 ], [ %0, %if.else18 ], [ %.126, %if.then29 ], [ %1, %if.then37 ], [ %.132, %if.then46 ]
store i32 %Max.0, ptr %p, align 4, !tbaa !5
store i32 %m1.0, ptr %q, align 4, !tbaa !5
store i32 %m2.0, ptr %r, align 4, !tbaa !5
ret i32 undef
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%p = alloca i32, align 4
%q = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not10 = icmp eq i32 %0, 0
br i1 %cmp.not10, label %for.end, label %for.body
for.body: ; preds = %entry, %Maxcheck.exit
%i.011 = phi i32 [ %inc, %Maxcheck.exit ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p, ptr noundef nonnull %q, ptr noundef nonnull %r)
%1 = load i32, ptr %p, align 4, !tbaa !5
%2 = load i32, ptr %q, align 4, !tbaa !5
%3 = load i32, ptr %r, align 4, !tbaa !5
%cmp.i = icmp sgt i32 %1, %2
%cmp1.i = icmp sgt i32 %1, %3
%and121.i = and i1 %cmp.i, %cmp1.i
br i1 %and121.i, label %Maxcheck.exit, label %if.else.i
if.else.i: ; preds = %for.body
%cmp3.i = icmp sgt i32 %2, %3
%cmp5.i = icmp sgt i32 %2, %1
%and7122.i = and i1 %cmp5.i, %cmp3.i
br i1 %and7122.i, label %Maxcheck.exit, label %if.else10.i
if.else10.i: ; preds = %if.else.i
%cmp11.i = icmp sgt i32 %3, %1
%cmp13.i = icmp sgt i32 %3, %2
%and15123.i = and i1 %cmp11.i, %cmp13.i
br i1 %and15123.i, label %Maxcheck.exit, label %if.else18.i
if.else18.i: ; preds = %if.else10.i
%cmp19.i = icmp eq i32 %1, %2
%cmp21.i = icmp eq i32 %2, %3
%and23124.i = and i1 %cmp19.i, %cmp21.i
br i1 %and23124.i, label %Maxcheck.exit, label %if.else26.i
if.else26.i: ; preds = %if.else18.i
br i1 %cmp19.i, label %if.then29.i, label %if.else34.i
if.then29.i: ; preds = %if.else26.i
%..i = call i32 @llvm.smax.i32(i32 %1, i32 %3)
%.126.i = call i32 @llvm.smin.i32(i32 %1, i32 %3)
br label %Maxcheck.exit
if.else34.i: ; preds = %if.else26.i
br i1 %cmp21.i, label %if.then37.i, label %if.else43.i
if.then37.i: ; preds = %if.else34.i
%.127.i = call i32 @llvm.smax.i32(i32 %1, i32 %2)
%.128.i = call i32 @llvm.smin.i32(i32 %1, i32 %2)
br label %Maxcheck.exit
if.else43.i: ; preds = %if.else34.i
%cmp44.i = icmp eq i32 %3, %1
br i1 %cmp44.i, label %if.then46.i, label %Maxcheck.exit
if.then46.i: ; preds = %if.else43.i
%.130.i = call i32 @llvm.smax.i32(i32 %1, i32 %2)
%.131.i = call i32 @llvm.smin.i32(i32 %1, i32 %2)
br label %Maxcheck.exit
Maxcheck.exit: ; preds = %for.body, %if.else.i, %if.else10.i, %if.else18.i, %if.then29.i, %if.then37.i, %if.else43.i, %if.then46.i
%Max.0.i = phi i32 [ undef, %if.else43.i ], [ %1, %for.body ], [ %2, %if.else.i ], [ %3, %if.else10.i ], [ %1, %if.else18.i ], [ %..i, %if.then29.i ], [ %.127.i, %if.then37.i ], [ %.130.i, %if.then46.i ]
%m1.0.i = phi i32 [ undef, %if.else43.i ], [ %2, %for.body ], [ %3, %if.else.i ], [ %1, %if.else10.i ], [ %1, %if.else18.i ], [ %1, %if.then29.i ], [ %.128.i, %if.then37.i ], [ %.131.i, %if.then46.i ]
%m2.0.i = phi i32 [ undef, %if.else43.i ], [ %3, %for.body ], [ %1, %if.else.i ], [ %2, %if.else10.i ], [ %1, %if.else18.i ], [ %.126.i, %if.then29.i ], [ %2, %if.then37.i ], [ %.130.i, %if.then46.i ]
store i32 %Max.0.i, ptr %p, align 4, !tbaa !5
store i32 %m1.0.i, ptr %q, align 4, !tbaa !5
store i32 %m2.0.i, ptr %r, align 4, !tbaa !5
%mul = mul nsw i32 %Max.0.i, %Max.0.i
%mul3 = mul nsw i32 %m1.0.i, %m1.0.i
%mul4 = mul nsw i32 %m2.0.i, %m2.0.i
%add = add nuw nsw i32 %mul4, %mul3
%cmp5 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.011, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %inc, %4
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %Maxcheck.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int max, a, b, c, i;
scanf("%d", &max);
for(i=1; i<=max; i++){
scanf("%d %d %d", &a, &b, &c);
a *= a;
b *= b;
c *= c;
if((a+b==c) || (a+c==b) || (b+c==a)){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203914/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203914/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%max = alloca i32, align 4
%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 %max) #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 %max)
%0 = load i32, ptr %max, align 4, !tbaa !5
%cmp.not15 = icmp slt i32 %0, 1
br i1 %cmp.not15, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.016 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
store i32 %mul, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
store i32 %mul2, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
store i32 %mul3, ptr %c, align 4, !tbaa !5
%add = add nuw nsw i32 %mul2, %mul
%cmp4 = icmp eq i32 %add, %mul3
%add5 = add nuw nsw i32 %mul3, %mul
%cmp6 = icmp eq i32 %add5, %mul2
%or.cond = select i1 %cmp4, i1 true, i1 %cmp6
%add8 = add nuw nsw i32 %mul3, %mul2
%cmp9 = icmp eq i32 %add8, %mul
%or.cond14 = select i1 %or.cond, i1 true, i1 %cmp9
%str.4.str = select i1 %or.cond14, ptr @str.4, ptr @str
%puts13 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.016, 1
%4 = load i32, ptr %max, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.016, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 %max) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int tri[3],nazo,i,j,n,m;
scanf("%d",&m);
for(n=0;n<m;n++){
scanf("%d %d %d",&tri[0],&tri[1],&tri[2]);
for(i=0;i<3;i++)for(j=0;j<3;j++){
if(tri[j]>tri[i]){nazo=tri[i];tri[i]=tri[j];tri[j]=nazo;}
}
if(tri[2]*tri[2]==tri[1]*tri[1]+tri[0]*tri[0]) puts("YES");
else puts("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203965/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203965/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [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:
%tri = alloca [3 x i32], align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tri) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %0, 0
br i1 %cmp53, label %for.body.lr.ph, label %for.end40
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %tri, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %tri, i64 0, i64 2
br label %for.inc
for.inc: ; preds = %for.inc.2.2, %for.body.lr.ph
%n.054 = phi i32 [ 0, %for.body.lr.ph ], [ %inc39, %for.inc.2.2 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tri, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %tri, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp13.1 = icmp sgt i32 %2, %1
br i1 %cmp13.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %2, ptr %tri, align 4, !tbaa !5
store i32 %1, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%3 = phi i32 [ %1, %if.then.1 ], [ %2, %for.inc ]
%4 = phi i32 [ %2, %if.then.1 ], [ %1, %for.inc ]
%5 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp13.2 = icmp sgt i32 %5, %4
br i1 %cmp13.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 %5, ptr %tri, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%6 = phi i32 [ %4, %if.then.2 ], [ %5, %for.inc.1 ]
%7 = phi i32 [ %5, %if.then.2 ], [ %4, %for.inc.1 ]
%cmp13.157 = icmp sgt i32 %7, %3
br i1 %cmp13.157, label %if.then.158, label %for.inc.1.1
if.then.158: ; preds = %for.inc.2
store i32 %7, ptr %arrayidx1, align 4, !tbaa !5
store i32 %3, ptr %tri, align 4, !tbaa !5
br label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.2, %if.then.158
%8 = phi i32 [ %3, %if.then.158 ], [ %7, %for.inc.2 ]
%9 = phi i32 [ %7, %if.then.158 ], [ %3, %for.inc.2 ]
%cmp13.2.1 = icmp sgt i32 %6, %9
br i1 %cmp13.2.1, label %if.then.2.1, label %for.inc.2.1
if.then.2.1: ; preds = %for.inc.1.1
store i32 %6, ptr %arrayidx1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1
%10 = phi i32 [ %6, %if.then.2.1 ], [ %9, %for.inc.1.1 ]
%11 = phi i32 [ %9, %if.then.2.1 ], [ %6, %for.inc.1.1 ]
%cmp13.260 = icmp sgt i32 %8, %11
br i1 %cmp13.260, label %if.then.261, label %for.inc.262
if.then.261: ; preds = %for.inc.2.1
store i32 %8, ptr %arrayidx2, align 4, !tbaa !5
store i32 %11, ptr %tri, align 4, !tbaa !5
br label %for.inc.262
for.inc.262: ; preds = %if.then.261, %for.inc.2.1
%12 = phi i32 [ %11, %if.then.261 ], [ %8, %for.inc.2.1 ]
%13 = phi i32 [ %8, %if.then.261 ], [ %11, %for.inc.2.1 ]
%cmp13.1.2 = icmp sgt i32 %10, %13
br i1 %cmp13.1.2, label %if.then.1.2, label %for.inc.2.2
if.then.1.2: ; preds = %for.inc.262
store i32 %10, ptr %arrayidx2, align 4, !tbaa !5
store i32 %13, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.2.2
for.inc.2.2: ; preds = %for.inc.262, %if.then.1.2
%14 = phi i32 [ %13, %if.then.1.2 ], [ %10, %for.inc.262 ]
%15 = phi i32 [ %10, %if.then.1.2 ], [ %13, %for.inc.262 ]
%mul = mul nsw i32 %15, %15
%mul29 = mul nsw i32 %14, %14
%mul32 = mul nsw i32 %12, %12
%add = add nuw nsw i32 %mul32, %mul29
%cmp33 = icmp eq i32 %mul, %add
%.str.2..str.3 = select i1 %cmp33, ptr @.str.2, ptr @.str.3
%call35 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
%inc39 = add nuw nsw i32 %n.054, 1
%16 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc39, %16
br i1 %cmp, label %for.inc, label %for.end40, !llvm.loop !9
for.end40: ; preds = %for.inc.2.2, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tri) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int i,a,b,c,cnt,tmp;
scanf("%d",&cnt);
for(i=0;i<cnt;i++){
scanf("%d %d %d",&a,&b,&c);
if(a > b){
tmp = a;
a = b;
b = tmp;
}
if(b > c){
tmp = b;
b = c;
c = tmp;
}
if(c*c == b*b + a*a) printf("YES\n");
else printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204014/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%cnt = 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 %cnt) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cnt)
%0 = load i32, ptr %cnt, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end5
%i.020 = phi i32 [ %inc, %if.end5 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %1, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%3 = phi i32 [ %2, %if.then ], [ %1, %for.body ]
%4 = phi i32 [ %1, %if.then ], [ %2, %for.body ]
%5 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %4, %5
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %5, ptr %b, align 4, !tbaa !5
store i32 %4, ptr %c, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%6 = phi i32 [ %5, %if.then4 ], [ %4, %if.end ]
%7 = phi i32 [ %4, %if.then4 ], [ %5, %if.end ]
%mul = mul nsw i32 %7, %7
%mul6 = mul nsw i32 %6, %6
%mul7 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul7, %mul6
%cmp8 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp8, ptr @str.4, ptr @str
%puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.020, 1
%8 = load i32, ptr %cnt, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end5, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cnt) #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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n;
int a, b, c;
int aa, bb, cc;
int i;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d %d %d", &a, &b, &c);
aa = a;
bb = b;
cc = c;
if(b >= a && b >= c){
aa = b;
bb = a;
}
else if(c >= a && c >= b){
aa = c;
cc = a;
}
if((aa * aa) == (bb * bb) + (cc * cc))
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204065/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204065/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%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 %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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end8
%i.029 = phi i32 [ %inc, %if.end8 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4
%3 = load i32, ptr %c, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %2, %1
%cmp3.not = icmp slt i32 %2, %3
%or.cond = select i1 %cmp2.not, i1 true, i1 %cmp3.not
br i1 %or.cond, label %if.else, label %if.end8
if.else: ; preds = %for.body
%cmp4.not = icmp slt i32 %3, %1
%cmp6.not = icmp slt i32 %3, %2
%or.cond26 = or i1 %cmp4.not, %cmp6.not
%spec.select = select i1 %or.cond26, i32 %1, i32 %3
%spec.select27 = select i1 %or.cond26, i32 %3, i32 %1
br label %if.end8
if.end8: ; preds = %if.else, %for.body
%aa.0 = phi i32 [ %2, %for.body ], [ %spec.select, %if.else ]
%bb.0 = phi i32 [ %1, %for.body ], [ %2, %if.else ]
%cc.0 = phi i32 [ %3, %for.body ], [ %spec.select27, %if.else ]
%mul = mul nsw i32 %aa.0, %aa.0
%mul9 = mul nsw i32 %bb.0, %bb.0
%mul10 = mul nsw i32 %cc.0, %cc.0
%add = add nuw nsw i32 %mul10, %mul9
%cmp11 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp11, ptr @str.4, ptr @str
%puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.029, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end8, %entry
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,n;
scanf("%d",&n);
for(;n>0;n--)
{
scanf("%d %d %d",&a,&b,&c);
if((a*a==b*b+c*c)||(b*b==a*a+c*c)||(c*c==a*a+b*b))
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204115/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204115/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %.pr, 0
br i1 %cmp20, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %1, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond19 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond19, ptr @str.4, ptr @str
%puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%3 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%cmp = icmp sgt i32 %3, 1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c,i,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d%d",&a,&b,&c);
if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b)printf("YES\n");
else printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204216/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204216/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
void solve()
{
int n;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
int av=0,c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(a[i]==0)
break;
if(a[j]==0||a[i]==a[j])
continue;
av=(a[i]+a[j])/2;
if(av<a[i])
{a[i]=0;c++;break;}
else
if(av<a[j])
{a[j]=0;c++;}
}
}printf("%d\n",c);
}
int main()
{
int t;
scanf("%d",&t);
for(int i=0;i<t;i++)
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20426/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20426/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @solve() 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
%cmp73 = icmp sgt i32 %3, 0
br i1 %cmp73, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp480 = icmp sgt i32 %5, 1
br i1 %cmp480, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%sub = add nsw i32 %5, -1
%4 = zext i32 %5 to i64
%wide.trip.count95 = zext i32 %sub to i64
%wide.trip.count = zext i32 %5 to i64
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
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %cleanup, %entry, %for.cond3.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %c.3, %cleanup ]
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret void
for.body6: ; preds = %for.body6.preheader, %cleanup
%indvars.iv92 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next93, %cleanup ]
%indvars.iv87 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next88, %cleanup ]
%c.081 = phi i32 [ 0, %for.body6.preheader ], [ %c.3, %cleanup ]
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%cmp875 = icmp ult i64 %indvars.iv.next93, %4
br i1 %cmp875, label %for.body10.lr.ph, label %cleanup
for.body10.lr.ph: ; preds = %for.body6
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv92
br label %for.body10
for.body10: ; preds = %for.body10.lr.ph, %for.inc45
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.body10.lr.ph ], [ %indvars.iv.next90, %for.inc45 ]
%c.176 = phi i32 [ %c.081, %for.body10.lr.ph ], [ %c.2, %for.inc45 ]
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp eq i32 %7, 0
br i1 %cmp13, label %cleanup, label %if.end
if.end: ; preds = %for.body10
%arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv89
%8 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %8, 0
%cmp21 = icmp eq i32 %7, %8
%or.cond = or i1 %cmp16, %cmp21
br i1 %or.cond, label %for.inc45, label %if.end23
if.end23: ; preds = %if.end
%add28 = add nsw i32 %8, %7
%div = sdiv i32 %add28, 2
%cmp31 = icmp slt i32 %div, %7
br i1 %cmp31, label %if.then32, label %if.else
if.then32: ; preds = %if.end23
store i32 0, ptr %arrayidx12, align 4, !tbaa !5
%inc35 = add nsw i32 %c.176, 1
br label %cleanup
if.else: ; preds = %if.end23
%cmp38 = icmp slt i32 %div, %8
br i1 %cmp38, label %if.then39, label %for.inc45
if.then39: ; preds = %if.else
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
%inc42 = add nsw i32 %c.176, 1
br label %for.inc45
for.inc45: ; preds = %if.then39, %if.else, %if.end
%c.2 = phi i32 [ %c.176, %if.end ], [ %inc42, %if.then39 ], [ %c.176, %if.else ]
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%exitcond.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body10, !llvm.loop !11
cleanup: ; preds = %for.inc45, %for.body10, %for.body6, %if.then32
%c.3 = phi i32 [ %inc35, %if.then32 ], [ %c.081, %for.body6 ], [ %c.2, %for.inc45 ], [ %c.176, %for.body10 ]
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%exitcond96.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count95
br i1 %exitcond96.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%cmp2 = icmp sgt i32 %0, 0
br i1 %cmp2, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.03 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @solve()
%inc = add nuw nsw i32 %i.03, 1
%1 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#define MOD 1000000007
#define END printf("\n");return 0;
#define QS09(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
#define QS90(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
void input_array(long how_data,long *data);
void output_array(long how_data,long *data);
void input_array2(long first , long second , long data[][2]);
long get_random(long min, long max);
long factorial(long n);
long fibonacci(long n);
int qsort_09(const int *sys1 , const int *sys2);
int qsort_90(const int *sys1 , const int *sys2);
long sel_max(long a , long b);
long sel_min(long a , long b);
long array_max(long how_data,long *data);
long array_min(long how_data,long *data);
long can_DP(long how_data,long *data,long how_can,bool *can);
long array_sum(long how_data,long *data);
long Leven_dist(char *now , char *target);
void prime_fact(long target, long *data);
long get_digit(long target);
long ncr(long n , long r);
long npr(long n , long r);
long nhr(long n , long r);
long loop1,loop2,loop3,loop4,loop5,i_temp;
char c_temp;
int main(void){
int how_team;
scanf("%d",&how_team);
long how_man=how_team*3;
long data[how_man];
input_array(how_man,data);
QS90(how_man,data);
unsigned long ans=0;
for(loop1=1;loop1<how_team*2;loop1+=2){
ans+=data[loop1];
}
printf("%ld\n",ans);
return 0;
}
void input_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data;loop++){
scanf("%ld",&data[loop]);
}
return ;
}
void output_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data;loop++){
printf("%ld\n",data[loop]);
}
return ;
}
void input_array2(long first,long second,long data[][2]){
long loopA,loopB;
for(loopA=0;loopA<first;loopA++){
for(loopB=0;loopB<second;loopB++){
scanf("%ld",&data[loopA][loopB]);
}
}
return ;
}
long get_random(long min, long max){ //指定の範囲から乱数を1つ返すやつ
//srand((unsigned int)time(0)); //現在時刻で疑似乱数初期化
rand();rand();rand();rand(); //乱数を空打ち
return (rand()%(max+1-min))+min;
}
long factorial(long n){//n!のMOD10^9+7を返すやつ
unsigned long long int ret=1;
for(long i=1;i<=n;i++)ret=(ret*i)%1000000007;
return (long)ret;
}
int qsort_09(const int *sys1 , const int *sys2){ //小さいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
if(*sys1<*sys2){
return -1;
}else if(*sys1==*sys2){
return 0;
}else{
return 1;
}
}
int qsort_90(const int *sys1 , const int *sys2){ //大きいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
if(*sys1<*sys2){
return 1;
}else if(*sys1==*sys2){
return 0;
}else{
return -1;
}
}
long fibonacci(long n){
switch(n){
case 0:return 0;
case 1:return 1;
default :return fibonacci(n-1)+fibonacci(n-2);
}
}
long sel_max(long a,long b){
if(a>b)return a;
return b;
}
long sel_min(long a,long b){
if(a>b)return b;
return a;
}
long can_DP(long how_data,long *data,long how_can,bool *can){//Typical DP Contest A
//data内で組み合わせられる和をcanに0 or 1で入れる
//返り値はパターン数
long loopA,loopB;
long ret=0;
for(loopA=0;loopA<how_can;loopA++){//初期化
can[loopA]=0;
}
can[0]=1;//絶対にありえる
for(loopA=0;loopA<how_data;loopA++){
for(loopB=how_can-1;loopB>=0;loopB--){
if(can[loopB]==1 && loopB+data[loopA]<how_can){
can[loopB+data[loopA]]=1;
}
}
}
for(loopA=0;loopA<how_can;loopA++){
if(can[loopA]==1){
ret++;
}
}
return ret;
}
long array_max(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret<data[loop])ret=data[loop];
}
return ret;
}
long array_min(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret>data[loop])ret=data[loop];
}
return ret;
}
long array_sum(long how_data,long *data){
long ret=0;
long loop;
for(loop=0;loop<how_data;loop++){
ret+=data[loop];
}
return ret;
}
long Leven_dist(char *now , char *target){
long loopA,loopB;
//レーベンシュタイン距離を求める
// 参考文献
// http://nw.tsuda.ac.jp/class/algoB/c13.html (アルゴリズム理解)
// http://d.hatena.ne.jp/ohnishiakira/20090809/1249845529 (実装)
long len_now=strlen(now)+1;
long len_target=strlen(target)+1;
long d[len_now][len_target]; //計算用
for(loopA=0;loopA<len_now;loopA++) d[loopA][0]=loopA;
for(loopA=0;loopA<len_target;loopA++) d[0][loopA]=loopA;
for(loopA=1;loopA<len_now;loopA++){
for(loopB=1;loopB<len_target;loopB++){
long cost=(now[loopA-1]==target[loopB-1] ? 0:1);
d[loopA][loopB]=sel_min(sel_min(d[loopA-1][loopB]+1,d[loopA][loopB-1]+1),d[loopA-1][loopB-1]+cost);
}
}
return d[len_now-1][len_target-1];
}
void prime_fact(long target, long *data){
long loopB=0;
long loopA=2;
long moto_target=target;
while(target!=1){
loopA-=1;
while(1){
loopA++;
if(loopA>=sqrt(moto_target)+100){
data[loopB]=target;
target=1;
break;
}
if(target%loopA==0){
data[loopB]=loopA;
target/=loopA;
loopB++;
break;
}
}
}
return ;
}
long get_digit(long target){
return (long)(log10(target)+1);
}
long ncr(long n , long r){
//パスカルの三角形
long loopA,loopB;
long pascal[100][102]={{0}};
pascal[1][0]=1;
pascal[1][1]=1;
for(loopA=2;loopA<100;loopA++){
pascal[loopA][0]=1;
for(loopB=1;loopB<loopA;loopB++){
pascal[loopA][loopB]=pascal[loopA-1][loopB-1]+pascal[loopA-1][loopB];
}
pascal[loopA][loopA]=1;
}
return pascal[n][r];
}
long npr(long n, long r){
return ncr(n,r)*factorial(r);
}
long nhr(long n , long r){
return ncr(n+r-1,r);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@loop1 = dso_local local_unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@loop2 = dso_local local_unnamed_addr global i64 0, align 8
@loop3 = dso_local local_unnamed_addr global i64 0, align 8
@loop4 = dso_local local_unnamed_addr global i64 0, align 8
@loop5 = dso_local local_unnamed_addr global i64 0, align 8
@i_temp = dso_local local_unnamed_addr global i64 0, align 8
@c_temp = dso_local local_unnamed_addr global i8 0, align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%how_team = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %how_team) #21
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %how_team)
%0 = load i32, ptr %how_team, align 4, !tbaa !5
%mul = mul nsw i32 %0, 3
%conv = sext i32 %mul to i64
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %conv, align 16
%cmp3.i = icmp sgt i32 %0, 0
br i1 %cmp3.i, label %for.body.i, label %input_array.exit
for.body.i: ; preds = %entry, %for.body.i
%loop.04.i = phi i64 [ %inc.i, %for.body.i ], [ 0, %entry ]
%arrayidx.i = getelementptr inbounds i64, ptr %vla, i64 %loop.04.i
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.i)
%inc.i = add nuw nsw i64 %loop.04.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %conv
br i1 %exitcond.not.i, label %input_array.exit, label %for.body.i, !llvm.loop !9
input_array.exit: ; preds = %for.body.i, %entry
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @qsort_90) #21
%2 = load i32, ptr %how_team, align 4, !tbaa !5
%mul1 = shl i32 %2, 1
%conv2 = sext i32 %mul1 to i64
%cmp9 = icmp sgt i32 %2, 0
br i1 %cmp9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %input_array.exit
%smax = call i64 @llvm.smax.i64(i64 %conv2, i64 3)
%3 = add nsw i64 %smax, -2
%min.iters.check = icmp ult i64 %3, 8
br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%4 = lshr i64 %3, 1
%5 = add nuw nsw i64 %4, 1
%n.mod.vf = and i64 %5, 3
%6 = icmp eq i64 %n.mod.vf, 0
%7 = select i1 %6, i64 4, i64 %n.mod.vf
%n.vec = sub nsw i64 %5, %7
%8 = shl i64 %n.vec, 1
%ind.end = or i64 %8, 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 <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi13 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%9 = shl i64 %index, 1
%offset.idx = or i64 %9, 1
%10 = or i64 %9, 5
%11 = getelementptr inbounds i64, ptr %vla, i64 %offset.idx
%12 = getelementptr inbounds i64, ptr %vla, i64 %10
%wide.vec = load <4 x i64>, ptr %11, align 8, !tbaa !11
%wide.vec14 = load <4 x i64>, ptr %12, align 8, !tbaa !11
%strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%strided.vec15 = shufflevector <4 x i64> %wide.vec14, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
%13 = add <2 x i64> %strided.vec, %vec.phi
%14 = add <2 x i64> %strided.vec15, %vec.phi13
%index.next = add nuw i64 %index, 4
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %14, %13
%16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
br label %for.body.preheader16
for.body.preheader16: ; preds = %for.body.preheader, %middle.block
%ans.011.ph = phi i64 [ 0, %for.body.preheader ], [ %16, %middle.block ]
%storemerge10.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader16, %for.body
%ans.011 = phi i64 [ %add, %for.body ], [ %ans.011.ph, %for.body.preheader16 ]
%storemerge10 = phi i64 [ %add4, %for.body ], [ %storemerge10.ph, %for.body.preheader16 ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %storemerge10
%17 = load i64, ptr %arrayidx, align 8, !tbaa !11
%add = add i64 %17, %ans.011
%add4 = add nuw nsw i64 %storemerge10, 2
%cmp = icmp slt i64 %add4, %conv2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16
for.end: ; preds = %for.body, %input_array.exit
%storemerge.lcssa = phi i64 [ 1, %input_array.exit ], [ %add4, %for.body ]
%ans.0.lcssa = phi i64 [ 0, %input_array.exit ], [ %add, %for.body ]
store i64 %storemerge.lcssa, ptr @loop1, align 8, !tbaa !11
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %how_team) #21
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array(i64 noundef %how_data, ptr noundef %data) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%loop.04 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx)
%inc = add nuw nsw i64 %loop.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_90(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) #5 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !5
%1 = load i32, ptr %sys2, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @output_array(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%loop.04 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04
%0 = load i64, ptr %arrayidx, align 8, !tbaa !11
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %0)
%inc = add nuw nsw i64 %loop.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array2(i64 noundef %first, i64 noundef %second, ptr noundef %data) local_unnamed_addr #0 {
entry:
%cmp14 = icmp sgt i64 %first, 0
%cmp212 = icmp sgt i64 %second, 0
%or.cond = and i1 %cmp14, %cmp212
br i1 %or.cond, label %for.cond1.preheader.us, label %for.end7
for.cond1.preheader.us: ; preds = %entry, %for.cond1.for.inc5_crit_edge.us
%loopA.015.us = phi i64 [ %inc6.us, %for.cond1.for.inc5_crit_edge.us ], [ 0, %entry ]
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.body3.us
%loopB.013.us = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.body3.us ]
%arrayidx4.us = getelementptr inbounds [2 x i64], ptr %data, i64 %loopA.015.us, i64 %loopB.013.us
%call.us = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx4.us)
%inc.us = add nuw nsw i64 %loopB.013.us, 1
%exitcond.not = icmp eq i64 %inc.us, %second
br i1 %exitcond.not, label %for.cond1.for.inc5_crit_edge.us, label %for.body3.us, !llvm.loop !18
for.cond1.for.inc5_crit_edge.us: ; preds = %for.body3.us
%inc6.us = add nuw nsw i64 %loopA.015.us, 1
%exitcond17.not = icmp eq i64 %inc6.us, %first
br i1 %exitcond17.not, label %for.end7, label %for.cond1.preheader.us, !llvm.loop !19
for.end7: ; preds = %for.cond1.for.inc5_crit_edge.us, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i64 @get_random(i64 noundef %min, i64 noundef %max) local_unnamed_addr #6 {
entry:
%call = tail call i32 @rand() #21
%call1 = tail call i32 @rand() #21
%call2 = tail call i32 @rand() #21
%call3 = tail call i32 @rand() #21
%call4 = tail call i32 @rand() #21
%conv = sext i32 %call4 to i64
%reass.sub = sub i64 %max, %min
%sub = add i64 %reass.sub, 1
%rem = srem i64 %conv, %sub
%add5 = add nsw i64 %rem, %min
ret i64 %add5
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #7
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i64 noundef %n) local_unnamed_addr #8 {
entry:
%cmp.not4 = icmp slt i64 %n, 1
br i1 %cmp.not4, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %n, 3
%0 = icmp ult i64 %n, 4
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %n, -4
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%i.06.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%ret.05.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%i.06.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.06.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%ret.05.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %ret.05.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul i64 %i.06.epil, %ret.05.epil
%rem.epil = urem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.06.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.cond.cleanup, label %for.body.epil, !llvm.loop !20
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ret.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
ret i64 %ret.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%i.06 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%ret.05 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul i64 %i.06, %ret.05
%rem = urem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.06, 1
%mul.1 = mul i64 %inc, %rem
%rem.1 = urem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.06, 2
%mul.2 = mul i64 %inc.1, %rem.1
%rem.2 = urem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.06, 3
%mul.3 = mul i64 %inc.2, %rem.2
%rem.3 = urem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.06, 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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !22
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_09(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !5
%1 = load i32, ptr %sys2, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @fibonacci(i64 noundef %n) local_unnamed_addr #9 {
entry:
%switch13 = icmp ult i64 %n, 2
br i1 %switch13, label %return, label %sw.default
sw.default: ; preds = %entry, %sw.default
%n.tr15 = phi i64 [ %sub2, %sw.default ], [ %n, %entry ]
%accumulator.tr14 = phi i64 [ %add, %sw.default ], [ 0, %entry ]
%sub = add nsw i64 %n.tr15, -1
%call = tail call i64 @fibonacci(i64 noundef %sub)
%sub2 = add nsw i64 %n.tr15, -2
%add = add nsw i64 %call, %accumulator.tr14
%switch = icmp ult i64 %sub2, 2
br i1 %switch, label %return, label %sw.default
return: ; preds = %sw.default, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %sw.default ]
%n.tr.lcssa = phi i64 [ %n, %entry ], [ %sub2, %sw.default ]
%accumulator.ret.tr = add nsw i64 %n.tr.lcssa, %accumulator.tr.lcssa
ret i64 %accumulator.ret.tr
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sel_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #10 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sel_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #10 {
entry:
%b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i64 @can_DP(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %how_can, ptr nocapture noundef %can) local_unnamed_addr #11 {
entry:
%cmp59 = icmp sgt i64 %how_can, 0
br i1 %cmp59, label %for.end, label %for.end.thread
for.end: ; preds = %entry
tail call void @llvm.memset.p0.i64(ptr align 1 %can, i8 0, i64 %how_can, i1 false), !tbaa !23
store i8 1, ptr %can, align 1, !tbaa !23
%cmp364 = icmp sgt i64 %how_data, 0
br i1 %cmp364, label %for.cond5.preheader.us.preheader, label %for.cond22.preheader
for.cond5.preheader.us.preheader: ; preds = %for.end
%xtraiter = and i64 %how_can, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%loopB.063.us.prol = add nsw i64 %how_can, -1
%arrayidx8.us.prol = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.prol
%0 = icmp eq i64 %how_can, 1
br label %for.cond5.preheader.us
for.end.thread: ; preds = %entry
store i8 1, ptr %can, align 1, !tbaa !23
br label %for.end36
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc19_crit_edge.us
%loopA.165.us = phi i64 [ %inc20.us, %for.cond5.for.inc19_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ]
%arrayidx11.us = getelementptr inbounds i64, ptr %data, i64 %loopA.165.us
br i1 %lcmp.mod.not, label %for.body7.us.prol.loopexit, label %for.body7.us.prol
for.body7.us.prol: ; preds = %for.cond5.preheader.us
%1 = load i8, ptr %arrayidx8.us.prol, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us.prol = icmp eq i8 %1, 0
br i1 %tobool.not.us.prol, label %for.body7.us.prol.loopexit, label %land.lhs.true.us.prol
land.lhs.true.us.prol: ; preds = %for.body7.us.prol
%2 = load i64, ptr %arrayidx11.us, align 8, !tbaa !11
%add.us.prol = add nsw i64 %2, %loopB.063.us.prol
%cmp12.us.prol = icmp slt i64 %add.us.prol, %how_can
br i1 %cmp12.us.prol, label %if.then.us.prol, label %for.body7.us.prol.loopexit
if.then.us.prol: ; preds = %land.lhs.true.us.prol
%arrayidx16.us.prol = getelementptr inbounds i8, ptr %can, i64 %add.us.prol
store i8 1, ptr %arrayidx16.us.prol, align 1, !tbaa !23
br label %for.body7.us.prol.loopexit
for.body7.us.prol.loopexit: ; preds = %for.body7.us.prol, %land.lhs.true.us.prol, %if.then.us.prol, %for.cond5.preheader.us
%loopB.063.us.in.unr = phi i64 [ %how_can, %for.cond5.preheader.us ], [ %loopB.063.us.prol, %if.then.us.prol ], [ %loopB.063.us.prol, %land.lhs.true.us.prol ], [ %loopB.063.us.prol, %for.body7.us.prol ]
br i1 %0, label %for.cond5.for.inc19_crit_edge.us, label %for.body7.us
for.body7.us: ; preds = %for.body7.us.prol.loopexit, %for.inc17.us.1
%loopB.063.us.in = phi i64 [ %loopB.063.us.1, %for.inc17.us.1 ], [ %loopB.063.us.in.unr, %for.body7.us.prol.loopexit ]
%loopB.063.us = add nsw i64 %loopB.063.us.in, -1
%arrayidx8.us = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us
%3 = load i8, ptr %arrayidx8.us, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us = icmp eq i8 %3, 0
br i1 %tobool.not.us, label %for.inc17.us, label %land.lhs.true.us
land.lhs.true.us: ; preds = %for.body7.us
%4 = load i64, ptr %arrayidx11.us, align 8, !tbaa !11
%add.us = add nsw i64 %4, %loopB.063.us
%cmp12.us = icmp slt i64 %add.us, %how_can
br i1 %cmp12.us, label %if.then.us, label %for.inc17.us
if.then.us: ; preds = %land.lhs.true.us
%arrayidx16.us = getelementptr inbounds i8, ptr %can, i64 %add.us
store i8 1, ptr %arrayidx16.us, align 1, !tbaa !23
br label %for.inc17.us
for.inc17.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body7.us
%loopB.063.us.1 = add nsw i64 %loopB.063.us.in, -2
%arrayidx8.us.1 = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.1
%5 = load i8, ptr %arrayidx8.us.1, align 1, !tbaa !23, !range !25, !noundef !26
%tobool.not.us.1 = icmp eq i8 %5, 0
br i1 %tobool.not.us.1, label %for.inc17.us.1, label %land.lhs.true.us.1
land.lhs.true.us.1: ; preds = %for.inc17.us
%6 = load i64, ptr %arrayidx11.us, align 8, !tbaa !11
%add.us.1 = add nsw i64 %6, %loopB.063.us.1
%cmp12.us.1 = icmp slt i64 %add.us.1, %how_can
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc17.us.1
if.then.us.1: ; preds = %land.lhs.true.us.1
%arrayidx16.us.1 = getelementptr inbounds i8, ptr %can, i64 %add.us.1
store i8 1, ptr %arrayidx16.us.1, align 1, !tbaa !23
br label %for.inc17.us.1
for.inc17.us.1: ; preds = %if.then.us.1, %land.lhs.true.us.1, %for.inc17.us
%cmp6.us.1 = icmp sgt i64 %loopB.063.us.in, 2
br i1 %cmp6.us.1, label %for.body7.us, label %for.cond5.for.inc19_crit_edge.us, !llvm.loop !27
for.cond5.for.inc19_crit_edge.us: ; preds = %for.inc17.us.1, %for.body7.us.prol.loopexit
%inc20.us = add nuw nsw i64 %loopA.165.us, 1
%exitcond.not = icmp eq i64 %inc20.us, %how_data
br i1 %exitcond.not, label %for.cond22.preheader, label %for.cond5.preheader.us, !llvm.loop !28
for.cond22.preheader: ; preds = %for.cond5.for.inc19_crit_edge.us, %for.end
br i1 %cmp59, label %for.body25.preheader, label %for.end36
for.body25.preheader: ; preds = %for.cond22.preheader
%xtraiter72 = and i64 %how_can, 7
%7 = icmp ult i64 %how_can, 8
br i1 %7, label %for.end36.loopexit.unr-lcssa, label %for.body25.preheader.new
for.body25.preheader.new: ; preds = %for.body25.preheader
%unroll_iter = and i64 %how_can, -8
br label %for.body25
for.body25: ; preds = %for.body25, %for.body25.preheader.new
%ret.068 = phi i64 [ 0, %for.body25.preheader.new ], [ %spec.select.7, %for.body25 ]
%loopA.267 = phi i64 [ 0, %for.body25.preheader.new ], [ %inc35.7, %for.body25 ]
%niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.7, %for.body25 ]
%arrayidx26 = getelementptr inbounds i8, ptr %can, i64 %loopA.267
%8 = load i8, ptr %arrayidx26, align 1, !tbaa !23, !range !25, !noundef !26
%inc32 = zext i8 %8 to i64
%spec.select = add nuw nsw i64 %ret.068, %inc32
%inc35 = or i64 %loopA.267, 1
%arrayidx26.1 = getelementptr inbounds i8, ptr %can, i64 %inc35
%9 = load i8, ptr %arrayidx26.1, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.1 = zext i8 %9 to i64
%spec.select.1 = add nuw nsw i64 %spec.select, %inc32.1
%inc35.1 = or i64 %loopA.267, 2
%arrayidx26.2 = getelementptr inbounds i8, ptr %can, i64 %inc35.1
%10 = load i8, ptr %arrayidx26.2, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.2 = zext i8 %10 to i64
%spec.select.2 = add nuw nsw i64 %spec.select.1, %inc32.2
%inc35.2 = or i64 %loopA.267, 3
%arrayidx26.3 = getelementptr inbounds i8, ptr %can, i64 %inc35.2
%11 = load i8, ptr %arrayidx26.3, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.3 = zext i8 %11 to i64
%spec.select.3 = add nuw nsw i64 %spec.select.2, %inc32.3
%inc35.3 = or i64 %loopA.267, 4
%arrayidx26.4 = getelementptr inbounds i8, ptr %can, i64 %inc35.3
%12 = load i8, ptr %arrayidx26.4, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.4 = zext i8 %12 to i64
%spec.select.4 = add nuw nsw i64 %spec.select.3, %inc32.4
%inc35.4 = or i64 %loopA.267, 5
%arrayidx26.5 = getelementptr inbounds i8, ptr %can, i64 %inc35.4
%13 = load i8, ptr %arrayidx26.5, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.5 = zext i8 %13 to i64
%spec.select.5 = add nuw nsw i64 %spec.select.4, %inc32.5
%inc35.5 = or i64 %loopA.267, 6
%arrayidx26.6 = getelementptr inbounds i8, ptr %can, i64 %inc35.5
%14 = load i8, ptr %arrayidx26.6, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.6 = zext i8 %14 to i64
%spec.select.6 = add nuw nsw i64 %spec.select.5, %inc32.6
%inc35.6 = or i64 %loopA.267, 7
%arrayidx26.7 = getelementptr inbounds i8, ptr %can, i64 %inc35.6
%15 = load i8, ptr %arrayidx26.7, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.7 = zext i8 %15 to i64
%spec.select.7 = add nuw nsw i64 %spec.select.6, %inc32.7
%inc35.7 = add nuw nsw i64 %loopA.267, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end36.loopexit.unr-lcssa, label %for.body25, !llvm.loop !29
for.end36.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%ret.068.unr = phi i64 [ 0, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%loopA.267.unr = phi i64 [ 0, %for.body25.preheader ], [ %inc35.7, %for.body25 ]
%lcmp.mod73.not = icmp eq i64 %xtraiter72, 0
br i1 %lcmp.mod73.not, label %for.end36, label %for.body25.epil
for.body25.epil: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil
%ret.068.epil = phi i64 [ %spec.select.epil, %for.body25.epil ], [ %ret.068.unr, %for.end36.loopexit.unr-lcssa ]
%loopA.267.epil = phi i64 [ %inc35.epil, %for.body25.epil ], [ %loopA.267.unr, %for.end36.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end36.loopexit.unr-lcssa ]
%arrayidx26.epil = getelementptr inbounds i8, ptr %can, i64 %loopA.267.epil
%16 = load i8, ptr %arrayidx26.epil, align 1, !tbaa !23, !range !25, !noundef !26
%inc32.epil = zext i8 %16 to i64
%spec.select.epil = add nuw nsw i64 %ret.068.epil, %inc32.epil
%inc35.epil = add nuw nsw i64 %loopA.267.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter72
br i1 %epil.iter.cmp.not, label %for.end36, label %for.body25.epil, !llvm.loop !30
for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil, %for.end.thread, %for.cond22.preheader
%ret.0.lcssa = phi i64 [ 0, %for.cond22.preheader ], [ 0, %for.end.thread ], [ %spec.select.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body25.epil ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_max(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #12 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !11
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !11
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !31
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !11
%spec.select = tail call i64 @llvm.smax.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !32
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_min(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #12 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !11
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !11
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !33
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !11
%spec.select = tail call i64 @llvm.smin.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !34
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_sum(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #13 {
entry:
%cmp4 = icmp sgt i64 %how_data, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi7 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !11
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = add <2 x i64> %wide.load, %vec.phi
%3 = add <2 x i64> %wide.load8, %vec.phi7
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !35
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %3, %2
%5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%loop.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ret.05.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%loop.06 = phi i64 [ %inc, %for.body ], [ %loop.06.ph, %for.body.preheader9 ]
%ret.05 = phi i64 [ %add, %for.body ], [ %ret.05.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06
%6 = load i64, ptr %arrayidx, align 8, !tbaa !11
%add = add nsw i64 %6, %ret.05
%inc = add nuw nsw i64 %loop.06, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !36
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @Leven_dist(ptr nocapture noundef readonly %now, ptr nocapture noundef readonly %target) local_unnamed_addr #14 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %now) #22
%add = add i64 %call, 1
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %target) #22
%add2 = add i64 %call1, 1
%0 = mul nuw i64 %add2, %add
%vla = alloca i64, i64 %0, align 16
%cmp81 = icmp ult i64 %call, 9223372036854775807
br i1 %cmp81, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %add, 3
%1 = icmp ult i64 %call, 3
br i1 %1, label %for.cond4.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %add, -4
br label %for.body
for.cond4.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%loopA.082.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond4.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil
%loopA.082.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %loopA.082.unr, %for.cond4.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond4.preheader.loopexit.unr-lcssa ]
%2 = mul nsw i64 %loopA.082.epil, %add2
%arrayidx.epil = getelementptr inbounds i64, ptr %vla, i64 %2
store i64 %loopA.082.epil, ptr %arrayidx.epil, align 8, !tbaa !11
%inc.epil = add nuw nsw i64 %loopA.082.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.cond4.preheader, label %for.body.epil, !llvm.loop !37
for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil, %entry
%cmp583 = icmp ult i64 %call1, 9223372036854775807
br i1 %cmp583, label %for.body6.preheader, label %for.cond12.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%min.iters.check = icmp ult i64 %add2, 4
br i1 %min.iters.check, label %for.body6.preheader95, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %add2, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%3 = getelementptr inbounds i64, ptr %vla, i64 %index
store <2 x i64> %vec.ind, ptr %3, align 16, !tbaa !11
%4 = getelementptr inbounds i64, ptr %3, i64 2
store <2 x i64> %step.add, ptr %4, align 16, !tbaa !11
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !38
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %add2, %n.vec
br i1 %cmp.n, label %for.cond12.preheader, label %for.body6.preheader95
for.body6.preheader95: ; preds = %for.body6.preheader, %middle.block
%loopA.184.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
br label %for.body6
for.body: ; preds = %for.body, %for.body.preheader.new
%loopA.082 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%6 = mul nsw i64 %loopA.082, %add2
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %6
store i64 %loopA.082, ptr %arrayidx, align 16, !tbaa !11
%inc = or i64 %loopA.082, 1
%7 = mul nsw i64 %inc, %add2
%arrayidx.1 = getelementptr inbounds i64, ptr %vla, i64 %7
store i64 %inc, ptr %arrayidx.1, align 8, !tbaa !11
%inc.1 = or i64 %loopA.082, 2
%8 = mul nsw i64 %inc.1, %add2
%arrayidx.2 = getelementptr inbounds i64, ptr %vla, i64 %8
store i64 %inc.1, ptr %arrayidx.2, align 16, !tbaa !11
%inc.2 = or i64 %loopA.082, 3
%9 = mul nsw i64 %inc.2, %add2
%arrayidx.3 = getelementptr inbounds i64, ptr %vla, i64 %9
store i64 %inc.2, ptr %arrayidx.3, align 8, !tbaa !11
%inc.3 = add nuw nsw i64 %loopA.082, 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.cond4.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !39
for.cond12.preheader: ; preds = %for.body6, %middle.block, %for.cond4.preheader
%cmp1387 = icmp sgt i64 %add, 1
%cmp1685 = icmp sgt i64 %add2, 1
%or.cond = select i1 %cmp1387, i1 %cmp1685, i1 false
br i1 %or.cond, label %for.cond15.preheader.us, label %for.end47
for.cond15.preheader.us: ; preds = %for.cond12.preheader, %for.cond15.for.inc45_crit_edge.us
%loopA.288.us = phi i64 [ %inc46.us, %for.cond15.for.inc45_crit_edge.us ], [ 1, %for.cond12.preheader ]
%sub.us = add nsw i64 %loopA.288.us, -1
%arrayidx18.us = getelementptr inbounds i8, ptr %now, i64 %sub.us
%10 = load i8, ptr %arrayidx18.us, align 1, !tbaa !40
%11 = mul nsw i64 %sub.us, %add2
%arrayidx26.us = getelementptr inbounds i64, ptr %vla, i64 %11
%12 = mul nsw i64 %loopA.288.us, %add2
%arrayidx29.us = getelementptr inbounds i64, ptr %vla, i64 %12
%.pre = load i64, ptr %arrayidx29.us, align 8, !tbaa !11
br label %for.body17.us
for.body17.us: ; preds = %for.cond15.preheader.us, %for.body17.us
%13 = phi i64 [ %.pre, %for.cond15.preheader.us ], [ %b.a.i80.us, %for.body17.us ]
%loopB.086.us = phi i64 [ 1, %for.cond15.preheader.us ], [ %inc43.us, %for.body17.us ]
%sub19.us = add nsw i64 %loopB.086.us, -1
%arrayidx20.us = getelementptr inbounds i8, ptr %target, i64 %sub19.us
%14 = load i8, ptr %arrayidx20.us, align 1, !tbaa !40
%cmp22.us = icmp ne i8 %10, %14
%conv24.us = zext i1 %cmp22.us to i64
%arrayidx27.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %loopB.086.us
%15 = load i64, ptr %arrayidx27.us, align 8, !tbaa !11
%add28.us = add nsw i64 %15, 1
%add32.us = add nsw i64 %13, 1
%b.a.i.us = tail call i64 @llvm.smin.i64(i64 %add28.us, i64 %add32.us)
%arrayidx37.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %sub19.us
%16 = load i64, ptr %arrayidx37.us, align 8, !tbaa !11
%add38.us = add nsw i64 %16, %conv24.us
%b.a.i80.us = tail call i64 @llvm.smin.i64(i64 %b.a.i.us, i64 %add38.us)
%arrayidx41.us = getelementptr inbounds i64, ptr %arrayidx29.us, i64 %loopB.086.us
store i64 %b.a.i80.us, ptr %arrayidx41.us, align 8, !tbaa !11
%inc43.us = add nuw nsw i64 %loopB.086.us, 1
%exitcond92.not = icmp eq i64 %loopB.086.us, %call1
br i1 %exitcond92.not, label %for.cond15.for.inc45_crit_edge.us, label %for.body17.us, !llvm.loop !41
for.cond15.for.inc45_crit_edge.us: ; preds = %for.body17.us
%inc46.us = add nuw nsw i64 %loopA.288.us, 1
%exitcond93.not = icmp eq i64 %loopA.288.us, %call
br i1 %exitcond93.not, label %for.end47, label %for.cond15.preheader.us, !llvm.loop !42
for.body6: ; preds = %for.body6.preheader95, %for.body6
%loopA.184 = phi i64 [ %inc10, %for.body6 ], [ %loopA.184.ph, %for.body6.preheader95 ]
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %loopA.184
store i64 %loopA.184, ptr %arrayidx8, align 8, !tbaa !11
%inc10 = add nuw nsw i64 %loopA.184, 1
%exitcond91.not = icmp eq i64 %loopA.184, %call1
br i1 %exitcond91.not, label %for.cond12.preheader, label %for.body6, !llvm.loop !43
for.end47: ; preds = %for.cond15.for.inc45_crit_edge.us, %for.cond12.preheader
%17 = mul nsw i64 %add2, %call
%arrayidx49 = getelementptr inbounds i64, ptr %vla, i64 %17
%arrayidx51 = getelementptr inbounds i64, ptr %arrayidx49, i64 %call1
%18 = load i64, ptr %arrayidx51, align 8, !tbaa !11
ret i64 %18
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #15
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local void @prime_fact(i64 noundef %target, ptr nocapture noundef writeonly %data) local_unnamed_addr #16 {
entry:
%cmp.not28 = icmp eq i64 %target, 1
br i1 %cmp.not28, label %while.end12, label %while.cond1.preheader.lr.ph
while.cond1.preheader.lr.ph: ; preds = %entry
%conv3 = sitofp i64 %target to double
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.cond1.preheader.lr.ph, %while.end
%target.addr.031 = phi i64 [ %target, %while.cond1.preheader.lr.ph ], [ %div, %while.end ]
%loopA.030 = phi i64 [ 1, %while.cond1.preheader.lr.ph ], [ %loopA.1, %while.end ]
%loopB.029 = phi i64 [ 0, %while.cond1.preheader.lr.ph ], [ %inc10, %while.end ]
br label %while.cond1
while.cond1: ; preds = %while.cond1.preheader, %if.end
%loopA.1 = phi i64 [ %inc, %if.end ], [ %loopA.030, %while.cond1.preheader ]
%inc = add nsw i64 %loopA.1, 1
%conv = sitofp i64 %inc to double
%call = tail call double @sqrt(double noundef %conv3) #21
%add = fadd double %call, 1.000000e+02
%cmp4 = fcmp ugt double %add, %conv
br i1 %cmp4, label %if.end, label %while.end.thread
while.end.thread: ; preds = %while.cond1
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loopB.029
store i64 %target.addr.031, ptr %arrayidx, align 8, !tbaa !11
br label %while.end12
if.end: ; preds = %while.cond1
%rem = srem i64 %target.addr.031, %inc
%div = sdiv i64 %target.addr.031, %inc
%cmp6 = icmp eq i64 %rem, 0
br i1 %cmp6, label %while.end, label %while.cond1
while.end: ; preds = %if.end
%arrayidx9 = getelementptr inbounds i64, ptr %data, i64 %loopB.029
store i64 %inc, ptr %arrayidx9, align 8, !tbaa !11
%inc10 = add nuw nsw i64 %loopB.029, 1
%cmp.not = icmp eq i64 %div, 1
br i1 %cmp.not, label %while.end12, label %while.cond1.preheader, !llvm.loop !44
while.end12: ; preds = %while.end, %while.end.thread, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #17
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @get_digit(i64 noundef %target) local_unnamed_addr #18 {
entry:
%conv = sitofp i64 %target to double
%call = tail call double @log10(double noundef %conv) #21
%add = fadd double %call, 1.000000e+00
%conv1 = fptosi double %add to i64
ret i64 %conv1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #17
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal, i8 0, i64 81600, i1 false)
%arrayidx = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1
store i64 1, ptr %arrayidx, align 16, !tbaa !11
%arrayidx3 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3, align 8, !tbaa !11
br label %for.body
for.body: ; preds = %entry, %for.end
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.end ]
%loopA.037 = phi i64 [ 2, %entry ], [ %inc20, %for.end ]
%0 = add i64 %indvar, 1
%arrayidx4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037
store i64 1, ptr %arrayidx4, align 16, !tbaa !11
%sub = add nsw i64 %loopA.037, -1
%arrayidx11.phi.trans.insert = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 0
%.pre = load i64, ptr %arrayidx11.phi.trans.insert, align 16, !tbaa !11
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !11
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !45
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body ]
%loopB.036.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%scalar.recur = phi i64 [ %6, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ]
%loopB.036 = phi i64 [ %inc, %for.body8 ], [ %loopB.036.ph, %for.body8.preheader ]
%arrayidx14 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %loopB.036
%6 = load i64, ptr %arrayidx14, align 8, !tbaa !11
%add = add nsw i64 %6, %scalar.recur
%arrayidx16 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopB.036
store i64 %add, ptr %arrayidx16, align 8, !tbaa !11
%inc = add nuw nsw i64 %loopB.036, 1
%exitcond.not = icmp eq i64 %inc, %loopA.037
br i1 %exitcond.not, label %for.end, label %for.body8, !llvm.loop !46
for.end: ; preds = %for.body8, %middle.block
%arrayidx18 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopA.037
store i64 1, ptr %arrayidx18, align 8, !tbaa !11
%inc20 = add nuw nsw i64 %loopA.037, 1
%exitcond38.not = icmp eq i64 %inc20, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not, label %for.end21, label %for.body, !llvm.loop !47
for.end21: ; preds = %for.end
%arrayidx23 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal) #21
ret i64 %7
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #19
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @npr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !11
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !11
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !11
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !11
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !11
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !48
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !11
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !11
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !49
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !11
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47
ncr.exit: ; preds = %for.end.i
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #21
%cmp.not4.i = icmp slt i64 %r, 1
br i1 %cmp.not4.i, label %factorial.exit, label %for.body.i3.preheader
for.body.i3.preheader: ; preds = %ncr.exit
%xtraiter = and i64 %r, 3
%8 = icmp ult i64 %r, 4
br i1 %8, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3.preheader.new
for.body.i3.preheader.new: ; preds = %for.body.i3.preheader
%unroll_iter = and i64 %r, -4
br label %for.body.i3
for.body.i3: ; preds = %for.body.i3, %for.body.i3.preheader.new
%i.06.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %rem.i.3, %for.body.i3 ]
%niter = phi i64 [ 0, %for.body.i3.preheader.new ], [ %niter.next.3, %for.body.i3 ]
%mul.i = mul i64 %ret.05.i, %i.06.i
%rem.i = urem i64 %mul.i, 1000000007
%inc.i4 = add nuw nsw i64 %i.06.i, 1
%mul.i.1 = mul i64 %rem.i, %inc.i4
%rem.i.1 = urem i64 %mul.i.1, 1000000007
%inc.i4.1 = add nuw nsw i64 %i.06.i, 2
%mul.i.2 = mul i64 %rem.i.1, %inc.i4.1
%rem.i.2 = urem i64 %mul.i.2, 1000000007
%inc.i4.2 = add nuw i64 %i.06.i, 3
%mul.i.3 = mul i64 %rem.i.2, %inc.i4.2
%rem.i.3 = urem i64 %mul.i.3, 1000000007
%inc.i4.3 = add nuw i64 %i.06.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3, !llvm.loop !22
factorial.exit.loopexit.unr-lcssa: ; preds = %for.body.i3, %for.body.i3.preheader
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%i.06.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %factorial.exit, label %for.body.i3.epil
for.body.i3.epil: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil
%i.06.i.epil = phi i64 [ %inc.i4.epil, %for.body.i3.epil ], [ %i.06.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%ret.05.i.epil = phi i64 [ %rem.i.epil, %for.body.i3.epil ], [ %ret.05.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i3.epil ], [ 0, %factorial.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul i64 %ret.05.i.epil, %i.06.i.epil
%rem.i.epil = urem i64 %mul.i.epil, 1000000007
%inc.i4.epil = add nuw i64 %i.06.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %factorial.exit, label %for.body.i3.epil, !llvm.loop !50
factorial.exit: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil, %ncr.exit
%ret.0.lcssa.i = phi i64 [ 1, %ncr.exit ], [ %rem.i.lcssa.ph, %factorial.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i3.epil ]
%mul = mul nsw i64 %ret.0.lcssa.i, %7
ret i64 %mul
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nhr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #9 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #21
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !11
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !11
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !11
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !11
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !11
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !11
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !51
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !11
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !11
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !52
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !11
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47
ncr.exit: ; preds = %for.end.i
%add = add i64 %n, -1
%sub = add i64 %add, %r
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #21
ret i64 %7
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #20
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #20
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { 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 #11 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { 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 #13 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nofree 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 #15 = { 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 #16 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #17 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #18 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #19 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #20 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #21 = { nounwind }
attributes #22 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !21}
!31 = distinct !{!31, !10, !14, !15}
!32 = distinct !{!32, !10, !15, !14}
!33 = distinct !{!33, !10, !14, !15}
!34 = distinct !{!34, !10, !15, !14}
!35 = distinct !{!35, !10, !14, !15}
!36 = distinct !{!36, !10, !15, !14}
!37 = distinct !{!37, !21}
!38 = distinct !{!38, !10, !14, !15}
!39 = distinct !{!39, !10}
!40 = !{!7, !7, i64 0}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !10}
!43 = distinct !{!43, !10, !15, !14}
!44 = distinct !{!44, !10}
!45 = distinct !{!45, !10, !14, !15}
!46 = distinct !{!46, !10, !15, !14}
!47 = distinct !{!47, !10}
!48 = distinct !{!48, !10, !14, !15}
!49 = distinct !{!49, !10, !15, !14}
!50 = distinct !{!50, !21}
!51 = distinct !{!51, !10, !14, !15}
!52 = distinct !{!52, !10, !15, !14}
|
// AOJ Volume 1 Problem 0159 The Best Body
#include <stdio.h>
#define ABS(x) ((x) < 0.0 ? ((x) * -1.0) : (x))
double cal_bmi(int h, int w)
{
double bmi;
bmi = (double)w / ((h / 100.0) * (h / 100.0));
return (bmi);
}
int main(void)
{
int n;
int i, h, w;
double bmi;
int ideal_no;
double ideal_bmi;
int j;
while (1){
scanf("%d", &n);
if (n == 0){
break;
}
scanf("%d%d%d", &i, &h, &w);
ideal_no = i;
ideal_bmi = cal_bmi(h, w);
for (j = 1; j < n; j++){
scanf("%d%d%d", &i, &h, &w);
bmi = cal_bmi(h, w);
if (ABS(22.0 - bmi) < ABS(22.0 - ideal_bmi)){
ideal_no = i;
ideal_bmi = bmi;
}
}
printf("%d\n", ideal_no);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204346/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = 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 double @cal_bmi(i32 noundef %h, i32 noundef %w) local_unnamed_addr #0 {
entry:
%conv = sitofp i32 %w to double
%conv1 = sitofp i32 %h to double
%div = fdiv double %conv1, 1.000000e+02
%mul = fmul double %div, %div
%div4 = fdiv double %conv, %mul
ret double %div4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%i = 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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #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
%call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp eq i32 %0, 0
br i1 %cmp38, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %h, ptr noundef nonnull %w)
%1 = load i32, ptr %i, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp333 = icmp sgt i32 %2, 1
br i1 %cmp333, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %if.end
%3 = load i32, ptr %w, align 4, !tbaa !5
%conv.i = sitofp i32 %3 to double
%4 = load i32, ptr %h, align 4, !tbaa !5
%conv1.i = sitofp i32 %4 to double
%div.i = fdiv double %conv1.i, 1.000000e+02
%mul.i = fmul double %div.i, %div.i
%div4.i = fdiv double %conv.i, %mul.i
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%j.036 = phi i32 [ %inc, %for.body ], [ 1, %for.body.preheader ]
%ideal_bmi.035 = phi double [ %ideal_bmi.1, %for.body ], [ %div4.i, %for.body.preheader ]
%ideal_no.034 = phi i32 [ %ideal_no.1, %for.body ], [ %1, %for.body.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %h, ptr noundef nonnull %w)
%5 = load i32, ptr %h, align 4, !tbaa !5
%6 = load i32, ptr %w, align 4, !tbaa !5
%conv.i28 = sitofp i32 %6 to double
%conv1.i29 = sitofp i32 %5 to double
%div.i30 = fdiv double %conv1.i29, 1.000000e+02
%mul.i31 = fmul double %div.i30, %div.i30
%div4.i32 = fdiv double %conv.i28, %mul.i31
%7 = insertelement <2 x double> poison, double %div4.i32, i64 0
%8 = insertelement <2 x double> %7, double %ideal_bmi.035, i64 1
%9 = fsub <2 x double> <double 2.200000e+01, double 2.200000e+01>, %8
%10 = fcmp olt <2 x double> %9, zeroinitializer
%11 = fneg <2 x double> %9
%12 = select <2 x i1> %10, <2 x double> %11, <2 x double> %9
%13 = extractelement <2 x double> %12, i64 0
%14 = extractelement <2 x double> %12, i64 1
%cmp18 = fcmp olt double %13, %14
%15 = load i32, ptr %i, align 4
%ideal_no.1 = select i1 %cmp18, i32 %15, i32 %ideal_no.034
%ideal_bmi.1 = select i1 %cmp18, double %div4.i32, double %ideal_bmi.035
%inc = add nuw nsw i32 %j.036, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc, %16
br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %if.end
%ideal_no.0.lcssa = phi i32 [ %1, %if.end ], [ %ideal_no.1, %for.body ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ideal_no.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %17, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.end, %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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define df 0
#define MOD 1000000007
void clear(int i);
void plus_i(char s);
void plus(int i);
void times10();
int ans[0][13]={};
int main(){
char s[100010];
scanf("%s",s);
int i,len=strlen(s);
ans[1][0]=1;
for(i=0;i<len;i++){
clear(0);
plus_i(s[i]);
if(df){
int k;
printf("[ ");
for(k=0;k<13;k++){
printf("%d ",ans[0][k]);
}
printf("]\n");
}
clear(1);
times10();
if(df){
int k;
printf("[ ");
for(k=0;k<13;k++){
printf("%d ",ans[1][k]);
}
printf("]\n");
}
}
printf("%d",ans[0][5]);
return 0;
}
void clear(int i){
int k;
for(k=0;k<13;k++)
ans[i][k]=0;
}
void plus_i(char s){
if(s=='?'){
int i;
for(i=0;i<10;i++){
plus(i);
}
}
else{
int i=s-'0';
plus(i);
}
}
void plus(int i){
int a;
for(a=0;a<13;a++){
ans[0][(a+i)%13]+=ans[1][a];
ans[0][(a+i)%13]%=MOD;
}
}
void times10(){
int k;
for(k=0;k<13;k++){
ans[1][10*k%13]=ans[0][k]%MOD;
}
}
/// confirm df==0 ///
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204397/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204397/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ans = dso_local local_unnamed_addr global [0 x [13 x i32]] zeroinitializer, align 4
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #9
%conv = trunc i64 %call2 to i32
store i32 1, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1), align 4, !tbaa !5
%cmp7 = icmp sgt i32 %conv, 0
br i1 %cmp7, label %for.body.preheader, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 5), align 4, !tbaa !5
br label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) @ans, i8 0, i64 52, i1 false), !tbaa !5
%arrayidx = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !9
call void @plus_i(i8 noundef signext %0)
%1 = load i32, ptr @ans, align 4, !tbaa !5
%rem.i = srem i32 %1, 1000000007
store i32 %rem.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 0), align 4, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 1), align 4, !tbaa !5
%rem.1.i = srem i32 %2, 1000000007
store i32 %rem.1.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 10), align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 2), align 4, !tbaa !5
%rem.2.i = srem i32 %3, 1000000007
store i32 %rem.2.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 7), align 4, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 3), align 4, !tbaa !5
%rem.3.i = srem i32 %4, 1000000007
store i32 %rem.3.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 4), align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 4), align 4, !tbaa !5
%rem.4.i = srem i32 %5, 1000000007
store i32 %rem.4.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 1), align 4, !tbaa !5
%6 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 5), align 4, !tbaa !5
%rem.5.i = srem i32 %6, 1000000007
store i32 %rem.5.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 11), align 4, !tbaa !5
%7 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 6), align 4, !tbaa !5
%rem.6.i = srem i32 %7, 1000000007
store i32 %rem.6.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 8), align 4, !tbaa !5
%8 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 7), align 4, !tbaa !5
%rem.7.i = srem i32 %8, 1000000007
store i32 %rem.7.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 5), align 4, !tbaa !5
%9 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 8), align 4, !tbaa !5
%rem.8.i = srem i32 %9, 1000000007
store i32 %rem.8.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 2), align 4, !tbaa !5
%10 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 9), align 4, !tbaa !5
%rem.9.i = srem i32 %10, 1000000007
store i32 %rem.9.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 12), align 4, !tbaa !5
%11 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 10), align 4, !tbaa !5
%rem.10.i = srem i32 %11, 1000000007
store i32 %rem.10.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 9), align 4, !tbaa !5
%12 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 11), align 4, !tbaa !5
%rem.11.i = srem i32 %12, 1000000007
store i32 %rem.11.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 6), align 4, !tbaa !5
%13 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 12), align 4, !tbaa !5
%rem.12.i = srem i32 %13, 1000000007
store i32 %rem.12.i, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 3), align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%14 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @clear(i32 noundef %i) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %i to i64
%0 = mul nsw i64 %idxprom, 52
%scevgep = getelementptr i8, ptr @ans, i64 %0
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(52) %scevgep, i8 0, i64 52, i1 false), !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @plus_i(i8 noundef signext %s) local_unnamed_addr #5 {
entry:
%cmp = icmp eq i8 %s, 63
br i1 %cmp, label %for.body.preheader, label %if.else
for.body.preheader: ; preds = %entry
tail call void @plus(i32 noundef 0)
tail call void @plus(i32 noundef 1)
tail call void @plus(i32 noundef 2)
tail call void @plus(i32 noundef 3)
tail call void @plus(i32 noundef 4)
tail call void @plus(i32 noundef 5)
tail call void @plus(i32 noundef 6)
tail call void @plus(i32 noundef 7)
tail call void @plus(i32 noundef 8)
br label %if.end
if.else: ; preds = %entry
%conv = sext i8 %s to i32
%sub = add nsw i32 %conv, -48
br label %if.end
if.end: ; preds = %for.body.preheader, %if.else
%.sink = phi i32 [ 9, %for.body.preheader ], [ %sub, %if.else ]
tail call void @plus(i32 noundef %.sink)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @plus(i32 noundef %i) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 0), align 4, !tbaa !5
%rem = srem i32 %i, 13
%idxprom1 = sext i32 %rem to i64
%arrayidx2 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%add3 = add nsw i32 %1, %0
%rem8 = srem i32 %add3, 1000000007
store i32 %rem8, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 1), align 4, !tbaa !5
%3 = add i32 %i, 1
%rem.1 = srem i32 %3, 13
%idxprom1.1 = sext i32 %rem.1 to i64
%arrayidx2.1 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.1
%4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%add3.1 = add nsw i32 %4, %2
%rem8.1 = srem i32 %add3.1, 1000000007
store i32 %rem8.1, ptr %arrayidx2.1, align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 2), align 4, !tbaa !5
%6 = add i32 %i, 2
%rem.2 = srem i32 %6, 13
%idxprom1.2 = sext i32 %rem.2 to i64
%arrayidx2.2 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.2
%7 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%add3.2 = add nsw i32 %7, %5
%rem8.2 = srem i32 %add3.2, 1000000007
store i32 %rem8.2, ptr %arrayidx2.2, align 4, !tbaa !5
%8 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 3), align 4, !tbaa !5
%9 = add i32 %i, 3
%rem.3 = srem i32 %9, 13
%idxprom1.3 = sext i32 %rem.3 to i64
%arrayidx2.3 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.3
%10 = load i32, ptr %arrayidx2.3, align 4, !tbaa !5
%add3.3 = add nsw i32 %10, %8
%rem8.3 = srem i32 %add3.3, 1000000007
store i32 %rem8.3, ptr %arrayidx2.3, align 4, !tbaa !5
%11 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 4), align 4, !tbaa !5
%12 = add i32 %i, 4
%rem.4 = srem i32 %12, 13
%idxprom1.4 = sext i32 %rem.4 to i64
%arrayidx2.4 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.4
%13 = load i32, ptr %arrayidx2.4, align 4, !tbaa !5
%add3.4 = add nsw i32 %13, %11
%rem8.4 = srem i32 %add3.4, 1000000007
store i32 %rem8.4, ptr %arrayidx2.4, align 4, !tbaa !5
%14 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 5), align 4, !tbaa !5
%15 = add i32 %i, 5
%rem.5 = srem i32 %15, 13
%idxprom1.5 = sext i32 %rem.5 to i64
%arrayidx2.5 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.5
%16 = load i32, ptr %arrayidx2.5, align 4, !tbaa !5
%add3.5 = add nsw i32 %16, %14
%rem8.5 = srem i32 %add3.5, 1000000007
store i32 %rem8.5, ptr %arrayidx2.5, align 4, !tbaa !5
%17 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 6), align 4, !tbaa !5
%18 = add i32 %i, 6
%rem.6 = srem i32 %18, 13
%idxprom1.6 = sext i32 %rem.6 to i64
%arrayidx2.6 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.6
%19 = load i32, ptr %arrayidx2.6, align 4, !tbaa !5
%add3.6 = add nsw i32 %19, %17
%rem8.6 = srem i32 %add3.6, 1000000007
store i32 %rem8.6, ptr %arrayidx2.6, align 4, !tbaa !5
%20 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 7), align 4, !tbaa !5
%21 = add i32 %i, 7
%rem.7 = srem i32 %21, 13
%idxprom1.7 = sext i32 %rem.7 to i64
%arrayidx2.7 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.7
%22 = load i32, ptr %arrayidx2.7, align 4, !tbaa !5
%add3.7 = add nsw i32 %22, %20
%rem8.7 = srem i32 %add3.7, 1000000007
store i32 %rem8.7, ptr %arrayidx2.7, align 4, !tbaa !5
%23 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 8), align 4, !tbaa !5
%24 = add i32 %i, 8
%rem.8 = srem i32 %24, 13
%idxprom1.8 = sext i32 %rem.8 to i64
%arrayidx2.8 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.8
%25 = load i32, ptr %arrayidx2.8, align 4, !tbaa !5
%add3.8 = add nsw i32 %25, %23
%rem8.8 = srem i32 %add3.8, 1000000007
store i32 %rem8.8, ptr %arrayidx2.8, align 4, !tbaa !5
%26 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 9), align 4, !tbaa !5
%27 = add i32 %i, 9
%rem.9 = srem i32 %27, 13
%idxprom1.9 = sext i32 %rem.9 to i64
%arrayidx2.9 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.9
%28 = load i32, ptr %arrayidx2.9, align 4, !tbaa !5
%add3.9 = add nsw i32 %28, %26
%rem8.9 = srem i32 %add3.9, 1000000007
store i32 %rem8.9, ptr %arrayidx2.9, align 4, !tbaa !5
%29 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 10), align 4, !tbaa !5
%30 = add i32 %i, 10
%rem.10 = srem i32 %30, 13
%idxprom1.10 = sext i32 %rem.10 to i64
%arrayidx2.10 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.10
%31 = load i32, ptr %arrayidx2.10, align 4, !tbaa !5
%add3.10 = add nsw i32 %31, %29
%rem8.10 = srem i32 %add3.10, 1000000007
store i32 %rem8.10, ptr %arrayidx2.10, align 4, !tbaa !5
%32 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 11), align 4, !tbaa !5
%33 = add i32 %i, 11
%rem.11 = srem i32 %33, 13
%idxprom1.11 = sext i32 %rem.11 to i64
%arrayidx2.11 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.11
%34 = load i32, ptr %arrayidx2.11, align 4, !tbaa !5
%add3.11 = add nsw i32 %34, %32
%rem8.11 = srem i32 %add3.11, 1000000007
store i32 %rem8.11, ptr %arrayidx2.11, align 4, !tbaa !5
%35 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 12), align 4, !tbaa !5
%36 = add i32 %i, 12
%rem.12 = srem i32 %36, 13
%idxprom1.12 = sext i32 %rem.12 to i64
%arrayidx2.12 = getelementptr inbounds [13 x i32], ptr @ans, i64 0, i64 %idxprom1.12
%37 = load i32, ptr %arrayidx2.12, align 4, !tbaa !5
%add3.12 = add nsw i32 %37, %35
%rem8.12 = srem i32 %add3.12, 1000000007
store i32 %rem8.12, ptr %arrayidx2.12, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @times10() local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @ans, align 4, !tbaa !5
%rem = srem i32 %0, 1000000007
store i32 %rem, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 0), align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 1), align 4, !tbaa !5
%rem.1 = srem i32 %1, 1000000007
store i32 %rem.1, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 10), align 4, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 2), align 4, !tbaa !5
%rem.2 = srem i32 %2, 1000000007
store i32 %rem.2, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 7), align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 3), align 4, !tbaa !5
%rem.3 = srem i32 %3, 1000000007
store i32 %rem.3, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 4), align 4, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 4), align 4, !tbaa !5
%rem.4 = srem i32 %4, 1000000007
store i32 %rem.4, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 1), align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 5), align 4, !tbaa !5
%rem.5 = srem i32 %5, 1000000007
store i32 %rem.5, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 11), align 4, !tbaa !5
%6 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 6), align 4, !tbaa !5
%rem.6 = srem i32 %6, 1000000007
store i32 %rem.6, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 8), align 4, !tbaa !5
%7 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 7), align 4, !tbaa !5
%rem.7 = srem i32 %7, 1000000007
store i32 %rem.7, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 5), align 4, !tbaa !5
%8 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 8), align 4, !tbaa !5
%rem.8 = srem i32 %8, 1000000007
store i32 %rem.8, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 2), align 4, !tbaa !5
%9 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 9), align 4, !tbaa !5
%rem.9 = srem i32 %9, 1000000007
store i32 %rem.9, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 12), align 4, !tbaa !5
%10 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 10), align 4, !tbaa !5
%rem.10 = srem i32 %10, 1000000007
store i32 %rem.10, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 9), align 4, !tbaa !5
%11 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 11), align 4, !tbaa !5
%rem.11 = srem i32 %11, 1000000007
store i32 %rem.11, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 6), align 4, !tbaa !5
%12 = load i32, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 0, i64 12), align 4, !tbaa !5
%rem.12 = srem i32 %12, 1000000007
store i32 %rem.12, ptr getelementptr inbounds ([0 x [13 x i32]], ptr @ans, i64 0, i64 1, i64 3), align 4, !tbaa !5
ret void
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int t=1;
scanf("%d",&t);
while(t--) {
int n;
scanf("%d",&n);
int a[n];
int min=10000000,p=-1;
for(int i=0; i<n; i++) {
scanf("%d",&a[i]);
if(a[i]<min) { min=a[i]; p=i;}
}
int x=0;
for(int i=0; i<n/2; i++) {
if(x==p) x++;
printf("%d %d\n",a[x],a[p]);
x++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20444/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20444/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
store i32 1, ptr %t, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec46 = add nsw i32 %0, -1
store i32 %dec46, ptr %t, align 4, !tbaa !5
%tobool.not47 = icmp eq i32 %0, 0
br i1 %tobool.not47, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %4, 0
br i1 %cmp38, label %for.body, label %for.cond.cleanup11
for.cond9.preheader: ; preds = %for.body
%cmp1043 = icmp sgt i32 %7, 1
br i1 %cmp1043, label %for.body12.lr.ph, label %for.cond.cleanup11
for.body12.lr.ph: ; preds = %for.cond9.preheader
%idxprom19 = sext i32 %spec.select36 to i64
%arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %idxprom19
br label %for.body12
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%p.040 = phi i32 [ %spec.select36, %for.body ], [ -1, %while.body ]
%min.039 = phi i32 [ %spec.select, %for.body ], [ 10000000, %while.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5 = icmp slt i32 %5, %min.039
%spec.select = call i32 @llvm.smin.i32(i32 %5, i32 %min.039)
%6 = trunc i64 %indvars.iv to i32
%spec.select36 = select i1 %cmp5, i32 %6, i32 %p.040
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond9.preheader, !llvm.loop !9
for.cond.cleanup11: ; preds = %for.body12, %while.body, %for.cond9.preheader
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
%9 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %9, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %9, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
for.body12: ; preds = %for.body12.lr.ph, %for.body12
%i8.045 = phi i32 [ 0, %for.body12.lr.ph ], [ %inc24, %for.body12 ]
%x.044 = phi i32 [ 0, %for.body12.lr.ph ], [ %inc22, %for.body12 ]
%cmp13 = icmp eq i32 %x.044, %spec.select36
%inc15 = zext i1 %cmp13 to i32
%spec.select37 = add nsw i32 %x.044, %inc15
%idxprom17 = sext i32 %spec.select37 to i64
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17
%10 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10, i32 noundef %11)
%inc22 = add nsw i32 %spec.select37, 1
%inc24 = add nuw nsw i32 %i8.045, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %12, 2
%cmp10 = icmp slt i32 %inc24, %div
br i1 %cmp10, label %for.body12, label %for.cond.cleanup11, !llvm.loop !12
while.end: ; preds = %for.cond.cleanup11, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
/*ex4_1
series2*/
# include <stdio.h>
# include <math.h>
int main(void){
//各文字の箱を作って読み取り
int tree,range;
scanf("%d %d", &tree,&range);
//一人当たり監視できる木は2*range+1である。余りがある場合はもう一人担当が必要。余りを表現するためにintから型変換
printf("%d",(int)ceil((float)tree/(2*range+1)));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204483/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204483/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%tree = alloca i32, align 4
%range = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tree) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %range) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tree, ptr noundef nonnull %range)
%0 = load i32, ptr %tree, align 4, !tbaa !5
%conv = sitofp i32 %0 to float
%1 = load i32, ptr %range, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%conv1 = sitofp i32 %add to float
%div = fdiv float %conv, %conv1
%2 = call float @llvm.ceil.f32(float %div)
%conv3 = fptosi float %2 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %range) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tree) #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 float @llvm.ceil.f32(float) #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"}
|
/* ex4_1 melo */
#include <stdio.h>
int main(void){
int Num,Watchman,Min_WM;
scanf("%d %d",&Num,&Watchman);
Min_WM=((Num+(2*Watchman+1)-1) / (2*Watchman+1));
printf("%d\n",Min_WM);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204526/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204526/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Num = alloca i32, align 4
%Watchman = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Num) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Watchman) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Num, ptr noundef nonnull %Watchman)
%0 = load i32, ptr %Num, align 4, !tbaa !5
%1 = load i32, ptr %Watchman, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%add1 = add i32 %0, -1
%sub = add i32 %add1, %add
%div = sdiv i32 %sub, %add
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Watchman) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Num) #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()
{
//監視範囲が重ならないような配置は 0*(2d+1)+d+1,(2d+1)+d+1,2(2d+1)+d+1...に
//一人ずつ配置される状態。だから、上記で配置すると考えて前の項+d内に木があれば+1
int n,d;
scanf("%d%d",&n,&d);
int i,cnt;
i = 0;
cnt = 0;
while (i*(2*d+1)+d+1 <= n)
{
cnt += 1;
i++;
}
//printf("%d\n",i*(2*d+1));
//printf("%d",i*(2*d+1)+d+1);
if (n > i*(2*d+1) && n < i*(2*d+1)+d+1)
{
printf("%d",cnt+1);
}
else
printf("%d",cnt);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = 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 %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not23 = icmp slt i32 %0, %1
br i1 %cmp.not.not23, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %entry
%mul = shl i32 %0, 1
%add = or i32 %mul, 1
%2 = mul i32 %0, 3
%3 = add i32 %2, 1
%smax = call i32 @llvm.smax.i32(i32 %1, i32 %3)
%4 = add nsw i32 %smax, -1
%5 = icmp ne i32 %4, %2
%umin = zext i1 %5 to i32
%6 = add i32 %2, %umin
%7 = sub i32 %4, %6
%8 = udiv i32 %7, %add
%9 = add i32 %8, %umin
%10 = mul i32 %9, %add
%11 = add i32 %10, %mul
%12 = add i32 %9, 1
%13 = add i32 %11, 1
br label %while.end
while.end: ; preds = %while.body.preheader, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %12, %while.body.preheader ]
%mul1.lcssa = phi i32 [ 0, %entry ], [ %13, %while.body.preheader ]
%cmp8.not = icmp sgt i32 %1, %mul1.lcssa
%add15 = zext i1 %cmp8.not to i32
%cnt.0.lcssa.sink = add nuw nsw i32 %cnt.0.lcssa, %add15
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa.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
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
//#pragma warning(disable:4996)
int chk[10100], check;
int main()
{
int T;
scanf("%d", &T);
while (T--) {
int n, x;
scanf("%d%d", &n, &x);
++check;
for (int i = 0; i < n; i++) {
int in;
scanf("%d", &in);
chk[in] = check;
}
int i = 1;
while(x){
if (chk[i] != check) {
x--;
chk[i] = check;
}
i++;
}
i = 1;
while (chk[i] == check) {
i++;
}
printf("%d\n", i - 1);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20462/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20462/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@check = dso_local local_unnamed_addr global i32 0, align 4
@chk = dso_local local_unnamed_addr global [10100 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca i32, align 4
%n = alloca i32, align 4
%x = alloca i32, align 4
%in = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%dec37 = add nsw i32 %0, -1
store i32 %dec37, ptr %T, align 4, !tbaa !5
%tobool.not38 = icmp eq i32 %0, 0
br i1 %tobool.not38, label %while.end23, label %while.body
while.body: ; preds = %entry, %while.end21
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %x)
%1 = load i32, ptr @check, align 4, !tbaa !5
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @check, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %2, 0
br i1 %cmp30, label %for.body, label %while.cond5.preheader
while.cond5.preheader: ; preds = %for.body, %while.body
%3 = phi i32 [ %inc, %while.body ], [ %4, %for.body ]
%x.promoted = load i32, ptr %x, align 4, !tbaa !5
%tobool6.not34 = icmp eq i32 %x.promoted, 0
br i1 %tobool6.not34, label %while.cond15.preheader, label %while.body7
for.body: ; preds = %while.body, %for.body
%i.031 = phi i32 [ %inc3, %for.body ], [ 0, %while.body ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in)
%4 = load i32, ptr @check, align 4, !tbaa !5
%5 = load i32, ptr %in, align 4, !tbaa !5
%idxprom = sext i32 %5 to i64
%arrayidx = getelementptr inbounds [10100 x i32], ptr @chk, i64 0, i64 %idxprom
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in) #3
%inc3 = add nuw nsw i32 %i.031, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc3, %6
br i1 %cmp, label %for.body, label %while.cond5.preheader, !llvm.loop !9
while.body7: ; preds = %while.cond5.preheader, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %while.cond5.preheader ]
%dec113335 = phi i32 [ %dec1132, %if.end ], [ %x.promoted, %while.cond5.preheader ]
%arrayidx9 = getelementptr inbounds [10100 x i32], ptr @chk, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10.not = icmp eq i32 %7, %3
br i1 %cmp10.not, label %if.end, label %if.then
if.then: ; preds = %while.body7
%dec11 = add nsw i32 %dec113335, -1
store i32 %dec11, ptr %x, align 4, !tbaa !5
store i32 %3, ptr %arrayidx9, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body7
%dec1132 = phi i32 [ %dec11, %if.then ], [ %dec113335, %while.body7 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%tobool6.not = icmp eq i32 %dec1132, 0
br i1 %tobool6.not, label %while.cond15.preheader, label %while.body7, !llvm.loop !11
while.cond15.preheader: ; preds = %if.end, %while.cond5.preheader
br label %while.cond15
while.cond15: ; preds = %while.cond15.preheader, %while.cond15
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %while.cond15 ], [ 1, %while.cond15.preheader ]
%arrayidx17 = getelementptr inbounds [10100 x i32], ptr @chk, i64 0, i64 %indvars.iv40
%8 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %8, %3
%indvars.iv.next41 = add nuw i64 %indvars.iv40, 1
br i1 %cmp18, label %while.cond15, label %while.end21, !llvm.loop !12
while.end21: ; preds = %while.cond15
%9 = trunc i64 %indvars.iv40 to i32
%sub = add nsw i32 %9, -1
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
%10 = load i32, ptr %T, align 4, !tbaa !5
%dec = add nsw i32 %10, -1
store i32 %dec, ptr %T, align 4, !tbaa !5
%tobool.not = icmp eq i32 %10, 0
br i1 %tobool.not, label %while.end23, label %while.body, !llvm.loop !13
while.end23: ; preds = %while.end21, %entry
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
c=(a-1)/(2*b+1)+1;
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204663/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204663/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%div = sdiv i32 %sub, %add
%add1 = add nsw i32 %div, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add1)
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 n,d;
scanf("%d %d",&n,&d);
int ans = (n+2*d)/(2*d+1);
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204706/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204706/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = add nsw i32 %mul, %0
%add2 = or i32 %mul, 1
%div = sdiv i32 %add, %add2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int t;
scanf("%d",&t);
int n,x,temp,a[201];
while(t--)
{
scanf("%d%d",&n,&x);
memset(a,0,sizeof(a));
for(int i=0;i<n;i++)
{
scanf("%d",&temp);
a[temp] = 1;
}
int j=1;
for(int i=0;i<x;i++)
{
while(a[j]==1)
j++;
a[j] = 1;
}
while(a[j]==1)
j++;
printf("%d\n",j-1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20475/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20475/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [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
%n = alloca i32, align 4
%x = alloca i32, align 4
%temp = alloca i32, align 4
%a = alloca [201 x i32], align 16
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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #4
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %a) #4
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec40 = add nsw i32 %0, -1
store i32 %dec40, ptr %t, align 4, !tbaa !5
%tobool.not41 = icmp eq i32 %0, 0
br i1 %tobool.not41, label %while.end27, label %while.body
while.body: ; preds = %entry, %while.end25
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %x)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(804) %a, i8 0, i64 804, i1 false)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %1, 0
br i1 %cmp35, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %while.body
%2 = load i32, ptr %x, align 4, !tbaa !5
%cmp537 = icmp sgt i32 %2, 0
br i1 %cmp537, label %while.cond8.preheader.preheader, label %while.cond19.preheader
while.cond8.preheader.preheader: ; preds = %for.cond4.preheader
%xtraiter = and i32 %2, 1
%3 = icmp eq i32 %2, 1
br i1 %3, label %while.cond19.preheader.loopexit.unr-lcssa, label %while.cond8.preheader.preheader.new
while.cond8.preheader.preheader.new: ; preds = %while.cond8.preheader.preheader
%unroll_iter = and i32 %2, -2
br label %while.cond8.preheader
for.body: ; preds = %while.body, %for.body
%i.036 = phi i32 [ %inc, %for.body ], [ 0, %while.body ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%4 = load i32, ptr %temp, align 4, !tbaa !5
%idxprom = sext i32 %4 to i64
%arrayidx = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.036, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
while.cond19.preheader.loopexit.unr-lcssa: ; preds = %while.end.1, %while.cond8.preheader.preheader
%indvars.iv.lcssa.lcssa.ph = phi i64 [ undef, %while.cond8.preheader.preheader ], [ %indvars.iv.1, %while.end.1 ]
%j.038.unr = phi i64 [ 1, %while.cond8.preheader.preheader ], [ %indvars.iv.1, %while.end.1 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.cond19.preheader, label %while.cond8.preheader.epil
while.cond8.preheader.epil: ; preds = %while.cond19.preheader.loopexit.unr-lcssa
%sext.epil = shl i64 %j.038.unr, 32
%6 = ashr exact i64 %sext.epil, 32
br label %while.cond8.epil
while.cond8.epil: ; preds = %while.cond8.epil, %while.cond8.preheader.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %while.cond8.epil ], [ %6, %while.cond8.preheader.epil ]
%arrayidx10.epil = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv.epil
%7 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%cmp11.epil = icmp eq i32 %7, 1
%indvars.iv.next.epil = add i64 %indvars.iv.epil, 1
br i1 %cmp11.epil, label %while.cond8.epil, label %while.end.epil, !llvm.loop !11
while.end.epil: ; preds = %while.cond8.epil
%arrayidx10.le.epil = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv.epil
store i32 1, ptr %arrayidx10.le.epil, align 4, !tbaa !5
br label %while.cond19.preheader
while.cond19.preheader: ; preds = %while.end.epil, %while.cond19.preheader.loopexit.unr-lcssa, %for.cond4.preheader
%j.0.lcssa = phi i64 [ 1, %for.cond4.preheader ], [ %indvars.iv.lcssa.lcssa.ph, %while.cond19.preheader.loopexit.unr-lcssa ], [ %indvars.iv.epil, %while.end.epil ]
%sext46 = shl i64 %j.0.lcssa, 32
%8 = ashr exact i64 %sext46, 32
br label %while.cond19
while.cond8.preheader: ; preds = %while.end.1, %while.cond8.preheader.preheader.new
%j.038 = phi i64 [ 1, %while.cond8.preheader.preheader.new ], [ %indvars.iv.1, %while.end.1 ]
%niter = phi i32 [ 0, %while.cond8.preheader.preheader.new ], [ %niter.next.1, %while.end.1 ]
%sext = shl i64 %j.038, 32
%9 = ashr exact i64 %sext, 32
br label %while.cond8
while.cond8: ; preds = %while.cond8, %while.cond8.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond8 ], [ %9, %while.cond8.preheader ]
%arrayidx10 = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %10, 1
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp11, label %while.cond8, label %while.end, !llvm.loop !11
while.end: ; preds = %while.cond8
%arrayidx10.le = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx10.le, align 4, !tbaa !5
%sext.1 = shl i64 %indvars.iv, 32
%11 = ashr exact i64 %sext.1, 32
br label %while.cond8.1
while.cond8.1: ; preds = %while.cond8.1, %while.end
%indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %while.cond8.1 ], [ %11, %while.end ]
%arrayidx10.1 = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv.1
%12 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %12, 1
%indvars.iv.next.1 = add i64 %indvars.iv.1, 1
br i1 %cmp11.1, label %while.cond8.1, label %while.end.1, !llvm.loop !11
while.end.1: ; preds = %while.cond8.1
%arrayidx10.le.1 = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv.1
store i32 1, ptr %arrayidx10.le.1, align 4, !tbaa !5
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %while.cond19.preheader.loopexit.unr-lcssa, label %while.cond8.preheader, !llvm.loop !12
while.cond19: ; preds = %while.cond19, %while.cond19.preheader
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %while.cond19 ], [ %8, %while.cond19.preheader ]
%arrayidx21 = getelementptr inbounds [201 x i32], ptr %a, i64 0, i64 %indvars.iv43
%13 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %13, 1
%indvars.iv.next44 = add i64 %indvars.iv43, 1
br i1 %cmp22, label %while.cond19, label %while.end25, !llvm.loop !13
while.end25: ; preds = %while.cond19
%14 = trunc i64 %indvars.iv43 to i32
%sub = add nsw i32 %14, -1
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
%15 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %15, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %15, 0
br i1 %tobool.not, label %while.end27, label %while.body, !llvm.loop !14
while.end27: ; preds = %while.end25, %entry
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = distinct !{!14, !10}
|
#include <stdio.h>
int main(void){
int N, D;
scanf("%d %d", &N, &D);
int person_x = 0, person_n = 0;
while(person_x < N){
person_x += 2*D+1;
person_n++;
}
if(person_x+D <= N)
printf("%d\n", person_n++);
else
printf("%d\n", person_n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%.pre = load i32, ptr %D, align 4, !tbaa !5
%mul = shl nsw i32 %.pre, 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%person_n.013 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%person_x.012 = phi i32 [ 0, %while.body.lr.ph ], [ %add1, %while.body ]
%add = add nsw i32 %person_x.012, 1
%add1 = add i32 %add, %mul
%inc = add nuw nsw i32 %person_n.013, 1
%cmp = icmp slt i32 %add1, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%person_n.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %person_n.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int n,d;
int nokori;
int k;
int count;
scanf("%d %d",&n,&d);
k = d*2 + 1;
nokori = n;
while(0 < nokori){
if(k < nokori){
count++;
nokori = nokori - k;
}else{
count++;
break;
}
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca i32, align 4
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 %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add = or i32 %mul, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %1, 0
call void @llvm.assume(i1 %cmp10)
br label %while.body
while.body: ; preds = %while.body, %entry
%count.012 = phi i32 [ undef, %entry ], [ %inc, %while.body ]
%nokori.011 = phi i32 [ %1, %entry ], [ %sub, %while.body ]
%cmp1 = icmp slt i32 %add, %nokori.011
%inc = add nsw i32 %count.012, 1
%sub = sub nsw i32 %nokori.011, %add
%cmp = icmp sgt i32 %sub, 0
%or.cond = select i1 %cmp1, i1 %cmp, i1 false
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind 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"}
|
#include<stdio.h>
int main(){
int N, D;
scanf("%d %d", &N, &D);
if(N % (D * 2 + 1) == 0){
printf("%d\n", N / (D * 2 + 1));
}
else {
printf("%d\n", N / (D * 2 + 1) + 1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204887/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204887/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %D, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%rem = srem i32 %0, %add
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %add
%add7 = zext i1 %cmp to i32
%add7.sink = add nsw i32 %div, %add7
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add7.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,j, k,i,d;
scanf("%d%d",&a,&b);
if(a>=500)
{
d=a%500;
if(d<=b)
{
printf("Yes");
}
else
{
printf("No");
}
}
else if(a<500)
{
if(b>=a){
printf("Yes");
}
else
{
printf("No");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204973/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204973/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 499
br i1 %cmp, label %if.then, label %if.then7
if.then: ; preds = %entry
%rem = urem i32 %0, 500
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %rem, %1
br label %if.end15
if.then7: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp8.not = icmp slt i32 %2, %0
br label %if.end15
if.end15: ; preds = %if.then7, %if.then
%cmp8.not.sink = phi i1 [ %cmp8.not, %if.then7 ], [ %cmp1.not, %if.then ]
%.str.2..str.116 = select i1 %cmp8.not.sink, ptr @.str.2, ptr @.str.1
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.116)
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 N,A,S;
scanf("%d",&N);
scanf("%d",&A);
S=N%500;
if(S<=A){
printf("Yes");
}
else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205015/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205015/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,a;
scanf("%d", &n);
scanf("%d", &a);
if(a >= n%500){
printf("Yes");
}else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205059/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205059/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %1, 500
%cmp.not = icmp slt i32 %0, %rem
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int pay, coin, divide, rest, oneyens;
scanf("%d %d", &pay, &coin);
divide=pay/500; //N円を500で割った商。500円玉を使った枚数。
rest=pay-500*divide; //500円玉で払った後の残額。1円玉で払う分。
oneyens=rest-coin; //1円玉を数えるのは面倒なので全部出しちゃった。正の値なら払いきれないぞ
if(rest==0)
printf("Yes"); //おつりがゼロ円。ちょうどだったぜ
else if(oneyens>0)
printf("No"); //正の値。払いきれなかった
else
printf("Yes"); //負の値。おつりがきたぜ。次からはちゃんと数えて出すぞ。
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205101/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205101/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"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:
%pay = alloca i32, align 4
%coin = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pay) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %coin) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pay, ptr noundef nonnull %coin)
%0 = load i32, ptr %pay, align 4, !tbaa !5
%.fr = freeze i32 %0
%1 = srem i32 %.fr, 500
%cmp = icmp eq i32 %1, 0
%2 = load i32, ptr %coin, align 4
%cmp3 = icmp sgt i32 %1, %2
%.str.2..str.1 = select i1 %cmp3, ptr @.str.2, ptr @.str.1
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %coin) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pay) #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,a;
scanf("%d %d",&n,&a);
if(a>=n%500)
printf("Yes\n");
else
printf("No\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205145/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205145/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %1, 500
%cmp.not = icmp slt i32 %0, %rem
%str.str.3 = select i1 %cmp.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 %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: 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,x,y,z;
scanf("%d %d",&n,&a);
x=n%500;
y=x-a;
z=n-a;
if(y<=0 || z<=0){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sle i32 %rem, %1
%cmp2 = icmp sle i32 %0, %1
%or.cond = or i1 %cmp, %cmp2
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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,n;
while(~scanf("%d %d",&a,&n))
{
if(a<500)
{
if(n>=a)
printf("Yes\n");
else
printf("No\n");
}
else if(a>=500)
{
while(a>=500)
{
a-=500;
}
if(n>=a)
printf("Yes\n");
else
printf("No\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205231/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205231/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %n)
%tobool.not25 = icmp eq i32 %call24, -1
br i1 %tobool.not25, label %while.end19, label %while.body
while.body: ; preds = %entry, %if.end18
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 500
br i1 %cmp, label %if.then, label %while.body10.preheader
while.body10.preheader: ; preds = %while.body
%1 = add nuw i32 %0, 499
%smin = call i32 @llvm.smin.i32(i32 %0, i32 999)
%2 = sub nuw i32 %1, %smin
%.fr = freeze i32 %2
%3 = urem i32 %.fr, 500
%.neg = sub i32 %3, %.fr
%4 = add nsw i32 %0, -500
%5 = add i32 %.neg, %4
store i32 %5, ptr %a, align 4, !tbaa !5
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp11.not = icmp slt i32 %6, %5
%str.str.3 = select i1 %cmp11.not, ptr @str.4, ptr @str.5
br label %if.end18
if.then: ; preds = %while.body
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %7, %0
%str.4.str.5 = select i1 %cmp1.not, ptr @str.4, ptr @str.5
br label %if.end18
if.end18: ; preds = %if.then, %while.body10.preheader
%str.sink = phi ptr [ %str.str.3, %while.body10.preheader ], [ %str.4.str.5, %if.then ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %n)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end19, label %while.body, !llvm.loop !9
while.end19: ; preds = %if.end18, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
double din(void){
double i;scanf("%lf",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void dprint(double a){
printf("%.10f\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
long long llabs(long long a){
return a>0?a:-a;
}
double dmax(double a,double b){
return a>b?a:b;
}
int cmp(const void *a,const void *b){
return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
long long gcd(long long x,long long y){
return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
return x/gcd(x,y)*y;
}
int main(void){
int n=in(),a=in();
puts(n%500<=a?"Yes":"No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205275/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205275/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.8 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.9 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
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 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
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 @llabs(i64 noundef %a) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12
ret i32 %call
}
; 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 #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #9 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse ]
%y.tr = phi i64 [ %y, %entry ], [ %rem, %tailrecurse ]
%rem = srem i64 %x.tr, %y.tr
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i64 %y.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %x, i64 noundef %y) local_unnamed_addr #9 {
entry:
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%x.tr.i = phi i64 [ %x, %entry ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i = phi i64 [ %y, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i64 %x.tr.i, %y.tr.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%div = sdiv i64 %x, %y.tr.i
%mul = mul nsw i64 %div, %y
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i3 = alloca i32, align 4
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #11
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i3) #11
%call.i4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i3)
%1 = load i32, ptr %i.i3, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i3) #11
%rem = srem i32 %0, 500
%cmp.not = icmp sgt i32 %rem, %1
%cond = select i1 %cmp.not, ptr @.str.9, ptr @.str.8
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #10
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
|
#include<stdio.h>
int main()
{
int n, a;
scanf("%d%d", &n, &a);
if (n % 500 <= a)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205325/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205325/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%str.str.3 = select i1 %cmp.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 %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: 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 nn;
scanf("%d",&nn);
char a[300];
int jdl=0; // judge number left
int jdr=0; // judge number right
scanf("%s",a);
int i;
for(i=0;i<nn;i++){
if(a[i]=='(')
jdr++;
else if(jdr>0)
jdr--;
else
jdl++;
}
for(i=nn-1;i>=0;i--){
a[i+jdl]=a[i];
}
for(i=0;i<jdl;i++){
a[i]='(';
}
for(i=0;i<jdr;i++){
a[i+nn+jdl]=')';
}
a[nn+jdl+jdr]='\0';
printf("%s\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205376/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205376/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%nn = alloca i32, align 4
%a = alloca [300 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nn) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nn)
call void @llvm.lifetime.start.p0(i64 300, ptr nonnull %a) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%0 = load i32, ptr %nn, align 4, !tbaa !5
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond31.preheader.for.end41_crit_edge
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.cond11.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond11.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%jdl.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %jdl.1.1, %for.inc.1 ]
%jdr.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %jdr.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%jdr.070.unr = phi i32 [ 0, %for.body.preheader ], [ %jdr.1.1, %for.inc.1 ]
%jdl.069.unr = phi i32 [ 0, %for.body.preheader ], [ %jdl.1.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond11.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp2.epil = icmp eq i8 %2, 40
br i1 %cmp2.epil, label %if.then.epil, label %if.else.epil
if.else.epil: ; preds = %for.body.epil
%cmp4.epil = icmp sgt i32 %jdr.070.unr, 0
br i1 %cmp4.epil, label %if.then6.epil, label %if.else7.epil
if.else7.epil: ; preds = %if.else.epil
%inc8.epil = add nsw i32 %jdl.069.unr, 1
br label %for.cond11.preheader
if.then6.epil: ; preds = %if.else.epil
%dec.epil = add nsw i32 %jdr.070.unr, -1
br label %for.cond11.preheader
if.then.epil: ; preds = %for.body.epil
%inc.epil = add nsw i32 %jdr.070.unr, 1
br label %for.cond11.preheader
for.cond11.preheader: ; preds = %if.else7.epil, %if.then6.epil, %if.then.epil, %for.cond11.preheader.unr-lcssa
%jdl.1.lcssa = phi i32 [ %jdl.1.lcssa.ph, %for.cond11.preheader.unr-lcssa ], [ %jdl.069.unr, %if.then.epil ], [ %jdl.069.unr, %if.then6.epil ], [ %inc8.epil, %if.else7.epil ]
%jdr.1.lcssa = phi i32 [ %jdr.1.lcssa.ph, %for.cond11.preheader.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %dec.epil, %if.then6.epil ], [ %jdr.070.unr, %if.else7.epil ]
br i1 %cmp68, label %iter.check, label %for.cond22.preheader
iter.check: ; preds = %for.cond11.preheader
%3 = zext i32 %0 to i64
%4 = sext i32 %jdl.1.lcssa to i64
%min.iters.check = icmp ult i32 %0, 4
br i1 %min.iters.check, label %for.body14.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%5 = add nsw i64 %wide.trip.count, -1
%scevgep = getelementptr i8, ptr %a, i64 %5
%scevgep108 = getelementptr i8, ptr %scevgep, i64 %4
%6 = sub nsw i64 1, %wide.trip.count
%7 = getelementptr i8, ptr %scevgep108, i64 %6
%8 = icmp ugt ptr %7, %scevgep108
%scevgep109 = getelementptr i8, ptr %a, i64 %5
%9 = icmp ugt ptr %a, %scevgep109
%10 = or i1 %8, %9
%11 = add nsw i64 %4, 15
%diff.check = icmp ult i64 %11, 16
%or.cond = select i1 %10, i1 true, i1 %diff.check
br i1 %or.cond, label %for.body14.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.scevcheck
%min.iters.check114 = icmp ult i32 %0, 16
br i1 %min.iters.check114, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count, 4294967280
%invariant.gep = getelementptr i8, ptr %a, i64 -15
%invariant.gep160 = getelementptr i8, ptr %a, i64 -15
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%12 = xor i64 %index, -1
%13 = add i64 %12, %3
%gep = getelementptr [300 x i8], ptr %invariant.gep, i64 0, i64 %13
%wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !9
%14 = add nsw i64 %13, %4
%gep161 = getelementptr [300 x i8], ptr %invariant.gep160, i64 0, i64 %14
store <16 x i8> %wide.load, ptr %gep161, align 1, !tbaa !9
%index.next = add nuw i64 %index, 16
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond22.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%ind.end118 = sub nsw i64 %3, %n.vec
%n.vec.remaining = and i64 %wide.trip.count, 12
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body14.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec117 = and i64 %wide.trip.count, 4294967292
%ind.end = sub nsw i64 %3, %n.vec117
%invariant.gep162 = getelementptr i8, ptr %a, i64 -3
%invariant.gep164 = getelementptr i8, ptr %a, i64 -3
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index120 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next125, %vec.epilog.vector.body ]
%16 = xor i64 %index120, -1
%17 = add i64 %16, %3
%gep163 = getelementptr [300 x i8], ptr %invariant.gep162, i64 0, i64 %17
%wide.load122 = load <4 x i8>, ptr %gep163, align 1, !tbaa !9
%18 = add nsw i64 %17, %4
%gep165 = getelementptr [300 x i8], ptr %invariant.gep164, i64 0, i64 %18
store <4 x i8> %wide.load122, ptr %gep165, align 1, !tbaa !9
%index.next125 = add nuw i64 %index120, 4
%19 = icmp eq i64 %index.next125, %n.vec117
br i1 %19, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n119 = icmp eq i64 %n.vec117, %wide.trip.count
br i1 %cmp.n119, label %for.cond22.preheader, label %for.body14.preheader
for.body14.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv81.ph = phi i64 [ %3, %iter.check ], [ %3, %vector.scevcheck ], [ %ind.end118, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body14
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%jdr.070 = phi i32 [ 0, %for.body.preheader.new ], [ %jdr.1.1, %for.inc.1 ]
%jdl.069 = phi i32 [ 0, %for.body.preheader.new ], [ %jdl.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %indvars.iv
%20 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp2 = icmp eq i8 %20, 40
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %jdr.070, 1
br label %for.inc
if.else: ; preds = %for.body
%cmp4 = icmp sgt i32 %jdr.070, 0
br i1 %cmp4, label %if.then6, label %if.else7
if.then6: ; preds = %if.else
%dec = add nsw i32 %jdr.070, -1
br label %for.inc
if.else7: ; preds = %if.else
%inc8 = add nsw i32 %jdl.069, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else7, %if.then6
%jdl.1 = phi i32 [ %jdl.069, %if.then ], [ %jdl.069, %if.then6 ], [ %inc8, %if.else7 ]
%jdr.1 = phi i32 [ %inc, %if.then ], [ %dec, %if.then6 ], [ %jdr.070, %if.else7 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %indvars.iv.next
%21 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp2.1 = icmp eq i8 %21, 40
br i1 %cmp2.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%cmp4.1 = icmp sgt i32 %jdr.1, 0
br i1 %cmp4.1, label %if.then6.1, label %if.else7.1
if.else7.1: ; preds = %if.else.1
%inc8.1 = add nsw i32 %jdl.1, 1
br label %for.inc.1
if.then6.1: ; preds = %if.else.1
%dec.1 = add nsw i32 %jdr.1, -1
br label %for.inc.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %jdr.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.then6.1, %if.else7.1
%jdl.1.1 = phi i32 [ %jdl.1, %if.then.1 ], [ %jdl.1, %if.then6.1 ], [ %inc8.1, %if.else7.1 ]
%jdr.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %dec.1, %if.then6.1 ], [ %jdr.1, %if.else7.1 ]
%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.cond11.preheader.unr-lcssa, label %for.body, !llvm.loop !15
for.cond22.preheader: ; preds = %for.body14, %middle.block, %vec.epilog.middle.block, %for.cond11.preheader
%cmp2376 = icmp sgt i32 %jdl.1.lcssa, 0
br i1 %cmp2376, label %for.body25.preheader, label %for.cond31.preheader
for.body25.preheader: ; preds = %for.cond22.preheader
%22 = zext i32 %jdl.1.lcssa to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 %a, i8 40, i64 %22, i1 false), !tbaa !9
br label %for.cond31.preheader
for.body14: ; preds = %for.body14.preheader, %for.body14
%indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body14 ], [ %indvars.iv81.ph, %for.body14.preheader ]
%indvars.iv.next82 = add nsw i64 %indvars.iv81, -1
%arrayidx16 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %indvars.iv.next82
%23 = load i8, ptr %arrayidx16, align 1, !tbaa !9
%24 = add nsw i64 %indvars.iv.next82, %4
%arrayidx18 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %24
store i8 %23, ptr %arrayidx18, align 1, !tbaa !9
%cmp12 = icmp ugt i64 %indvars.iv81, 1
br i1 %cmp12, label %for.body14, label %for.cond22.preheader, !llvm.loop !16
for.cond31.preheader: ; preds = %for.body25.preheader, %for.cond22.preheader
%cmp3278 = icmp sgt i32 %jdr.1.lcssa, 0
br i1 %cmp3278, label %iter.check130, label %for.cond31.preheader.for.end41_crit_edge
for.cond31.preheader.for.end41_crit_edge: ; preds = %entry, %for.cond31.preheader
%jdr.0.lcssa96100107 = phi i32 [ %jdr.1.lcssa, %for.cond31.preheader ], [ 0, %entry ]
%jdl.0.lcssa95101105 = phi i32 [ %jdl.1.lcssa, %for.cond31.preheader ], [ 0, %entry ]
%.pre = add nsw i32 %0, %jdl.0.lcssa95101105
br label %for.end41
iter.check130: ; preds = %for.cond31.preheader
%add35 = add i32 %0, %jdl.1.lcssa
%wide.trip.count91 = zext i32 %jdr.1.lcssa to i64
%min.iters.check128 = icmp ult i32 %jdr.1.lcssa, 8
br i1 %min.iters.check128, label %for.body34.preheader, label %vector.scevcheck126
vector.scevcheck126: ; preds = %iter.check130
%25 = add nsw i64 %wide.trip.count91, -1
%26 = add i32 %0, %jdl.1.lcssa
%27 = trunc i64 %25 to i32
%28 = add i32 %26, %27
%29 = icmp slt i32 %28, %26
%30 = icmp ugt i64 %25, 4294967295
%31 = or i1 %29, %30
br i1 %31, label %for.body34.preheader, label %vector.main.loop.iter.check132
vector.main.loop.iter.check132: ; preds = %vector.scevcheck126
%min.iters.check131 = icmp ult i32 %jdr.1.lcssa, 32
br i1 %min.iters.check131, label %vec.epilog.ph144, label %vector.ph133
vector.ph133: ; preds = %vector.main.loop.iter.check132
%n.vec135 = and i64 %wide.trip.count91, 4294967264
br label %vector.body137
vector.body137: ; preds = %vector.body137, %vector.ph133
%offset.idx139 = phi i64 [ 0, %vector.ph133 ], [ %index.next140, %vector.body137 ]
%32 = trunc i64 %offset.idx139 to i32
%33 = add i32 %add35, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %34
store <16 x i8> <i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41>, ptr %35, align 1, !tbaa !9
%36 = getelementptr inbounds i8, ptr %35, i64 16
store <16 x i8> <i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41>, ptr %36, align 1, !tbaa !9
%index.next140 = add nuw i64 %offset.idx139, 32
%37 = icmp eq i64 %index.next140, %n.vec135
br i1 %37, label %middle.block127, label %vector.body137, !llvm.loop !17
middle.block127: ; preds = %vector.body137
%cmp.n136 = icmp eq i64 %n.vec135, %wide.trip.count91
br i1 %cmp.n136, label %for.end41, label %vec.epilog.iter.check143
vec.epilog.iter.check143: ; preds = %middle.block127
%n.vec.remaining145 = and i64 %wide.trip.count91, 24
%min.epilog.iters.check146 = icmp eq i64 %n.vec.remaining145, 0
br i1 %min.epilog.iters.check146, label %for.body34.preheader, label %vec.epilog.ph144
vec.epilog.ph144: ; preds = %vector.main.loop.iter.check132, %vec.epilog.iter.check143
%vec.epilog.resume.val147 = phi i64 [ %n.vec135, %vec.epilog.iter.check143 ], [ 0, %vector.main.loop.iter.check132 ]
%n.vec149 = and i64 %wide.trip.count91, 4294967288
br label %vec.epilog.vector.body152
vec.epilog.vector.body152: ; preds = %vec.epilog.vector.body152, %vec.epilog.ph144
%offset.idx154 = phi i64 [ %vec.epilog.resume.val147, %vec.epilog.ph144 ], [ %index.next155, %vec.epilog.vector.body152 ]
%38 = trunc i64 %offset.idx154 to i32
%39 = add i32 %add35, %38
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %40
store <8 x i8> <i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41, i8 41>, ptr %41, align 1, !tbaa !9
%index.next155 = add nuw i64 %offset.idx154, 8
%42 = icmp eq i64 %index.next155, %n.vec149
br i1 %42, label %vec.epilog.middle.block141, label %vec.epilog.vector.body152, !llvm.loop !18
vec.epilog.middle.block141: ; preds = %vec.epilog.vector.body152
%cmp.n151 = icmp eq i64 %n.vec149, %wide.trip.count91
br i1 %cmp.n151, label %for.end41, label %for.body34.preheader
for.body34.preheader: ; preds = %vector.scevcheck126, %iter.check130, %vec.epilog.iter.check143, %vec.epilog.middle.block141
%indvars.iv88.ph = phi i64 [ 0, %iter.check130 ], [ 0, %vector.scevcheck126 ], [ %n.vec135, %vec.epilog.iter.check143 ], [ %n.vec149, %vec.epilog.middle.block141 ]
%43 = xor i64 %indvars.iv88.ph, -1
%44 = add nsw i64 %43, %wide.trip.count91
%xtraiter158 = and i64 %wide.trip.count91, 3
%lcmp.mod159.not = icmp eq i64 %xtraiter158, 0
br i1 %lcmp.mod159.not, label %for.body34.prol.loopexit, label %for.body34.prol
for.body34.prol: ; preds = %for.body34.preheader, %for.body34.prol
%indvars.iv88.prol = phi i64 [ %indvars.iv.next89.prol, %for.body34.prol ], [ %indvars.iv88.ph, %for.body34.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body34.prol ], [ 0, %for.body34.preheader ]
%45 = trunc i64 %indvars.iv88.prol to i32
%add36.prol = add i32 %add35, %45
%idxprom37.prol = sext i32 %add36.prol to i64
%arrayidx38.prol = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom37.prol
store i8 41, ptr %arrayidx38.prol, align 1, !tbaa !9
%indvars.iv.next89.prol = add nuw nsw i64 %indvars.iv88.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter158
br i1 %prol.iter.cmp.not, label %for.body34.prol.loopexit, label %for.body34.prol, !llvm.loop !19
for.body34.prol.loopexit: ; preds = %for.body34.prol, %for.body34.preheader
%indvars.iv88.unr = phi i64 [ %indvars.iv88.ph, %for.body34.preheader ], [ %indvars.iv.next89.prol, %for.body34.prol ]
%46 = icmp ult i64 %44, 3
br i1 %46, label %for.end41, label %for.body34
for.body34: ; preds = %for.body34.prol.loopexit, %for.body34
%indvars.iv88 = phi i64 [ %indvars.iv.next89.3, %for.body34 ], [ %indvars.iv88.unr, %for.body34.prol.loopexit ]
%47 = trunc i64 %indvars.iv88 to i32
%add36 = add i32 %add35, %47
%idxprom37 = sext i32 %add36 to i64
%arrayidx38 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom37
store i8 41, ptr %arrayidx38, align 1, !tbaa !9
%48 = trunc i64 %indvars.iv88 to i32
%49 = add i32 %48, 1
%add36.1 = add i32 %add35, %49
%idxprom37.1 = sext i32 %add36.1 to i64
%arrayidx38.1 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom37.1
store i8 41, ptr %arrayidx38.1, align 1, !tbaa !9
%50 = trunc i64 %indvars.iv88 to i32
%51 = add i32 %50, 2
%add36.2 = add i32 %add35, %51
%idxprom37.2 = sext i32 %add36.2 to i64
%arrayidx38.2 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom37.2
store i8 41, ptr %arrayidx38.2, align 1, !tbaa !9
%52 = trunc i64 %indvars.iv88 to i32
%53 = add i32 %52, 3
%add36.3 = add i32 %add35, %53
%idxprom37.3 = sext i32 %add36.3 to i64
%arrayidx38.3 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom37.3
store i8 41, ptr %arrayidx38.3, align 1, !tbaa !9
%indvars.iv.next89.3 = add nuw nsw i64 %indvars.iv88, 4
%exitcond92.not.3 = icmp eq i64 %indvars.iv.next89.3, %wide.trip.count91
br i1 %exitcond92.not.3, label %for.end41, label %for.body34, !llvm.loop !21
for.end41: ; preds = %for.body34.prol.loopexit, %for.body34, %middle.block127, %vec.epilog.middle.block141, %for.cond31.preheader.for.end41_crit_edge
%jdr.0.lcssa96100106 = phi i32 [ %jdr.0.lcssa96100107, %for.cond31.preheader.for.end41_crit_edge ], [ %jdr.1.lcssa, %vec.epilog.middle.block141 ], [ %jdr.1.lcssa, %middle.block127 ], [ %jdr.1.lcssa, %for.body34 ], [ %jdr.1.lcssa, %for.body34.prol.loopexit ]
%add42.pre-phi = phi i32 [ %.pre, %for.cond31.preheader.for.end41_crit_edge ], [ %add35, %vec.epilog.middle.block141 ], [ %add35, %middle.block127 ], [ %add35, %for.body34 ], [ %add35, %for.body34.prol.loopexit ]
%add43 = add nsw i32 %add42.pre-phi, %jdr.0.lcssa96100106
%idxprom44 = sext i32 %add43 to i64
%arrayidx45 = getelementptr inbounds [300 x i8], ptr %a, i64 0, i64 %idxprom44
store i8 0, ptr %arrayidx45, align 1, !tbaa !9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %a)
call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nn) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11, !12}
!17 = distinct !{!17, !11, !12, !13}
!18 = distinct !{!18, !11, !12, !13}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !11, !12}
|
#include <stdio.h>
#include <string.h>
int main(void){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a==b&&b==c){printf("Yes\n");}
else {printf("No\n");}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205426/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205426/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %1, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 n;
double a[110],b,max=-1.0,need=0.0;
int main()
{
int i;
scanf("%d %lf",&n,&b);
for (i=0;i<n;i++)
{
scanf("%lf",a+i);
if (a[i]>max) { max=a[i]; }
}
for (i=0;i<n;i++) { need+=max-a[i]; }
if (need>b)
{
printf("-1\n");
}
else
{
for (i=0;i<n;i++)
{
printf("%.8f\n",max-a[i]+(b-need)/(double)n);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@max = dso_local local_unnamed_addr global double -1.000000e+00, align 8
@need = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@.str = private unnamed_addr constant [7 x i8] c"%d %lf\00", align 1
@n = dso_local global i32 0, align 4
@b = dso_local global double 0.000000e+00, align 8
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@a = dso_local global [110 x double] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [6 x i8] c"%.8f\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @b)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.body, label %for.cond5.preheader.for.end12_crit_edge
for.cond5.preheader: ; preds = %for.inc
%cmp643 = icmp sgt i32 %6, 0
br i1 %cmp643, label %for.body7.lr.ph, label %for.cond5.preheader.for.end12_crit_edge
for.cond5.preheader.for.end12_crit_edge: ; preds = %entry, %for.cond5.preheader
%1 = phi i32 [ %6, %for.cond5.preheader ], [ %0, %entry ]
%.pre = load double, ptr @need, align 8, !tbaa !9
br label %for.end12
for.body7.lr.ph: ; preds = %for.cond5.preheader
%need.promoted = load double, ptr @need, align 8, !tbaa !9
%2 = load double, ptr @max, align 8, !tbaa !9
%wide.trip.count = zext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count, 3
%3 = icmp ult i32 %6, 4
br i1 %3, label %for.cond5.for.end12_crit_edge.unr-lcssa, label %for.body7.lr.ph.new
for.body7.lr.ph.new: ; preds = %for.body7.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body7
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%add.ptr = getelementptr inbounds double, ptr @a, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%4 = load double, ptr %add.ptr, align 8, !tbaa !9
%5 = load double, ptr @max, align 8, !tbaa !9
%cmp2 = fcmp ogt double %4, %5
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
store double %4, ptr @max, align 8, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr @n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !11
for.body7: ; preds = %for.body7, %for.body7.lr.ph.new
%indvars.iv50 = phi i64 [ 0, %for.body7.lr.ph.new ], [ %indvars.iv.next51.3, %for.body7 ]
%add4244 = phi double [ %need.promoted, %for.body7.lr.ph.new ], [ %add.3, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.lr.ph.new ], [ %niter.next.3, %for.body7 ]
%arrayidx9 = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv50
%8 = load double, ptr %arrayidx9, align 16, !tbaa !9
%sub = fsub double %2, %8
%add = fadd double %add4244, %sub
%indvars.iv.next51 = or i64 %indvars.iv50, 1
%arrayidx9.1 = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv.next51
%9 = load double, ptr %arrayidx9.1, align 8, !tbaa !9
%sub.1 = fsub double %2, %9
%add.1 = fadd double %add, %sub.1
%indvars.iv.next51.1 = or i64 %indvars.iv50, 2
%arrayidx9.2 = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv.next51.1
%10 = load double, ptr %arrayidx9.2, align 16, !tbaa !9
%sub.2 = fsub double %2, %10
%add.2 = fadd double %add.1, %sub.2
%indvars.iv.next51.2 = or i64 %indvars.iv50, 3
%arrayidx9.3 = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv.next51.2
%11 = load double, ptr %arrayidx9.3, align 8, !tbaa !9
%sub.3 = fsub double %2, %11
%add.3 = fadd double %add.2, %sub.3
%indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 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.cond5.for.end12_crit_edge.unr-lcssa, label %for.body7, !llvm.loop !13
for.cond5.for.end12_crit_edge.unr-lcssa: ; preds = %for.body7, %for.body7.lr.ph
%add.lcssa.ph = phi double [ undef, %for.body7.lr.ph ], [ %add.3, %for.body7 ]
%indvars.iv50.unr = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next51.3, %for.body7 ]
%add4244.unr = phi double [ %need.promoted, %for.body7.lr.ph ], [ %add.3, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond5.for.end12_crit_edge, label %for.body7.epil
for.body7.epil: ; preds = %for.cond5.for.end12_crit_edge.unr-lcssa, %for.body7.epil
%indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %for.body7.epil ], [ %indvars.iv50.unr, %for.cond5.for.end12_crit_edge.unr-lcssa ]
%add4244.epil = phi double [ %add.epil, %for.body7.epil ], [ %add4244.unr, %for.cond5.for.end12_crit_edge.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.cond5.for.end12_crit_edge.unr-lcssa ]
%arrayidx9.epil = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv50.epil
%12 = load double, ptr %arrayidx9.epil, align 8, !tbaa !9
%sub.epil = fsub double %2, %12
%add.epil = fadd double %add4244.epil, %sub.epil
%indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.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.cond5.for.end12_crit_edge, label %for.body7.epil, !llvm.loop !14
for.cond5.for.end12_crit_edge: ; preds = %for.body7.epil, %for.cond5.for.end12_crit_edge.unr-lcssa
%add.lcssa = phi double [ %add.lcssa.ph, %for.cond5.for.end12_crit_edge.unr-lcssa ], [ %add.epil, %for.body7.epil ]
store double %add.lcssa, ptr @need, align 8, !tbaa !9
br label %for.end12
for.end12: ; preds = %for.cond5.preheader.for.end12_crit_edge, %for.cond5.for.end12_crit_edge
%cmp64357 = phi i1 [ false, %for.cond5.preheader.for.end12_crit_edge ], [ %cmp643, %for.cond5.for.end12_crit_edge ]
%13 = phi i32 [ %1, %for.cond5.preheader.for.end12_crit_edge ], [ %6, %for.cond5.for.end12_crit_edge ]
%14 = phi double [ %.pre, %for.cond5.preheader.for.end12_crit_edge ], [ %add.lcssa, %for.cond5.for.end12_crit_edge ]
%15 = load double, ptr @b, align 8, !tbaa !9
%cmp13 = fcmp ogt double %14, %15
br i1 %cmp13, label %if.then14, label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.end12
br i1 %cmp64357, label %for.body18, label %if.end28
if.then14: ; preds = %for.end12
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end28
for.body18: ; preds = %for.cond16.preheader, %for.body18
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body18 ], [ 0, %for.cond16.preheader ]
%16 = phi i32 [ %21, %for.body18 ], [ %13, %for.cond16.preheader ]
%17 = load double, ptr @max, align 8, !tbaa !9
%arrayidx20 = getelementptr inbounds [110 x double], ptr @a, i64 0, i64 %indvars.iv53
%18 = load double, ptr %arrayidx20, align 8, !tbaa !9
%sub21 = fsub double %17, %18
%19 = load double, ptr @b, align 8, !tbaa !9
%20 = load double, ptr @need, align 8, !tbaa !9
%sub22 = fsub double %19, %20
%conv = sitofp i32 %16 to double
%div = fdiv double %sub22, %conv
%add23 = fadd double %sub21, %div
%call24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %add23)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%21 = load i32, ptr @n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp17 = icmp slt i64 %indvars.iv.next54, %22
br i1 %cmp17, label %for.body18, label %if.end28, !llvm.loop !16
if.end28: ; preds = %for.body18, %for.cond16.preheader, %if.then14
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
; 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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !12}
|
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
if(a==b&&b==c){
printf("Yes");
}else {
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp3 = icmp eq i32 %1, %2
%or.cond = select i1 %cmp, i1 %cmp3, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a==b&&a==c&&b==c){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205556/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %0, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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()
{
char string[11];
scanf("%s", string);
printf("2018");
for (int i = 4; string[i] != '\0'; i++)
{
printf("%c", string[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205606/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205606/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"2018\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%string = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %string) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %string)
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%arrayidx9 = getelementptr inbounds [11 x i8], ptr %string, i64 0, i64 4
%0 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp.not10 = icmp eq i8 %0, 0
br i1 %cmp.not10, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %string) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 4, %entry ]
%1 = phi i8 [ %2, %for.body ], [ %0, %entry ]
%conv = sext i8 %1 to i32
%putchar = call i32 @putchar(i32 %conv)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [11 x i8], ptr %string, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.