#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_gui_nick_group {
  int dummy;
};
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
char *gui_nicklist_get_group_start(char const *);
struct t_gui_nick_group *gui_nicklist_search_group_internal(
    struct t_gui_buffer *, struct t_gui_nick_group *, char const *, int);
struct t_gui_nick_group *
gui_nicklist_search_group(struct t_gui_buffer *buffer,
                          struct t_gui_nick_group *from_group,
                          const char *name) {
  const char *ptr_name;
  ptr_name = gui_nicklist_get_group_start(name);
  return gui_nicklist_search_group_internal(buffer, from_group, name,
                                            (ptr_name == name) ? 1 : 0);
}


x86 assembly (clang, -O0):
<gui_nicklist_search_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <gui_nicklist_get_group_start@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%r9
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    %r9,%r8
cmove  %eax,%ecx
call   1040 <gui_nicklist_search_group_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_nicklist_search_group>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <gui_nicklist_get_group_start@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <gui_nicklist_search_group_internal@plt>

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
%struct.t_gui_nick_group = type { i32 }
define %struct.t_gui_nick_group* @gui_nicklist_search_group(%struct.t_gui_buffer* %0, %struct.t_gui_nick_group* %1, i8* %2) {
%4 = alloca %struct.t_gui_buffer*
%5 = alloca %struct.t_gui_nick_group*
%6 = alloca i8*
%7 = alloca i8*
store %struct.t_gui_buffer* %0, %struct.t_gui_buffer** %4
store %struct.t_gui_nick_group* %1, %struct.t_gui_nick_group** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i8* @gui_nicklist_get_group_start(i8* %8)
store i8* %9, i8** %7
%10 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %4
%11 = load %struct.t_gui_nick_group*, %struct.t_gui_nick_group** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %6
%15 = icmp eq i8* %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = call %struct.t_gui_nick_group* @gui_nicklist_search_group_internal(%struct.t_gui_buffer* %10, %struct.t_gui_nick_group* %11, i8* %12, i32 %17)
ret %struct.t_gui_nick_group* %18
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
%struct.t_gui_nick_group = type { i32 }
define %struct.t_gui_nick_group* @gui_nicklist_search_group(%struct.t_gui_buffer* %0, %struct.t_gui_nick_group* %1, i8* %2) {
%4 = tail call i8* @gui_nicklist_get_group_start(i8* %2)
%5 = icmp eq i8* %4, %2
%6 = zext i1 %5 to i32
%7 = tail call %struct.t_gui_nick_group* @gui_nicklist_search_group_internal(%struct.t_gui_buffer* %0, %struct.t_gui_nick_group* %1, i8* %2, i32 %6)
ret %struct.t_gui_nick_group* %7
}