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

/* Variables and functions */
void const *cl_rhash_insert(struct cl_rhash *, void **);
int /*<<< orphan*/ cl_rhash_is_map(struct cl_rhash *);
const void *cl_rhash_put(struct cl_rhash *hash, const void *key,
                         const void *value) {
  if (!cl_rhash_is_map(hash))
    return NULL;
  void *tent[2];
  tent[0] = (void *)key;
  tent[1] = (void *)value;
  return cl_rhash_insert(hash, tent);
}


x86 assembly (clang, -O0):
<cl_rhash_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cl_rhash_is_map@plt>
cmp    $0x0,%eax
jne    1153 <cl_rhash_put+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1174 <cl_rhash_put+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <cl_rhash_insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_put>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <cl_rhash_is_map@plt>
test   %eax,%eax
je     1151 <cl_rhash_put+0x31>
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <cl_rhash_insert@plt>
jmp    1153 <cl_rhash_put+0x33>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.cl_rhash = type { i32 }
define i8* @cl_rhash_put(%struct.cl_rhash* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.cl_rhash*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [2 x i8*]
store %struct.cl_rhash* %0, %struct.cl_rhash** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load %struct.cl_rhash*, %struct.cl_rhash** %5
%10 = call i32 @cl_rhash_is_map(%struct.cl_rhash* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %3
store i8* null, i8** %4
br label %21
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 0
store i8* %14, i8** %15
%16 = load i8*, i8** %7
%17 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 1
store i8* %16, i8** %17
%18 = load %struct.cl_rhash*, %struct.cl_rhash** %5
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 0
%20 = call i8* @cl_rhash_insert(%struct.cl_rhash* %18, i8** %19)
store i8* %20, i8** %4
br label %21
21: ; preds = %13, %12
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
%struct.cl_rhash = type { i32 }
define i8* @cl_rhash_put(%struct.cl_rhash* %0, i8* %1, i8* %2) {
%4 = alloca [2 x i8*]
%5 = tail call i32 @cl_rhash_is_map(%struct.cl_rhash* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = bitcast [2 x i8*]* %4 to i8*
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
store i8* %1, i8** %9
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 1
store i8* %2, i8** %10
%11 = call i8* @cl_rhash_insert(%struct.cl_rhash* %0, i8** %9)
br label %12
12: ; preds = %3, %7
%13 = phi i8* [ %11, %7 ], [ null, %3 ]
ret i8* %13
}