#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_config_section {
  int dummy;
};
struct t_config_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_keyboard_bind(int /*<<< orphan*/ *, char const *,
                                     char const *);
int /*<<< orphan*/ gui_keyboard_unbind(int /*<<< orphan*/ *, char const *, int);
int config_weechat_key_read_cb(void *data, struct t_config_file *config_file,
                               struct t_config_section *section,
                               const char *option_name, const char *value) {
  (void)data;
  (void)config_file;
  (void)section;
  if (option_name) {
    if (value && value[0]) {
      gui_keyboard_bind(NULL, option_name, value);
    } else {
      gui_keyboard_unbind(NULL, option_name, 1);
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<config_weechat_key_read_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118f <config_weechat_key_read_cb+0x6f>
cmpq   $0x0,-0x28(%rbp)
je     1178 <config_weechat_key_read_cb+0x58>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1178 <config_weechat_key_read_cb+0x58>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <gui_keyboard_bind@plt>
jmp    118a <config_weechat_key_read_cb+0x6a>
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
call   1040 <gui_keyboard_unbind@plt>
jmp    118f <config_weechat_key_read_cb+0x6f>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_weechat_key_read_cb>:
push   %rax
test   %rcx,%rcx
je     114f <config_weechat_key_read_cb+0x2f>
test   %r8,%r8
je     1140 <config_weechat_key_read_cb+0x20>
cmpb   $0x0,(%r8)
je     1140 <config_weechat_key_read_cb+0x20>
xor    %edi,%edi
mov    %rcx,%rsi
mov    %r8,%rdx
call   1030 <gui_keyboard_bind@plt>
jmp    114f <config_weechat_key_read_cb+0x2f>
xor    %edi,%edi
mov    %rcx,%rsi
mov    $0x1,%edx
call   1040 <gui_keyboard_unbind@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_file = type { i32 }
%struct.t_config_section = type { i32 }
define i32 @config_weechat_key_read_cb(i8* %0, %struct.t_config_file* %1, %struct.t_config_section* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca %struct.t_config_file*
%8 = alloca %struct.t_config_section*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store %struct.t_config_file* %1, %struct.t_config_file** %7
store %struct.t_config_section* %2, %struct.t_config_section** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load %struct.t_config_file*, %struct.t_config_file** %7
%13 = load %struct.t_config_section*, %struct.t_config_section** %8
%14 = load i8*, i8** %9
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %33
16: ; preds = %5
%17 = load i8*, i8** %10
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load i8*, i8** %10
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i8*, i8** %9
%27 = load i8*, i8** %10
%28 = call i32 @gui_keyboard_bind(i32* null, i8* %26, i8* %27)
br label %32
29: ; preds = %19, %16
%30 = load i8*, i8** %9
%31 = call i32 @gui_keyboard_unbind(i32* null, i8* %30, i32 1)
br label %32
32: ; preds = %29, %25
br label %33
33: ; preds = %32, %5
ret i32 1
}

LLVM IR (-O2):
%struct.t_config_file = type { i32 }
%struct.t_config_section = type { i32 }
define i32 @config_weechat_key_read_cb(i8* nocapture readnone %0, %struct.t_config_file* nocapture readnone %1, %struct.t_config_section* nocapture readnone %2, i8* %3, i8* %4) {
%6 = icmp eq i8* %3, null
br i1 %6, label %16, label %7
7: ; preds = %5
%8 = icmp eq i8* %4, null
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 @gui_keyboard_bind(i32* null, i8* %3, i8* %4)
br label %16
14: ; preds = %9, %7
%15 = tail call i32 @gui_keyboard_unbind(i32* null, i8* %3, i32 1)
br label %16
16: ; preds = %12, %14, %5
ret i32 1
}