#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 */
struct op_unit_mask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
struct op_unit_mask *try_find_um(char const *);
struct op_unit_mask *find_um(char const *value) {
  struct op_unit_mask *um = try_find_um(value);
  if (um)
    return um;
  fprintf(stderr, "oprofile: could not find unit mask %s\n", value);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<find_um>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <try_find_um@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <find_um+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<find_um>:
push   %rbx
mov    %rdi,%rbx
call   1030 <try_find_um@plt>
test   %rax,%rax
je     1140 <find_um+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.op_unit_mask = type { i32 }
@stderr = global i32 0
@.str = [39 x i8] c"oprofile: could not find unit mask %s\0A\00"
@EXIT_FAILURE = global i32 0
define %struct.op_unit_mask* @find_um(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.op_unit_mask*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.op_unit_mask* @try_find_um(i8* %4)
store %struct.op_unit_mask* %5, %struct.op_unit_mask** %3
%6 = load %struct.op_unit_mask*, %struct.op_unit_mask** %3
%7 = icmp ne %struct.op_unit_mask* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load %struct.op_unit_mask*, %struct.op_unit_mask** %3
ret %struct.op_unit_mask* %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
%struct.op_unit_mask = type { i32 }
@stderr = global i32 0
@.str = [39 x i8] c"oprofile: could not find unit mask %s\0A\00"
@EXIT_FAILURE = global i32 0
define %struct.op_unit_mask* @find_um(i8* %0) {
%2 = tail call %struct.op_unit_mask* @try_find_um(i8* %0)
%3 = icmp eq %struct.op_unit_mask* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret %struct.op_unit_mask* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}