#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*/ f1(int /*<<< orphan*/);
int /*<<< orphan*/ f2(int /*<<< orphan*/);
int /*<<< orphan*/ f3(int /*<<< orphan*/);
int /*<<< orphan*/ f4(int /*<<< orphan*/);
void f5(void) {
  int i;
  for (i = 0; i < 100; i++)
    f1(0);
  for (i = 0; i < 100; i++)
    f2(0);
  for (i = 0; i < 100; i++)
    f3(0);
  for (i = 0; i < 100; i++)
    f4(0);
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116e <f5+0x2e>
xor    %edi,%edi
call   1050 <f1@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <f5+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1194 <f5+0x54>
xor    %edi,%edi
call   1030 <f2@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <f5+0x35>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    11ba <f5+0x7a>
xor    %edi,%edi
call   1040 <f3@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119b <f5+0x5b>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    11e0 <f5+0xa0>
xor    %edi,%edi
call   1060 <f4@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <f5+0x81>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1050 <f1@plt>
add    $0xffffffff,%ebx
jne    1150 <f5+0x10>
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <f2@plt>
add    $0xffffffff,%ebx
jne    1170 <f5+0x30>
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <f3@plt>
add    $0xffffffff,%ebx
jne    1190 <f5+0x50>
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1060 <f4@plt>
add    $0xffffffff,%ebx
jne    11b0 <f5+0x70>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @f5() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @f1(i32 0)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @f2(i32 0)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %6
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ 0, %6 ]
%13 = tail call i32 @f3(i32 0)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, 100
br i1 %15, label %16, label %11
16: ; preds = %11, %16
%17 = phi i32 [ %19, %16 ], [ 0, %11 ]
%18 = tail call i32 @f4(i32 0)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, 100
br i1 %20, label %21, label %16
21: ; preds = %16
ret void
}