#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*/ abort();
int get_kind(int);
scalar_t__ some_call();
void example(int arg) {
  int tmp, kind = get_kind(arg);
  if (kind == 9 || kind == 10 || kind == 5) {
    if (some_call() == 0) {
      if (kind == 9 || kind == 10)
        tmp = arg;
      else
        abort();
    }
  }
}


x86 assembly (clang, -O0):
<example>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_kind@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
je     1164 <example+0x34>
cmpl   $0xa,-0xc(%rbp)
je     1164 <example+0x34>
cmpl   $0x5,-0xc(%rbp)
jne    11a5 <example+0x75>
mov    $0x0,%al
call   1050 <some_call@plt>
cmp    $0x0,%rax
jne    11a0 <example+0x70>
cmpl   $0x9,-0xc(%rbp)
je     1189 <example+0x59>
cmpl   $0xa,-0xc(%rbp)
jne    1194 <example+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    119b <example+0x6b>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11a0 <example+0x70>
jmp    11a5 <example+0x75>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example>:
push   %rbx
call   1040 <get_kind@plt>
cmp    $0xa,%eax
ja     115b <example+0x2b>
mov    %eax,%ebx
mov    $0x620,%eax
bt     %ebx,%eax
jae    115b <example+0x2b>
xor    %eax,%eax
call   1050 <some_call@plt>
test   %rax,%rax
jne    115b <example+0x2b>
add    $0xfffffff7,%ebx
cmp    $0x2,%ebx
jae    115d <example+0x2d>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @example(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @get_kind(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 9
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 10
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %30
15: ; preds = %12, %9, %1
%16 = call i64 (...) @some_call()
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 9
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 10
br i1 %23, label %24, label %26
24: ; preds = %21, %18
%25 = load i32, i32* %2
store i32 %25, i32* %3
br label %28
26: ; preds = %21
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %24
br label %29
29: ; preds = %28, %15
br label %30
30: ; preds = %29, %12
ret void
}

LLVM IR (-O2):
define void @example(i32 %0) {
%2 = tail call i32 @get_kind(i32 %0)
switch i32 %2, label %11 [
i32 10, label %3
i32 9, label %3
i32 5, label %3
]
3: ; preds = %1, %1, %1
%4 = add nsw i32 %2, -9
%5 = icmp ult i32 %4, 2
%6 = tail call i64 (...) @some_call()
%7 = icmp ne i64 %6, 0
%8 = select i1 %7, i1 true, i1 %5
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3, %1
ret void
}