#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*/ t();
int /*<<< orphan*/ tt();
int main() {
  int i, j;
  for (j = 0; j < 10; j++)
    if (j % 2 == 0)
      for (i = 0; i < 1000; i++)
        t();
    else
      for (i = 0; i < 1000; i++)
        tt();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11c3 <main+0xa3>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1182 <main+0x62>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    117d <main+0x5d>
mov    $0x0,%al
call   1030 <t@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x3b>
jmp    11b0 <main+0x90>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11ab <main+0x8b>
mov    $0x0,%al
call   1040 <tt@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1189 <main+0x69>
jmp    11b0 <main+0x90>
jmp    11b5 <main+0x95>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
jmp    1138 <main+0x18>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xa,%ebx
je     116e <main+0x4e>
mov    $0x3e8,%ebp
test   $0x1,%bl
jne    1160 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <t@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
jmp    1130 <main+0x10>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <tt@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x40>
jmp    1130 <main+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %32, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %35
7: ; preds = %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 1000
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = call i32 (...) @t()
br label %17
17: ; preds = %15
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %12
20: ; preds = %12
br label %31
21: ; preds = %7
store i32 0, i32* %2
br label %22
22: ; preds = %27, %21
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 1000
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = call i32 (...) @tt()
br label %27
27: ; preds = %25
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %22
30: ; preds = %22
br label %31
31: ; preds = %30, %20
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %4
35: ; preds = %4
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %15
%2 = phi i32 [ 0, %0 ], [ %16, %15 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 (...) @t()
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %15, label %5
10: ; preds = %1, %10
%11 = phi i32 [ %13, %10 ], [ 0, %1 ]
%12 = tail call i32 (...) @tt()
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, 1000
br i1 %14, label %15, label %10
15: ; preds = %10, %5
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %1
18: ; preds = %15
ret i32 1
}