#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*/ f(int);
int /*<<< orphan*/ x();
void h(int v) {
  if (v == 0) {
    f(0);
    f(0);
    f(0);
    f(0);
    f(1);
  }
  if (v == 1) {
    x();
    x();
    x();
    x();
    x();
    x();
    x();
    x();
  }
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    115b <h+0x3b>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
mov    $0x1,%edi
call   1040 <f@plt>
cmpl   $0x1,-0x4(%rbp)
jne    119d <h+0x7d>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x0,%al
call   1030 <x@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
cmp    $0x1,%edi
je     1151 <h+0x31>
test   %edi,%edi
jne    118a <h+0x6a>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <f@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
call   1030 <x@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <x@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 @f(i32 0)
%7 = call i32 @f(i32 0)
%8 = call i32 @f(i32 0)
%9 = call i32 @f(i32 0)
%10 = call i32 @f(i32 1)
br label %11
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = call i32 (...) @x()
%16 = call i32 (...) @x()
%17 = call i32 (...) @x()
%18 = call i32 (...) @x()
%19 = call i32 (...) @x()
%20 = call i32 (...) @x()
%21 = call i32 (...) @x()
%22 = call i32 (...) @x()
br label %23
23: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
define void @h(i32 %0) {
switch i32 %0, label %17 [
i32 0, label %2
i32 1, label %8
]
2: ; preds = %1
%3 = tail call i32 @f(i32 0)
%4 = tail call i32 @f(i32 0)
%5 = tail call i32 @f(i32 0)
%6 = tail call i32 @f(i32 0)
%7 = tail call i32 @f(i32 1)
br label %17
8: ; preds = %1
%9 = tail call i32 (...) @x()
%10 = tail call i32 (...) @x()
%11 = tail call i32 (...) @x()
%12 = tail call i32 (...) @x()
%13 = tail call i32 (...) @x()
%14 = tail call i32 (...) @x()
%15 = tail call i32 (...) @x()
%16 = tail call i32 (...) @x()
br label %17
17: ; preds = %2, %1, %8
ret void
}