#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*/ static_assert(int);
scalar_t__ unknown2();
void main() {
  int w = 1;
  int z = 0;
  int x = 0;
  int y = 0;
  while (unknown2()) {
    if (w % 2 == 1) {
      x++;
      w++;
    };
    if (z % 2 == 0) {
      y++;
      z++;
    };
  }
  static_assert(x == y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <unknown2@plt>
cmp    $0x0,%rax
je     11a6 <main+0x86>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    117b <main+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a1 <main+0x81>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <unknown2@plt>
mov    $0x0,%r15d
test   %rax,%rax
je     1183 <main+0x63>
mov    $0x1,%ebx
xor    %r15d,%r15d
xor    %r14d,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
mov    %ebx,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    %ecx,%ebx
add    %eax,%r14d
mov    %ebp,%eax
not    %eax
and    $0x1,%eax
add    %eax,%ebp
add    %eax,%r15d
xor    %eax,%eax
call   1030 <unknown2@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %edi,%edi
cmp    %r15d,%r14d
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <static_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %26, %0
%6 = call i64 (...) @unknown2()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i32, i32* %1
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %2
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %26
26: ; preds = %21, %17
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = icmp eq i32 %28, %29
%31 = zext i1 %30 to i32
%32 = call i32 @static_assert(i32 %31)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @unknown2()
%2 = icmp eq i64 %1, 0
br i1 %2, label %19, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %16, %3 ], [ 0, %0 ]
%5 = phi i32 [ %12, %3 ], [ 0, %0 ]
%6 = phi i32 [ %15, %3 ], [ 0, %0 ]
%7 = phi i32 [ %10, %3 ], [ 1, %0 ]
%8 = srem i32 %7, 2
%9 = icmp eq i32 %8, 1
%10 = add nsw i32 %8, %7
%11 = zext i1 %9 to i32
%12 = add nuw nsw i32 %5, %11
%13 = and i32 %6, 1
%14 = xor i32 %13, 1
%15 = add nuw nsw i32 %14, %6
%16 = add nuw nsw i32 %4, %14
%17 = tail call i64 (...) @unknown2()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %3
19: ; preds = %3, %0
%20 = phi i32 [ 0, %0 ], [ %12, %3 ]
%21 = phi i32 [ 0, %0 ], [ %16, %3 ]
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i32
%24 = tail call i32 @static_assert(i32 %23)
ret void
}