program abc093c
  integer a(3), s
  read *, a
  s = sum(maxval(a)-a)
  print *, merge(s/2,s/2+2,mod(s,2)==0)
end program abc093c

; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.ebeb93e1a24f86ee1d9a0e5d2dc9362a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6115/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca [3 x i32], align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ebeb93e1a24f86ee1d9a0e5d2dc9362a, i32 3)
  store ptr %2, ptr %1, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 3, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %4 = call i1 @_FortranAioInputDescriptor(ptr %3, ptr nonnull %1)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i64, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %7 = icmp sgt i64 %6, 0
  br i1 %7, label %.lr.ph.i, label %_FortranAMaxvalInteger4x1_contract_simplified.exit

.lr.ph.i:                                         ; preds = %0
  %8 = load ptr, ptr %1, align 8, !tbaa !3
  %9 = load i64, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %xtraiter = and i64 %6, 3
  %10 = icmp ult i64 %6, 4
  br i1 %10, label %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa, label %.lr.ph.i.new

.lr.ph.i.new:                                     ; preds = %.lr.ph.i
  %unroll_iter = and i64 %6, -4
  br label %11

11:                                               ; preds = %11, %.lr.ph.i.new
  %12 = phi i32 [ -2147483648, %.lr.ph.i.new ], [ %32, %11 ]
  %13 = phi i64 [ 0, %.lr.ph.i.new ], [ %33, %11 ]
  %niter = phi i64 [ 0, %.lr.ph.i.new ], [ %niter.next.3, %11 ]
  %14 = mul i64 %13, %9
  %15 = getelementptr i8, ptr %8, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !7
  %17 = call i32 @llvm.smax.i32(i32 %16, i32 %12)
  %18 = or i64 %13, 1
  %19 = mul i64 %18, %9
  %20 = getelementptr i8, ptr %8, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !7
  %22 = call i32 @llvm.smax.i32(i32 %21, i32 %17)
  %23 = or i64 %13, 2
  %24 = mul i64 %23, %9
  %25 = getelementptr i8, ptr %8, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %27 = call i32 @llvm.smax.i32(i32 %26, i32 %22)
  %28 = or i64 %13, 3
  %29 = mul i64 %28, %9
  %30 = getelementptr i8, ptr %8, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !7
  %32 = call i32 @llvm.smax.i32(i32 %31, i32 %27)
  %33 = add nuw nsw i64 %13, 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 %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa, label %11

_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa: ; preds = %11, %.lr.ph.i
  %.lcssa.ph = phi i32 [ undef, %.lr.ph.i ], [ %32, %11 ]
  %.unr = phi i32 [ -2147483648, %.lr.ph.i ], [ %32, %11 ]
  %.unr26 = phi i64 [ 0, %.lr.ph.i ], [ %33, %11 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.epil.preheader

.epil.preheader:                                  ; preds = %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa, %.epil.preheader
  %34 = phi i32 [ %39, %.epil.preheader ], [ %.unr, %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa ]
  %35 = phi i64 [ %40, %.epil.preheader ], [ %.unr26, %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa ]
  %36 = mul i64 %35, %9
  %37 = getelementptr i8, ptr %8, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !7
  %39 = call i32 @llvm.smax.i32(i32 %38, i32 %34)
  %40 = add nuw nsw i64 %35, 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 %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.epil.preheader, !llvm.loop !9

_FortranAMaxvalInteger4x1_contract_simplified.exit: ; preds = %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa, %.epil.preheader, %0
  %.lcssa.i = phi i32 [ -2147483648, %0 ], [ %.lcssa.ph, %_FortranAMaxvalInteger4x1_contract_simplified.exit.loopexit.unr-lcssa ], [ %39, %.epil.preheader ]
  %41 = load i32, ptr %2, align 4, !tbaa !7
  %42 = sub i32 %.lcssa.i, %41
  %43 = getelementptr inbounds i32, ptr %2, i64 1
  %44 = load i32, ptr %43, align 4, !tbaa !7
  %45 = sub i32 %.lcssa.i, %44
  %46 = getelementptr inbounds i32, ptr %2, i64 2
  %47 = load i32, ptr %46, align 4, !tbaa !7
  %48 = sub i32 %.lcssa.i, %47
  %49 = add i32 %45, %42
  %50 = add i32 %48, %49
  %51 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ebeb93e1a24f86ee1d9a0e5d2dc9362a, i32 5)
  %52 = sdiv i32 %50, 2
  %53 = add nsw i32 %52, 2
  %54 = and i32 %50, 1
  %55 = icmp eq i32 %54, 0
  %56 = select i1 %55, i32 %52, i32 %53
  %57 = call i1 @_FortranAioOutputInteger32(ptr %51, i32 %56)
  %58 = call i32 @_FortranAioEndIoStatement(ptr %51)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #0

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
