#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 katcp_notice {
  int dummy;
};
struct katcp_dispatch {
  int dummy;
};
struct katcl_parse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ configure_notice_katcp(struct katcp_dispatch *,
                                          struct katcp_notice *, int, void *);
struct katcp_notice *find_notice_katcp(struct katcp_dispatch *, char *);
int /*<<< orphan*/ set_parse_notice_katcp(struct katcp_dispatch *,
                                          struct katcp_notice *,
                                          struct katcl_parse *);
int wake_single_name_notice_katcp(struct katcp_dispatch *d, char *name,
                                  struct katcl_parse *p, void *data) {
  struct katcp_notice *n;
  n = find_notice_katcp(d, name);
  if (n == NULL) {
    return -1;
  }
  set_parse_notice_katcp(d, n, p);
  configure_notice_katcp(d, n, 2, data);
  return 0;
}


x86 assembly (clang, -O0):
<wake_single_name_notice_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <find_notice_katcp@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1170 <wake_single_name_notice_katcp+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    119e <wake_single_name_notice_katcp+0x6e>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <set_parse_notice_katcp@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x2,%edx
call   1050 <configure_notice_katcp@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wake_single_name_notice_katcp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%r12
call   1040 <find_notice_katcp@plt>
test   %rax,%rax
je     1173 <wake_single_name_notice_katcp+0x43>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
call   1030 <set_parse_notice_katcp@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
mov    %r14,%rcx
call   1050 <configure_notice_katcp@plt>
xor    %eax,%eax
jmp    1178 <wake_single_name_notice_katcp+0x48>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
%struct.katcl_parse = type { i32 }
%struct.katcp_notice = type { i32 }
define i32 @wake_single_name_notice_katcp(%struct.katcp_dispatch* %0, i8* %1, %struct.katcl_parse* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.katcp_dispatch*
%7 = alloca i8*
%8 = alloca %struct.katcl_parse*
%9 = alloca i8*
%10 = alloca %struct.katcp_notice*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %6
store i8* %1, i8** %7
store %struct.katcl_parse* %2, %struct.katcl_parse** %8
store i8* %3, i8** %9
%11 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %6
%12 = load i8*, i8** %7
%13 = call %struct.katcp_notice* @find_notice_katcp(%struct.katcp_dispatch* %11, i8* %12)
store %struct.katcp_notice* %13, %struct.katcp_notice** %10
%14 = load %struct.katcp_notice*, %struct.katcp_notice** %10
%15 = icmp eq %struct.katcp_notice* %14, null
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 -1, i32* %5
br label %26
17: ; preds = %4
%18 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %6
%19 = load %struct.katcp_notice*, %struct.katcp_notice** %10
%20 = load %struct.katcl_parse*, %struct.katcl_parse** %8
%21 = call i32 @set_parse_notice_katcp(%struct.katcp_dispatch* %18, %struct.katcp_notice* %19, %struct.katcl_parse* %20)
%22 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %6
%23 = load %struct.katcp_notice*, %struct.katcp_notice** %10
%24 = load i8*, i8** %9
%25 = call i32 @configure_notice_katcp(%struct.katcp_dispatch* %22, %struct.katcp_notice* %23, i32 2, i8* %24)
store i32 0, i32* %5
br label %26
26: ; preds = %17, %16
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
%struct.katcl_parse = type { i32 }
%struct.katcp_notice = type { i32 }
define i32 @wake_single_name_notice_katcp(%struct.katcp_dispatch* %0, i8* %1, %struct.katcl_parse* %2, i8* %3) {
%5 = tail call %struct.katcp_notice* @find_notice_katcp(%struct.katcp_dispatch* %0, i8* %1)
%6 = icmp eq %struct.katcp_notice* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @set_parse_notice_katcp(%struct.katcp_dispatch* %0, %struct.katcp_notice* %5, %struct.katcl_parse* %2)
%9 = tail call i32 @configure_notice_katcp(%struct.katcp_dispatch* %0, %struct.katcp_notice* %5, i32 2, i8* %3)
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %11
}