#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 */
scalar_t__ channel_is_name(char const *);
int parse_msg_chan(const char *origin, const char *nick, const char *hostname,
                   const char *param1, const char *param2, int cmdindex,
                   int *pass) {
  const char *chan;
  if ((param1[0] == '@' || param1[0] == '%' || param1[0] == '+') &&
      channel_is_name(param1 + 1) != 0) {
    chan = param1 + 1;
  } else {
    chan = param1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_msg_chan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     1164 <parse_msg_chan+0x54>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
je     1164 <parse_msg_chan+0x54>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    118c <parse_msg_chan+0x7c>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1030 <channel_is_name@plt>
cmp    $0x0,%rax
je     118c <parse_msg_chan+0x7c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1194 <parse_msg_chan+0x84>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_msg_chan>:
push   %rax
mov    (%rcx),%al
add    $0xdb,%al
cmp    $0x1b,%al
ja     1133 <parse_msg_chan+0x23>
movzbl %al,%eax
mov    $0x8000041,%edx
bt     %rax,%rdx
jae    1133 <parse_msg_chan+0x23>
add    $0x1,%rcx
mov    %rcx,%rdi
call   1030 <channel_is_name@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parse_msg_chan(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%16 = load i8*, i8** %11
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 64
br i1 %20, label %33, label %21
21: ; preds = %7
%22 = load i8*, i8** %11
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 37
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i8*, i8** %11
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 43
br i1 %32, label %33, label %41
33: ; preds = %27, %21, %7
%34 = load i8*, i8** %11
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = call i64 @channel_is_name(i8* %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8*, i8** %11
%40 = getelementptr inbounds i8, i8* %39, i64 1
store i8* %40, i8** %15
br label %43
41: ; preds = %33, %27
%42 = load i8*, i8** %11
store i8* %42, i8** %15
br label %43
43: ; preds = %41, %38
ret i32 0
}

LLVM IR (-O2):
define i32 @parse_msg_chan(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3, i8* nocapture readnone %4, i32 %5, i32* nocapture readnone %6) {
%8 = load i8, i8* %3
switch i8 %8, label %12 [
i8 64, label %9
i8 37, label %9
i8 43, label %9
]
9: ; preds = %7, %7, %7
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i64 @channel_is_name(i8* %10)
br label %12
12: ; preds = %9, %7
ret i32 0
}