#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 */
typedef int uint8_t;
typedef int uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  uint16_t now = 0xFA00;
  uint16_t runTime = now;
  uint16_t rate = 0xFF;
  uint8_t inc = 2;
  uint16_t i;
  for (i = 0; i < 0xFFF; i += inc) {
    uint8_t canRun = (int16_t)(now - runTime) >= 0;
    if (canRun) {
      printf("now-runTime = %d ", (int16_t)(now - runTime));
      printf("now = %u runTime = %u ", now, runTime);
      runTime = runTime + rate;
      printf("next = %u\n", runTime);
    }
    now += inc;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfa00,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0xff,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xfff,-0x18(%rbp)
jge    11cc <main+0xbc>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltq
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11b5 <main+0xa5>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltq
mov    %eax,%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <main+0x31>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0xfa00,%ebx
lea    0xedc(%rip),%r14
lea    0xee7(%rip),%r15
lea    0xef7(%rip),%r12
mov    $0xfa00,%ebp
jmp    1153 <main+0x43>
nopl   0x0(%rax)
lea    0x2(%rbx),%eax
add    $0xffff0600,%ebx
cmp    $0xffd,%ebx
mov    %eax,%ebx
jae    1185 <main+0x75>
mov    %ebx,%esi
sub    %ebp,%esi
js     1140 <main+0x30>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xff,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"now-runTime = %d \00"
@.str.1 = [23 x i8] c"now = %u runTime = %u \00"
@.str.2 = [11 x i8] c"next = %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 64000, i32* %2
%8 = load i32, i32* %2
store i32 %8, i32* %3
store i32 255, i32* %4
store i32 2, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %40, %0
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 4095
br i1 %11, label %12, label %44
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = icmp sge i64 %16, 0
%18 = zext i1 %17 to i32
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %36
21: ; preds = %12
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = trunc i64 %25 to i32
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29)
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = add nsw i32 %31, %32
store i32 %33, i32* %3
%34 = load i32, i32* %3
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %21, %12
%37 = load i32, i32* %5
%38 = load i32, i32* %2
%39 = add nsw i32 %38, %37
store i32 %39, i32* %2
br label %40
40: ; preds = %36
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = add nsw i32 %42, %41
store i32 %43, i32* %6
br label %9
44: ; preds = %9
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str = [18 x i8] c"now-runTime = %d \00"
@.str.1 = [23 x i8] c"now = %u runTime = %u \00"
@.str.2 = [11 x i8] c"next = %u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %12
%2 = phi i32 [ 64000, %0 ], [ %14, %12 ]
%3 = phi i32 [ 0, %0 ], [ %15, %12 ]
%4 = phi i32 [ 64000, %0 ], [ %13, %12 ]
%5 = sub nsw i32 %2, %4
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %4)
%10 = add nsw i32 %4, 255
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %1
%13 = phi i32 [ %10, %7 ], [ %4, %1 ]
%14 = add nuw nsw i32 %2, 2
%15 = add nuw nsw i32 %3, 2
%16 = icmp ult i32 %3, 4093
br i1 %16, label %1, label %17
17: ; preds = %12
ret i32 0
}