#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ adapt_add_binary(char *);
int /*<<< orphan*/ adapt_close();
int adapt_open();
int /*<<< orphan*/ cat(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_category(int, char *);
int /*<<< orphan*/ print_threads();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
size_t strlen(char *);
char *strstr(char *, char *);
int test_dct(int /*<<< orphan*/, int);
int test_dvfs(int /*<<< orphan*/, int);
int test_file(int /*<<< orphan*/, int, char *);
int main(int argc, char **argv) {
  char *filename = "./test_file";
  char *option = "Intel_Clock_Modulation";
  static const int verbose = 1, machine = 2;
  int message = verbose;
  int test = 0;
  int executed_tests = 0;
  int error = 0;
  while (*++argv) {
    if (strcmp(*argv, "help") == 0) {
      printf("Use verbose, machine or simply nothing as parameter");
      printf("You can also add the unit that should be tested, like) == 0 )");
      printf("%s message dct", argv[0]);
      printf("Possibile values are) == 0 ) all, dct, dvfs and file");
      return 0;
    } else if (strcmp(*argv, "verbose") == 0)
      message = verbose;
    else if (strcmp(*argv, "machine") == 0)
      message = machine;
    else if (strcmp(*argv, "dct") == 0)
      test |= (1 << 0);
    else if (strcmp(*argv, "dvfs") == 0)
      test |= (1 << 1);
    else if (strcmp(*argv, "file") == 0)
      test |= (1 << 2);
    else if (strcmp(*argv, "x86_adapt") == 0)
      test |= 0;
    else if (strcmp(*argv, "all") == 0)
      test = (1 << 0) | (1 << 1) | (1 << 2) | 0;
    else if (strstr(*argv, "/") != NULL)
      filename = *argv;
    else if (strstr(*argv, "x86_adapt_") != NULL) {
      option = strstr(*argv, "x86_adapt_");
      option = &option[strlen("x86_adapt_")];
    }
  }
  if (test == 0)
    test = (1 << 0) | (1 << 1) | (1 << 2) | 0;
  if (message == 1)
    printf("\nOpen adapter \n");
  error |= adapt_open();
  if (message == 1)
    printf("Returned error code: %d\n", error);
  if (message == 1)
    printf("\nAdd binary \n");
  uint64_t bid = adapt_add_binary("test");
  if (test & (1 << 2)) {
    error |= test_file(bid, message, filename);
    test &= ~(1 << 2);
  }
  if (test & (1 << 1)) {
    error |= test_dvfs(bid, message);
    test &= ~(1 << 1);
    executed_tests |= (1 << 1);
  }
  if (test & (1 << 0)) {
    error |= test_dct(bid, message);
    test &= ~(1 << 0);
    executed_tests |= (1 << 0);
  }
  if (test != 0) {
    printf("Something went wrong with the tests, status: %d", test);
    error |= 2;
  }
  if (message == 1)
    printf("\nClose adapter\n");
  adapt_close();
  print_category(message, "after closing");
  if (executed_tests & (1 << 1)) {
    if (message == 1) {
      printf("Test dvfs\n");
      printf("Freq:\n");
    }
    printf("init_dvfs_freq_after=");
    cat("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", 0);
    printf("\n");
    if (message == 1)
      printf("\n");
    executed_tests &= ~(1 << 1);
  }
  if (executed_tests & (1 << 0)) {
    if (message == 1) {
      printf("Test dct\n");
      printf("Threads:\n");
    }
    printf("init_dct_threads_after=");
    print_threads();
    printf("\n");
    executed_tests &= ~(1 << 0);
  }
  return error;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe13(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe14(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1476 <main+0x2a6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    129a <main+0xca>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16b8 <main+0x4e8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe36(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12c3 <main+0xf3>
movl   $0x1,-0x24(%rbp)
jmp    146c <main+0x29c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe15(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12ec <main+0x11c>
movl   $0x2,-0x24(%rbp)
jmp    1467 <main+0x297>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdab(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1317 <main+0x147>
mov    -0x28(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1462 <main+0x292>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdc9(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1342 <main+0x172>
mov    -0x28(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    145d <main+0x28d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd89(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    136d <main+0x19d>
mov    -0x28(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    1458 <main+0x288>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd78(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1398 <main+0x1c8>
mov    -0x28(%rbp),%eax
or     $0x0,%eax
mov    %eax,-0x28(%rbp)
jmp    1453 <main+0x283>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd57(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13c1 <main+0x1f1>
movl   $0x7,-0x28(%rbp)
jmp    144e <main+0x27e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd32(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     13ee <main+0x21e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1449 <main+0x279>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd07(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1444 <main+0x274>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xcea(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    0xcd2(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1449 <main+0x279>
jmp    144e <main+0x27e>
jmp    1453 <main+0x283>
jmp    1458 <main+0x288>
jmp    145d <main+0x28d>
jmp    1462 <main+0x292>
jmp    1467 <main+0x297>
jmp    146c <main+0x29c>
jmp    1471 <main+0x2a1>
jmp    1218 <main+0x48>
cmpl   $0x0,-0x28(%rbp)
jne    1487 <main+0x2b7>
movl   $0x7,-0x28(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    149f <main+0x2cf>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <adapt_open@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    14c7 <main+0x2f7>
mov    -0x30(%rbp),%esi
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    14df <main+0x30f>
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc5f(%rip),%rdi
call   1080 <adapt_add_binary@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     151b <main+0x34b>
mov    -0x34(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1070 <test_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
and    $0xfffffffb,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     154d <main+0x37d>
mov    -0x34(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1050 <test_dvfs@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
and    $0xfffffffd,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     157f <main+0x3af>
mov    -0x34(%rbp),%edi
mov    -0x24(%rbp),%esi
call   10c0 <test_dct@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     15a3 <main+0x3d3>
mov    -0x28(%rbp),%esi
lea    0xbb7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    15bb <main+0x3eb>
lea    0xbc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <adapt_close@plt>
mov    -0x24(%rbp),%edi
lea    0xbbe(%rip),%rsi
call   10b0 <print_category@plt>
mov    -0x2c(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1651 <main+0x481>
cmpl   $0x1,-0x24(%rbp)
jne    1606 <main+0x436>
lea    0xba7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xba4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xba5(%rip),%rdi
xor    %esi,%esi
call   10f0 <cat@plt>
lea    0xaf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    1648 <main+0x478>
lea    0xadb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
and    $0xfffffffd,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     16b2 <main+0x4e2>
cmpl   $0x1,-0x24(%rbp)
jne    1686 <main+0x4b6>
lea    0xb85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10d0 <print_threads@plt>
lea    0xa7a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1351 <main+0x171>
mov    %rsi,%rbx
add    $0x8,%rbx
lea    0xdf7(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%r15d
xor    %r12d,%r12d
lea    0xdee(%rip),%r14
lea    0xea2(%rip),%r13
lea    0xea3(%rip),%rbp
jmp    1247 <main+0x67>
xchg   %ax,%ax
mov    $0x1,%r15d
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     1360 <main+0x180>
mov    %r14,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     14cd <main+0x2ed>
mov    (%rbx),%rdi
mov    %r13,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1230 <main+0x50>
mov    (%rbx),%rdi
mov    %rbp,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1320 <main+0x140>
mov    (%rbx),%rdi
lea    0xe08(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     132b <main+0x14b>
mov    (%rbx),%rdi
lea    0xf1e(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1334 <main+0x154>
mov    (%rbx),%rdi
lea    0xe0c(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     133d <main+0x15d>
mov    (%rbx),%rdi
lea    0xe0d(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1236 <main+0x56>
mov    (%rbx),%rdi
lea    0xdff(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1346 <main+0x166>
mov    %r15d,0x14(%rsp)
mov    (%rbx),%r15
mov    %r15,%rdi
mov    $0x2f,%esi
call   1070 <strchr@plt>
test   %rax,%rax
mov    0x8(%rsp),%rax
cmovne %r15,%rax
mov    0x14(%rsp),%r15d
mov    %rax,0x8(%rsp)
jmp    1236 <main+0x56>
nopl   0x0(%rax)
mov    $0x2,%r15d
jmp    1236 <main+0x56>
or     $0x1,%r12d
jmp    1236 <main+0x56>
or     $0x2,%r12d
jmp    1236 <main+0x56>
or     $0x4,%r12d
jmp    1236 <main+0x56>
mov    $0x7,%r12d
jmp    1236 <main+0x56>
lea    0xca8(%rip),%rbx
mov    $0x1,%r15d
jmp    136a <main+0x18a>
test   %r12d,%r12d
mov    0x8(%rsp),%rbx
jne    1370 <main+0x190>
mov    $0x7,%r12d
mov    %r15d,%ebp
cmp    $0x1,%r15d
jne    13ad <main+0x1cd>
lea    0xe63(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <adapt_open@plt>
mov    %eax,%r14d
lea    0xd4f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
jmp    13b7 <main+0x1d7>
xor    %eax,%eax
call   10c0 <adapt_open@plt>
mov    %eax,%r14d
lea    0xd40(%rip),%rdi
call   10a0 <adapt_add_binary@plt>
mov    %eax,%r15d
test   $0x4,%r12b
je     13e0 <main+0x200>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1090 <test_file@plt>
or     %eax,%r14d
and    $0xfffffffb,%r12d
xor    %ebx,%ebx
test   $0x2,%r12b
jne    148b <main+0x2ab>
test   $0x1,%r12b
jne    14ab <main+0x2cb>
test   %r12d,%r12d
je     1410 <main+0x230>
lea    0xd01(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
or     $0x2,%r14d
cmp    $0x1,%ebp
jne    1421 <main+0x241>
lea    0xdab(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <adapt_close@plt>
lea    0xd04(%rip),%rsi
mov    %ebp,%edi
call   10d0 <print_category@plt>
test   $0x2,%bl
je     1536 <main+0x356>
cmp    $0x1,%ebp
jne    150d <main+0x32d>
lea    0xd68(%rip),%rdi
call   1040 <puts@plt>
lea    0xd66(%rip),%rdi
call   1040 <puts@plt>
lea    0xcda(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xce2(%rip),%rdi
xor    %esi,%esi
call   1100 <cat@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1529 <main+0x349>
mov    %r15d,%edi
mov    %ebp,%esi
call   1060 <test_dvfs@plt>
or     %eax,%r14d
and    $0xfffffffd,%r12d
mov    $0x2,%ebx
test   $0x1,%r12b
je     13f6 <main+0x216>
mov    %r15d,%edi
mov    %ebp,%esi
call   10e0 <test_dct@plt>
or     %eax,%r14d
and    $0xfffffffe,%r12d
or     $0x1,%ebx
test   %r12d,%r12d
jne    13fb <main+0x21b>
jmp    1410 <main+0x230>
lea    0xb3d(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb60(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%rbx),%rsi
lea    0xb8d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb8e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1577 <main+0x397>
lea    0xc2d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc35(%rip),%rdi
xor    %esi,%esi
call   1100 <cat@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
and    $0x1,%ebx
test   $0x1,%bl
je     1577 <main+0x397>
cmp    $0x1,%ebp
jne    1558 <main+0x378>
lea    0xc5e(%rip),%rdi
call   1040 <puts@plt>
lea    0xc5b(%rip),%rdi
call   1040 <puts@plt>
lea    0xc2e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   10f0 <print_threads@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"./test_file\00"
@.str.1 = [23 x i8] c"Intel_Clock_Modulation\00"
@main.verbose = internal constant i32 1
@main.machine = internal constant i32 2
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [52 x i8] c"Use verbose, machine or simply nothing as parameter\00"
@.str.4 = [62 x i8] c"You can also add the unit that should be tested, like) == 0 )\00"
@.str.5 = [15 x i8] c"%s message dct\00"
@.str.6 = [53 x i8] c"Possibile values are) == 0 ) all, dct, dvfs and file\00"
@.str.7 = [8 x i8] c"verbose\00"
@.str.8 = [8 x i8] c"machine\00"
@.str.9 = [4 x i8] c"dct\00"
@.str.10 = [5 x i8] c"dvfs\00"
@.str.11 = [5 x i8] c"file\00"
@.str.12 = [10 x i8] c"x86_adapt\00"
@.str.13 = [4 x i8] c"all\00"
@.str.14 = [2 x i8] c"/\00"
@.str.15 = [11 x i8] c"x86_adapt_\00"
@.str.16 = [16 x i8] c"\0AOpen adapter \0A\00"
@.str.17 = [25 x i8] c"Returned error code: %d\0A\00"
@.str.18 = [14 x i8] c"\0AAdd binary \0A\00"
@.str.19 = [5 x i8] c"test\00"
@.str.20 = [48 x i8] c"Something went wrong with the tests, status: %d\00"
@.str.21 = [16 x i8] c"\0AClose adapter\0A\00"
@.str.22 = [14 x i8] c"after closing\00"
@.str.23 = [11 x i8] c"Test dvfs\0A\00"
@.str.24 = [7 x i8] c"Freq:\0A\00"
@.str.25 = [22 x i8] c"init_dvfs_freq_after=\00"
@.str.26 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.27 = [2 x i8] c"\0A\00"
@.str.28 = [10 x i8] c"Test dct\0A\00"
@.str.29 = [10 x i8] c"Threads:\0A\00"
@.str.30 = [24 x i8] c"init_dct_threads_after=\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i32 1, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %13
13: ; preds = %110, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i32 1
store i8** %15, i8*** %5
%16 = load i8*, i8** %15
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %111
18: ; preds = %13
%19 = load i8**, i8*** %5
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %231
31: ; preds = %18
%32 = load i8**, i8*** %5
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %31
store i32 1, i32* %8
br label %109
37: ; preds = %31
%38 = load i8**, i8*** %5
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %37
store i32 2, i32* %8
br label %108
43: ; preds = %37
%44 = load i8**, i8*** %5
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = load i32, i32* %9
%50 = or i32 %49, 1
store i32 %50, i32* %9
br label %107
51: ; preds = %43
%52 = load i8**, i8*** %5
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i32, i32* %9
%58 = or i32 %57, 2
store i32 %58, i32* %9
br label %106
59: ; preds = %51
%60 = load i8**, i8*** %5
%61 = load i8*, i8** %60
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i32, i32* %9
%66 = or i32 %65, 4
store i32 %66, i32* %9
br label %105
67: ; preds = %59
%68 = load i8**, i8*** %5
%69 = load i8*, i8** %68
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load i32, i32* %9
%74 = or i32 %73, 0
store i32 %74, i32* %9
br label %104
75: ; preds = %67
%76 = load i8**, i8*** %5
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %75
store i32 7, i32* %9
br label %103
81: ; preds = %75
%82 = load i8**, i8*** %5
%83 = load i8*, i8** %82
%84 = call i8* @strstr(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%85 = icmp ne i8* %84, null
br i1 %85, label %86, label %89
86: ; preds = %81
%87 = load i8**, i8*** %5
%88 = load i8*, i8** %87
store i8* %88, i8** %6
br label %102
89: ; preds = %81
%90 = load i8**, i8*** %5
%91 = load i8*, i8** %90
%92 = call i8* @strstr(i8* %91, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
%93 = icmp ne i8* %92, null
br i1 %93, label %94, label %101
94: ; preds = %89
%95 = load i8**, i8*** %5
%96 = load i8*, i8** %95
%97 = call i8* @strstr(i8* %96, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
store i8* %97, i8** %7
%98 = load i8*, i8** %7
%99 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
%100 = getelementptr inbounds i8, i8* %98, i64 %99
store i8* %100, i8** %7
br label %101
101: ; preds = %94, %89
br label %102
102: ; preds = %101, %86
br label %103
103: ; preds = %102, %80
br label %104
104: ; preds = %103, %72
br label %105
105: ; preds = %104, %64
br label %106
106: ; preds = %105, %56
br label %107
107: ; preds = %106, %48
br label %108
108: ; preds = %107, %42
br label %109
109: ; preds = %108, %36
br label %110
110: ; preds = %109
br label %13
111: ; preds = %13
%112 = load i32, i32* %9
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %115
114: ; preds = %111
store i32 7, i32* %9
br label %115
115: ; preds = %114, %111
%116 = load i32, i32* %8
%117 = icmp eq i32 %116, 1
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
br label %120
120: ; preds = %118, %115
%121 = call i32 (...) @adapt_open()
%122 = load i32, i32* %11
%123 = or i32 %122, %121
store i32 %123, i32* %11
%124 = load i32, i32* %8
%125 = icmp eq i32 %124, 1
br i1 %125, label %126, label %129
126: ; preds = %120
%127 = load i32, i32* %11
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i32 %127)
br label %129
129: ; preds = %126, %120
%130 = load i32, i32* %8
%131 = icmp eq i32 %130, 1
br i1 %131, label %132, label %134
132: ; preds = %129
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0))
br label %134
134: ; preds = %132, %129
%135 = call i32 @adapt_add_binary(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
store i32 %135, i32* %12
%136 = load i32, i32* %9
%137 = and i32 %136, 4
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %148
139: ; preds = %134
%140 = load i32, i32* %12
%141 = load i32, i32* %8
%142 = load i8*, i8** %6
%143 = call i32 @test_file(i32 %140, i32 %141, i8* %142)
%144 = load i32, i32* %11
%145 = or i32 %144, %143
store i32 %145, i32* %11
%146 = load i32, i32* %9
%147 = and i32 %146, -5
store i32 %147, i32* %9
br label %148
148: ; preds = %139, %134
%149 = load i32, i32* %9
%150 = and i32 %149, 2
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %162
152: ; preds = %148
%153 = load i32, i32* %12
%154 = load i32, i32* %8
%155 = call i32 @test_dvfs(i32 %153, i32 %154)
%156 = load i32, i32* %11
%157 = or i32 %156, %155
store i32 %157, i32* %11
%158 = load i32, i32* %9
%159 = and i32 %158, -3
store i32 %159, i32* %9
%160 = load i32, i32* %10
%161 = or i32 %160, 2
store i32 %161, i32* %10
br label %162
162: ; preds = %152, %148
%163 = load i32, i32* %9
%164 = and i32 %163, 1
%165 = icmp ne i32 %164, 0
br i1 %165, label %166, label %176
166: ; preds = %162
%167 = load i32, i32* %12
%168 = load i32, i32* %8
%169 = call i32 @test_dct(i32 %167, i32 %168)
%170 = load i32, i32* %11
%171 = or i32 %170, %169
store i32 %171, i32* %11
%172 = load i32, i32* %9
%173 = and i32 %172, -2
store i32 %173, i32* %9
%174 = load i32, i32* %10
%175 = or i32 %174, 1
store i32 %175, i32* %10
br label %176
176: ; preds = %166, %162
%177 = load i32, i32* %9
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %184
179: ; preds = %176
%180 = load i32, i32* %9
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.20, i64 0, i64 0), i32 %180)
%182 = load i32, i32* %11
%183 = or i32 %182, 2
store i32 %183, i32* %11
br label %184
184: ; preds = %179, %176
%185 = load i32, i32* %8
%186 = icmp eq i32 %185, 1
br i1 %186, label %187, label %189
187: ; preds = %184
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0))
br label %189
189: ; preds = %187, %184
%190 = call i32 (...) @adapt_close()
%191 = load i32, i32* %8
%192 = call i32 @print_category(i32 %191, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
%193 = load i32, i32* %10
%194 = and i32 %193, 2
%195 = icmp ne i32 %194, 0
br i1 %195, label %196, label %213
196: ; preds = %189
%197 = load i32, i32* %8
%198 = icmp eq i32 %197, 1
br i1 %198, label %199, label %202
199: ; preds = %196
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0))
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0))
br label %202
202: ; preds = %199, %196
%203 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.25, i64 0, i64 0))
%204 = call i32 @cat(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.26, i64 0, i64 0), i32 0)
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
%206 = load i32, i32* %8
%207 = icmp eq i32 %206, 1
br i1 %207, label %208, label %210
208: ; preds = %202
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
br label %210
210: ; preds = %208, %202
%211 = load i32, i32* %10
%212 = and i32 %211, -3
store i32 %212, i32* %10
br label %213
213: ; preds = %210, %189
%214 = load i32, i32* %10
%215 = and i32 %214, 1
%216 = icmp ne i32 %215, 0
br i1 %216, label %217, label %229
217: ; preds = %213
%218 = load i32, i32* %8
%219 = icmp eq i32 %218, 1
br i1 %219, label %220, label %223
220: ; preds = %217
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0))
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.29, i64 0, i64 0))
br label %223
223: ; preds = %220, %217
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.30, i64 0, i64 0))
%225 = call i32 (...) @print_threads()
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
%227 = load i32, i32* %10
%228 = and i32 %227, -2
store i32 %228, i32* %10
br label %229
229: ; preds = %223, %213
%230 = load i32, i32* %11
store i32 %230, i32* %3
br label %231
231: ; preds = %229, %23
%232 = load i32, i32* %3
ret i32 %232
}

LLVM IR (-O2):
@.str = [12 x i8] c"./test_file\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [52 x i8] c"Use verbose, machine or simply nothing as parameter\00"
@.str.4 = [62 x i8] c"You can also add the unit that should be tested, like) == 0 )\00"
@.str.5 = [15 x i8] c"%s message dct\00"
@.str.6 = [53 x i8] c"Possibile values are) == 0 ) all, dct, dvfs and file\00"
@.str.7 = [8 x i8] c"verbose\00"
@.str.8 = [8 x i8] c"machine\00"
@.str.9 = [4 x i8] c"dct\00"
@.str.10 = [5 x i8] c"dvfs\00"
@.str.11 = [5 x i8] c"file\00"
@.str.12 = [10 x i8] c"x86_adapt\00"
@.str.13 = [4 x i8] c"all\00"
@.str.17 = [25 x i8] c"Returned error code: %d\0A\00"
@.str.19 = [5 x i8] c"test\00"
@.str.20 = [48 x i8] c"Something went wrong with the tests, status: %d\00"
@.str.22 = [14 x i8] c"after closing\00"
@.str.25 = [22 x i8] c"init_dvfs_freq_after=\00"
@.str.26 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.30 = [24 x i8] c"init_dct_threads_after=\00"
@str = [9 x i8] c"Test dct\00"
@str.31 = [9 x i8] c"Threads:\00"
@str.32 = [10 x i8] c"Test dvfs\00"
@str.33 = [6 x i8] c"Freq:\00"
@str.34 = [15 x i8] c"\0AClose adapter\00"
@str.35 = [13 x i8] c"\0AAdd binary \00"
@str.36 = [15 x i8] c"\0AOpen adapter \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %68, label %6
6: ; preds = %2, %59
%7 = phi i8* [ %64, %59 ], [ %4, %2 ]
%8 = phi i8** [ %63, %59 ], [ %3, %2 ]
%9 = phi i32 [ %62, %59 ], [ 0, %2 ]
%10 = phi i32 [ %61, %59 ], [ 1, %2 ]
%11 = phi i8* [ %60, %59 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %2 ]
%12 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %6
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%17 = load i8*, i8** %8
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
br label %154
20: ; preds = %6
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %59, label %24
24: ; preds = %20
%25 = load i8*, i8** %8
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %59, label %28
28: ; preds = %24
%29 = load i8*, i8** %8
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = or i32 %9, 1
br label %59
34: ; preds = %28
%35 = load i8*, i8** %8
%36 = tail call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = or i32 %9, 2
br label %59
40: ; preds = %34
%41 = load i8*, i8** %8
%42 = tail call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = or i32 %9, 4
br label %59
46: ; preds = %40
%47 = load i8*, i8** %8
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %59, label %50
50: ; preds = %46
%51 = load i8*, i8** %8
%52 = tail call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %59, label %54
54: ; preds = %50
%55 = load i8*, i8** %8
%56 = tail call i8* @strchr(i8* dereferenceable(1) %55, i32 47)
%57 = icmp eq i8* %56, null
%58 = select i1 %57, i8* %11, i8* %55
br label %59
59: ; preds = %54, %50, %46, %24, %20, %32, %44, %38
%60 = phi i8* [ %11, %32 ], [ %11, %38 ], [ %11, %44 ], [ %11, %20 ], [ %11, %24 ], [ %11, %46 ], [ %11, %50 ], [ %58, %54 ]
%61 = phi i32 [ %10, %32 ], [ %10, %38 ], [ %10, %44 ], [ 1, %20 ], [ 2, %24 ], [ %10, %46 ], [ %10, %50 ], [ %10, %54 ]
%62 = phi i32 [ %33, %32 ], [ %39, %38 ], [ %45, %44 ], [ %9, %20 ], [ %9, %24 ], [ %9, %46 ], [ 7, %50 ], [ %9, %54 ]
%63 = getelementptr inbounds i8*, i8** %8, i64 1
%64 = load i8*, i8** %63
%65 = icmp eq i8* %64, null
br i1 %65, label %66, label %6
66: ; preds = %59
%67 = icmp eq i32 %62, 0
br i1 %67, label %68, label %71
68: ; preds = %2, %66
%69 = phi i32 [ %61, %66 ], [ 1, %2 ]
%70 = phi i8* [ %60, %66 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %2 ]
br label %71
71: ; preds = %66, %68
%72 = phi i32 [ %69, %68 ], [ %61, %66 ]
%73 = phi i8* [ %70, %68 ], [ %60, %66 ]
%74 = phi i32 [ 7, %68 ], [ %62, %66 ]
%75 = icmp eq i32 %72, 1
br i1 %75, label %78, label %76
76: ; preds = %71
%77 = tail call i32 (...) @adapt_open()
br label %83
78: ; preds = %71
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.36, i64 0, i64 0))
%80 = tail call i32 (...) @adapt_open()
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i32 %80)
%82 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.35, i64 0, i64 0))
br label %83
83: ; preds = %76, %78
%84 = phi i32 [ %77, %76 ], [ %80, %78 ]
%85 = tail call i32 @adapt_add_binary(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%86 = and i32 %74, 4
%87 = icmp eq i32 %86, 0
br i1 %87, label %92, label %88
88: ; preds = %83
%89 = tail call i32 @test_file(i32 %85, i32 %72, i8* %73)
%90 = or i32 %89, %84
%91 = and i32 %74, -5
br label %92
92: ; preds = %88, %83
%93 = phi i32 [ %91, %88 ], [ %74, %83 ]
%94 = phi i32 [ %90, %88 ], [ %84, %83 ]
%95 = and i32 %93, 2
%96 = icmp eq i32 %95, 0
br i1 %96, label %101, label %97
97: ; preds = %92
%98 = tail call i32 @test_dvfs(i32 %85, i32 %72)
%99 = or i32 %98, %94
%100 = and i32 %93, -3
br label %101
101: ; preds = %97, %92
%102 = phi i32 [ %100, %97 ], [ %93, %92 ]
%103 = phi i32 [ 2, %97 ], [ 0, %92 ]
%104 = phi i32 [ %99, %97 ], [ %94, %92 ]
%105 = and i32 %102, 1
%106 = icmp eq i32 %105, 0
br i1 %106, label %112, label %107
107: ; preds = %101
%108 = tail call i32 @test_dct(i32 %85, i32 %72)
%109 = or i32 %108, %104
%110 = and i32 %102, -2
%111 = or i32 %103, 1
br label %112
112: ; preds = %107, %101
%113 = phi i32 [ %110, %107 ], [ %102, %101 ]
%114 = phi i32 [ %111, %107 ], [ %103, %101 ]
%115 = phi i32 [ %109, %107 ], [ %104, %101 ]
%116 = icmp eq i32 %113, 0
br i1 %116, label %120, label %117
117: ; preds = %112
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.20, i64 0, i64 0), i32 %113)
%119 = or i32 %115, 2
br label %120
120: ; preds = %117, %112
%121 = phi i32 [ %119, %117 ], [ %115, %112 ]
br i1 %75, label %122, label %124
122: ; preds = %120
%123 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.34, i64 0, i64 0))
br label %124
124: ; preds = %122, %120
%125 = tail call i32 (...) @adapt_close()
%126 = tail call i32 @print_category(i32 %72, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
%127 = and i32 %114, 2
%128 = icmp eq i32 %127, 0
br i1 %128, label %142, label %129
129: ; preds = %124
br i1 %75, label %130, label %136
130: ; preds = %129
%131 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.32, i64 0, i64 0))
%132 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.33, i64 0, i64 0))
%133 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.25, i64 0, i64 0))
%134 = tail call i32 @cat(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.26, i64 0, i64 0), i32 0)
%135 = tail call i32 @putchar(i32 10)
br label %139
136: ; preds = %129
%137 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.25, i64 0, i64 0))
%138 = tail call i32 @cat(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.26, i64 0, i64 0), i32 0)
br label %139
139: ; preds = %136, %130
%140 = tail call i32 @putchar(i32 10)
%141 = and i32 %114, -3
br label %142
142: ; preds = %139, %124
%143 = phi i32 [ %141, %139 ], [ %114, %124 ]
%144 = and i32 %143, 1
%145 = icmp eq i32 %144, 0
br i1 %145, label %154, label %146
146: ; preds = %142
br i1 %75, label %147, label %150
147: ; preds = %146
%148 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%149 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.31, i64 0, i64 0))
br label %150
150: ; preds = %147, %146
%151 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.30, i64 0, i64 0))
%152 = tail call i32 (...) @print_threads()
%153 = tail call i32 @putchar(i32 10)
br label %154
154: ; preds = %142, %150, %14
%155 = phi i32 [ 0, %14 ], [ %121, %150 ], [ %121, %142 ]
ret i32 %155
}