#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*/ GMRM_init();
int /*<<< orphan*/ GMRM_tick_all();
int /*<<< orphan*/ PLYRDB_save_to_disk();
int /*<<< orphan*/ PLYRMNGR_init();
int /*<<< orphan*/ PLYRMNGR_tick();
int /*<<< orphan*/ SERVER_init();
int /*<<< orphan*/ usleep(int);
int main(void) {
  int save_stats_clock = 0;
  if (!SERVER_init())
    return 1;
  PLYRMNGR_init();
  GMRM_init();
  while (~0) {
    save_stats_clock++;
    if (save_stats_clock >= 120) {
      save_stats_clock = 0;
      PLYRDB_save_to_disk();
    }
    PLYRMNGR_tick();
    GMRM_tick_all();
    usleep(250000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <SERVER_init@plt>
cmp    $0x0,%eax
jne    11a1 <main+0x31>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1050 <PLYRMNGR_init@plt>
mov    $0x0,%al
call   1030 <GMRM_init@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x78,-0x8(%rbp)
jl     11d0 <main+0x60>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1080 <PLYRDB_save_to_disk@plt>
mov    $0x0,%al
call   1040 <PLYRMNGR_tick@plt>
mov    $0x0,%al
call   1070 <GMRM_tick_all@plt>
mov    $0x3d090,%edi
call   1090 <usleep@plt>
jmp    11af <main+0x3f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <SERVER_init@plt>
test   %eax,%eax
je     11bb <main+0x4b>
xor    %eax,%eax
call   1050 <PLYRMNGR_init@plt>
xor    %eax,%eax
call   1030 <GMRM_init@plt>
xor    %ebx,%ebx
jmp    11b1 <main+0x41>
xchg   %ax,%ax
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <PLYRDB_save_to_disk@plt>
xor    %eax,%eax
call   1040 <PLYRMNGR_tick@plt>
xor    %eax,%eax
call   1070 <GMRM_tick_all@plt>
mov    $0x3d090,%edi
call   1090 <usleep@plt>
cmp    $0x77,%ebx
jge    1190 <main+0x20>
add    $0x1,%ebx
jmp    1199 <main+0x29>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @SERVER_init()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
ret i32 1
6: ; preds = %0
%7 = call i32 (...) @PLYRMNGR_init()
%8 = call i32 (...) @GMRM_init()
br label %9
9: ; preds = %6, %16
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 120
br i1 %13, label %14, label %16
14: ; preds = %9
store i32 0, i32* %2
%15 = call i32 (...) @PLYRDB_save_to_disk()
br label %16
16: ; preds = %14, %9
%17 = call i32 (...) @PLYRMNGR_tick()
%18 = call i32 (...) @GMRM_tick_all()
%19 = call i32 @usleep(i32 250000)
br label %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SERVER_init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
ret i32 1
4: ; preds = %0
%5 = tail call i32 (...) @PLYRMNGR_init()
%6 = tail call i32 (...) @GMRM_init()
br label %7
7: ; preds = %13, %4
%8 = phi i32 [ 0, %4 ], [ %14, %13 ]
%9 = add nsw i32 %8, 1
%10 = icmp sgt i32 %8, 118
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 (...) @PLYRDB_save_to_disk()
br label %13
13: ; preds = %11, %7
%14 = phi i32 [ 0, %11 ], [ %9, %7 ]
%15 = tail call i32 (...) @PLYRMNGR_tick()
%16 = tail call i32 (...) @GMRM_tick_all()
%17 = tail call i32 @usleep(i32 250000)
br label %7
}