#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 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(struct hashtable *);
char *hashtable_strerror(int);
int /*<<< orphan*/ stderr;
void hashtable_new_f(struct hashtable *ht) {
  int r;
  r = hashtable_new(ht);
  if (r != 0) {
    fprintf(stderr, "Error creating hashtable: %s\n", hashtable_strerror(r));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<hashtable_new_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <hashtable_new@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1196 <hashtable_new_f+0x56>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <hashtable_strerror@plt>
mov    -0x10(%rbp),%edi
mov    %rax,%rdx
lea    0xe7d(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_new_f>:
push   %rbx
call   1050 <hashtable_new@plt>
test   %eax,%eax
jne    114c <hashtable_new_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   1040 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.hashtable = 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_f(%struct.hashtable* %0) {
%2 = alloca %struct.hashtable*
%3 = alloca i32
store %struct.hashtable* %0, %struct.hashtable** %2
%4 = load %struct.hashtable*, %struct.hashtable** %2
%5 = call i32 @hashtable_new(%struct.hashtable* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = call i8* @hashtable_strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.hashtable = 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_f(%struct.hashtable* %0) {
%2 = tail call i32 @hashtable_new(%struct.hashtable* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i8* @hashtable_strerror(i32 %2)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}