#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*/ printf(char *, int, int);
scalar_t__ t5_1_3();
int main() {
  int j = 0, i0 = 0, i1 = 0;
  for (; j < 500; j++) {
    if (t5_1_3() == 0)
      i0++;
    else
      i1++;
  }
  printf("i0=%d,i1=%d", i0, i1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    118c <main+0x6c>
mov    $0x0,%al
call   1040 <t5_1_3@plt>
cmp    $0x0,%rax
jne    1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117e <main+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1f4,%ebx
xor    %r14d,%r14d
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <t5_1_3@plt>
xor    %ecx,%ecx
xor    %edx,%edx
test   %rax,%rax
setne  %cl
sete   %dl
add    %edx,%ebp
add    %ecx,%r14d
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"i0=%d,i1=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 500
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = call i64 (...) @t5_1_3()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %17
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"i0=%d,i1=%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %11, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = phi i32 [ 0, %0 ], [ %12, %1 ]
%5 = tail call i64 (...) @t5_1_3()
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %3, %7
%9 = xor i1 %6, true
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %2, %10
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 500
br i1 %13, label %14, label %1
14: ; preds = %1
%15 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
ret i32 0
}