#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 */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *getSymName(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char const *, char *);
int isExit(uint32_t pos) {
  const char *s;
  if ((s = getSymName(NULL, pos)) != NULL) {
    if (!strcmp(s, "abort"))
      return 1;
    if (!strcmp(s, "exit"))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <getSymName@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1194 <isExit+0x74>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    116a <isExit+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    119b <isExit+0x7b>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118f <isExit+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    119b <isExit+0x7b>
jmp    1194 <isExit+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isExit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1030 <getSymName@plt>
test   %rax,%rax
je     115f <isExit+0x3f>
mov    %rax,%rbx
lea    0xec5(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1161 <isExit+0x41>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1161 <isExit+0x41>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"abort\00"
@.str.1 = [5 x i8] c"exit\00"
define i32 @isExit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i8* @getSymName(i32* null, i32 %5)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 1, i32* %2
br label %20
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 1, i32* %2
br label %20
18: ; preds = %13
br label %19
19: ; preds = %18, %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %17, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"abort\00"
@.str.1 = [5 x i8] c"exit\00"
define i32 @isExit(i32 %0) {
%2 = tail call i8* @getSymName(i32* null, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %1
br label %11
11: ; preds = %7, %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ], [ 1, %7 ]
ret i32 %12
}