#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 hashtablesettings {
  int dummy;
};
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int hashtable_new_custom(struct hashtable *, struct hashtablesettings const *);
char *hashtable_strerror(int);
int /*<<< orphan*/ stderr;
void hashtable_new_custom_f(struct hashtable *ht,
                            const struct hashtablesettings *s) {
  int r;
  r = hashtable_new_custom(ht, s);
  if (r != 0) {
    fprintf(stderr, "Error creating hashtable: %s\n", hashtable_strerror(r));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<hashtable_new_custom_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <hashtable_new_custom@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     119e <hashtable_new_custom_f+0x5e>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <hashtable_strerror@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rdx
lea    0xe75(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_new_custom_f>:
push   %rbx
call   1040 <hashtable_new_custom@plt>
test   %eax,%eax
jne    114c <hashtable_new_custom_f+0xc>
pop    %rbx
ret
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1030 <hashtable_strerror@plt>
lea    0xe9d(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1050 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.hashtable = type { i32 }
%struct.hashtablesettings = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"Error creating hashtable: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @hashtable_new_custom_f(%struct.hashtable* %0, %struct.hashtablesettings* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca %struct.hashtablesettings*
%5 = alloca i32
store %struct.hashtable* %0, %struct.hashtable** %3
store %struct.hashtablesettings* %1, %struct.hashtablesettings** %4
%6 = load %struct.hashtable*, %struct.hashtable** %3
%7 = load %struct.hashtablesettings*, %struct.hashtablesettings** %4
%8 = call i32 @hashtable_new_custom(%struct.hashtable* %6, %struct.hashtablesettings* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %5
%14 = call i8* @hashtable_strerror(i32 %13)
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
%struct.hashtablesettings = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"Error creating hashtable: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @hashtable_new_custom_f(%struct.hashtable* %0, %struct.hashtablesettings* %1) {
%3 = tail call i32 @hashtable_new_custom(%struct.hashtable* %0, %struct.hashtablesettings* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @hashtable_strerror(i32 %3)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret void
}