#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*/ assume(int);
int /*<<< orphan*/ static_assert(int);
int unknown1();
int unknown2();
int main(int argc, char *argv[]) {
  int c1 = 4000;
  int c2 = 2000;
  int n, v;
  int i, k, j;
  n = unknown1();
  assume(n > 0);
  assume(n < 10);
  k = 0;
  i = 0;
  while (i < n) {
    i++;
    if (unknown2() % 2 == 0)
      v = 0;
    else
      v = 1;
    if (v == 0)
      k += c1;
    else
      k += c2;
  }
  static_assert(k > n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfa0,-0x14(%rbp)
movl   $0x7d0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <unknown1@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assume@plt>
cmpl   $0xa,-0x1c(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assume@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1204 <main+0xc4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <unknown2@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d7 <main+0x97>
movl   $0x0,-0x20(%rbp)
jmp    11de <main+0x9e>
movl   $0x1,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    11f6 <main+0xb6>
mov    -0x14(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11ff <main+0xbf>
mov    -0x18(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    119e <main+0x5e>
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <static_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unknown1@plt>
mov    %eax,%r14d
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1060 <assume@plt>
xor    %edi,%edi
cmp    $0xa,%r14d
setl   %dil
call   1060 <assume@plt>
test   %r14d,%r14d
jle    119d <main+0x5d>
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <unknown2@plt>
lea    0x7d0(%rbx),%ecx
add    $0xfa0,%ebx
test   $0x1,%al
cmovne %ecx,%ebx
add    $0xffffffff,%ebp
jne    1180 <main+0x40>
xor    %edi,%edi
cmp    %r14d,%ebx
setg   %dil
call   1050 <static_assert@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4000, i32* %6
store i32 2000, i32* %7
%13 = call i32 (...) @unknown1()
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp sgt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assume(i32 %16)
%18 = load i32, i32* %8
%19 = icmp slt i32 %18, 10
%20 = zext i1 %19 to i32
%21 = call i32 @assume(i32 %20)
store i32 0, i32* %11
store i32 0, i32* %10
br label %22
22: ; preds = %45, %2
%23 = load i32, i32* %10
%24 = load i32, i32* %8
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %46
26: ; preds = %22
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
%29 = call i32 (...) @unknown2()
%30 = srem i32 %29, 2
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %26
store i32 0, i32* %9
br label %34
33: ; preds = %26
store i32 1, i32* %9
br label %34
34: ; preds = %33, %32
%35 = load i32, i32* %9
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* %6
%39 = load i32, i32* %11
%40 = add nsw i32 %39, %38
store i32 %40, i32* %11
br label %45
41: ; preds = %34
%42 = load i32, i32* %7
%43 = load i32, i32* %11
%44 = add nsw i32 %43, %42
store i32 %44, i32* %11
br label %45
45: ; preds = %41, %37
br label %22
46: ; preds = %22
%47 = load i32, i32* %11
%48 = load i32, i32* %8
%49 = icmp sgt i32 %47, %48
%50 = zext i1 %49 to i32
%51 = call i32 @static_assert(i32 %50)
ret i32 0
}

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