#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 */
typedef int /*<<< orphan*/ hwloc_topology_t;
typedef int /*<<< orphan*/ hwloc_obj_type_t;
typedef scalar_t__ hwloc_obj_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ HWLOC_OBJ_CORE;
int /*<<< orphan*/ HWLOC_OBJ_NODE;
int /*<<< orphan*/ HWLOC_OBJ_PU;
int /*<<< orphan*/ HWLOC_OBJ_SOCKET;
int /*<<< orphan*/ assert(int);
scalar_t__ hwloc_get_obj_below_array_by_type(int /*<<< orphan*/, int,
                                             int /*<<< orphan*/ *,
                                             unsigned int *);
scalar_t__ hwloc_get_obj_below_by_type(int /*<<< orphan*/, int /*<<< orphan*/,
                                       unsigned int, int /*<<< orphan*/,
                                       unsigned int);
scalar_t__ hwloc_get_obj_by_depth(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ hwloc_topology_destroy(int /*<<< orphan*/);
int hwloc_topology_init(int /*<<< orphan*/ *);
int hwloc_topology_load(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_set_synthetic(int /*<<< orphan*/, char *);
int main(void) {
  hwloc_topology_t topology;
  hwloc_obj_t obj;
  hwloc_obj_type_t typev[4];
  unsigned idxv[4];
  int err;
  err = hwloc_topology_init(&topology);
  if (err)
    return EXIT_FAILURE;
  hwloc_topology_set_synthetic(topology, "node:3 socket:3 core:3 pu:3");
  err = hwloc_topology_load(topology);
  if (err)
    return EXIT_FAILURE;
  typev[0] = HWLOC_OBJ_NODE;
  idxv[0] = 0;
  typev[1] = HWLOC_OBJ_SOCKET;
  idxv[1] = 0;
  typev[2] = HWLOC_OBJ_CORE;
  idxv[2] = 0;
  typev[3] = HWLOC_OBJ_PU;
  idxv[3] = 0;
  obj = hwloc_get_obj_below_array_by_type(topology, 4, typev, idxv);
  assert(obj == hwloc_get_obj_by_depth(topology, 4, 0));
  typev[0] = HWLOC_OBJ_NODE;
  idxv[0] = 2;
  typev[1] = HWLOC_OBJ_SOCKET;
  idxv[1] = 2;
  typev[2] = HWLOC_OBJ_CORE;
  idxv[2] = 2;
  obj = hwloc_get_obj_below_array_by_type(topology, 3, typev, idxv);
  assert(obj == hwloc_get_obj_by_depth(topology, 3, 26));
  typev[0] = HWLOC_OBJ_SOCKET;
  idxv[0] = 2;
  obj = hwloc_get_obj_below_array_by_type(topology, 1, typev, idxv);
  assert(obj == hwloc_get_obj_by_depth(topology, 2, 2));
  typev[0] = HWLOC_OBJ_NODE;
  idxv[0] = 2;
  typev[1] = HWLOC_OBJ_CORE;
  idxv[1] = 2;
  obj = hwloc_get_obj_below_array_by_type(topology, 2, typev, idxv);
  assert(obj == hwloc_get_obj_by_depth(topology, 3, 20));
  obj = hwloc_get_obj_below_by_type(topology, typev[0], idxv[0], typev[1],
                                    idxv[1]);
  assert(obj == hwloc_get_obj_by_depth(topology, 3, 20));
  typev[0] = HWLOC_OBJ_SOCKET;
  idxv[0] = 1;
  typev[1] = HWLOC_OBJ_PU;
  idxv[1] = 1;
  obj = hwloc_get_obj_below_array_by_type(topology, 2, typev, idxv);
  assert(obj == hwloc_get_obj_by_depth(topology, 4, 10));
  obj = hwloc_get_obj_below_by_type(topology, typev[0], idxv[0], typev[1],
                                    idxv[1]);
  assert(obj == hwloc_get_obj_by_depth(topology, 4, 10));
  hwloc_topology_destroy(topology);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <hwloc_topology_init@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     11b6 <main+0x36>
mov    0x2e14(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e3 <main+0x363>
mov    -0x8(%rbp),%edi
lea    0xe40(%rip),%rsi
call   1080 <hwloc_topology_set_synthetic@plt>
mov    -0x8(%rbp),%edi
call   1060 <hwloc_topology_load@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     11eb <main+0x6b>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e3 <main+0x363>
mov    0x2df6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2ddb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x4,%esi
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x2,-0x30(%rbp)
mov    0x2d48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x2,-0x2c(%rbp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x3,%esi
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
mov    $0x1a,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2cd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x2,-0x30(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2c86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x2,-0x30(%rbp)
mov    0x2c53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x2,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x2,%esi
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
mov    $0x14,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
call   1040 <hwloc_get_obj_below_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
mov    $0x14,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2bc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x30(%rbp)
mov    0x2ba1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x2,%esi
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
call   1040 <hwloc_get_obj_below_by_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x8(%rbp),%edi
call   1090 <hwloc_topology_destroy@plt>
mov    0x2ada(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xc(%rsp),%rdi
call   1050 <hwloc_topology_init@plt>
mov    0x2e21(%rip),%rbx
test   %eax,%eax
jne    1431 <main+0x2b1>
mov    0xc(%rsp),%edi
lea    0xe4e(%rip),%rsi
call   1080 <hwloc_topology_set_synthetic@plt>
mov    0xc(%rsp),%edi
call   1060 <hwloc_topology_load@plt>
test   %eax,%eax
jne    1431 <main+0x2b1>
mov    0x2e19(%rip),%rcx
mov    (%rcx),%eax
mov    %rcx,%r12
mov    %eax,0x10(%rsp)
mov    0x2e01(%rip),%rcx
mov    (%rcx),%eax
mov    %rcx,%rbp
mov    %eax,0x14(%rsp)
mov    0x2dd9(%rip),%r13
mov    0x0(%r13),%eax
mov    %eax,0x18(%rsp)
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%r15
lea    0x20(%rsp),%r14
mov    $0x4,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    (%r12),%eax
mov    %eax,0x10(%rsp)
movl   $0x2,0x20(%rsp)
mov    0x0(%rbp),%eax
mov    %eax,0x14(%rsp)
movabs $0x200000002,%r12
mov    %r12,0x24(%rsp)
mov    0x0(%r13),%eax
mov    %eax,0x18(%rsp)
mov    0xc(%rsp),%edi
mov    $0x3,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x3,%esi
mov    $0x1a,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x10(%rsp)
movl   $0x2,0x20(%rsp)
mov    0xc(%rsp),%edi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0x2ce9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    %r12,0x20(%rsp)
mov    0x0(%r13),%eax
mov    %eax,0x14(%rsp)
mov    0xc(%rsp),%edi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x3,%esi
mov    $0x14,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%ecx
mov    0x20(%rsp),%edx
mov    0x24(%rsp),%r8d
call   1040 <hwloc_get_obj_below_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x3,%esi
mov    $0x14,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x10(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x20(%rsp)
mov    0x2c2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0xc(%rsp),%edi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   10a0 <hwloc_get_obj_below_array_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%ecx
mov    0x20(%rsp),%edx
mov    0x24(%rsp),%r8d
call   1040 <hwloc_get_obj_below_by_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <hwloc_get_obj_by_depth@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1070 <assert@plt>
mov    0xc(%rsp),%edi
call   1090 <hwloc_topology_destroy@plt>
mov    0x2b87(%rip),%rbx
mov    (%rbx),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [28 x i8] c"node:3 socket:3 core:3 pu:3\00"
@HWLOC_OBJ_NODE = global i32 0
@HWLOC_OBJ_SOCKET = global i32 0
@HWLOC_OBJ_CORE = global i32 0
@HWLOC_OBJ_PU = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca [4 x i32]
%5 = alloca [4 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @hwloc_topology_init(i32* %2)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %1
br label %143
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i32 @hwloc_topology_set_synthetic(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = call i32 @hwloc_topology_load(i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i32, i32* @EXIT_FAILURE
store i32 %20, i32* %1
br label %143
21: ; preds = %12
%22 = load i32, i32* @HWLOC_OBJ_NODE
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %22, i32* %23
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 0, i32* %24
%25 = load i32, i32* @HWLOC_OBJ_SOCKET
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %25, i32* %26
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 0, i32* %27
%28 = load i32, i32* @HWLOC_OBJ_CORE
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
store i32 %28, i32* %29
%30 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 0, i32* %30
%31 = load i32, i32* @HWLOC_OBJ_PU
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
store i32 %31, i32* %32
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 0, i32* %33
%34 = load i32, i32* %2
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%37 = call i64 @hwloc_get_obj_below_array_by_type(i32 %34, i32 4, i32* %35, i32* %36)
store i64 %37, i64* %3
%38 = load i64, i64* %3
%39 = load i32, i32* %2
%40 = call i64 @hwloc_get_obj_by_depth(i32 %39, i32 4, i32 0)
%41 = icmp eq i64 %38, %40
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = load i32, i32* @HWLOC_OBJ_NODE
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %44, i32* %45
%46 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 2, i32* %46
%47 = load i32, i32* @HWLOC_OBJ_SOCKET
%48 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %47, i32* %48
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 2, i32* %49
%50 = load i32, i32* @HWLOC_OBJ_CORE
%51 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
store i32 %50, i32* %51
%52 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 2, i32* %52
%53 = load i32, i32* %2
%54 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%55 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%56 = call i64 @hwloc_get_obj_below_array_by_type(i32 %53, i32 3, i32* %54, i32* %55)
store i64 %56, i64* %3
%57 = load i64, i64* %3
%58 = load i32, i32* %2
%59 = call i64 @hwloc_get_obj_by_depth(i32 %58, i32 3, i32 26)
%60 = icmp eq i64 %57, %59
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load i32, i32* @HWLOC_OBJ_SOCKET
%64 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %63, i32* %64
%65 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 2, i32* %65
%66 = load i32, i32* %2
%67 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%68 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%69 = call i64 @hwloc_get_obj_below_array_by_type(i32 %66, i32 1, i32* %67, i32* %68)
store i64 %69, i64* %3
%70 = load i64, i64* %3
%71 = load i32, i32* %2
%72 = call i64 @hwloc_get_obj_by_depth(i32 %71, i32 2, i32 2)
%73 = icmp eq i64 %70, %72
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = load i32, i32* @HWLOC_OBJ_NODE
%77 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %76, i32* %77
%78 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 2, i32* %78
%79 = load i32, i32* @HWLOC_OBJ_CORE
%80 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %79, i32* %80
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 2, i32* %81
%82 = load i32, i32* %2
%83 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%84 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%85 = call i64 @hwloc_get_obj_below_array_by_type(i32 %82, i32 2, i32* %83, i32* %84)
store i64 %85, i64* %3
%86 = load i64, i64* %3
%87 = load i32, i32* %2
%88 = call i64 @hwloc_get_obj_by_depth(i32 %87, i32 3, i32 20)
%89 = icmp eq i64 %86, %88
%90 = zext i1 %89 to i32
%91 = call i32 @assert(i32 %90)
%92 = load i32, i32* %2
%93 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%94 = load i32, i32* %93
%95 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%96 = load i32, i32* %95
%97 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%98 = load i32, i32* %97
%99 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%100 = load i32, i32* %99
%101 = call i64 @hwloc_get_obj_below_by_type(i32 %92, i32 %94, i32 %96, i32 %98, i32 %100)
store i64 %101, i64* %3
%102 = load i64, i64* %3
%103 = load i32, i32* %2
%104 = call i64 @hwloc_get_obj_by_depth(i32 %103, i32 3, i32 20)
%105 = icmp eq i64 %102, %104
%106 = zext i1 %105 to i32
%107 = call i32 @assert(i32 %106)
%108 = load i32, i32* @HWLOC_OBJ_SOCKET
%109 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %108, i32* %109
%110 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 1, i32* %110
%111 = load i32, i32* @HWLOC_OBJ_PU
%112 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %111, i32* %112
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 1, i32* %113
%114 = load i32, i32* %2
%115 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%116 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%117 = call i64 @hwloc_get_obj_below_array_by_type(i32 %114, i32 2, i32* %115, i32* %116)
store i64 %117, i64* %3
%118 = load i64, i64* %3
%119 = load i32, i32* %2
%120 = call i64 @hwloc_get_obj_by_depth(i32 %119, i32 4, i32 10)
%121 = icmp eq i64 %118, %120
%122 = zext i1 %121 to i32
%123 = call i32 @assert(i32 %122)
%124 = load i32, i32* %2
%125 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%126 = load i32, i32* %125
%127 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%128 = load i32, i32* %127
%129 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%130 = load i32, i32* %129
%131 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%132 = load i32, i32* %131
%133 = call i64 @hwloc_get_obj_below_by_type(i32 %124, i32 %126, i32 %128, i32 %130, i32 %132)
store i64 %133, i64* %3
%134 = load i64, i64* %3
%135 = load i32, i32* %2
%136 = call i64 @hwloc_get_obj_by_depth(i32 %135, i32 4, i32 10)
%137 = icmp eq i64 %134, %136
%138 = zext i1 %137 to i32
%139 = call i32 @assert(i32 %138)
%140 = load i32, i32* %2
%141 = call i32 @hwloc_topology_destroy(i32 %140)
%142 = load i32, i32* @EXIT_SUCCESS
store i32 %142, i32* %1
br label %143
143: ; preds = %21, %19, %10
%144 = load i32, i32* %1
ret i32 %144
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [28 x i8] c"node:3 socket:3 core:3 pu:3\00"
@HWLOC_OBJ_NODE = global i32 0
@HWLOC_OBJ_SOCKET = global i32 0
@HWLOC_OBJ_CORE = global i32 0
@HWLOC_OBJ_PU = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca <4 x i32>
%4 = bitcast i32* %1 to i8*
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast <4 x i32>* %3 to i8*
%7 = call i32 @hwloc_topology_init(i32* %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %94
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 @hwloc_topology_set_synthetic(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = call i32 @hwloc_topology_load(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %94
15: ; preds = %9
%16 = load i32, i32* @HWLOC_OBJ_NODE
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 %16, i32* %17
%18 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%19 = load i32, i32* @HWLOC_OBJ_SOCKET
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 %19, i32* %20
%21 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 1
%22 = load i32, i32* @HWLOC_OBJ_CORE
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
store i32 %22, i32* %23
%24 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 2
%25 = load i32, i32* @HWLOC_OBJ_PU
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
store i32 %25, i32* %26
store <4 x i32> zeroinitializer, <4 x i32>* %3
%27 = load i32, i32* %1
%28 = call i64 @hwloc_get_obj_below_array_by_type(i32 %27, i32 4, i32* %17, i32* %18)
%29 = load i32, i32* %1
%30 = call i64 @hwloc_get_obj_by_depth(i32 %29, i32 4, i32 0)
%31 = icmp eq i64 %28, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i32, i32* @HWLOC_OBJ_NODE
store i32 %34, i32* %17
store i32 2, i32* %18
%35 = load i32, i32* @HWLOC_OBJ_SOCKET
store i32 %35, i32* %20
store i32 2, i32* %21
%36 = load i32, i32* @HWLOC_OBJ_CORE
store i32 %36, i32* %23
store i32 2, i32* %24
%37 = load i32, i32* %1
%38 = call i64 @hwloc_get_obj_below_array_by_type(i32 %37, i32 3, i32* %17, i32* %18)
%39 = load i32, i32* %1
%40 = call i64 @hwloc_get_obj_by_depth(i32 %39, i32 3, i32 26)
%41 = icmp eq i64 %38, %40
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = load i32, i32* @HWLOC_OBJ_SOCKET
store i32 %44, i32* %17
store i32 2, i32* %18
%45 = load i32, i32* %1
%46 = call i64 @hwloc_get_obj_below_array_by_type(i32 %45, i32 1, i32* %17, i32* %18)
%47 = load i32, i32* %1
%48 = call i64 @hwloc_get_obj_by_depth(i32 %47, i32 2, i32 2)
%49 = icmp eq i64 %46, %48
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = load i32, i32* @HWLOC_OBJ_NODE
store i32 %52, i32* %17
store i32 2, i32* %18
%53 = load i32, i32* @HWLOC_OBJ_CORE
store i32 %53, i32* %20
store i32 2, i32* %21
%54 = load i32, i32* %1
%55 = call i64 @hwloc_get_obj_below_array_by_type(i32 %54, i32 2, i32* %17, i32* %18)
%56 = load i32, i32* %1
%57 = call i64 @hwloc_get_obj_by_depth(i32 %56, i32 3, i32 20)
%58 = icmp eq i64 %55, %57
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = load i32, i32* %1
%62 = load i32, i32* %17
%63 = load i32, i32* %18
%64 = load i32, i32* %20
%65 = load i32, i32* %21
%66 = call i64 @hwloc_get_obj_below_by_type(i32 %61, i32 %62, i32 %63, i32 %64, i32 %65)
%67 = load i32, i32* %1
%68 = call i64 @hwloc_get_obj_by_depth(i32 %67, i32 3, i32 20)
%69 = icmp eq i64 %66, %68
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = load i32, i32* @HWLOC_OBJ_SOCKET
store i32 %72, i32* %17
store i32 1, i32* %18
%73 = load i32, i32* @HWLOC_OBJ_PU
store i32 %73, i32* %20
store i32 1, i32* %21
%74 = load i32, i32* %1
%75 = call i64 @hwloc_get_obj_below_array_by_type(i32 %74, i32 2, i32* %17, i32* %18)
%76 = load i32, i32* %1
%77 = call i64 @hwloc_get_obj_by_depth(i32 %76, i32 4, i32 10)
%78 = icmp eq i64 %75, %77
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = load i32, i32* %1
%82 = load i32, i32* %17
%83 = load i32, i32* %18
%84 = load i32, i32* %20
%85 = load i32, i32* %21
%86 = call i64 @hwloc_get_obj_below_by_type(i32 %81, i32 %82, i32 %83, i32 %84, i32 %85)
%87 = load i32, i32* %1
%88 = call i64 @hwloc_get_obj_by_depth(i32 %87, i32 4, i32 10)
%89 = icmp eq i64 %86, %88
%90 = zext i1 %89 to i32
%91 = call i32 @assert(i32 %90)
%92 = load i32, i32* %1
%93 = call i32 @hwloc_topology_destroy(i32 %92)
br label %94
94: ; preds = %9, %0, %15
%95 = phi i32* [ @EXIT_SUCCESS, %15 ], [ @EXIT_FAILURE, %0 ], [ @EXIT_FAILURE, %9 ]
%96 = load i32, i32* %95
ret i32 %96
}