#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;
};
typedef int /*<<< orphan*/ hash_key;

/* Variables and functions */
int /*<<< orphan*/ hashtable_set(struct t_hashtable *, char *, char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void gui_focus_buffer_localvar_map_cb(void *data, struct t_hashtable *hashtable,
                                      const void *key, const void *value) {
  struct t_hashtable *hashtable_focus;
  char hash_key[512];
  (void)hashtable;
  hashtable_focus = (struct t_hashtable *)data;
  if (hashtable_focus && key && value) {
    snprintf(hash_key, sizeof(hash_key), "_buffer_localvar_%s",
             (const char *)key);
    hashtable_set(hashtable_focus, hash_key, (const char *)value);
  }
}


x86 assembly (clang, -O0):
<gui_focus_buffer_localvar_map_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1194 <gui_focus_buffer_localvar_map_cb+0x74>
cmpq   $0x0,-0x18(%rbp)
je     1194 <gui_focus_buffer_localvar_map_cb+0x74>
cmpq   $0x0,-0x20(%rbp)
je     1194 <gui_focus_buffer_localvar_map_cb+0x74>
lea    -0x230(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x200,%esi
lea    0xe85(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <hashtable_set@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_focus_buffer_localvar_map_cb>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
test   %rdi,%rdi
je     1169 <gui_focus_buffer_localvar_map_cb+0x49>
mov    %rcx,%r14
mov    %rdx,%rcx
test   %rdx,%rdx
je     1169 <gui_focus_buffer_localvar_map_cb+0x49>
test   %r14,%r14
je     1169 <gui_focus_buffer_localvar_map_cb+0x49>
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <hashtable_set@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.t_hashtable = type { i32 }
@.str = [20 x i8] c"_buffer_localvar_%s\00"
define void @gui_focus_buffer_localvar_map_cb(i8* %0, %struct.t_hashtable* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca %struct.t_hashtable*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.t_hashtable*
%10 = alloca [512 x i8]
store i8* %0, i8** %5
store %struct.t_hashtable* %1, %struct.t_hashtable** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load %struct.t_hashtable*, %struct.t_hashtable** %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to %struct.t_hashtable*
store %struct.t_hashtable* %13, %struct.t_hashtable** %9
%14 = load %struct.t_hashtable*, %struct.t_hashtable** %9
%15 = icmp ne %struct.t_hashtable* %14, null
br i1 %15, label %16, label %30
16: ; preds = %4
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %30
19: ; preds = %16
%20 = load i8*, i8** %8
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%24 = load i8*, i8** %7
%25 = call i32 @snprintf(i8* %23, i32 512, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load %struct.t_hashtable*, %struct.t_hashtable** %9
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%28 = load i8*, i8** %8
%29 = call i32 @hashtable_set(%struct.t_hashtable* %26, i8* %27, i8* %28)
br label %30
30: ; preds = %22, %19, %16, %4
ret void
}

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
@.str = [20 x i8] c"_buffer_localvar_%s\00"
define void @gui_focus_buffer_localvar_map_cb(i8* %0, %struct.t_hashtable* nocapture readnone %1, i8* %2, i8* %3) {
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = icmp ne i8* %0, null
%8 = icmp ne i8* %2, null
%9 = and i1 %7, %8
%10 = icmp ne i8* %3, null
%11 = and i1 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = bitcast i8* %0 to %struct.t_hashtable*
%14 = call i32 @snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
%15 = call i32 @hashtable_set(%struct.t_hashtable* %13, i8* %6, i8* %3)
br label %16
16: ; preds = %12, %4
ret void
}