#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*/ hwloc_topology_t;
typedef TYPE_1__ *hwloc_obj_t;
typedef int /*<<< orphan*/ hwloc_bitmap_t;
struct TYPE_5__ {
  int /*<<< orphan*/ cpuset;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ check_cpuset(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ hwloc_bitmap_alloc();
int /*<<< orphan*/ hwloc_bitmap_alloc_full();
int hwloc_bitmap_asprintf(char **, int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_bitmap_clr(int /*<<< orphan*/, int);
int /*<<< orphan*/ hwloc_bitmap_clr_range(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ hwloc_bitmap_free(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_bitmap_set(int /*<<< orphan*/, int);
int /*<<< orphan*/ hwloc_bitmap_set_ith_ulong(int /*<<< orphan*/, int,
                                              unsigned long);
int /*<<< orphan*/ hwloc_bitmap_set_range(int /*<<< orphan*/, int, int);
scalar_t__ hwloc_get_nbobjs_by_depth(int /*<<< orphan*/, unsigned int);
TYPE_1__ *hwloc_get_obj_by_depth(int /*<<< orphan*/, unsigned int, scalar_t__);
TYPE_1__ *hwloc_get_root_obj(int /*<<< orphan*/);
int hwloc_obj_cpuset_snprintf(char *, int, int, TYPE_1__ **);
int /*<<< orphan*/ hwloc_topology_destroy(int /*<<< orphan*/);
unsigned int hwloc_topology_get_depth(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ hwloc_topology_load(int /*<<< orphan*/);
int /*<<< orphan*/ hwloc_topology_set_synthetic(int /*<<< orphan*/, char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  hwloc_topology_t topology;
  unsigned depth;
  char *string = NULL;
  int stringlen, len;
  hwloc_obj_t obj;
  hwloc_bitmap_t set;
  set = hwloc_bitmap_alloc();
  check_cpuset(set, "0x0", "", "0x0");
  printf("empty cpuset converted back and forth, ok\n");
  hwloc_bitmap_set_ith_ulong(set, 0, 0UL);
  check_cpuset(set, "0x0", "", "0x0");
  printf("uselessly modified empty cpuset converted back and forth, ok\n");
  hwloc_bitmap_set_ith_ulong(set, 5, 0UL);
  check_cpuset(set, "0x0", "", "0x0");
  printf(
      "twice uselessly modified empty cpuset converted back and forth, ok\n");
  hwloc_bitmap_free(set);
  set = hwloc_bitmap_alloc_full();
  check_cpuset(set, "0xf...f", "0-", "0xf...f");
  printf("full cpuset converted back and forth, ok\n");
  hwloc_bitmap_set_ith_ulong(set, 0, ~0UL);
  check_cpuset(set, "0xf...f", "0-", "0xf...f");
  printf("uselessly modified full cpuset converted back and forth, ok\n");
  hwloc_bitmap_set_ith_ulong(set, 8, ~0UL);
  check_cpuset(set, "0xf...f", "0-", "0xf...f");
  printf("twice uselessly modified full cpuset converted back and forth, ok\n");
  hwloc_bitmap_free(set);
  set = hwloc_bitmap_alloc_full();
  hwloc_bitmap_clr(set, 173);
  hwloc_bitmap_clr_range(set, 60, 70);
  check_cpuset(set,
               "0xf...f,0xffffdfff,0xffffffff,0xffffffff,0xffffff80,0x0fffffff,"
               "0xffffffff",
               "0-59,71-172,174-",
               "0xf...fffffdfffffffffffffffffffffffff800fffffffffffffff");
  hwloc_bitmap_free(set);
  printf("infinite/nonfull cpuset converted back and forth, ok\n");
  set = hwloc_bitmap_alloc();
  hwloc_bitmap_set(set, 2);
  hwloc_bitmap_set_range(set, 67, 70);
  check_cpuset(set, "0x00000078,,0x00000004", "2,67-70",
               "0x780000000000000004");
  hwloc_bitmap_free(set);
  printf("finite/nonnull cpuset converted back and forth, ok\n");
  hwloc_topology_init(&topology);
  hwloc_topology_set_synthetic(topology, "6 5 4 3 2");
  hwloc_topology_load(topology);
  depth = hwloc_topology_get_depth(topology);
  obj = hwloc_get_root_obj(topology);
  stringlen = hwloc_bitmap_asprintf(&string, obj->cpuset);
  printf("system cpuset is %s\n", string);
  check_cpuset(obj->cpuset, NULL, NULL, NULL);
  printf("system cpuset converted back and forth, ok\n");
  printf("truncating system cpuset to NULL buffer\n");
  len = hwloc_obj_cpuset_snprintf(NULL, 0, 1, &obj);
  assert(len == stringlen);
  printf("truncating system cpuset to 0 char (no modification)\n");
  memset(string, 'X', 1);
  string[1] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 0, 1, &obj);
  assert(len == stringlen);
  assert(string[0] == 'X');
  printf("truncating system cpuset to 1 char (empty string)\n");
  memset(string, 'X', 2);
  string[2] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 1, 1, &obj);
  printf("got %s\n", string);
  assert(len == stringlen);
  assert(string[0] == 0);
  assert(string[1] == 'X');
  printf("truncating system cpuset to 10 chars (single 32bit subset except "
         "last char)\n");
  memset(string, 'X', 11);
  string[11] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 10, 1, &obj);
  printf("got %s\n", string);
  assert(len == stringlen);
  assert(string[8] == 'f');
  assert(string[9] == 0);
  assert(string[10] == 'X');
  printf("truncating system cpuset to 11 chars (single 32bit subset)\n");
  memset(string, 'X', 12);
  string[12] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 11, 1, &obj);
  printf("got %s\n", string);
  assert(len == stringlen);
  assert(string[9] == 'f');
  assert(string[10] == 0);
  assert(string[11] == 'X');
  printf("truncating system cpuset to 23 chars (two 32bit subsets with ending "
         "comma)\n");
  memset(string, 'X', 24);
  string[24] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 23, 1, &obj);
  printf("got %s\n", string);
  assert(len == stringlen);
  assert(string[20] == 'f');
  assert(string[21] == ',');
  assert(string[22] == 0);
  assert(string[23] == 'X');
  printf("truncating system cpuset to 51 chars (truncate to four and a half "
         "32bit subsets)\n");
  memset(string, 'X', 52);
  string[52] = 0;
  len = hwloc_obj_cpuset_snprintf(string, 51, 1, &obj);
  printf("got %s\n", string);
  assert(len == stringlen);
  assert(string[49] == 'f');
  assert(string[50] == 0);
  assert(string[51] == 'X');
  obj = hwloc_get_obj_by_depth(topology, depth - 1, 0);
  hwloc_obj_cpuset_snprintf(string, stringlen + 1, 1, &obj);
  printf("first cpu cpuset is %s\n", string);
  check_cpuset(obj->cpuset, NULL, NULL, NULL);
  printf("first cpu cpuset converted back and forth, ok\n");
  obj = hwloc_get_obj_by_depth(
      topology, depth - 1, hwloc_get_nbobjs_by_depth(topology, depth - 1) - 1);
  hwloc_obj_cpuset_snprintf(string, stringlen + 1, 1, &obj);
  printf("last cpu cpuset is %s\n", string);
  check_cpuset(obj->cpuset, NULL, NULL, NULL);
  printf("last cpu cpuset converted back and forth, ok\n");
  free(string);
  hwloc_topology_destroy(topology);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
lea    0xd65(%rip),%rcx
lea    0x10de(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1120 <hwloc_bitmap_set_ith_ulong@plt>
mov    -0x2c(%rbp),%edi
lea    0xd30(%rip),%rcx
lea    0x10a9(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    $0x5,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1120 <hwloc_bitmap_set_ith_ulong@plt>
mov    -0x2c(%rbp),%edi
lea    0xcf8(%rip),%rcx
lea    0x1071(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
call   1060 <hwloc_bitmap_free@plt>
mov    $0x0,%al
call   1130 <hwloc_bitmap_alloc_full@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
lea    0xd07(%rip),%rcx
lea    0xd08(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
xor    %esi,%esi
mov    $0xffffffffffffffff,%rdx
call   1120 <hwloc_bitmap_set_ith_ulong@plt>
mov    -0x2c(%rbp),%edi
lea    0xccf(%rip),%rcx
lea    0xcd0(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    $0x8,%esi
mov    $0xffffffffffffffff,%rdx
call   1120 <hwloc_bitmap_set_ith_ulong@plt>
mov    -0x2c(%rbp),%edi
lea    0xc94(%rip),%rcx
lea    0xc95(%rip),%rdx
mov    %rcx,%rsi
call   1190 <check_cpuset@plt>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x2c(%rbp),%edi
call   1060 <hwloc_bitmap_free@plt>
mov    $0x0,%al
call   1130 <hwloc_bitmap_alloc_full@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0xad,%esi
call   1070 <hwloc_bitmap_clr@plt>
mov    -0x2c(%rbp),%edi
mov    $0x3c,%esi
mov    $0x46,%edx
call   1150 <hwloc_bitmap_clr_range@plt>
mov    -0x2c(%rbp),%edi
lea    0xc8a(%rip),%rsi
lea    0xccd(%rip),%rdx
lea    0xcd7(%rip),%rcx
call   1190 <check_cpuset@plt>
mov    -0x2c(%rbp),%edi
call   1060 <hwloc_bitmap_free@plt>
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    $0x0,%al
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x2,%esi
call   10d0 <hwloc_bitmap_set@plt>
mov    -0x2c(%rbp),%edi
mov    $0x43,%esi
mov    $0x46,%edx
call   1100 <hwloc_bitmap_set_range@plt>
mov    -0x2c(%rbp),%edi
lea    0xcf7(%rip),%rsi
lea    0xd07(%rip),%rdx
lea    0xd08(%rip),%rcx
call   1190 <check_cpuset@plt>
mov    -0x2c(%rbp),%edi
call   1060 <hwloc_bitmap_free@plt>
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1080 <hwloc_topology_init@plt>
mov    -0x8(%rbp),%edi
lea    0xd23(%rip),%rsi
call   1160 <hwloc_topology_set_synthetic@plt>
mov    -0x8(%rbp),%edi
call   10b0 <hwloc_topology_load@plt>
mov    -0x8(%rbp),%edi
call   10c0 <hwloc_topology_get_depth@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1170 <hwloc_get_root_obj@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdi
call   10a0 <hwloc_bitmap_asprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xcec(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1190 <check_cpuset@plt>
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0x1,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0x2,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
mov    %edx,%esi
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xca8(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0xb,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0xb(%rax)
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xc11(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x8(%rax),%eax
cmp    $0x66,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x9(%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0xa(%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xbfd(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0xc,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0xc(%rax)
mov    -0x18(%rbp),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xb61(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x9(%rax),%eax
cmp    $0x66,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0xa(%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0xb(%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xb89(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0x18,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x18(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xab1(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x14(%rax),%eax
cmp    $0x66,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x15(%rax),%eax
cmp    $0x2c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x16(%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x17(%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
lea    0xb0d(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x58,%esi
mov    $0x34,%edx
call   10f0 <memset@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x34(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0x9e9(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x31(%rax),%eax
cmp    $0x66,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x32(%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x18(%rbp),%rax
movsbl 0x33(%rax),%eax
cmp    $0x58,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1110 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <hwloc_get_obj_by_depth@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xa7d(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1190 <check_cpuset@plt>
lea    0xa72(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1140 <hwloc_get_nbobjs_by_depth@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    %rax,%rdx
sub    $0x1,%rdx
call   1040 <hwloc_get_obj_by_depth@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    $0x1,%edx
lea    -0x28(%rbp),%rcx
call   1090 <hwloc_obj_cpuset_snprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xa44(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1190 <check_cpuset@plt>
lea    0xa38(%rip),%rdi
mov    $0x0,%al
call   10e0 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <free@plt>
mov    -0x8(%rbp),%edi
call   1180 <hwloc_topology_destroy@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,%ebx
lea    0xe4f(%rip),%r14
lea    0xd54(%rip),%rbp
mov    %eax,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xe82(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1130 <hwloc_bitmap_set_ith_ulong@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xe48(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1130 <hwloc_bitmap_set_ith_ulong@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xe18(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
call   1060 <hwloc_bitmap_free@plt>
xor    %eax,%eax
call   1140 <hwloc_bitmap_alloc_full@plt>
mov    %eax,%ebx
lea    0xcdc(%rip),%r14
lea    0xccd(%rip),%rbp
mov    %eax,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xe3a(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0xffffffffffffffff,%rdx
call   1130 <hwloc_bitmap_set_ith_ulong@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xdfb(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
mov    $0x8,%esi
mov    $0xffffffffffffffff,%rdx
call   1130 <hwloc_bitmap_set_ith_ulong@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   11a0 <check_cpuset@plt>
lea    0xdc6(%rip),%rdi
call   1090 <puts@plt>
mov    %ebx,%edi
call   1060 <hwloc_bitmap_free@plt>
xor    %eax,%eax
call   1140 <hwloc_bitmap_alloc_full@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0xad,%esi
call   1070 <hwloc_bitmap_clr@plt>
mov    %ebx,%edi
mov    $0x3c,%esi
mov    $0x46,%edx
call   1160 <hwloc_bitmap_clr_range@plt>
lea    0xc2d(%rip),%rsi
lea    0xc70(%rip),%rdx
lea    0xc7a(%rip),%rcx
mov    %ebx,%edi
call   11a0 <check_cpuset@plt>
mov    %ebx,%edi
call   1060 <hwloc_bitmap_free@plt>
lea    0xdac(%rip),%rdi
call   1090 <puts@plt>
xor    %eax,%eax
call   1030 <hwloc_bitmap_alloc@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x2,%esi
call   10e0 <hwloc_bitmap_set@plt>
mov    %ebx,%edi
mov    $0x43,%esi
mov    $0x46,%edx
call   1110 <hwloc_bitmap_set_range@plt>
lea    0xc6b(%rip),%rsi
lea    0xc7b(%rip),%rdx
lea    0xc7c(%rip),%rcx
mov    %ebx,%edi
call   11a0 <check_cpuset@plt>
mov    %ebx,%edi
call   1060 <hwloc_bitmap_free@plt>
lea    0xd8c(%rip),%rdi
call   1090 <puts@plt>
lea    0x14(%rsp),%rdi
call   1080 <hwloc_topology_init@plt>
mov    0x14(%rsp),%edi
lea    0xc62(%rip),%rsi
call   1170 <hwloc_topology_set_synthetic@plt>
mov    0x14(%rsp),%edi
call   10c0 <hwloc_topology_load@plt>
mov    0x14(%rsp),%edi
call   10d0 <hwloc_topology_get_depth@plt>
mov    %eax,%r12d
mov    0x14(%rsp),%edi
call   1180 <hwloc_get_root_obj@plt>
mov    %rax,%rbx
mov    %rax,0x18(%rsp)
mov    (%rax),%esi
lea    0x8(%rsp),%rdi
call   10b0 <hwloc_bitmap_asprintf@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rsi
lea    0xc27(%rip),%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
mov    (%rbx),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   11a0 <check_cpuset@plt>
lea    0xd45(%rip),%rdi
call   1090 <puts@plt>
lea    0xd64(%rip),%rdi
call   1090 <puts@plt>
lea    0x18(%rsp),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
xor    %edi,%edi
cmp    %ebp,%eax
sete   %dil
call   1120 <assert@plt>
lea    0xd5d(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0x1,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rax
movb   $0x0,0x1(%rax)
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
xor    %edi,%edi
cmp    %ebp,%eax
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,(%rax)
sete   %dil
call   1120 <assert@plt>
lea    0xd35(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0x2,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rax
movb   $0x0,0x2(%rax)
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
lea    0xb42(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %edi,%edi
cmp    %ebp,%ebx
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x0,(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,0x1(%rax)
sete   %dil
call   1120 <assert@plt>
lea    0xcdb(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0xb,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rdi
movb   $0x0,0xb(%rdi)
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %edi,%edi
cmp    %ebp,%ebx
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x66,0x8(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x0,0x9(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,0xa(%rax)
sete   %dil
call   1120 <assert@plt>
lea    0xc92(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0xc,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rdi
movb   $0x0,0xc(%rdi)
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %edi,%edi
cmp    %ebp,%ebx
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x66,0x9(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x0,0xa(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,0xb(%rax)
sete   %dil
call   1120 <assert@plt>
lea    0xc38(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0x18,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rdi
movb   $0x0,0x18(%rdi)
mov    $0x17,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %edi,%edi
cmp    %ebp,%ebx
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x66,0x14(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x2c,0x15(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x0,0x16(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,0x17(%rax)
sete   %dil
call   1120 <assert@plt>
lea    0xbda(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
mov    $0x58,%esi
mov    $0x34,%edx
call   1100 <memset@plt>
mov    0x8(%rsp),%rdi
movb   $0x0,0x34(%rdi)
mov    $0x33,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
xor    %edi,%edi
cmp    %ebp,%ebx
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x66,0x31(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x0,0x32(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmpb   $0x58,0x33(%rax)
sete   %dil
call   1120 <assert@plt>
mov    0x14(%rsp),%edi
add    $0xffffffff,%r12d
mov    %r12d,%esi
xor    %edx,%edx
call   1040 <hwloc_get_obj_by_depth@plt>
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%rdi
add    $0x1,%ebp
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    0x8(%rsp),%rsi
lea    0x86a(%rip),%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
mov    0x18(%rsp),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   11a0 <check_cpuset@plt>
lea    0xb43(%rip),%rdi
call   1090 <puts@plt>
mov    0x14(%rsp),%ebx
mov    %ebx,%edi
mov    %r12d,%esi
call   1150 <hwloc_get_nbobjs_by_depth@plt>
lea    -0x1(%rax),%rdx
mov    %ebx,%edi
mov    %r12d,%esi
call   1040 <hwloc_get_obj_by_depth@plt>
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10a0 <hwloc_obj_cpuset_snprintf@plt>
mov    0x8(%rsp),%rsi
lea    0x81c(%rip),%rdi
xor    %eax,%eax
call   10f0 <printf@plt>
mov    0x18(%rsp),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   11a0 <check_cpuset@plt>
lea    0xb0b(%rip),%rdi
call   1090 <puts@plt>
mov    0x8(%rsp),%rdi
call   1050 <free@plt>
mov    0x14(%rsp),%edi
call   1190 <hwloc_topology_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
@.str = [4 x i8] c"0x0\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [43 x i8] c"empty cpuset converted back and forth, ok\0A\00"
@.str.3 = [62 x i8] c"uselessly modified empty cpuset converted back and forth, ok\0A\00"
@.str.4 = [68 x i8] c"twice uselessly modified empty cpuset converted back and forth, ok\0A\00"
@.str.5 = [8 x i8] c"0xf...f\00"
@.str.6 = [3 x i8] c"0-\00"
@.str.7 = [42 x i8] c"full cpuset converted back and forth, ok\0A\00"
@.str.8 = [61 x i8] c"uselessly modified full cpuset converted back and forth, ok\0A\00"
@.str.9 = [67 x i8] c"twice uselessly modified full cpuset converted back and forth, ok\0A\00"
@.str.10 = [74 x i8] c"0xf...f,0xffffdfff,0xffffffff,0xffffffff,0xffffff80,0x0fffffff,0xffffffff\00"
@.str.11 = [17 x i8] c"0-59,71-172,174-\00"
@.str.12 = [56 x i8] c"0xf...fffffdfffffffffffffffffffffffff800fffffffffffffff\00"
@.str.13 = [54 x i8] c"infinite/nonfull cpuset converted back and forth, ok\0A\00"
@.str.14 = [23 x i8] c"0x00000078,,0x00000004\00"
@.str.15 = [8 x i8] c"2,67-70\00"
@.str.16 = [21 x i8] c"0x780000000000000004\00"
@.str.17 = [52 x i8] c"finite/nonnull cpuset converted back and forth, ok\0A\00"
@.str.18 = [10 x i8] c"6 5 4 3 2\00"
@.str.19 = [21 x i8] c"system cpuset is %s\0A\00"
@.str.20 = [44 x i8] c"system cpuset converted back and forth, ok\0A\00"
@.str.21 = [41 x i8] c"truncating system cpuset to NULL buffer\0A\00"
@.str.22 = [54 x i8] c"truncating system cpuset to 0 char (no modification)\0A\00"
@.str.23 = [51 x i8] c"truncating system cpuset to 1 char (empty string)\0A\00"
@.str.24 = [8 x i8] c"got %s\0A\00"
@.str.25 = [77 x i8] c"truncating system cpuset to 10 chars (single 32bit subset except last char)\0A\00"
@.str.26 = [60 x i8] c"truncating system cpuset to 11 chars (single 32bit subset)\0A\00"
@.str.27 = [76 x i8] c"truncating system cpuset to 23 chars (two 32bit subsets with ending comma)\0A\00"
@.str.28 = [82 x i8] c"truncating system cpuset to 51 chars (truncate to four and a half 32bit subsets)\0A\00"
@.str.29 = [24 x i8] c"first cpu cpuset is %s\0A\00"
@.str.30 = [47 x i8] c"first cpu cpuset converted back and forth, ok\0A\00"
@.str.31 = [23 x i8] c"last cpu cpuset is %s\0A\00"
@.str.32 = [46 x i8] c"last cpu cpuset converted back and forth, ok\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.TYPE_5__*
%8 = alloca i32
store i32 0, i32* %1
store i8* null, i8** %4
%9 = call i32 (...) @hwloc_bitmap_alloc()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = call i32 @check_cpuset(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %8
%14 = call i32 @hwloc_bitmap_set_ith_ulong(i32 %13, i32 0, i64 0)
%15 = load i32, i32* %8
%16 = call i32 @check_cpuset(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* %8
%19 = call i32 @hwloc_bitmap_set_ith_ulong(i32 %18, i32 5, i64 0)
%20 = load i32, i32* %8
%21 = call i32 @check_cpuset(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
%23 = load i32, i32* %8
%24 = call i32 @hwloc_bitmap_free(i32 %23)
%25 = call i32 (...) @hwloc_bitmap_alloc_full()
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = call i32 @check_cpuset(i32 %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%29 = load i32, i32* %8
%30 = call i32 @hwloc_bitmap_set_ith_ulong(i32 %29, i32 0, i64 -1)
%31 = load i32, i32* %8
%32 = call i32 @check_cpuset(i32 %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0))
%34 = load i32, i32* %8
%35 = call i32 @hwloc_bitmap_set_ith_ulong(i32 %34, i32 8, i64 -1)
%36 = load i32, i32* %8
%37 = call i32 @check_cpuset(i32 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0))
%39 = load i32, i32* %8
%40 = call i32 @hwloc_bitmap_free(i32 %39)
%41 = call i32 (...) @hwloc_bitmap_alloc_full()
store i32 %41, i32* %8
%42 = load i32, i32* %8
%43 = call i32 @hwloc_bitmap_clr(i32 %42, i32 173)
%44 = load i32, i32* %8
%45 = call i32 @hwloc_bitmap_clr_range(i32 %44, i32 60, i32 70)
%46 = load i32, i32* %8
%47 = call i32 @check_cpuset(i32 %46, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0))
%48 = load i32, i32* %8
%49 = call i32 @hwloc_bitmap_free(i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.13, i64 0, i64 0))
%51 = call i32 (...) @hwloc_bitmap_alloc()
store i32 %51, i32* %8
%52 = load i32, i32* %8
%53 = call i32 @hwloc_bitmap_set(i32 %52, i32 2)
%54 = load i32, i32* %8
%55 = call i32 @hwloc_bitmap_set_range(i32 %54, i32 67, i32 70)
%56 = load i32, i32* %8
%57 = call i32 @check_cpuset(i32 %56, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
%58 = load i32, i32* %8
%59 = call i32 @hwloc_bitmap_free(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.17, i64 0, i64 0))
%61 = call i32 @hwloc_topology_init(i32* %2)
%62 = load i32, i32* %2
%63 = call i32 @hwloc_topology_set_synthetic(i32 %62, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%64 = load i32, i32* %2
%65 = call i32 @hwloc_topology_load(i32 %64)
%66 = load i32, i32* %2
%67 = call i32 @hwloc_topology_get_depth(i32 %66)
store i32 %67, i32* %3
%68 = load i32, i32* %2
%69 = call %struct.TYPE_5__* @hwloc_get_root_obj(i32 %68)
store %struct.TYPE_5__* %69, %struct.TYPE_5__** %7
%70 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%71 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %70, i32 0, i32 0
%72 = load i32, i32* %71
%73 = call i32 @hwloc_bitmap_asprintf(i8** %4, i32 %72)
store i32 %73, i32* %5
%74 = load i8*, i8** %4
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %74)
%76 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%77 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %76, i32 0, i32 0
%78 = load i32, i32* %77
%79 = call i32 @check_cpuset(i32 %78, i8* null, i8* null, i8* null)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.20, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.21, i64 0, i64 0))
%82 = call i32 @hwloc_obj_cpuset_snprintf(i8* null, i32 0, i32 1, %struct.TYPE_5__** %7)
store i32 %82, i32* %6
%83 = load i32, i32* %6
%84 = load i32, i32* %5
%85 = icmp eq i32 %83, %84
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.22, i64 0, i64 0))
%89 = load i8*, i8** %4
%90 = call i32 @memset(i8* %89, i8 signext 88, i32 1)
%91 = load i8*, i8** %4
%92 = getelementptr inbounds i8, i8* %91, i64 1
store i8 0, i8* %92
%93 = load i8*, i8** %4
%94 = call i32 @hwloc_obj_cpuset_snprintf(i8* %93, i32 0, i32 1, %struct.TYPE_5__** %7)
store i32 %94, i32* %6
%95 = load i32, i32* %6
%96 = load i32, i32* %5
%97 = icmp eq i32 %95, %96
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = load i8*, i8** %4
%101 = getelementptr inbounds i8, i8* %100, i64 0
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 88
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.23, i64 0, i64 0))
%108 = load i8*, i8** %4
%109 = call i32 @memset(i8* %108, i8 signext 88, i32 2)
%110 = load i8*, i8** %4
%111 = getelementptr inbounds i8, i8* %110, i64 2
store i8 0, i8* %111
%112 = load i8*, i8** %4
%113 = call i32 @hwloc_obj_cpuset_snprintf(i8* %112, i32 1, i32 1, %struct.TYPE_5__** %7)
store i32 %113, i32* %6
%114 = load i8*, i8** %4
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %114)
%116 = load i32, i32* %6
%117 = load i32, i32* %5
%118 = icmp eq i32 %116, %117
%119 = zext i1 %118 to i32
%120 = call i32 @assert(i32 %119)
%121 = load i8*, i8** %4
%122 = getelementptr inbounds i8, i8* %121, i64 0
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp eq i32 %124, 0
%126 = zext i1 %125 to i32
%127 = call i32 @assert(i32 %126)
%128 = load i8*, i8** %4
%129 = getelementptr inbounds i8, i8* %128, i64 1
%130 = load i8, i8* %129
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 88
%133 = zext i1 %132 to i32
%134 = call i32 @assert(i32 %133)
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.25, i64 0, i64 0))
%136 = load i8*, i8** %4
%137 = call i32 @memset(i8* %136, i8 signext 88, i32 11)
%138 = load i8*, i8** %4
%139 = getelementptr inbounds i8, i8* %138, i64 11
store i8 0, i8* %139
%140 = load i8*, i8** %4
%141 = call i32 @hwloc_obj_cpuset_snprintf(i8* %140, i32 10, i32 1, %struct.TYPE_5__** %7)
store i32 %141, i32* %6
%142 = load i8*, i8** %4
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %142)
%144 = load i32, i32* %6
%145 = load i32, i32* %5
%146 = icmp eq i32 %144, %145
%147 = zext i1 %146 to i32
%148 = call i32 @assert(i32 %147)
%149 = load i8*, i8** %4
%150 = getelementptr inbounds i8, i8* %149, i64 8
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 102
%154 = zext i1 %153 to i32
%155 = call i32 @assert(i32 %154)
%156 = load i8*, i8** %4
%157 = getelementptr inbounds i8, i8* %156, i64 9
%158 = load i8, i8* %157
%159 = sext i8 %158 to i32
%160 = icmp eq i32 %159, 0
%161 = zext i1 %160 to i32
%162 = call i32 @assert(i32 %161)
%163 = load i8*, i8** %4
%164 = getelementptr inbounds i8, i8* %163, i64 10
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = icmp eq i32 %166, 88
%168 = zext i1 %167 to i32
%169 = call i32 @assert(i32 %168)
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.26, i64 0, i64 0))
%171 = load i8*, i8** %4
%172 = call i32 @memset(i8* %171, i8 signext 88, i32 12)
%173 = load i8*, i8** %4
%174 = getelementptr inbounds i8, i8* %173, i64 12
store i8 0, i8* %174
%175 = load i8*, i8** %4
%176 = call i32 @hwloc_obj_cpuset_snprintf(i8* %175, i32 11, i32 1, %struct.TYPE_5__** %7)
store i32 %176, i32* %6
%177 = load i8*, i8** %4
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %177)
%179 = load i32, i32* %6
%180 = load i32, i32* %5
%181 = icmp eq i32 %179, %180
%182 = zext i1 %181 to i32
%183 = call i32 @assert(i32 %182)
%184 = load i8*, i8** %4
%185 = getelementptr inbounds i8, i8* %184, i64 9
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = icmp eq i32 %187, 102
%189 = zext i1 %188 to i32
%190 = call i32 @assert(i32 %189)
%191 = load i8*, i8** %4
%192 = getelementptr inbounds i8, i8* %191, i64 10
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
%195 = icmp eq i32 %194, 0
%196 = zext i1 %195 to i32
%197 = call i32 @assert(i32 %196)
%198 = load i8*, i8** %4
%199 = getelementptr inbounds i8, i8* %198, i64 11
%200 = load i8, i8* %199
%201 = sext i8 %200 to i32
%202 = icmp eq i32 %201, 88
%203 = zext i1 %202 to i32
%204 = call i32 @assert(i32 %203)
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.27, i64 0, i64 0))
%206 = load i8*, i8** %4
%207 = call i32 @memset(i8* %206, i8 signext 88, i32 24)
%208 = load i8*, i8** %4
%209 = getelementptr inbounds i8, i8* %208, i64 24
store i8 0, i8* %209
%210 = load i8*, i8** %4
%211 = call i32 @hwloc_obj_cpuset_snprintf(i8* %210, i32 23, i32 1, %struct.TYPE_5__** %7)
store i32 %211, i32* %6
%212 = load i8*, i8** %4
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %212)
%214 = load i32, i32* %6
%215 = load i32, i32* %5
%216 = icmp eq i32 %214, %215
%217 = zext i1 %216 to i32
%218 = call i32 @assert(i32 %217)
%219 = load i8*, i8** %4
%220 = getelementptr inbounds i8, i8* %219, i64 20
%221 = load i8, i8* %220
%222 = sext i8 %221 to i32
%223 = icmp eq i32 %222, 102
%224 = zext i1 %223 to i32
%225 = call i32 @assert(i32 %224)
%226 = load i8*, i8** %4
%227 = getelementptr inbounds i8, i8* %226, i64 21
%228 = load i8, i8* %227
%229 = sext i8 %228 to i32
%230 = icmp eq i32 %229, 44
%231 = zext i1 %230 to i32
%232 = call i32 @assert(i32 %231)
%233 = load i8*, i8** %4
%234 = getelementptr inbounds i8, i8* %233, i64 22
%235 = load i8, i8* %234
%236 = sext i8 %235 to i32
%237 = icmp eq i32 %236, 0
%238 = zext i1 %237 to i32
%239 = call i32 @assert(i32 %238)
%240 = load i8*, i8** %4
%241 = getelementptr inbounds i8, i8* %240, i64 23
%242 = load i8, i8* %241
%243 = sext i8 %242 to i32
%244 = icmp eq i32 %243, 88
%245 = zext i1 %244 to i32
%246 = call i32 @assert(i32 %245)
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.28, i64 0, i64 0))
%248 = load i8*, i8** %4
%249 = call i32 @memset(i8* %248, i8 signext 88, i32 52)
%250 = load i8*, i8** %4
%251 = getelementptr inbounds i8, i8* %250, i64 52
store i8 0, i8* %251
%252 = load i8*, i8** %4
%253 = call i32 @hwloc_obj_cpuset_snprintf(i8* %252, i32 51, i32 1, %struct.TYPE_5__** %7)
store i32 %253, i32* %6
%254 = load i8*, i8** %4
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %254)
%256 = load i32, i32* %6
%257 = load i32, i32* %5
%258 = icmp eq i32 %256, %257
%259 = zext i1 %258 to i32
%260 = call i32 @assert(i32 %259)
%261 = load i8*, i8** %4
%262 = getelementptr inbounds i8, i8* %261, i64 49
%263 = load i8, i8* %262
%264 = sext i8 %263 to i32
%265 = icmp eq i32 %264, 102
%266 = zext i1 %265 to i32
%267 = call i32 @assert(i32 %266)
%268 = load i8*, i8** %4
%269 = getelementptr inbounds i8, i8* %268, i64 50
%270 = load i8, i8* %269
%271 = sext i8 %270 to i32
%272 = icmp eq i32 %271, 0
%273 = zext i1 %272 to i32
%274 = call i32 @assert(i32 %273)
%275 = load i8*, i8** %4
%276 = getelementptr inbounds i8, i8* %275, i64 51
%277 = load i8, i8* %276
%278 = sext i8 %277 to i32
%279 = icmp eq i32 %278, 88
%280 = zext i1 %279 to i32
%281 = call i32 @assert(i32 %280)
%282 = load i32, i32* %2
%283 = load i32, i32* %3
%284 = sub i32 %283, 1
%285 = call %struct.TYPE_5__* @hwloc_get_obj_by_depth(i32 %282, i32 %284, i64 0)
store %struct.TYPE_5__* %285, %struct.TYPE_5__** %7
%286 = load i8*, i8** %4
%287 = load i32, i32* %5
%288 = add nsw i32 %287, 1
%289 = call i32 @hwloc_obj_cpuset_snprintf(i8* %286, i32 %288, i32 1, %struct.TYPE_5__** %7)
%290 = load i8*, i8** %4
%291 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.29, i64 0, i64 0), i8* %290)
%292 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%293 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %292, i32 0, i32 0
%294 = load i32, i32* %293
%295 = call i32 @check_cpuset(i32 %294, i8* null, i8* null, i8* null)
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.30, i64 0, i64 0))
%297 = load i32, i32* %2
%298 = load i32, i32* %3
%299 = sub i32 %298, 1
%300 = load i32, i32* %2
%301 = load i32, i32* %3
%302 = sub i32 %301, 1
%303 = call i64 @hwloc_get_nbobjs_by_depth(i32 %300, i32 %302)
%304 = sub nsw i64 %303, 1
%305 = call %struct.TYPE_5__* @hwloc_get_obj_by_depth(i32 %297, i32 %299, i64 %304)
store %struct.TYPE_5__* %305, %struct.TYPE_5__** %7
%306 = load i8*, i8** %4
%307 = load i32, i32* %5
%308 = add nsw i32 %307, 1
%309 = call i32 @hwloc_obj_cpuset_snprintf(i8* %306, i32 %308, i32 1, %struct.TYPE_5__** %7)
%310 = load i8*, i8** %4
%311 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.31, i64 0, i64 0), i8* %310)
%312 = load %struct.TYPE_5__*, %struct.TYPE_5__** %7
%313 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %312, i32 0, i32 0
%314 = load i32, i32* %313
%315 = call i32 @check_cpuset(i32 %314, i8* null, i8* null, i8* null)
%316 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.32, i64 0, i64 0))
%317 = load i8*, i8** %4
%318 = call i32 @free(i8* %317)
%319 = load i32, i32* %2
%320 = call i32 @hwloc_topology_destroy(i32 %319)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
@.str = [4 x i8] c"0x0\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.5 = [8 x i8] c"0xf...f\00"
@.str.6 = [3 x i8] c"0-\00"
@.str.10 = [74 x i8] c"0xf...f,0xffffdfff,0xffffffff,0xffffffff,0xffffff80,0x0fffffff,0xffffffff\00"
@.str.11 = [17 x i8] c"0-59,71-172,174-\00"
@.str.12 = [56 x i8] c"0xf...fffffdfffffffffffffffffffffffff800fffffffffffffff\00"
@.str.14 = [23 x i8] c"0x00000078,,0x00000004\00"
@.str.15 = [8 x i8] c"2,67-70\00"
@.str.16 = [21 x i8] c"0x780000000000000004\00"
@.str.18 = [10 x i8] c"6 5 4 3 2\00"
@.str.19 = [21 x i8] c"system cpuset is %s\0A\00"
@.str.24 = [8 x i8] c"got %s\0A\00"
@.str.29 = [24 x i8] c"first cpu cpuset is %s\0A\00"
@.str.31 = [23 x i8] c"last cpu cpuset is %s\0A\00"
@str = [42 x i8] c"empty cpuset converted back and forth, ok\00"
@str.33 = [61 x i8] c"uselessly modified empty cpuset converted back and forth, ok\00"
@str.34 = [67 x i8] c"twice uselessly modified empty cpuset converted back and forth, ok\00"
@str.35 = [41 x i8] c"full cpuset converted back and forth, ok\00"
@str.36 = [60 x i8] c"uselessly modified full cpuset converted back and forth, ok\00"
@str.37 = [66 x i8] c"twice uselessly modified full cpuset converted back and forth, ok\00"
@str.38 = [53 x i8] c"infinite/nonfull cpuset converted back and forth, ok\00"
@str.39 = [51 x i8] c"finite/nonnull cpuset converted back and forth, ok\00"
@str.40 = [43 x i8] c"system cpuset converted back and forth, ok\00"
@str.41 = [40 x i8] c"truncating system cpuset to NULL buffer\00"
@str.42 = [53 x i8] c"truncating system cpuset to 0 char (no modification)\00"
@str.43 = [50 x i8] c"truncating system cpuset to 1 char (empty string)\00"
@str.44 = [76 x i8] c"truncating system cpuset to 10 chars (single 32bit subset except last char)\00"
@str.45 = [59 x i8] c"truncating system cpuset to 11 chars (single 32bit subset)\00"
@str.46 = [75 x i8] c"truncating system cpuset to 23 chars (two 32bit subsets with ending comma)\00"
@str.47 = [81 x i8] c"truncating system cpuset to 51 chars (truncate to four and a half 32bit subsets)\00"
@str.48 = [46 x i8] c"first cpu cpuset converted back and forth, ok\00"
@str.49 = [45 x i8] c"last cpu cpuset converted back and forth, ok\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca %struct.TYPE_5__*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%6 = bitcast %struct.TYPE_5__** %3 to i8*
%7 = tail call i32 (...) @hwloc_bitmap_alloc()
%8 = tail call i32 @check_cpuset(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @hwloc_bitmap_set_ith_ulong(i32 %7, i32 0, i64 0)
%11 = tail call i32 @check_cpuset(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.33, i64 0, i64 0))
%13 = tail call i32 @hwloc_bitmap_set_ith_ulong(i32 %7, i32 5, i64 0)
%14 = tail call i32 @check_cpuset(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.34, i64 0, i64 0))
%16 = tail call i32 @hwloc_bitmap_free(i32 %7)
%17 = tail call i32 (...) @hwloc_bitmap_alloc_full()
%18 = tail call i32 @check_cpuset(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.35, i64 0, i64 0))
%20 = tail call i32 @hwloc_bitmap_set_ith_ulong(i32 %17, i32 0, i64 -1)
%21 = tail call i32 @check_cpuset(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.36, i64 0, i64 0))
%23 = tail call i32 @hwloc_bitmap_set_ith_ulong(i32 %17, i32 8, i64 -1)
%24 = tail call i32 @check_cpuset(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.37, i64 0, i64 0))
%26 = tail call i32 @hwloc_bitmap_free(i32 %17)
%27 = tail call i32 (...) @hwloc_bitmap_alloc_full()
%28 = tail call i32 @hwloc_bitmap_clr(i32 %27, i32 173)
%29 = tail call i32 @hwloc_bitmap_clr_range(i32 %27, i32 60, i32 70)
%30 = tail call i32 @check_cpuset(i32 %27, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0))
%31 = tail call i32 @hwloc_bitmap_free(i32 %27)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.38, i64 0, i64 0))
%33 = tail call i32 (...) @hwloc_bitmap_alloc()
%34 = tail call i32 @hwloc_bitmap_set(i32 %33, i32 2)
%35 = tail call i32 @hwloc_bitmap_set_range(i32 %33, i32 67, i32 70)
%36 = tail call i32 @check_cpuset(i32 %33, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
%37 = tail call i32 @hwloc_bitmap_free(i32 %33)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.39, i64 0, i64 0))
%39 = call i32 @hwloc_topology_init(i32* %1)
%40 = load i32, i32* %1
%41 = call i32 @hwloc_topology_set_synthetic(i32 %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%42 = load i32, i32* %1
%43 = call i32 @hwloc_topology_load(i32 %42)
%44 = load i32, i32* %1
%45 = call i32 @hwloc_topology_get_depth(i32 %44)
%46 = load i32, i32* %1
%47 = call %struct.TYPE_5__* @hwloc_get_root_obj(i32 %46)
store %struct.TYPE_5__* %47, %struct.TYPE_5__** %3
%48 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %47, i64 0, i32 0
%49 = load i32, i32* %48
%50 = call i32 @hwloc_bitmap_asprintf(i8** %2, i32 %49)
%51 = load i8*, i8** %2
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %51)
%53 = load i32, i32* %48
%54 = call i32 @check_cpuset(i32 %53, i8* null, i8* null, i8* null)
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.40, i64 0, i64 0))
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.41, i64 0, i64 0))
%57 = call i32 @hwloc_obj_cpuset_snprintf(i8* null, i32 0, i32 1, %struct.TYPE_5__** %3)
%58 = icmp eq i32 %57, %50
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.42, i64 0, i64 0))
%62 = load i8*, i8** %2
%63 = call i32 @memset(i8* %62, i8 signext 88, i32 1)
%64 = load i8*, i8** %2
%65 = getelementptr inbounds i8, i8* %64, i64 1
store i8 0, i8* %65
%66 = load i8*, i8** %2
%67 = call i32 @hwloc_obj_cpuset_snprintf(i8* %66, i32 0, i32 1, %struct.TYPE_5__** %3)
%68 = icmp eq i32 %67, %50
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = load i8*, i8** %2
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 88
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.43, i64 0, i64 0))
%77 = load i8*, i8** %2
%78 = call i32 @memset(i8* %77, i8 signext 88, i32 2)
%79 = load i8*, i8** %2
%80 = getelementptr inbounds i8, i8* %79, i64 2
store i8 0, i8* %80
%81 = load i8*, i8** %2
%82 = call i32 @hwloc_obj_cpuset_snprintf(i8* %81, i32 1, i32 1, %struct.TYPE_5__** %3)
%83 = load i8*, i8** %2
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %83)
%85 = icmp eq i32 %82, %50
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = load i8*, i8** %2
%89 = load i8, i8* %88
%90 = icmp eq i8 %89, 0
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = load i8*, i8** %2
%94 = getelementptr inbounds i8, i8* %93, i64 1
%95 = load i8, i8* %94
%96 = icmp eq i8 %95, 88
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.44, i64 0, i64 0))
%100 = load i8*, i8** %2
%101 = call i32 @memset(i8* %100, i8 signext 88, i32 11)
%102 = load i8*, i8** %2
%103 = getelementptr inbounds i8, i8* %102, i64 11
store i8 0, i8* %103
%104 = call i32 @hwloc_obj_cpuset_snprintf(i8* %102, i32 10, i32 1, %struct.TYPE_5__** %3)
%105 = load i8*, i8** %2
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %105)
%107 = icmp eq i32 %104, %50
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = load i8*, i8** %2
%111 = getelementptr inbounds i8, i8* %110, i64 8
%112 = load i8, i8* %111
%113 = icmp eq i8 %112, 102
%114 = zext i1 %113 to i32
%115 = call i32 @assert(i32 %114)
%116 = load i8*, i8** %2
%117 = getelementptr inbounds i8, i8* %116, i64 9
%118 = load i8, i8* %117
%119 = icmp eq i8 %118, 0
%120 = zext i1 %119 to i32
%121 = call i32 @assert(i32 %120)
%122 = load i8*, i8** %2
%123 = getelementptr inbounds i8, i8* %122, i64 10
%124 = load i8, i8* %123
%125 = icmp eq i8 %124, 88
%126 = zext i1 %125 to i32
%127 = call i32 @assert(i32 %126)
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.45, i64 0, i64 0))
%129 = load i8*, i8** %2
%130 = call i32 @memset(i8* %129, i8 signext 88, i32 12)
%131 = load i8*, i8** %2
%132 = getelementptr inbounds i8, i8* %131, i64 12
store i8 0, i8* %132
%133 = call i32 @hwloc_obj_cpuset_snprintf(i8* %131, i32 11, i32 1, %struct.TYPE_5__** %3)
%134 = load i8*, i8** %2
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %134)
%136 = icmp eq i32 %133, %50
%137 = zext i1 %136 to i32
%138 = call i32 @assert(i32 %137)
%139 = load i8*, i8** %2
%140 = getelementptr inbounds i8, i8* %139, i64 9
%141 = load i8, i8* %140
%142 = icmp eq i8 %141, 102
%143 = zext i1 %142 to i32
%144 = call i32 @assert(i32 %143)
%145 = load i8*, i8** %2
%146 = getelementptr inbounds i8, i8* %145, i64 10
%147 = load i8, i8* %146
%148 = icmp eq i8 %147, 0
%149 = zext i1 %148 to i32
%150 = call i32 @assert(i32 %149)
%151 = load i8*, i8** %2
%152 = getelementptr inbounds i8, i8* %151, i64 11
%153 = load i8, i8* %152
%154 = icmp eq i8 %153, 88
%155 = zext i1 %154 to i32
%156 = call i32 @assert(i32 %155)
%157 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.46, i64 0, i64 0))
%158 = load i8*, i8** %2
%159 = call i32 @memset(i8* %158, i8 signext 88, i32 24)
%160 = load i8*, i8** %2
%161 = getelementptr inbounds i8, i8* %160, i64 24
store i8 0, i8* %161
%162 = call i32 @hwloc_obj_cpuset_snprintf(i8* %160, i32 23, i32 1, %struct.TYPE_5__** %3)
%163 = load i8*, i8** %2
%164 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %163)
%165 = icmp eq i32 %162, %50
%166 = zext i1 %165 to i32
%167 = call i32 @assert(i32 %166)
%168 = load i8*, i8** %2
%169 = getelementptr inbounds i8, i8* %168, i64 20
%170 = load i8, i8* %169
%171 = icmp eq i8 %170, 102
%172 = zext i1 %171 to i32
%173 = call i32 @assert(i32 %172)
%174 = load i8*, i8** %2
%175 = getelementptr inbounds i8, i8* %174, i64 21
%176 = load i8, i8* %175
%177 = icmp eq i8 %176, 44
%178 = zext i1 %177 to i32
%179 = call i32 @assert(i32 %178)
%180 = load i8*, i8** %2
%181 = getelementptr inbounds i8, i8* %180, i64 22
%182 = load i8, i8* %181
%183 = icmp eq i8 %182, 0
%184 = zext i1 %183 to i32
%185 = call i32 @assert(i32 %184)
%186 = load i8*, i8** %2
%187 = getelementptr inbounds i8, i8* %186, i64 23
%188 = load i8, i8* %187
%189 = icmp eq i8 %188, 88
%190 = zext i1 %189 to i32
%191 = call i32 @assert(i32 %190)
%192 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.47, i64 0, i64 0))
%193 = load i8*, i8** %2
%194 = call i32 @memset(i8* %193, i8 signext 88, i32 52)
%195 = load i8*, i8** %2
%196 = getelementptr inbounds i8, i8* %195, i64 52
store i8 0, i8* %196
%197 = call i32 @hwloc_obj_cpuset_snprintf(i8* %195, i32 51, i32 1, %struct.TYPE_5__** %3)
%198 = load i8*, i8** %2
%199 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8* %198)
%200 = icmp eq i32 %197, %50
%201 = zext i1 %200 to i32
%202 = call i32 @assert(i32 %201)
%203 = load i8*, i8** %2
%204 = getelementptr inbounds i8, i8* %203, i64 49
%205 = load i8, i8* %204
%206 = icmp eq i8 %205, 102
%207 = zext i1 %206 to i32
%208 = call i32 @assert(i32 %207)
%209 = load i8*, i8** %2
%210 = getelementptr inbounds i8, i8* %209, i64 50
%211 = load i8, i8* %210
%212 = icmp eq i8 %211, 0
%213 = zext i1 %212 to i32
%214 = call i32 @assert(i32 %213)
%215 = load i8*, i8** %2
%216 = getelementptr inbounds i8, i8* %215, i64 51
%217 = load i8, i8* %216
%218 = icmp eq i8 %217, 88
%219 = zext i1 %218 to i32
%220 = call i32 @assert(i32 %219)
%221 = load i32, i32* %1
%222 = add i32 %45, -1
%223 = call %struct.TYPE_5__* @hwloc_get_obj_by_depth(i32 %221, i32 %222, i64 0)
store %struct.TYPE_5__* %223, %struct.TYPE_5__** %3
%224 = load i8*, i8** %2
%225 = add nsw i32 %50, 1
%226 = call i32 @hwloc_obj_cpuset_snprintf(i8* %224, i32 %225, i32 1, %struct.TYPE_5__** %3)
%227 = load i8*, i8** %2
%228 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.29, i64 0, i64 0), i8* %227)
%229 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%230 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %229, i64 0, i32 0
%231 = load i32, i32* %230
%232 = call i32 @check_cpuset(i32 %231, i8* null, i8* null, i8* null)
%233 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.48, i64 0, i64 0))
%234 = load i32, i32* %1
%235 = call i64 @hwloc_get_nbobjs_by_depth(i32 %234, i32 %222)
%236 = add nsw i64 %235, -1
%237 = call %struct.TYPE_5__* @hwloc_get_obj_by_depth(i32 %234, i32 %222, i64 %236)
store %struct.TYPE_5__* %237, %struct.TYPE_5__** %3
%238 = load i8*, i8** %2
%239 = call i32 @hwloc_obj_cpuset_snprintf(i8* %238, i32 %225, i32 1, %struct.TYPE_5__** %3)
%240 = load i8*, i8** %2
%241 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.31, i64 0, i64 0), i8* %240)
%242 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%243 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %242, i64 0, i32 0
%244 = load i32, i32* %243
%245 = call i32 @check_cpuset(i32 %244, i8* null, i8* null, i8* null)
%246 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.49, i64 0, i64 0))
%247 = load i8*, i8** %2
%248 = call i32 @free(i8* %247)
%249 = load i32, i32* %1
%250 = call i32 @hwloc_topology_destroy(i32 %249)
ret i32 0
}