#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();
scalar_t__ unknown3();
void main() {
  int x = 0, y = 0;
  while (unknown1()) {
    if (unknown2()) {
      x++;
      y += 100;
    } else if (unknown3()) {
      if (x >= 4) {
        x++;
        y++;
      }
      if (x < 0) {
        y--;
      }
    }
  }
  static_assert(x < 4 || y > 2);
}


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   1030 <unknown1@plt>
cmp    $0x0,%rax
je     11de <main+0x9e>
mov    $0x0,%al
call   1040 <unknown2@plt>
cmp    $0x0,%rax
je     118f <main+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0x99>
mov    $0x0,%al
call   1060 <unknown3@plt>
cmp    $0x0,%rax
je     11d4 <main+0x94>
cmpl   $0x4,-0x4(%rbp)
jl     11bc <main+0x7c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11cf <main+0x8f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11d4 <main+0x94>
jmp    11d9 <main+0x99>
jmp    1156 <main+0x16>
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     11f7 <main+0xb7>
cmpl   $0x2,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%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   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unknown1@plt>
mov    $0x0,%ebp
test   %rax,%rax
je     119f <main+0x5f>
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1172 <main+0x32>
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0x64,%ebp
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %rax,%rax
je     119f <main+0x5f>
xor    %eax,%eax
call   1040 <unknown2@plt>
test   %rax,%rax
jne    1160 <main+0x20>
xor    %eax,%eax
call   1060 <unknown3@plt>
test   %rax,%rax
je     1166 <main+0x26>
xor    %eax,%eax
cmp    $0x4,%ebx
setge  %al
add    %eax,%ebx
add    %eax,%ebp
mov    %ebx,%eax
sar    $0x1f,%eax
add    %eax,%ebp
jmp    1166 <main+0x26>
cmp    $0x4,%ebx
setl   %al
cmp    $0x3,%ebp
setge  %cl
or     %al,%cl
movzbl %cl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <static_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %33, %0
%4 = call i64 (...) @unknown1()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %34
6: ; preds = %3
%7 = call i64 (...) @unknown2()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 100
store i32 %13, i32* %2
br label %33
14: ; preds = %6
%15 = call i64 (...) @unknown3()
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %14
%18 = load i32, i32* %1
%19 = icmp sge i32 %18, 4
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %25
25: ; preds = %20, %17
%26 = load i32, i32* %1
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %2
%30 = add nsw i32 %29, -1
store i32 %30, i32* %2
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %14
br label %33
33: ; preds = %32, %9
br label %3
34: ; preds = %3
%35 = load i32, i32* %1
%36 = icmp slt i32 %35, 4
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp sgt i32 %38, 2
br label %40
40: ; preds = %37, %34
%41 = phi i1 [ true, %34 ], [ %39, %37 ]
%42 = zext i1 %41 to i32
%43 = call i32 @static_assert(i32 %42)
ret void
}

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