program sunuke

implicit none

integer::    n
integer::    x,y,z

read(*,*) n
x=int(n/100)
n=n-100*x
y=int(n/10)
z=n-10*y


if(x==1) then
  x=9
else if(x==9) then
  x=1
endif
if(y==1) then
  y=9
else if(y==9) then
  y=1
endif
if(z==1) then
  z=9
else if(z==9) then
  z=1
endif

n=100*x+10*y+z

write(*,*) n

end program sunuke

; 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.74211e57499645b43a438812f0d3be14 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5472/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.74211e57499645b43a438812f0d3be14, i32 8)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = sdiv i32 %5, 100
  %.neg = mul nsw i32 %6, -100
  %7 = add i32 %.neg, %5
  %8 = sdiv i32 %7, 10
  %.neg18 = mul nsw i32 %8, -10
  %9 = add i32 %.neg18, %7
  %.off = add i32 %5, -100
  %10 = icmp ult i32 %.off, 100
  %.off19 = add i32 %5, -900
  %11 = icmp ult i32 %.off19, 100
  %.op = mul nsw i32 %6, 100
  %12 = select i1 %11, i32 100, i32 %.op
  %.014 = select i1 %10, i32 900, i32 %12
  %.off20 = add i32 %7, -10
  %13 = icmp ult i32 %.off20, 10
  %.off21 = add i32 %7, -90
  %14 = icmp ult i32 %.off21, 10
  %.op22 = mul nsw i32 %8, 10
  %15 = select i1 %14, i32 10, i32 %.op22
  %.013 = select i1 %13, i32 90, i32 %15
  %16 = icmp eq i32 %9, 1
  %17 = icmp eq i32 %9, 9
  %spec.store.select2 = select i1 %17, i32 1, i32 %9
  %.0 = select i1 %16, i32 9, i32 %spec.store.select2
  %18 = add i32 %.013, %.014
  %19 = add i32 %18, %.0
  store i32 %19, ptr %1, align 4, !tbaa !3
  %20 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.74211e57499645b43a438812f0d3be14, i32 33)
  %21 = load i32, ptr %1, align 4, !tbaa !3
  %22 = call i1 @_FortranAioOutputInteger32(ptr %20, i32 %21)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %20)
  ret void
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) 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

!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 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
