#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__ unknown1();
scalar_t__ unknown2();
void main() {
  int w = 1;
  int z = 0;
  int x = 0;
  int y = 0;
  while (unknown1()) {
    while (unknown2()) {
      if (w % 2 == 1)
        x++;
      if (z % 2 == 0)
        y++;
    }
    z = x + y;
    w = z + 1;
  }
  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 <unknown1@plt>
cmp    $0x0,%rax
je     11d1 <main+0xa1>
jmp    116a <main+0x3a>
mov    $0x0,%al
call   1040 <unknown2@plt>
cmp    $0x0,%rax
je     11ba <main+0x8a>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1198 <main+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b5 <main+0x85>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116a <main+0x3a>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <main+0x24>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <unknown1@plt>
mov    $0x0,%ebx
test   %rax,%rax
je     11c4 <main+0x94>
mov    $0x1,%r15d
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %r12d,%r12d
jmp    1178 <main+0x48>
nopl   0x0(%rax)
lea    (%rbx,%r14,1),%r12d
lea    (%rbx,%r14,1),%r15d
add    $0x1,%r15d
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %rax,%rax
je     11c4 <main+0x94>
xor    %eax,%eax
call   1040 <unknown2@plt>
test   %rax,%rax
je     1160 <main+0x30>
mov    %r15d,%eax
shr    $0x1f,%eax
add    %r15d,%eax
and    $0xfffffffe,%eax
sub    %eax,%r15d
xor    %ebp,%ebp
cmp    $0x1,%r15d
sete   %bpl
not    %r12d
and    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %r12d,%ebx
add    %ebp,%r14d
xor    %eax,%eax
call   1040 <unknown2@plt>
test   %rax,%rax
jne    11b0 <main+0x80>
jmp    1160 <main+0x30>
xor    %edi,%edi
cmp    %ebx,%r14d
sete   %dil
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <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 = %27, %0
%6 = call i64 (...) @unknown1()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %33
8: ; preds = %5
br label %9
9: ; preds = %26, %8
%10 = call i64 (...) @unknown2()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %1
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %12
%20 = load i32, i32* %2
%21 = srem i32 %20, 2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %19
br label %9
27: ; preds = %9
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = add nsw i32 %28, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %5
33: ; preds = %5
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = icmp eq i32 %34, %35
%37 = zext i1 %36 to i32
%38 = call i32 @static_assert(i32 %37)
ret void
}

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