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

/* Variables and functions */
char *hashtable_get(struct t_hashtable *, char const *);
char *strdup(char const *);
char *gui_key_focus_command_replace_cb(void *data, const char *text) {
  struct t_hashtable *ptr_hashtable;
  const char *ptr_value;
  ptr_hashtable = (struct t_hashtable *)data;
  if (ptr_hashtable) {
    ptr_value = hashtable_get(ptr_hashtable, text);
    if (ptr_value)
      return strdup(ptr_value);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<gui_key_focus_command_replace_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <gui_key_focus_command_replace_cb+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hashtable_get@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <gui_key_focus_command_replace_cb+0x51>
mov    -0x28(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    117e <gui_key_focus_command_replace_cb+0x5e>
jmp    1176 <gui_key_focus_command_replace_cb+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_key_focus_command_replace_cb>:
test   %rdi,%rdi
je     113d <gui_key_focus_command_replace_cb+0x1d>
push   %rax
call   1030 <hashtable_get@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     113d <gui_key_focus_command_replace_cb+0x1d>
mov    %rax,%rdi
jmp    1040 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.t_hashtable = type { i32 }
define i8* @gui_key_focus_command_replace_cb(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_hashtable*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.t_hashtable*
store %struct.t_hashtable* %9, %struct.t_hashtable** %6
%10 = load %struct.t_hashtable*, %struct.t_hashtable** %6
%11 = icmp ne %struct.t_hashtable* %10, null
br i1 %11, label %12, label %22
12: ; preds = %2
%13 = load %struct.t_hashtable*, %struct.t_hashtable** %6
%14 = load i8*, i8** %5
%15 = call i8* @hashtable_get(%struct.t_hashtable* %13, i8* %14)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i8*, i8** %7
%20 = call i8* @strdup(i8* %19)
store i8* %20, i8** %3
br label %23
21: ; preds = %12
br label %22
22: ; preds = %21, %2
store i8* null, i8** %3
br label %23
23: ; preds = %22, %18
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
define noalias i8* @gui_key_focus_command_replace_cb(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to %struct.t_hashtable*
%6 = tail call i8* @hashtable_get(%struct.t_hashtable* %5, i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i8* @strdup(i8* %6)
br label %10
10: ; preds = %2, %4, %8
%11 = phi i8* [ %9, %8 ], [ null, %4 ], [ null, %2 ]
ret i8* %11
}