#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
scalar_t__ frob();
int main() {
  int i;
  for (i = 0; i < 10 && frob() == 0; i++)
    foo();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1166 <main+0x36>
mov    $0x0,%al
call   1040 <frob@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1176 <main+0x46>
jmp    118b <main+0x5b>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <frob@plt>
test   %rax,%rax
jne    11fb <main+0xcb>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i64 (...) @frob()
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ false, %3 ], [ %8, %6 ]
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = call i32 (...) @foo()
br label %13
13: ; preds = %11
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %9
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @frob()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %41
3: ; preds = %0
%4 = tail call i32 (...) @foo()
%5 = tail call i64 (...) @frob()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %41
7: ; preds = %3
%8 = tail call i32 (...) @foo()
%9 = tail call i64 (...) @frob()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %41
11: ; preds = %7
%12 = tail call i32 (...) @foo()
%13 = tail call i64 (...) @frob()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %41
15: ; preds = %11
%16 = tail call i32 (...) @foo()
%17 = tail call i64 (...) @frob()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %41
19: ; preds = %15
%20 = tail call i32 (...) @foo()
%21 = tail call i64 (...) @frob()
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %41
23: ; preds = %19
%24 = tail call i32 (...) @foo()
%25 = tail call i64 (...) @frob()
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = tail call i32 (...) @foo()
%29 = tail call i64 (...) @frob()
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %41
31: ; preds = %27
%32 = tail call i32 (...) @foo()
%33 = tail call i64 (...) @frob()
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %31
%36 = tail call i32 (...) @foo()
%37 = tail call i64 (...) @frob()
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = tail call i32 (...) @foo()
br label %41
41: ; preds = %39, %35, %31, %27, %23, %19, %15, %11, %7, %3, %0
%42 = tail call i32 @exit(i32 0)
unreachable
}