#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ type;
typedef int /*<<< orphan*/ hwloc_topology_t;
typedef TYPE_1__ *hwloc_obj_t;
typedef int /*<<< orphan*/ hwloc_const_bitmap_t;
typedef int /*<<< orphan*/ hwloc_bitmap_t;
struct TYPE_5__ {
  int logical_index;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ HWLOC_CPUBIND_PROCESS;
int /*<<< orphan*/ HWLOC_CPUBIND_THREAD;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ hwloc_bitmap_alloc();
int /*<<< orphan*/ hwloc_bitmap_andnot(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_bitmap_asprintf(char **, int /*<<< orphan*/);
unsigned int hwloc_bitmap_first(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_bitmap_free(int /*<<< orphan*/);
scalar_t__ hwloc_bitmap_isequal(int /*<<< orphan*/, int /*<<< orphan*/);
int hwloc_bitmap_isincluded(int /*<<< orphan*/, int /*<<< orphan*/);
int hwloc_bitmap_weight(int /*<<< orphan*/);
int hwloc_get_cpubind(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int hwloc_get_last_cpu_location(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
TYPE_1__ *hwloc_get_obj_covering_cpuset(int /*<<< orphan*/, int /*<<< orphan*/);
TYPE_1__ *hwloc_get_pu_obj_by_os_index(int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ hwloc_obj_type_snprintf(char *, int, TYPE_1__ *,
                                           int /*<<< orphan*/);
int hwloc_set_cpubind(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_destroy(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_get_complete_cpuset(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_get_topology_cpuset(int /*<<< orphan*/);
int hwloc_topology_init(int /*<<< orphan*/ *);
int hwloc_topology_load(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(void) {
  hwloc_topology_t topology;
  hwloc_bitmap_t set, set2;
  hwloc_const_bitmap_t cset_available, cset_all;
  hwloc_obj_t obj;
  char *buffer;
  char type[64];
  unsigned i;
  int err;
  err = hwloc_topology_init(&topology);
  if (err < 0) {
    fprintf(stderr, "failed to initialize the topology\n");
    return EXIT_FAILURE;
  }
  err = hwloc_topology_load(topology);
  if (err < 0) {
    fprintf(stderr, "failed to load the topology\n");
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  cset_available = hwloc_topology_get_topology_cpuset(topology);
  set = hwloc_bitmap_alloc();
  if (!set) {
    fprintf(stderr, "failed to allocate a bitmap\n");
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  err = hwloc_get_cpubind(topology, set, HWLOC_CPUBIND_PROCESS);
  if (err < 0) {
    fprintf(stderr, "failed to get cpu binding\n");
    hwloc_bitmap_free(set);
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  if (hwloc_bitmap_isequal(set, cset_available)) {
    printf(
        "this process can use all available processing units in the system\n");
  } else {
    hwloc_bitmap_andnot(set, cset_available, set);
    hwloc_bitmap_asprintf(&buffer, set);
    printf("process cannot use %d process units (%s) among %u in the system\n",
           hwloc_bitmap_weight(set), buffer,
           hwloc_bitmap_weight(cset_available));
    free(buffer);
    hwloc_bitmap_andnot(set, cset_available, set);
  }
  obj = hwloc_get_obj_covering_cpuset(topology, set);
  hwloc_obj_type_snprintf(type, sizeof(type), obj, 0);
  printf("process is bound within object %s logical index %u\n", type,
         obj->logical_index);
  set2 = hwloc_bitmap_alloc();
  if (!set2) {
    fprintf(stderr, "failed to allocate a bitmap\n");
    hwloc_bitmap_free(set);
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  err = hwloc_get_last_cpu_location(topology, set2, HWLOC_CPUBIND_THREAD);
  if (err < 0) {
    fprintf(stderr, "failed to get last cpu location\n");
    hwloc_bitmap_free(set);
    hwloc_bitmap_free(set2);
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  assert(hwloc_bitmap_isincluded(set2, set));
  assert(hwloc_bitmap_weight(set2) == 1);
  i = hwloc_bitmap_first(set2);
  obj = hwloc_get_pu_obj_by_os_index(topology, i);
  printf(
      "thread is now running on PU logical index %u (OS/physical index %u)\n",
      obj->logical_index, i);
  hwloc_bitmap_andnot(set2, set, set2);
  err = hwloc_set_cpubind(topology, set2, HWLOC_CPUBIND_THREAD);
  if (err < 0) {
    fprintf(stderr, "failed to set thread binding\n");
    hwloc_bitmap_free(set);
    hwloc_bitmap_free(set2);
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  err = hwloc_get_last_cpu_location(topology, set2, HWLOC_CPUBIND_THREAD);
  if (err < 0) {
    fprintf(stderr, "failed to get last cpu location\n");
    hwloc_bitmap_free(set);
    hwloc_bitmap_free(set2);
    hwloc_topology_destroy(topology);
    return EXIT_FAILURE;
  }
  i = hwloc_bitmap_first(set2);
  obj = hwloc_get_pu_obj_by_os_index(topology, i);
  printf("thread is running on PU logical index %u (OS/physical index %u)\n",
         obj->logical_index, i);
  hwloc_bitmap_free(set);
  hwloc_bitmap_free(set2);
  cset_all = hwloc_topology_get_complete_cpuset(topology);
  if (hwloc_bitmap_isequal(cset_all, cset_available)) {
    printf("all hardware PUs are available\n");
  } else {
    printf("only %d hardware PUs are available in the machine among %d\n",
           hwloc_bitmap_weight(cset_available), hwloc_bitmap_weight(cset_all));
  }
  hwloc_topology_destroy(topology);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1070 <hwloc_topology_init@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    12be <main+0x4e>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
lea    0xd58(%rip),%rsi
call   10e0 <fprintf@plt>
mov    0x2d14(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x8(%rbp),%edi
call   1090 <hwloc_topology_load@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    1301 <main+0x91>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x8(%rbp),%edi
call   1110 <hwloc_topology_get_topology_cpuset@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    134e <main+0xde>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
lea    0xd10(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2c84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2c8d(%rip),%rax
mov    (%rax),%edx
call   10f0 <hwloc_get_cpubind@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    13a5 <main+0x135>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
lea    0xcde(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1130 <hwloc_bitmap_isequal@plt>
cmp    $0x0,%rax
je     13cd <main+0x15d>
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1436 <main+0x1c6>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1160 <hwloc_bitmap_andnot@plt>
mov    -0xc(%rbp),%esi
lea    -0x28(%rbp),%rdi
call   1080 <hwloc_bitmap_asprintf@plt>
mov    -0xc(%rbp),%edi
call   1190 <hwloc_bitmap_weight@plt>
mov    %eax,-0x84(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x14(%rbp),%edi
call   1190 <hwloc_bitmap_weight@plt>
mov    -0x84(%rbp),%esi
mov    -0x80(%rbp),%rdx
mov    %eax,%ecx
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1160 <hwloc_bitmap_andnot@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   10b0 <hwloc_get_obj_covering_cpuset@plt>
mov    %rax,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x40,%esi
xor    %ecx,%ecx
call   1140 <hwloc_obj_type_snprintf@plt>
lea    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x0,%al
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    14bb <main+0x24b>
mov    0x2b4c(%rip),%rax
mov    (%rax),%edi
lea    0xbab(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2b17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x2b08(%rip),%rax
mov    (%rax),%edx
call   1120 <hwloc_get_last_cpu_location@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    151a <main+0x2aa>
mov    0x2af5(%rip),%rax
mov    (%rax),%edi
lea    0xc44(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x10(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2ab8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <hwloc_bitmap_isincluded@plt>
mov    %eax,%edi
call   10d0 <assert@plt>
mov    -0x10(%rbp),%edi
call   1190 <hwloc_bitmap_weight@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10d0 <assert@plt>
mov    -0x10(%rbp),%edi
call   10c0 <hwloc_bitmap_first@plt>
mov    %eax,-0x74(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x74(%rbp),%esi
call   1150 <hwloc_get_pu_obj_by_os_index@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x74(%rbp),%edx
lea    0xbe3(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1160 <hwloc_bitmap_andnot@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x2a40(%rip),%rax
mov    (%rax),%edx
call   1100 <hwloc_set_cpubind@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    15e2 <main+0x372>
mov    0x2a2d(%rip),%rax
mov    (%rax),%edi
lea    0xbe2(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x10(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x29f0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    0x29e1(%rip),%rax
mov    (%rax),%edx
call   1120 <hwloc_get_last_cpu_location@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jge    1641 <main+0x3d1>
mov    0x29ce(%rip),%rax
mov    (%rax),%edi
lea    0xb1d(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x10(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x2991(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16f5 <main+0x485>
mov    -0x10(%rbp),%edi
call   10c0 <hwloc_bitmap_first@plt>
mov    %eax,-0x74(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x74(%rbp),%esi
call   1150 <hwloc_get_pu_obj_by_os_index@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x74(%rbp),%edx
lea    0xb49(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0xc(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x10(%rbp),%edi
call   1050 <hwloc_bitmap_free@plt>
mov    -0x8(%rbp),%edi
call   1180 <hwloc_topology_get_complete_cpuset@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1130 <hwloc_bitmap_isequal@plt>
cmp    $0x0,%rax
je     16b5 <main+0x445>
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    16e1 <main+0x471>
mov    -0x14(%rbp),%edi
call   1190 <hwloc_bitmap_weight@plt>
mov    %eax,-0x88(%rbp)
mov    -0x18(%rbp),%edi
call   1190 <hwloc_bitmap_weight@plt>
mov    -0x88(%rbp),%esi
mov    %eax,%edx
lea    0xb3b(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x8(%rbp),%edi
call   1170 <hwloc_topology_destroy@plt>
mov    0x28d0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
lea    0x4(%rsp),%rdi
call   1070 <hwloc_topology_init@plt>
test   %eax,%eax
js     12f8 <main+0x78>
mov    0x4(%rsp),%edi
call   10a0 <hwloc_topology_load@plt>
test   %eax,%eax
js     1312 <main+0x92>
mov    0x4(%rsp),%edi
call   1120 <hwloc_topology_get_topology_cpuset@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <hwloc_bitmap_alloc@plt>
test   %eax,%eax
je     1324 <main+0xa4>
mov    %eax,%ebx
mov    0x4(%rsp),%edi
mov    0x2d1d(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%esi
call   1100 <hwloc_get_cpubind@plt>
test   %eax,%eax
js     133e <main+0xbe>
mov    %ebx,%edi
mov    %r14d,%esi
call   1140 <hwloc_bitmap_isequal@plt>
test   %rax,%rax
je     1353 <main+0xd3>
lea    0xf1f(%rip),%rdi
call   1080 <puts@plt>
jmp    13ac <main+0x12c>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xcf8(%rip),%rsi
call   10f0 <fprintf@plt>
jmp    154e <main+0x2ce>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
jmp    1334 <main+0xb4>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
lea    0xd0c(%rip),%rsi
call   10f0 <fprintf@plt>
jmp    1545 <main+0x2c5>
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
lea    0xd0f(%rip),%rsi
jmp    1507 <main+0x287>
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebx,%edx
call   1170 <hwloc_bitmap_andnot@plt>
lea    0x8(%rsp),%rdi
mov    %ebx,%esi
call   1090 <hwloc_bitmap_asprintf@plt>
mov    %ebx,%edi
call   11a0 <hwloc_bitmap_weight@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%r15
mov    %r14d,%edi
call   11a0 <hwloc_bitmap_weight@plt>
lea    0xcf0(%rip),%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebx,%edx
call   1170 <hwloc_bitmap_andnot@plt>
mov    0x4(%rsp),%edi
mov    %ebx,%esi
call   10c0 <hwloc_get_obj_covering_cpuset@plt>
mov    %rax,%rbp
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x40,%esi
mov    %rax,%rdx
xor    %ecx,%ecx
call   1150 <hwloc_obj_type_snprintf@plt>
mov    0x0(%rbp),%edx
lea    0xcde(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
xor    %eax,%eax
call   1030 <hwloc_bitmap_alloc@plt>
test   %eax,%eax
je     14f7 <main+0x277>
mov    %eax,%ebp
mov    0x4(%rsp),%edi
mov    0x2bcf(%rip),%r12
mov    (%r12),%edx
mov    %eax,%esi
call   1130 <hwloc_get_last_cpu_location@plt>
test   %eax,%eax
js     1510 <main+0x290>
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <hwloc_bitmap_isincluded@plt>
mov    %eax,%edi
call   10e0 <assert@plt>
mov    %ebp,%edi
call   11a0 <hwloc_bitmap_weight@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   10e0 <assert@plt>
mov    %ebp,%edi
call   10d0 <hwloc_bitmap_first@plt>
mov    %eax,%r15d
mov    0x4(%rsp),%edi
mov    %eax,%esi
call   1160 <hwloc_get_pu_obj_by_os_index@plt>
mov    (%rax),%esi
lea    0xcb7(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1170 <hwloc_bitmap_andnot@plt>
mov    0x4(%rsp),%edi
mov    (%r12),%edx
mov    %ebp,%esi
call   1110 <hwloc_set_cpubind@plt>
test   %eax,%eax
js     1522 <main+0x2a2>
mov    0x4(%rsp),%edi
mov    (%r12),%edx
mov    %ebp,%esi
call   1130 <hwloc_get_last_cpu_location@plt>
test   %eax,%eax
js     1510 <main+0x290>
mov    %ebp,%edi
call   10d0 <hwloc_bitmap_first@plt>
mov    %eax,%r15d
mov    0x4(%rsp),%edi
mov    %eax,%esi
call   1160 <hwloc_get_pu_obj_by_os_index@plt>
mov    (%rax),%esi
lea    0xcbd(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %ebx,%edi
call   1050 <hwloc_bitmap_free@plt>
mov    %ebp,%edi
call   1050 <hwloc_bitmap_free@plt>
mov    0x4(%rsp),%edi
call   1190 <hwloc_topology_get_complete_cpuset@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14d,%esi
call   1140 <hwloc_bitmap_isequal@plt>
test   %rax,%rax
je     1564 <main+0x2e4>
lea    0xd01(%rip),%rdi
call   1080 <puts@plt>
jmp    1587 <main+0x307>
mov    0x2ada(%rip),%rax
mov    (%rax),%edi
lea    0xb39(%rip),%rsi
call   10f0 <fprintf@plt>
mov    %ebx,%edi
jmp    1540 <main+0x2c0>
mov    0x2ac1(%rip),%rax
mov    (%rax),%edi
lea    0xbcd(%rip),%rsi
jmp    1532 <main+0x2b2>
mov    0x2aaf(%rip),%rax
mov    (%rax),%edi
lea    0xc21(%rip),%rsi
call   10f0 <fprintf@plt>
mov    %ebx,%edi
call   1050 <hwloc_bitmap_free@plt>
mov    %ebp,%edi
call   1050 <hwloc_bitmap_free@plt>
mov    0x4(%rsp),%edi
call   1180 <hwloc_topology_destroy@plt>
mov    0x2a73(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,%edi
call   11a0 <hwloc_bitmap_weight@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   11a0 <hwloc_bitmap_weight@plt>
lea    0xc36(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x4(%rsp),%edi
call   1180 <hwloc_topology_destroy@plt>
mov    0x2a29(%rip),%rax
jmp    1555 <main+0x2d5>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"failed to initialize the topology\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"failed to load the topology\0A\00"
@.str.2 = [29 x i8] c"failed to allocate a bitmap\0A\00"
@HWLOC_CPUBIND_PROCESS = global i32 0
@.str.3 = [27 x i8] c"failed to get cpu binding\0A\00"
@.str.4 = [67 x i8] c"this process can use all available processing units in the system\0A\00"
@.str.5 = [65 x i8] c"process cannot use %d process units (%s) among %u in the system\0A\00"
@.str.6 = [52 x i8] c"process is bound within object %s logical index %u\0A\00"
@HWLOC_CPUBIND_THREAD = global i32 0
@.str.7 = [33 x i8] c"failed to get last cpu location\0A\00"
@.str.8 = [69 x i8] c"thread is now running on PU logical index %u (OS/physical index %u)\0A\00"
@.str.9 = [30 x i8] c"failed to set thread binding\0A\00"
@.str.10 = [65 x i8] c"thread is running on PU logical index %u (OS/physical index %u)\0A\00"
@.str.11 = [32 x i8] c"all hardware PUs are available\0A\00"
@.str.12 = [60 x i8] c"only %d hardware PUs are available in the machine among %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.TYPE_5__*
%8 = alloca i8*
%9 = alloca [64 x i8]
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 @hwloc_topology_init(i32* %2)
store i32 %12, i32* %11
%13 = load i32, i32* %11
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
store i32 %18, i32* %1
br label %213
19: ; preds = %0
%20 = load i32, i32* %2
%21 = call i32 @hwloc_topology_load(i32 %20)
store i32 %21, i32* %11
%22 = load i32, i32* %11
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = call i32 @hwloc_topology_destroy(i32 %27)
%29 = load i32, i32* @EXIT_FAILURE
store i32 %29, i32* %1
br label %213
30: ; preds = %19
%31 = load i32, i32* %2
%32 = call i32 @hwloc_topology_get_topology_cpuset(i32 %31)
store i32 %32, i32* %5
%33 = call i32 (...) @hwloc_bitmap_alloc()
store i32 %33, i32* %3
%34 = load i32, i32* %3
%35 = icmp ne i32 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%39 = load i32, i32* %2
%40 = call i32 @hwloc_topology_destroy(i32 %39)
%41 = load i32, i32* @EXIT_FAILURE
store i32 %41, i32* %1
br label %213
42: ; preds = %30
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = load i32, i32* @HWLOC_CPUBIND_PROCESS
%46 = call i32 @hwloc_get_cpubind(i32 %43, i32 %44, i32 %45)
store i32 %46, i32* %11
%47 = load i32, i32* %11
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %57
49: ; preds = %42
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%52 = load i32, i32* %3
%53 = call i32 @hwloc_bitmap_free(i32 %52)
%54 = load i32, i32* %2
%55 = call i32 @hwloc_topology_destroy(i32 %54)
%56 = load i32, i32* @EXIT_FAILURE
store i32 %56, i32* %1
br label %213
57: ; preds = %42
%58 = load i32, i32* %3
%59 = load i32, i32* %5
%60 = call i64 @hwloc_bitmap_isequal(i32 %58, i32 %59)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0))
br label %83
64: ; preds = %57
%65 = load i32, i32* %3
%66 = load i32, i32* %5
%67 = load i32, i32* %3
%68 = call i32 @hwloc_bitmap_andnot(i32 %65, i32 %66, i32 %67)
%69 = load i32, i32* %3
%70 = call i32 @hwloc_bitmap_asprintf(i8** %8, i32 %69)
%71 = load i32, i32* %3
%72 = call i32 @hwloc_bitmap_weight(i32 %71)
%73 = load i8*, i8** %8
%74 = load i32, i32* %5
%75 = call i32 @hwloc_bitmap_weight(i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i32 %72, i8* %73, i32 %75)
%77 = load i8*, i8** %8
%78 = call i32 @free(i8* %77)
%79 = load i32, i32* %3
%80 = load i32, i32* %5
%81 = load i32, i32* %3
%82 = call i32 @hwloc_bitmap_andnot(i32 %79, i32 %80, i32 %81)
br label %83
83: ; preds = %64, %62
%84 = load i32, i32* %2
%85 = load i32, i32* %3
%86 = call %struct.TYPE_5__* @hwloc_get_obj_covering_cpuset(i32 %84, i32 %85)
store %struct.TYPE_5__* %86, %struct.TYPE_5__** %7
%87 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%88 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%89 = call i32 @hwloc_obj_type_snprintf(i8* %87, i32 64, %struct.TYPE_5__* %88, i32 0)
%90 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%91 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%92 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %91, i32 0, i32 0
%93 = load i32, i32* %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0), i8* %90, i32 %93)
%95 = call i32 (...) @hwloc_bitmap_alloc()
store i32 %95, i32* %4
%96 = load i32, i32* %4
%97 = icmp ne i32 %96, 0
br i1 %97, label %106, label %98
98: ; preds = %83
%99 = load i32, i32* @stderr
%100 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%101 = load i32, i32* %3
%102 = call i32 @hwloc_bitmap_free(i32 %101)
%103 = load i32, i32* %2
%104 = call i32 @hwloc_topology_destroy(i32 %103)
%105 = load i32, i32* @EXIT_FAILURE
store i32 %105, i32* %1
br label %213
106: ; preds = %83
%107 = load i32, i32* %2
%108 = load i32, i32* %4
%109 = load i32, i32* @HWLOC_CPUBIND_THREAD
%110 = call i32 @hwloc_get_last_cpu_location(i32 %107, i32 %108, i32 %109)
store i32 %110, i32* %11
%111 = load i32, i32* %11
%112 = icmp slt i32 %111, 0
br i1 %112, label %113, label %123
113: ; preds = %106
%114 = load i32, i32* @stderr
%115 = call i32 @fprintf(i32 %114, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%116 = load i32, i32* %3
%117 = call i32 @hwloc_bitmap_free(i32 %116)
%118 = load i32, i32* %4
%119 = call i32 @hwloc_bitmap_free(i32 %118)
%120 = load i32, i32* %2
%121 = call i32 @hwloc_topology_destroy(i32 %120)
%122 = load i32, i32* @EXIT_FAILURE
store i32 %122, i32* %1
br label %213
123: ; preds = %106
%124 = load i32, i32* %4
%125 = load i32, i32* %3
%126 = call i32 @hwloc_bitmap_isincluded(i32 %124, i32 %125)
%127 = call i32 @assert(i32 %126)
%128 = load i32, i32* %4
%129 = call i32 @hwloc_bitmap_weight(i32 %128)
%130 = icmp eq i32 %129, 1
%131 = zext i1 %130 to i32
%132 = call i32 @assert(i32 %131)
%133 = load i32, i32* %4
%134 = call i32 @hwloc_bitmap_first(i32 %133)
store i32 %134, i32* %10
%135 = load i32, i32* %2
%136 = load i32, i32* %10
%137 = call %struct.TYPE_5__* @hwloc_get_pu_obj_by_os_index(i32 %135, i32 %136)
store %struct.TYPE_5__* %137, %struct.TYPE_5__** %7
%138 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%139 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %138, i32 0, i32 0
%140 = load i32, i32* %139
%141 = load i32, i32* %10
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0), i32 %140, i32 %141)
%143 = load i32, i32* %4
%144 = load i32, i32* %3
%145 = load i32, i32* %4
%146 = call i32 @hwloc_bitmap_andnot(i32 %143, i32 %144, i32 %145)
%147 = load i32, i32* %2
%148 = load i32, i32* %4
%149 = load i32, i32* @HWLOC_CPUBIND_THREAD
%150 = call i32 @hwloc_set_cpubind(i32 %147, i32 %148, i32 %149)
store i32 %150, i32* %11
%151 = load i32, i32* %11
%152 = icmp slt i32 %151, 0
br i1 %152, label %153, label %163
153: ; preds = %123
%154 = load i32, i32* @stderr
%155 = call i32 @fprintf(i32 %154, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%156 = load i32, i32* %3
%157 = call i32 @hwloc_bitmap_free(i32 %156)
%158 = load i32, i32* %4
%159 = call i32 @hwloc_bitmap_free(i32 %158)
%160 = load i32, i32* %2
%161 = call i32 @hwloc_topology_destroy(i32 %160)
%162 = load i32, i32* @EXIT_FAILURE
store i32 %162, i32* %1
br label %213
163: ; preds = %123
%164 = load i32, i32* %2
%165 = load i32, i32* %4
%166 = load i32, i32* @HWLOC_CPUBIND_THREAD
%167 = call i32 @hwloc_get_last_cpu_location(i32 %164, i32 %165, i32 %166)
store i32 %167, i32* %11
%168 = load i32, i32* %11
%169 = icmp slt i32 %168, 0
br i1 %169, label %170, label %180
170: ; preds = %163
%171 = load i32, i32* @stderr
%172 = call i32 @fprintf(i32 %171, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%173 = load i32, i32* %3
%174 = call i32 @hwloc_bitmap_free(i32 %173)
%175 = load i32, i32* %4
%176 = call i32 @hwloc_bitmap_free(i32 %175)
%177 = load i32, i32* %2
%178 = call i32 @hwloc_topology_destroy(i32 %177)
%179 = load i32, i32* @EXIT_FAILURE
store i32 %179, i32* %1
br label %213
180: ; preds = %163
%181 = load i32, i32* %4
%182 = call i32 @hwloc_bitmap_first(i32 %181)
store i32 %182, i32* %10
%183 = load i32, i32* %2
%184 = load i32, i32* %10
%185 = call %struct.TYPE_5__* @hwloc_get_pu_obj_by_os_index(i32 %183, i32 %184)
store %struct.TYPE_5__* %185, %struct.TYPE_5__** %7
%186 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%187 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %186, i32 0, i32 0
%188 = load i32, i32* %187
%189 = load i32, i32* %10
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0), i32 %188, i32 %189)
%191 = load i32, i32* %3
%192 = call i32 @hwloc_bitmap_free(i32 %191)
%193 = load i32, i32* %4
%194 = call i32 @hwloc_bitmap_free(i32 %193)
%195 = load i32, i32* %2
%196 = call i32 @hwloc_topology_get_complete_cpuset(i32 %195)
store i32 %196, i32* %6
%197 = load i32, i32* %6
%198 = load i32, i32* %5
%199 = call i64 @hwloc_bitmap_isequal(i32 %197, i32 %198)
%200 = icmp ne i64 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %180
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %209
203: ; preds = %180
%204 = load i32, i32* %5
%205 = call i32 @hwloc_bitmap_weight(i32 %204)
%206 = load i32, i32* %6
%207 = call i32 @hwloc_bitmap_weight(i32 %206)
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.12, i64 0, i64 0), i32 %205, i32 %207)
br label %209
209: ; preds = %203, %201
%210 = load i32, i32* %2
%211 = call i32 @hwloc_topology_destroy(i32 %210)
%212 = load i32, i32* @EXIT_SUCCESS
store i32 %212, i32* %1
br label %213
213: ; preds = %209, %170, %153, %113, %98, %49, %36, %24, %15
%214 = load i32, i32* %1
ret i32 %214
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"failed to initialize the topology\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"failed to load the topology\0A\00"
@.str.2 = [29 x i8] c"failed to allocate a bitmap\0A\00"
@HWLOC_CPUBIND_PROCESS = global i32 0
@.str.3 = [27 x i8] c"failed to get cpu binding\0A\00"
@.str.5 = [65 x i8] c"process cannot use %d process units (%s) among %u in the system\0A\00"
@.str.6 = [52 x i8] c"process is bound within object %s logical index %u\0A\00"
@HWLOC_CPUBIND_THREAD = global i32 0
@.str.7 = [33 x i8] c"failed to get last cpu location\0A\00"
@.str.8 = [69 x i8] c"thread is now running on PU logical index %u (OS/physical index %u)\0A\00"
@.str.9 = [30 x i8] c"failed to set thread binding\0A\00"
@.str.10 = [65 x i8] c"thread is running on PU logical index %u (OS/physical index %u)\0A\00"
@.str.12 = [60 x i8] c"only %d hardware PUs are available in the machine among %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"all hardware PUs are available\00"
@str.13 = [66 x i8] c"this process can use all available processing units in the system\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [64 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i8** %2 to i8*
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = call i32 @hwloc_topology_init(i32* %1)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %143
12: ; preds = %0
%13 = load i32, i32* %1
%14 = call i32 @hwloc_topology_load(i32 %13)
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = call i32 @hwloc_topology_destroy(i32 %19)
br label %143
21: ; preds = %12
%22 = load i32, i32* %1
%23 = call i32 @hwloc_topology_get_topology_cpuset(i32 %22)
%24 = call i32 (...) @hwloc_bitmap_alloc()
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %1
%30 = call i32 @hwloc_topology_destroy(i32 %29)
br label %143
31: ; preds = %21
%32 = load i32, i32* %1
%33 = load i32, i32* @HWLOC_CPUBIND_PROCESS
%34 = call i32 @hwloc_get_cpubind(i32 %32, i32 %24, i32 %33)
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %42
36: ; preds = %31
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 @hwloc_bitmap_free(i32 %24)
%40 = load i32, i32* %1
%41 = call i32 @hwloc_topology_destroy(i32 %40)
br label %143
42: ; preds = %31
%43 = call i64 @hwloc_bitmap_isequal(i32 %24, i32 %23)
%44 = icmp eq i64 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.13, i64 0, i64 0))
br label %57
47: ; preds = %42
%48 = call i32 @hwloc_bitmap_andnot(i32 %24, i32 %23, i32 %24)
%49 = call i32 @hwloc_bitmap_asprintf(i8** %2, i32 %24)
%50 = call i32 @hwloc_bitmap_weight(i32 %24)
%51 = load i8*, i8** %2
%52 = call i32 @hwloc_bitmap_weight(i32 %23)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i32 %50, i8* %51, i32 %52)
%54 = load i8*, i8** %2
%55 = call i32 @free(i8* %54)
%56 = call i32 @hwloc_bitmap_andnot(i32 %24, i32 %23, i32 %24)
br label %57
57: ; preds = %47, %45
%58 = load i32, i32* %1
%59 = call %struct.TYPE_5__* @hwloc_get_obj_covering_cpuset(i32 %58, i32 %24)
%60 = call i32 @hwloc_obj_type_snprintf(i8* %6, i32 64, %struct.TYPE_5__* %59, i32 0)
%61 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %59, i64 0, i32 0
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0), i8* %6, i32 %62)
%64 = call i32 (...) @hwloc_bitmap_alloc()
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %57
%67 = load i32, i32* @stderr
%68 = call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%69 = call i32 @hwloc_bitmap_free(i32 %24)
%70 = load i32, i32* %1
%71 = call i32 @hwloc_topology_destroy(i32 %70)
br label %143
72: ; preds = %57
%73 = load i32, i32* %1
%74 = load i32, i32* @HWLOC_CPUBIND_THREAD
%75 = call i32 @hwloc_get_last_cpu_location(i32 %73, i32 %64, i32 %74)
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %84
77: ; preds = %72
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%80 = call i32 @hwloc_bitmap_free(i32 %24)
%81 = call i32 @hwloc_bitmap_free(i32 %64)
%82 = load i32, i32* %1
%83 = call i32 @hwloc_topology_destroy(i32 %82)
br label %143
84: ; preds = %72
%85 = call i32 @hwloc_bitmap_isincluded(i32 %64, i32 %24)
%86 = call i32 @assert(i32 %85)
%87 = call i32 @hwloc_bitmap_weight(i32 %64)
%88 = icmp eq i32 %87, 1
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = call i32 @hwloc_bitmap_first(i32 %64)
%92 = load i32, i32* %1
%93 = call %struct.TYPE_5__* @hwloc_get_pu_obj_by_os_index(i32 %92, i32 %91)
%94 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %93, i64 0, i32 0
%95 = load i32, i32* %94
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0), i32 %95, i32 %91)
%97 = call i32 @hwloc_bitmap_andnot(i32 %64, i32 %24, i32 %64)
%98 = load i32, i32* %1
%99 = load i32, i32* @HWLOC_CPUBIND_THREAD
%100 = call i32 @hwloc_set_cpubind(i32 %98, i32 %64, i32 %99)
%101 = icmp slt i32 %100, 0
br i1 %101, label %102, label %109
102: ; preds = %84
%103 = load i32, i32* @stderr
%104 = call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%105 = call i32 @hwloc_bitmap_free(i32 %24)
%106 = call i32 @hwloc_bitmap_free(i32 %64)
%107 = load i32, i32* %1
%108 = call i32 @hwloc_topology_destroy(i32 %107)
br label %143
109: ; preds = %84
%110 = load i32, i32* %1
%111 = load i32, i32* @HWLOC_CPUBIND_THREAD
%112 = call i32 @hwloc_get_last_cpu_location(i32 %110, i32 %64, i32 %111)
%113 = icmp slt i32 %112, 0
br i1 %113, label %114, label %121
114: ; preds = %109
%115 = load i32, i32* @stderr
%116 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%117 = call i32 @hwloc_bitmap_free(i32 %24)
%118 = call i32 @hwloc_bitmap_free(i32 %64)
%119 = load i32, i32* %1
%120 = call i32 @hwloc_topology_destroy(i32 %119)
br label %143
121: ; preds = %109
%122 = call i32 @hwloc_bitmap_first(i32 %64)
%123 = load i32, i32* %1
%124 = call %struct.TYPE_5__* @hwloc_get_pu_obj_by_os_index(i32 %123, i32 %122)
%125 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %124, i64 0, i32 0
%126 = load i32, i32* %125
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0), i32 %126, i32 %122)
%128 = call i32 @hwloc_bitmap_free(i32 %24)
%129 = call i32 @hwloc_bitmap_free(i32 %64)
%130 = load i32, i32* %1
%131 = call i32 @hwloc_topology_get_complete_cpuset(i32 %130)
%132 = call i64 @hwloc_bitmap_isequal(i32 %131, i32 %23)
%133 = icmp eq i64 %132, 0
br i1 %133, label %136, label %134
134: ; preds = %121
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %140
136: ; preds = %121
%137 = call i32 @hwloc_bitmap_weight(i32 %23)
%138 = call i32 @hwloc_bitmap_weight(i32 %131)
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.12, i64 0, i64 0), i32 %137, i32 %138)
br label %140
140: ; preds = %136, %134
%141 = load i32, i32* %1
%142 = call i32 @hwloc_topology_destroy(i32 %141)
br label %143
143: ; preds = %140, %114, %102, %77, %66, %36, %26, %16, %9
%144 = phi i32* [ @EXIT_FAILURE, %9 ], [ @EXIT_FAILURE, %16 ], [ @EXIT_FAILURE, %36 ], [ @EXIT_FAILURE, %77 ], [ @EXIT_FAILURE, %102 ], [ @EXIT_FAILURE, %114 ], [ @EXIT_SUCCESS, %140 ], [ @EXIT_FAILURE, %66 ], [ @EXIT_FAILURE, %26 ]
%145 = load i32, i32* %144
ret i32 %145
}