#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*/ assert(int);
int /*<<< orphan*/ tmpl(char *);
void main() {
  int k = 100;
  int b;
  int i;
  int j;
  int n;
  i = j;
  for (n = 0; n < 2 * k; n++) {
    tmpl("(le(k,b,i,j,n),le(k,b,i,j,n))");
    if (b) {
      i++;
    } else {
      j++;
    }
    b = !b;
  }
  assert(i == j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1199 <main+0x79>
lea    0xeac(%rip),%rdi
call   1030 <tmpl@plt>
cmpl   $0x0,-0x8(%rbp)
je     1171 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117a <main+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <main+0x1c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0xc8,%r15d
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <tmpl@plt>
xor    %eax,%eax
xor    %ecx,%ecx
test   %ebx,%ebx
sete   %al
setne  %cl
add    %ecx,%ebp
add    %eax,%r12d
mov    %eax,%ebx
add    $0xffffffff,%r15d
jne    1140 <main+0x20>
xor    %edi,%edi
cmp    %r12d,%ebp
sete   %dil
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"(le(k,b,i,j,n),le(k,b,i,j,n))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 100, i32* %1
%6 = load i32, i32* %4
store i32 %6, i32* %3
store i32 0, i32* %5
br label %7
7: ; preds = %27, %0
%8 = load i32, i32* %5
%9 = load i32, i32* %1
%10 = mul nsw i32 2, %9
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = call i32 @tmpl(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
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 %22
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
store i32 %26, i32* %2
br label %27
27: ; preds = %22
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %7
30: ; preds = %7
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = icmp eq i32 %31, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"(le(k,b,i,j,n),le(k,b,i,j,n))\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %13, %1 ]
%3 = phi i32 [ undef, %0 ], [ %12, %1 ]
%4 = phi i32 [ undef, %0 ], [ %10, %1 ]
%5 = phi i32 [ undef, %0 ], [ %11, %1 ]
%6 = tail call i32 @tmpl(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = add nsw i32 %4, %9
%11 = zext i1 %7 to i32
%12 = add nsw i32 %3, %11
%13 = add nuw nsw i32 %2, 1
%14 = icmp eq i32 %13, 200
br i1 %14, label %15, label %1
15: ; preds = %1
%16 = icmp eq i32 %10, %12
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
ret void
}