#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 yuuu_ipfrags_node {
  int dummy;
};
struct yuuu_ipfrags {
  int dummy;
};

/* Variables and functions */
struct yuuu_ipfrags_node *yuuu_ipfrags_alloc(struct yuuu_ipfrags *, void *);
struct yuuu_ipfrags_node *
yuuu_ipfrags_intern(struct yuuu_ipfrags *, struct yuuu_ipfrags_node *, void *);
struct yuuu_ipfrags_node *yuuu_ipfrags_add(struct yuuu_ipfrags *ipfrags,
                                           void *keys) {
  struct yuuu_ipfrags_node *item;
  item = yuuu_ipfrags_alloc(ipfrags, keys);
  if (!item)
    return NULL;
  return yuuu_ipfrags_intern(ipfrags, item, keys);
}


x86 assembly (clang, -O0):
<yuuu_ipfrags_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <yuuu_ipfrags_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <yuuu_ipfrags_add+0x39>
movq   $0x0,-0x8(%rbp)
jmp    116e <yuuu_ipfrags_add+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <yuuu_ipfrags_intern@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuuu_ipfrags_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <yuuu_ipfrags_alloc@plt>
test   %rax,%rax
je     1149 <yuuu_ipfrags_add+0x29>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <yuuu_ipfrags_intern@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.yuuu_ipfrags_node = type { i32 }
%struct.yuuu_ipfrags = type { i32 }
define %struct.yuuu_ipfrags_node* @yuuu_ipfrags_add(%struct.yuuu_ipfrags* %0, i8* %1) {
%3 = alloca %struct.yuuu_ipfrags_node*
%4 = alloca %struct.yuuu_ipfrags*
%5 = alloca i8*
%6 = alloca %struct.yuuu_ipfrags_node*
store %struct.yuuu_ipfrags* %0, %struct.yuuu_ipfrags** %4
store i8* %1, i8** %5
%7 = load %struct.yuuu_ipfrags*, %struct.yuuu_ipfrags** %4
%8 = load i8*, i8** %5
%9 = call %struct.yuuu_ipfrags_node* @yuuu_ipfrags_alloc(%struct.yuuu_ipfrags* %7, i8* %8)
store %struct.yuuu_ipfrags_node* %9, %struct.yuuu_ipfrags_node** %6
%10 = load %struct.yuuu_ipfrags_node*, %struct.yuuu_ipfrags_node** %6
%11 = icmp ne %struct.yuuu_ipfrags_node* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store %struct.yuuu_ipfrags_node* null, %struct.yuuu_ipfrags_node** %3
br label %18
13: ; preds = %2
%14 = load %struct.yuuu_ipfrags*, %struct.yuuu_ipfrags** %4
%15 = load %struct.yuuu_ipfrags_node*, %struct.yuuu_ipfrags_node** %6
%16 = load i8*, i8** %5
%17 = call %struct.yuuu_ipfrags_node* @yuuu_ipfrags_intern(%struct.yuuu_ipfrags* %14, %struct.yuuu_ipfrags_node* %15, i8* %16)
store %struct.yuuu_ipfrags_node* %17, %struct.yuuu_ipfrags_node** %3
br label %18
18: ; preds = %13, %12
%19 = load %struct.yuuu_ipfrags_node*, %struct.yuuu_ipfrags_node** %3
ret %struct.yuuu_ipfrags_node* %19
}

LLVM IR (-O2):
%struct.yuuu_ipfrags_node = type { i32 }
%struct.yuuu_ipfrags = type { i32 }
define %struct.yuuu_ipfrags_node* @yuuu_ipfrags_add(%struct.yuuu_ipfrags* %0, i8* %1) {
%3 = tail call %struct.yuuu_ipfrags_node* @yuuu_ipfrags_alloc(%struct.yuuu_ipfrags* %0, i8* %1)
%4 = icmp eq %struct.yuuu_ipfrags_node* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.yuuu_ipfrags_node* @yuuu_ipfrags_intern(%struct.yuuu_ipfrags* %0, %struct.yuuu_ipfrags_node* %3, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.yuuu_ipfrags_node* [ %6, %5 ], [ null, %2 ]
ret %struct.yuuu_ipfrags_node* %8
}