#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 dns_resolver {
  int dummy;
};
struct dns_resolv_conf {
  int dummy;
};
struct dns_options {
  int dummy;
};
struct dns_hosts {
  int dummy;
};
struct dns_hints {
  int dummy;
};
struct dns_cache {
  int dummy;
};

/* Variables and functions */
struct dns_resolver *levee_dns_res_open(int, struct dns_resolv_conf *,
                                        struct dns_hosts *, struct dns_hints *,
                                        struct dns_cache *,
                                        struct dns_options const *, int *);
struct dns_resolver *dns_res_open(struct dns_resolv_conf *resconf,
                                  struct dns_hosts *hosts,
                                  struct dns_hints *hints,
                                  struct dns_cache *cache,
                                  const struct dns_options *opts, int *_error) {
  return levee_dns_res_open(-1, resconf, hosts, hints, cache, opts, _error);
}


x86 assembly (clang, -O0):
<dns_res_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edi
mov    %rax,(%rsp)
call   1030 <levee_dns_res_open@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_res_open>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r9,(%rsp)
mov    $0xffffffff,%edi
mov    %rax,%r9
call   1030 <levee_dns_res_open@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.dns_resolver = type { i32 }
%struct.dns_resolv_conf = type { i32 }
%struct.dns_hosts = type { i32 }
%struct.dns_hints = type { i32 }
%struct.dns_cache = type { i32 }
%struct.dns_options = type { i32 }
define %struct.dns_resolver* @dns_res_open(%struct.dns_resolv_conf* %0, %struct.dns_hosts* %1, %struct.dns_hints* %2, %struct.dns_cache* %3, %struct.dns_options* %4, i32* %5) {
%7 = alloca %struct.dns_resolv_conf*
%8 = alloca %struct.dns_hosts*
%9 = alloca %struct.dns_hints*
%10 = alloca %struct.dns_cache*
%11 = alloca %struct.dns_options*
%12 = alloca i32*
store %struct.dns_resolv_conf* %0, %struct.dns_resolv_conf** %7
store %struct.dns_hosts* %1, %struct.dns_hosts** %8
store %struct.dns_hints* %2, %struct.dns_hints** %9
store %struct.dns_cache* %3, %struct.dns_cache** %10
store %struct.dns_options* %4, %struct.dns_options** %11
store i32* %5, i32** %12
%13 = load %struct.dns_resolv_conf*, %struct.dns_resolv_conf** %7
%14 = load %struct.dns_hosts*, %struct.dns_hosts** %8
%15 = load %struct.dns_hints*, %struct.dns_hints** %9
%16 = load %struct.dns_cache*, %struct.dns_cache** %10
%17 = load %struct.dns_options*, %struct.dns_options** %11
%18 = load i32*, i32** %12
%19 = call %struct.dns_resolver* @levee_dns_res_open(i32 -1, %struct.dns_resolv_conf* %13, %struct.dns_hosts* %14, %struct.dns_hints* %15, %struct.dns_cache* %16, %struct.dns_options* %17, i32* %18)
ret %struct.dns_resolver* %19
}

LLVM IR (-O2):
%struct.dns_resolver = type { i32 }
%struct.dns_resolv_conf = type { i32 }
%struct.dns_hosts = type { i32 }
%struct.dns_hints = type { i32 }
%struct.dns_cache = type { i32 }
%struct.dns_options = type { i32 }
define %struct.dns_resolver* @dns_res_open(%struct.dns_resolv_conf* %0, %struct.dns_hosts* %1, %struct.dns_hints* %2, %struct.dns_cache* %3, %struct.dns_options* %4, i32* %5) {
%7 = tail call %struct.dns_resolver* @levee_dns_res_open(i32 -1, %struct.dns_resolv_conf* %0, %struct.dns_hosts* %1, %struct.dns_hints* %2, %struct.dns_cache* %3, %struct.dns_options* %4, i32* %5)
ret %struct.dns_resolver* %7
}