#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 uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  uint32_t now = 0;
  uint32_t runTime = now;
  printf("Beginn\n");
  while (now < 0xFFFFFFF) {
    uint8_t canRun = (int32_t)(now - runTime) >= 0;
    if (canRun) {
      static uint32_t cum;
      static uint32_t last;
      static uint32_t s;
      if (now - last >= 1000) {
        s++;
        last = now;
      }
      if (s != now / 1000) {
        printf("Fehler ");
        printf("now = %u ", now);
        printf("s = %u ", s);
        printf("\n");
        break;
      }
      runTime = runTime + 200;
    }
    now += 333;
  }
  printf("Ende\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xfffffff,-0x8(%rbp)
jge    1216 <main+0x106>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltq
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1206 <main+0xf6>
mov    -0x8(%rbp),%eax
sub    0x2ebf(%rip),%eax
cmp    $0x3e8,%eax
jl     1194 <main+0x84>
mov    0x2eb2(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea9(%rip)
mov    -0x8(%rbp),%eax
mov    %eax,0x2e9c(%rip)
mov    0x2e9a(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
je     11fb <main+0xeb>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5a(%rip),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1216 <main+0x106>
mov    -0xc(%rbp),%eax
add    $0xc8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x14d,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x2a>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee2(%rip),%rdi
call   1040 <puts@plt>
mov    0x2ef9(%rip),%edx
xor    %ebx,%ebx
mov    0x2ef5(%rip),%eax
xor    %ecx,%ecx
jmp    1160 <main+0x30>
nop
lea    0x14d(%rbx),%esi
cmp    $0xffffeb2,%ebx
mov    %esi,%ebx
jae    11d6 <main+0xa6>
cmp    %ecx,%ebx
jl     1150 <main+0x20>
mov    %ebx,%esi
sub    %edx,%esi
cmp    $0x3e8,%esi
jl     1181 <main+0x51>
add    $0x1,%eax
mov    %eax,0x2ec7(%rip)
mov    %ebx,0x2ebd(%rip)
mov    %ebx,%edx
mov    %ebx,%esi
imul   $0x10624dd3,%rsi,%rsi
shr    $0x26,%rsi
cmp    %esi,%eax
jne    119a <main+0x6a>
add    $0xc8,%ecx
jmp    1150 <main+0x20>
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe59(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e82(%rip),%esi
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@main.last = internal unnamed_addr global i32 0
@main.s = internal unnamed_addr global i32 0
@.str.1 = [8 x i8] c"Fehler \00"
@.str.2 = [10 x i8] c"now = %u \00"
@.str.3 = [8 x i8] c"s = %u \00"
@str = [7 x i8] c"Beginn\00"
@str.6 = [5 x i8] c"Ende\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @main.last
%3 = load i32, i32* @main.s
br label %4
4: ; preds = %0, %28
%5 = phi i32 [ 0, %0 ], [ %32, %28 ]
%6 = phi i32 [ 0, %0 ], [ %31, %28 ]
%7 = phi i32 [ %2, %0 ], [ %30, %28 ]
%8 = phi i32 [ %3, %0 ], [ %29, %28 ]
%9 = icmp slt i32 %5, %6
br i1 %9, label %28, label %10
10: ; preds = %4
%11 = sub nsw i32 %5, %7
%12 = icmp sgt i32 %11, 999
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = add nsw i32 %8, 1
store i32 %14, i32* @main.s
store i32 %5, i32* @main.last
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %14, %13 ], [ %8, %10 ]
%17 = phi i32 [ %5, %13 ], [ %7, %10 ]
%18 = udiv i32 %5, 1000
%19 = icmp eq i32 %16, %18
br i1 %19, label %26, label %20
20: ; preds = %15
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%23 = load i32, i32* @main.s
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = tail call i32 @putchar(i32 10)
br label %34
26: ; preds = %15
%27 = add nsw i32 %6, 200
br label %28
28: ; preds = %4, %26
%29 = phi i32 [ %16, %26 ], [ %8, %4 ]
%30 = phi i32 [ %17, %26 ], [ %7, %4 ]
%31 = phi i32 [ %27, %26 ], [ %6, %4 ]
%32 = add nuw nsw i32 %5, 333
%33 = icmp ult i32 %5, 268435122
br i1 %33, label %4, label %34
34: ; preds = %28, %20
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}