#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 fubar();
void blowup(int x) {
  if (x == 1)
    x = fubar();
  if (x == 2)
    x = fubar();
  if (x == 3)
    x = fubar();
  if (x == 4)
    x = fubar();
}


x86 assembly (clang, -O0):
<blowup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112f <blowup+0x1f>
mov    $0x0,%al
call   1030 <fubar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1143 <blowup+0x33>
mov    $0x0,%al
call   1030 <fubar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1157 <blowup+0x47>
mov    $0x0,%al
call   1030 <fubar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    116b <blowup+0x5b>
mov    $0x0,%al
call   1030 <fubar@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blowup>:
push   %rax
mov    %edi,%eax
cmp    $0x1,%edi
je     112f <blowup+0x1f>
cmp    $0x2,%eax
je     113b <blowup+0x2b>
cmp    $0x3,%eax
je     1147 <blowup+0x37>
cmp    $0x4,%eax
jne    1153 <blowup+0x43>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fubar@plt>
xor    %eax,%eax
call   1030 <fubar@plt>
cmp    $0x2,%eax
jne    111d <blowup+0xd>
xor    %eax,%eax
call   1030 <fubar@plt>
cmp    $0x3,%eax
jne    1122 <blowup+0x12>
xor    %eax,%eax
call   1030 <fubar@plt>
cmp    $0x4,%eax
je     1127 <blowup+0x17>
pop    %rax
ret

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

LLVM IR (-O2):
define void @blowup(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @fubar()
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @fubar()
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %9, %8 ], [ %6, %5 ]
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (...) @fubar()
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %14, %13 ], [ %11, %10 ]
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 (...) @fubar()
br label %20
20: ; preds = %18, %15
ret void
}