#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 t_irc_server {
  int dummy;
};

/* Variables and functions */
char *irc_server_get_isupport_value(struct t_irc_server *, char *);
scalar_t__ irc_server_get_prefix_char_index(struct t_irc_server *, char);
scalar_t__ strchr(char const *, char);
int irc_server_prefix_char_statusmsg(struct t_irc_server *server,
                                     char prefix_char) {
  const char *support_statusmsg;
  support_statusmsg = irc_server_get_isupport_value(server, "STATUSMSG");
  if (support_statusmsg)
    return (strchr(support_statusmsg, prefix_char)) ? 1 : 0;
  return (irc_server_get_prefix_char_index(server, prefix_char) >= 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<irc_server_prefix_char_statusmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <irc_server_get_isupport_value@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1187 <irc_server_prefix_char_statusmsg+0x57>
mov    -0x20(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11a8 <irc_server_prefix_char_statusmsg+0x78>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1050 <irc_server_get_prefix_char_index@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovge %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_server_prefix_char_statusmsg>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
call   1040 <irc_server_get_isupport_value@plt>
movsbl %bpl,%esi
test   %rax,%rax
je     1162 <irc_server_prefix_char_statusmsg+0x32>
mov    %rax,%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1171 <irc_server_prefix_char_statusmsg+0x41>
mov    %rbx,%rdi
call   1050 <irc_server_get_prefix_char_index@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.t_irc_server = type { i32 }
@.str = [10 x i8] c"STATUSMSG\00"
define i32 @irc_server_prefix_char_statusmsg(%struct.t_irc_server* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca %struct.t_irc_server*
%5 = alloca i8
%6 = alloca i8*
store %struct.t_irc_server* %0, %struct.t_irc_server** %4
store i8 %1, i8* %5
%7 = load %struct.t_irc_server*, %struct.t_irc_server** %4
%8 = call i8* @irc_server_get_isupport_value(%struct.t_irc_server* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = load i8, i8* %5
%14 = call i64 @strchr(i8* %12, i8 signext %13)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
store i32 %17, i32* %3
br label %25
18: ; preds = %2
%19 = load %struct.t_irc_server*, %struct.t_irc_server** %4
%20 = load i8, i8* %5
%21 = call i64 @irc_server_get_prefix_char_index(%struct.t_irc_server* %19, i8 signext %20)
%22 = icmp sge i64 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
store i32 %24, i32* %3
br label %25
25: ; preds = %18, %11
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
%struct.t_irc_server = type { i32 }
@.str = [10 x i8] c"STATUSMSG\00"
define i32 @irc_server_prefix_char_statusmsg(%struct.t_irc_server* %0, i8 signext %1) {
%3 = tail call i8* @irc_server_get_isupport_value(%struct.t_irc_server* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strchr(i8* %3, i8 signext %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %14
9: ; preds = %2
%10 = tail call i64 @irc_server_get_prefix_char_index(%struct.t_irc_server* %0, i8 signext %1)
%11 = lshr i64 %10, 63
%12 = trunc i64 %11 to i32
%13 = xor i32 %12, 1
br label %14
14: ; preds = %9, %5
%15 = phi i32 [ %8, %5 ], [ %13, %9 ]
ret i32 %15
}