#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ boundary_conditions(int *, int *);
int /*<<< orphan*/ frame_xterm(int *);
int /*<<< orphan*/ initialize_cold(int *);
int /*<<< orphan*/ mcmove(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int);
float ran3(long *);
main() {
  int itime;
  int height[100];
  int nbr1[100];
  int nbr2[100];
  long int iseed;
  float junk;
  iseed = -12888333;
  junk = ran3(&iseed);
  boundary_conditions(nbr1, nbr2);
  initialize_cold(height);
  itime = 0;
  printf("initiate with i= %d \n", itime);
  frame_xterm(height);
  for (itime = 1; itime < 300; itime++) {
    mcmove(height, nbr1, nbr2);
    printf("i=%d \n", itime);
    frame_xterm(height);
  }
  itime = 300;
  mcmove(height, nbr1, nbr2);
  printf("end with i=%d \n", itime);
  frame_xterm(height);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffff3b56f3,-0x4c8(%rbp)
f3 56 3b ff
lea    -0x4c8(%rbp),%rdi
call   1070 <ran3@plt>
movss  %xmm0,-0x4cc(%rbp)
ff
lea    -0x330(%rbp),%rdi
lea    -0x4c0(%rbp),%rsi
call   1080 <boundary_conditions@plt>
lea    -0x1a0(%rbp),%rdi
call   1050 <initialize_cold@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe3f(%rip),%rdi
call   1060 <printf@plt>
lea    -0x1a0(%rbp),%rdi
call   1040 <frame_xterm@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x12c,-0x8(%rbp)
jge    1229 <main+0xc9>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
lea    -0x4c0(%rbp),%rdx
call   1030 <mcmove@plt>
mov    -0x8(%rbp),%esi
lea    0xe15(%rip),%rdi
call   1060 <printf@plt>
lea    -0x1a0(%rbp),%rdi
call   1040 <frame_xterm@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0x79>
movl   $0x12c,-0x8(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
lea    -0x4c0(%rbp),%rdx
call   1030 <mcmove@plt>
mov    -0x8(%rbp),%esi
lea    0xdc2(%rip),%rdi
call   1060 <printf@plt>
lea    -0x1a0(%rbp),%rdi
call   1040 <frame_xterm@plt>
mov    -0x4(%rbp),%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x4c0,%rsp
movq   $0xffffffffff3b56f3,0x8(%rsp)
3b ff
lea    0x8(%rsp),%rdi
call   1070 <ran3@plt>
lea    0x1a0(%rsp),%r14
lea    0x10(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <boundary_conditions@plt>
lea    0x330(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <initialize_cold@plt>
lea    0xe4f(%rip),%rdi
xor    %esi,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <frame_xterm@plt>
mov    $0x1,%ebp
lea    0xe53(%rip),%r12
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <mcmove@plt>
mov    %r12,%rdi
mov    %ebp,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <frame_xterm@plt>
add    $0x1,%ebp
cmp    $0x12c,%ebp
jne    11d0 <main+0x70>
lea    0x330(%rsp),%rbx
lea    0x1a0(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <mcmove@plt>
lea    0xdf7(%rip),%rdi
mov    $0x12c,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <frame_xterm@plt>
xor    %eax,%eax
add    $0x4c0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"initiate with i= %d \0A\00"
@.str.1 = [7 x i8] c"i=%d \0A\00"
@.str.2 = [16 x i8] c"end with i=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = alloca [100 x i32]
%6 = alloca i64
%7 = alloca float
store i32 0, i32* %1
store i64 -12888333, i64* %6
%8 = call float @ran3(i64* %6)
store float %8, float* %7
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%11 = call i32 @boundary_conditions(i32* %9, i32* %10)
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%13 = call i32 @initialize_cold(i32* %12)
store i32 0, i32* %2
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%17 = call i32 @frame_xterm(i32* %16)
store i32 1, i32* %2
br label %18
18: ; preds = %30, %0
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 300
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%25 = call i32 @mcmove(i32* %22, i32* %23, i32* %24)
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%29 = call i32 @frame_xterm(i32* %28)
br label %30
30: ; preds = %21
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %18
33: ; preds = %18
store i32 300, i32* %2
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%35 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%37 = call i32 @mcmove(i32* %34, i32* %35, i32* %36)
%38 = load i32, i32* %2
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%41 = call i32 @frame_xterm(i32* %40)
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [22 x i8] c"initiate with i= %d \0A\00"
@.str.1 = [7 x i8] c"i=%d \0A\00"
@.str.2 = [16 x i8] c"end with i=%d \0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca i64
%5 = bitcast [100 x i32]* %1 to i8*
%6 = bitcast [100 x i32]* %2 to i8*
%7 = bitcast [100 x i32]* %3 to i8*
%8 = bitcast i64* %4 to i8*
store i64 -12888333, i64* %4
%9 = call float @ran3(i64* %4)
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%12 = call i32 @boundary_conditions(i32* %10, i32* %11)
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%14 = call i32 @initialize_cold(i32* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0)
%16 = call i32 @frame_xterm(i32* %13)
br label %17
17: ; preds = %0, %17
%18 = phi i32 [ 1, %0 ], [ %22, %17 ]
%19 = call i32 @mcmove(i32* %13, i32* %10, i32* %11)
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%21 = call i32 @frame_xterm(i32* %13)
%22 = add nuw nsw i32 %18, 1
%23 = icmp eq i32 %22, 300
br i1 %23, label %24, label %17
24: ; preds = %17
%25 = call i32 @mcmove(i32* %13, i32* %10, i32* %11)
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 300)
%27 = call i32 @frame_xterm(i32* %13)
ret i32 0
}