#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*/ foo();
scalar_t__ jump();
int main(void) {
start:
  foo();
  for (int i = 0; i < 10; ++i) {
    if (jump())
      goto start;
    foo();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1172 <main+0x52>
mov    $0x0,%al
call   1040 <jump@plt>
cmp    $0x0,%rax
je     115d <main+0x3d>
jmp    112f <main+0xf>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1130 <main+0x10>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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