#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ stderr;
int syscall(int /*<<< orphan*/);
scalar_t__ update_value(char *, int *, char const *);
int read_ctx_switches(int *vol, int *nonvol, int *migrate) {
  static int vol_once, nonvol_once;
  const char *vol_name = "nr_voluntary_switches";
  const char *nonvol_name = "nr_involuntary_switches";
  const char *migrate_name = "se.nr_migrations";
  char file[1024];
  char buf[1024];
  char *pbuf;
  int pid;
  size_t *pn;
  size_t n;
  FILE *fp;
  int r;
  pid = syscall(__NR_gettid);
  snprintf(file, 1024, "/proc/%d/sched", pid);
  fp = fopen(file, "r");
  if (!fp) {
    snprintf(file, 1024, "/proc/%d/status", pid);
    fp = fopen(file, "r");
    if (!fp) {
      fprintf(stderr, "could not open %s", file);
      return -1;
    }
    vol_name = "voluntary_ctxt_switches";
    nonvol_name = "nonvoluntary_ctxt_switches";
  }
  *vol = *nonvol = *migrate = -1;
  n = 1024;
  pn = &n;
  pbuf = buf;
  while ((r = getline(&pbuf, pn, fp)) >= 0) {
    if (update_value(buf, vol, vol_name))
      continue;
    if (update_value(buf, nonvol, nonvol_name))
      continue;
    if (update_value(buf, migrate, migrate_name))
      continue;
  }
  fclose(fp);
  if (!vol_once && *vol == -1) {
    vol_once++;
    fprintf(stderr, "Warning, could not find voluntary ctx switch count\n");
  }
  if (!nonvol_once && *nonvol == -1) {
    nonvol_once++;
    fprintf(stderr, "Warning, could not find nonvoluntary ctx switch count\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_ctx_switches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xe72(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe7d(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1070 <syscall@plt>
mov    %eax,-0x84c(%rbp)
lea    -0x440(%rbp),%rdi
mov    -0x84c(%rbp),%ecx
mov    $0x400,%esi
lea    0xe6a(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x440(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x868(%rbp)
cmpq   $0x0,-0x868(%rbp)
jne    1288 <read_ctx_switches+0x118>
lea    -0x440(%rbp),%rdi
mov    -0x84c(%rbp),%ecx
mov    $0x400,%esi
lea    0xe35(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x440(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x868(%rbp)
cmpq   $0x0,-0x868(%rbp)
jne    1272 <read_ctx_switches+0x102>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    -0x440(%rbp),%rdx
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f7 <read_ctx_switches+0x287>
lea    0xdfc(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xdee(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
movq   $0x400,-0x860(%rbp)
lea    -0x860(%rbp),%rax
mov    %rax,-0x858(%rbp)
lea    -0x840(%rbp),%rax
mov    %rax,-0x848(%rbp)
mov    -0x858(%rbp),%rsi
mov    -0x868(%rbp),%rdx
lea    -0x848(%rbp),%rdi
call   1090 <getline@plt>
mov    %eax,-0x86c(%rbp)
cmp    $0x0,%eax
jl     1364 <read_ctx_switches+0x1f4>
lea    -0x840(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <update_value@plt>
cmp    $0x0,%rax
je     1319 <read_ctx_switches+0x1a9>
jmp    12cd <read_ctx_switches+0x15d>
lea    -0x840(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <update_value@plt>
cmp    $0x0,%rax
je     133c <read_ctx_switches+0x1cc>
jmp    12cd <read_ctx_switches+0x15d>
lea    -0x840(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <update_value@plt>
cmp    $0x0,%rax
je     135f <read_ctx_switches+0x1ef>
jmp    12cd <read_ctx_switches+0x15d>
jmp    12cd <read_ctx_switches+0x15d>
mov    -0x868(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,0x2ce5(%rip)
jne    13b0 <read_ctx_switches+0x240>
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    13b0 <read_ctx_switches+0x240>
mov    0x2ccc(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2cc3(%rip)
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
lea    0xce4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x0,0x2ca9(%rip)
jne    13f0 <read_ctx_switches+0x280>
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    13f0 <read_ctx_switches+0x280>
mov    0x2c90(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c87(%rip)
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ctx_switches>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,%r12
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1070 <syscall@plt>
mov    %eax,%ebp
lea    0xe9a(%rip),%rdx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %eax,%ecx
call   1050 <snprintf@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
test   %rax,%rax
je     11e0 <read_ctx_switches+0x70>
mov    %rax,%rbx
lea    0xe29(%rip),%r13
lea    0xe38(%rip),%rax
jmp    1224 <read_ctx_switches+0xb4>
lea    0xe69(%rip),%rdx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %ebp,%ecx
call   1050 <snprintf@plt>
lea    0xe4c(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
test   %rax,%rax
je     134f <read_ctx_switches+0x1df>
mov    %rax,%rbx
lea    0xe58(%rip),%r13
lea    0xe4e(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0x10(%rsp),%rax
movl   $0xffffffff,(%rax)
mov    0x8(%rsp),%rax
movl   $0xffffffff,(%rax)
movl   $0xffffffff,(%r12)
ff
movq   $0x400,0x20(%rsp)
lea    0x430(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    0x28(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rbx,%rdx
call   1090 <getline@plt>
test   %eax,%eax
js     12e2 <read_ctx_switches+0x172>
lea    0x430(%rsp),%r15
lea    0x28(%rsp),%r14
lea    0x20(%rsp),%rbp
jmp    12a2 <read_ctx_switches+0x132>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1090 <getline@plt>
test   %eax,%eax
js     12e2 <read_ctx_switches+0x172>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1030 <update_value@plt>
test   %rax,%rax
jne    1290 <read_ctx_switches+0x120>
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
mov    0x18(%rsp),%rdx
call   1030 <update_value@plt>
test   %rax,%rax
jne    1290 <read_ctx_switches+0x120>
mov    %r15,%rdi
mov    0x10(%rsp),%rsi
lea    0xd53(%rip),%rdx
call   1030 <update_value@plt>
jmp    1290 <read_ctx_switches+0x120>
mov    %rbx,%rdi
call   1040 <fclose@plt>
cmpb   $0x0,0x2d6b(%rip)
jne    1318 <read_ctx_switches+0x1a8>
cmpl   $0xffffffff,(%r12)
jne    1318 <read_ctx_switches+0x1a8>
movb   $0x1,0x2d5b(%rip)
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
lea    0xd7c(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %ebx,%ebx
cmpb   $0x0,0x2d3f(%rip)
jne    1370 <read_ctx_switches+0x200>
mov    0x8(%rsp),%rax
cmpl   $0xffffffff,(%rax)
jne    1370 <read_ctx_switches+0x200>
movb   $0x1,0x2d2c(%rip)
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
lea    0xd7d(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1370 <read_ctx_switches+0x200>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
lea    0x30(%rsp),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x838,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@read_ctx_switches.vol_once = internal global i32 0
@read_ctx_switches.nonvol_once = internal global i32 0
@.str = [22 x i8] c"nr_voluntary_switches\00"
@.str.1 = [24 x i8] c"nr_involuntary_switches\00"
@.str.2 = [17 x i8] c"se.nr_migrations\00"
@__NR_gettid = global i32 0
@.str.3 = [15 x i8] c"/proc/%d/sched\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [16 x i8] c"/proc/%d/status\00"
@stderr = global i32 0
@.str.6 = [18 x i8] c"could not open %s\00"
@.str.7 = [24 x i8] c"voluntary_ctxt_switches\00"
@.str.8 = [27 x i8] c"nonvoluntary_ctxt_switches\00"
@.str.9 = [52 x i8] c"Warning, could not find voluntary ctx switch count\0A\00"
@.str.10 = [55 x i8] c"Warning, could not find nonvoluntary ctx switch count\0A\00"
define i32 @read_ctx_switches(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [1024 x i8]
%12 = alloca [1024 x i8]
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64
%17 = alloca i32*
%18 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %10
%19 = load i32, i32* @__NR_gettid
%20 = call i32 @syscall(i32 %19)
store i32 %20, i32* %14
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%22 = load i32, i32* %14
%23 = call i32 @snprintf(i8* %21, i32 1024, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %25, i32** %17
%26 = load i32*, i32** %17
%27 = icmp ne i32* %26, null
br i1 %27, label %41, label %28
28: ; preds = %3
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%30 = load i32, i32* %14
%31 = call i32 @snprintf(i8* %29, i32 1024, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %33, i32** %17
%34 = load i32*, i32** %17
%35 = icmp ne i32* %34, null
br i1 %35, label %40, label %36
36: ; preds = %28
%37 = load i32, i32* @stderr
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %38)
store i32 -1, i32* %4
br label %100
40: ; preds = %28
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8** %9
br label %41
41: ; preds = %40, %3
%42 = load i32*, i32** %7
store i32 -1, i32* %42
%43 = load i32*, i32** %6
store i32 -1, i32* %43
%44 = load i32*, i32** %5
store i32 -1, i32* %44
store i64 1024, i64* %16
store i64* %16, i64** %15
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
store i8* %45, i8** %13
br label %46
46: ; preds = %72, %71, %64, %57, %41
%47 = load i64*, i64** %15
%48 = load i32*, i32** %17
%49 = call i32 @getline(i8** %13, i64* %47, i32* %48)
store i32 %49, i32* %18
%50 = icmp sge i32 %49, 0
br i1 %50, label %51, label %73
51: ; preds = %46
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%53 = load i32*, i32** %5
%54 = load i8*, i8** %8
%55 = call i64 @update_value(i8* %52, i32* %53, i8* %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %51
br label %46
58: ; preds = %51
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%60 = load i32*, i32** %6
%61 = load i8*, i8** %9
%62 = call i64 @update_value(i8* %59, i32* %60, i8* %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %58
br label %46
65: ; preds = %58
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%67 = load i32*, i32** %7
%68 = load i8*, i8** %10
%69 = call i64 @update_value(i8* %66, i32* %67, i8* %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %65
br label %46
72: ; preds = %65
br label %46
73: ; preds = %46
%74 = load i32*, i32** %17
%75 = call i32 @fclose(i32* %74)
%76 = load i32, i32* @read_ctx_switches.vol_once
%77 = icmp ne i32 %76, 0
br i1 %77, label %87, label %78
78: ; preds = %73
%79 = load i32*, i32** %5
%80 = load i32, i32* %79
%81 = icmp eq i32 %80, -1
br i1 %81, label %82, label %87
82: ; preds = %78
%83 = load i32, i32* @read_ctx_switches.vol_once
%84 = add nsw i32 %83, 1
store i32 %84, i32* @read_ctx_switches.vol_once
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0))
br label %87
87: ; preds = %82, %78, %73
%88 = load i32, i32* @read_ctx_switches.nonvol_once
%89 = icmp ne i32 %88, 0
br i1 %89, label %99, label %90
90: ; preds = %87
%91 = load i32*, i32** %6
%92 = load i32, i32* %91
%93 = icmp eq i32 %92, -1
br i1 %93, label %94, label %99
94: ; preds = %90
%95 = load i32, i32* @read_ctx_switches.nonvol_once
%96 = add nsw i32 %95, 1
store i32 %96, i32* @read_ctx_switches.nonvol_once
%97 = load i32, i32* @stderr
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
br label %99
99: ; preds = %94, %90, %87
store i32 0, i32* %4
br label %100
100: ; preds = %99, %36
%101 = load i32, i32* %4
ret i32 %101
}

LLVM IR (-O2):
@read_ctx_switches.vol_once = internal unnamed_addr global i1 false
@read_ctx_switches.nonvol_once = internal unnamed_addr global i1 false
@.str = [22 x i8] c"nr_voluntary_switches\00"
@.str.1 = [24 x i8] c"nr_involuntary_switches\00"
@.str.2 = [17 x i8] c"se.nr_migrations\00"
@__NR_gettid = global i32 0
@.str.3 = [15 x i8] c"/proc/%d/sched\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [16 x i8] c"/proc/%d/status\00"
@stderr = global i32 0
@.str.6 = [18 x i8] c"could not open %s\00"
@.str.7 = [24 x i8] c"voluntary_ctxt_switches\00"
@.str.8 = [27 x i8] c"nonvoluntary_ctxt_switches\00"
@.str.9 = [52 x i8] c"Warning, could not find voluntary ctx switch count\0A\00"
@.str.10 = [55 x i8] c"Warning, could not find nonvoluntary ctx switch count\0A\00"
define i32 @read_ctx_switches(i32* %0, i32* %1, i32* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca i8*
%7 = alloca i64
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = bitcast i8** %6 to i8*
%11 = bitcast i64* %7 to i8*
%12 = load i32, i32* @__NR_gettid
%13 = tail call i32 @syscall(i32 %12)
%14 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %24
17: ; preds = %3
%18 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%19 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %8)
br label %58
24: ; preds = %17, %3
%25 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), %17 ]
%26 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), %17 ]
%27 = phi i32* [ %15, %3 ], [ %19, %17 ]
store i32 -1, i32* %2
store i32 -1, i32* %1
store i32 -1, i32* %0
store i64 1024, i64* %7
store i8* %9, i8** %6
%28 = call i32 @getline(i8** %6, i64* %7, i32* %27)
%29 = icmp sgt i32 %28, -1
br i1 %29, label %30, label %41
30: ; preds = %24, %33
%31 = call i64 @update_value(i8* %9, i32* %0, i8* %26)
%32 = icmp eq i64 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %30, %36, %39
%34 = call i32 @getline(i8** %6, i64* %7, i32* %27)
%35 = icmp sgt i32 %34, -1
br i1 %35, label %30, label %41
36: ; preds = %30
%37 = call i64 @update_value(i8* %9, i32* %1, i8* %25)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %33
39: ; preds = %36
%40 = call i64 @update_value(i8* %9, i32* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %33
41: ; preds = %33, %24
%42 = call i32 @fclose(i32* %27)
%43 = load i1, i1* @read_ctx_switches.vol_once
br i1 %43, label %50, label %44
44: ; preds = %41
%45 = load i32, i32* %0
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %50
47: ; preds = %44
store i1 true, i1* @read_ctx_switches.vol_once
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0))
br label %50
50: ; preds = %47, %44, %41
%51 = load i1, i1* @read_ctx_switches.nonvol_once
br i1 %51, label %58, label %52
52: ; preds = %50
%53 = load i32, i32* %1
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %58
55: ; preds = %52
store i1 true, i1* @read_ctx_switches.nonvol_once
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
br label %58
58: ; preds = %50, %52, %55, %21
%59 = phi i32 [ -1, %21 ], [ 0, %55 ], [ 0, %52 ], [ 0, %50 ]
ret i32 %59
}