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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ find_target_bots(char *, char *);
scalar_t__ find_target_channels(struct evbuffer *, char *, char *);
int /*<<< orphan*/ info_direct_forward(struct evbuffer *, char *, char *);
int /*<<< orphan*/ log_err(char *);
void info_forward(struct evbuffer *out, char *type, char *message) {
  int ret = 0;
  assert(type != NULL);
  if (type[0] == '=') {
    info_direct_forward(out, type + sizeof(char), message);
    return;
  }
  ret += find_target_channels(out, type, message);
  ret += find_target_bots(type, message);
  if (ret == -2)
    log_err("[i] unknow information type\n");
}


x86 assembly (clang, -O0):
<info_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    11a7 <info_forward+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1050 <info_direct_forward@plt>
jmp    11f5 <info_forward+0xa5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1070 <find_target_channels@plt>
mov    %rax,%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <find_target_bots@plt>
mov    %rax,%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffffe,-0x1c(%rbp)
jne    11f5 <info_forward+0xa5>
lea    0xe10(%rip),%rdi
call   1060 <log_err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_forward>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
cmpb   $0x3d,(%rbx)
jne    1188 <info_forward+0x38>
add    $0x1,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <info_direct_forward@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <find_target_channels@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <find_target_bots@plt>
add    %r15d,%eax
cmp    $0xfffffffe,%eax
jne    11bd <info_forward+0x6d>
lea    0xe4d(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <log_err@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
@.str = [29 x i8] c"[i] unknow information type\0A\00"
define void @info_forward(%struct.evbuffer* %0, i8* %1, i8* %2) {
%4 = alloca %struct.evbuffer*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store %struct.evbuffer* %0, %struct.evbuffer** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 61
br i1 %16, label %17, label %23
17: ; preds = %3
%18 = load %struct.evbuffer*, %struct.evbuffer** %4
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8*, i8** %6
%22 = call i32 @info_direct_forward(%struct.evbuffer* %18, i8* %20, i8* %21)
br label %43
23: ; preds = %3
%24 = load %struct.evbuffer*, %struct.evbuffer** %4
%25 = load i8*, i8** %5
%26 = load i8*, i8** %6
%27 = call i64 @find_target_channels(%struct.evbuffer* %24, i8* %25, i8* %26)
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = add nsw i64 %29, %27
%31 = trunc i64 %30 to i32
store i32 %31, i32* %7
%32 = load i8*, i8** %5
%33 = load i8*, i8** %6
%34 = call i64 @find_target_bots(i8* %32, i8* %33)
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = add nsw i64 %36, %34
%38 = trunc i64 %37 to i32
store i32 %38, i32* %7
%39 = load i32, i32* %7
%40 = icmp eq i32 %39, -2
br i1 %40, label %41, label %43
41: ; preds = %23
%42 = call i32 @log_err(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %43
43: ; preds = %17, %41, %23
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
@.str = [29 x i8] c"[i] unknow information type\0A\00"
define void @info_forward(%struct.evbuffer* %0, i8* %1, i8* %2) {
%4 = icmp ne i8* %1, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 61
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %1, i64 1
%11 = tail call i32 @info_direct_forward(%struct.evbuffer* %0, i8* %10, i8* %2)
br label %20
12: ; preds = %3
%13 = tail call i64 @find_target_channels(%struct.evbuffer* %0, i8* %1, i8* %2)
%14 = tail call i64 @find_target_bots(i8* %1, i8* %2)
%15 = add i64 %14, %13
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %16, -2
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = tail call i32 @log_err(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %12, %18, %9
ret void
}