#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*/ fn1(int);
int fn2(int x, int y, int z) {
  int a = 8;
  if (x != z) {
    fn1(x);
    fn1(x);
    if (x == 36)
      fn1(x);
    fn1(x);
    if (x == 98)
      fn1(x);
    fn1(x);
    fn1(x + a);
  }
  return y;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1183 <fn2+0x73>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
cmpl   $0x24,-0x4(%rbp)
jne    1156 <fn2+0x46>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
cmpl   $0x62,-0x4(%rbp)
jne    1170 <fn2+0x60>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
mov    -0x4(%rbp),%edi
call   1030 <fn1@plt>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
call   1030 <fn1@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
cmp    %edx,%edi
je     116a <fn2+0x5a>
mov    %edi,%ebp
call   1030 <fn1@plt>
mov    %ebp,%edi
call   1030 <fn1@plt>
cmp    $0x24,%ebp
jne    113f <fn2+0x2f>
mov    $0x24,%r14d
mov    $0x24,%edi
call   1030 <fn1@plt>
jmp    1151 <fn2+0x41>
mov    %ebp,%edi
call   1030 <fn1@plt>
mov    $0x62,%r14d
cmp    $0x62,%ebp
jne    1159 <fn2+0x49>
mov    %r14d,%edi
call   1030 <fn1@plt>
mov    %ebp,%edi
call   1030 <fn1@plt>
add    $0x8,%ebp
mov    %ebp,%edi
call   1030 <fn1@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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