#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
char *symbol(int const *);
int is_jump_symbol(const uint8_t *addr, const char *sym) {
  if (*addr == 0xff && addr[1] == 0x25) {
    addr = **(uint8_t ***)(addr + 2);
    const char *s = symbol(addr);
    return s != NULL && !strcmp(s, sym);
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_jump_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xff,(%rax)
jne    11a2 <is_jump_symbol+0x82>
mov    -0x10(%rbp),%rax
cmpl   $0x25,0x4(%rax)
jne    11a2 <is_jump_symbol+0x82>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <symbol@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
je     1192 <is_jump_symbol+0x72>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11a9 <is_jump_symbol+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_jump_symbol>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmpl   $0xff,(%rdi)
jne    115a <is_jump_symbol+0x3a>
cmpl   $0x25,0x4(%rdi)
jne    115a <is_jump_symbol+0x3a>
mov    %rsi,%r14
mov    0x8(%rdi),%rax
mov    (%rax),%rdi
call   1040 <symbol@plt>
test   %rax,%rax
je     115a <is_jump_symbol+0x3a>
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_jump_symbol(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 255
br i1 %9, label %10, label %34
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 37
br i1 %14, label %15, label %34
15: ; preds = %10
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = bitcast i32* %17 to i32***
%19 = load i32**, i32*** %18
%20 = load i32*, i32** %19
store i32* %20, i32** %4
%21 = load i32*, i32** %4
%22 = call i8* @symbol(i32* %21)
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %31
25: ; preds = %15
%26 = load i8*, i8** %6
%27 = load i8*, i8** %5
%28 = call i32 @strcmp(i8* %26, i8* %27)
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br label %31
31: ; preds = %25, %15
%32 = phi i1 [ false, %15 ], [ %30, %25 ]
%33 = zext i1 %32 to i32
store i32 %33, i32* %3
br label %35
34: ; preds = %10, %2
store i32 0, i32* %3
br label %35
35: ; preds = %34, %31
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @is_jump_symbol(i32* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 255
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 37
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = bitcast i32* %10 to i32***
%12 = load i32**, i32*** %11
%13 = load i32*, i32** %12
%14 = tail call i8* @symbol(i32* %13)
%15 = icmp eq i8* %14, null
br i1 %15, label %20, label %16
16: ; preds = %9
%17 = tail call i32 @strcmp(i8* %14, i8* dereferenceable(1) %1)
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %2, %5, %9, %16
%21 = phi i32 [ 0, %9 ], [ %19, %16 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %21
}