#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*/ uid_t;
struct portal_cred {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ENAMETOOLONG;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_WARNING;
int errno;
int /*<<< orphan*/ exit(int);
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fill_cmd(char **, char *, char *, int);
scalar_t__ getuid();
int lose_credentials(struct portal_cred *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
scalar_t__ setegid(int /*<<< orphan*/);
scalar_t__ seteuid(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int portal_rfilter(struct portal_cred *pcr, char *key, char **v, int *fdp) {
  char cmd[8192];
  char *path;
  FILE *fp;
  int error = 0;
  char percent_s[] = "%s";
  error = lose_credentials(pcr);
  if (error != 0)
    return error;
  if (!v[1] || !v[2]) {
    syslog(LOG_ERR, "rfilter: got strip-key of %s, and command start of %s\n",
           v[1], v[2]);
    exit(1);
  }
  if (!v[3] || strlen(v[3]) == 0)
    v[3] = percent_s;
  path = key;
  if (!strncmp(v[1], key, strlen(v[1])))
    path += strlen(v[1]);
  fill_cmd(v + 2, path, cmd, 8192);
  if (strlen(cmd) >= 8192) {
    syslog(LOG_WARNING,
           "Warning:  potential overflow on string!  Length was %lu\n",
           (unsigned long)strlen(cmd));
    return ENAMETOOLONG;
  }
  fp = popen(cmd, "r");
  if (fp == NULL)
    return errno;
  if (getuid() == 0) {
    if ((seteuid((uid_t)0) < 0) || (setegid((gid_t)0) < 0)) {
      error = errno;
      syslog(LOG_WARNING, "setcred: %m");
      pclose(fp);
      fp = NULL;
    }
  }
  if (fp)
    fdp[0] = fileno(fp);
  return error;
}


x86 assembly (clang, -O0):
<portal_rfilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2060,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2044(%rbp)
mov    0xe14(%rip),%ax
mov    %ax,-0x2047(%rbp)
mov    0xe09(%rip),%al
mov    %al,-0x2045(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <lose_credentials@plt>
mov    %eax,-0x2044(%rbp)
cmpl   $0x0,-0x2044(%rbp)
je     1229 <portal_rfilter+0x69>
mov    -0x2044(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1472 <portal_rfilter+0x2b2>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1247 <portal_rfilter+0x87>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    1278 <portal_rfilter+0xb8>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1090 <syslog@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     129d <portal_rfilter+0xdd>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    12ac <portal_rfilter+0xec>
lea    -0x2047(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2038(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x2058(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2050(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x2058(%rbp),%rdi
mov    -0x2050(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    131f <portal_rfilter+0x15f>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x2038(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x2038(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x10,%rdi
mov    -0x2038(%rbp),%rsi
lea    -0x2030(%rbp),%rdx
mov    $0x2000,%ecx
call   10d0 <fill_cmd@plt>
lea    -0x2030(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x2000,%eax
jl     1399 <portal_rfilter+0x1d9>
mov    0x2c8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x205c(%rbp)
lea    -0x2030(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x205c(%rbp),%edi
movslq %eax,%rdx
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1090 <syslog@plt>
mov    0x2c41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1472 <portal_rfilter+0x2b2>
lea    -0x2030(%rbp),%rdi
lea    0xccc(%rip),%rsi
call   10a0 <popen@plt>
mov    %rax,-0x2040(%rbp)
cmpq   $0x0,-0x2040(%rbp)
jne    13d2 <portal_rfilter+0x212>
mov    0x2c10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1472 <portal_rfilter+0x2b2>
mov    $0x0,%al
call   1050 <getuid@plt>
cmp    $0x0,%rax
jne    1447 <portal_rfilter+0x287>
xor    %edi,%edi
call   10e0 <seteuid@plt>
cmp    $0x0,%rax
jl     1405 <portal_rfilter+0x245>
xor    %edi,%edi
call   10c0 <setegid@plt>
cmp    $0x0,%rax
jge    1442 <portal_rfilter+0x282>
mov    0x2bcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2044(%rbp)
mov    0x2bcd(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1090 <syslog@plt>
mov    -0x2040(%rbp),%rdi
call   1060 <pclose@plt>
movq   $0x0,-0x2040(%rbp)
jmp    1447 <portal_rfilter+0x287>
cmpq   $0x0,-0x2040(%rbp)
je     1469 <portal_rfilter+0x2a9>
mov    -0x2040(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2044(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portal_rfilter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2010,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
movb   $0x0,0xe(%rsp)
movw   $0x7325,0xc(%rsp)
call   1070 <lose_credentials@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    132e <portal_rfilter+0x16e>
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rcx
test   %rdx,%rdx
je     1342 <portal_rfilter+0x182>
test   %rcx,%rcx
je     1340 <portal_rfilter+0x180>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     121f <portal_rfilter+0x5f>
call   1040 <strlen@plt>
test   %eax,%eax
jne    1228 <portal_rfilter+0x68>
lea    0xc(%rsp),%rax
mov    %rax,0x18(%rbx)
lea    0x10(%rbx),%r12
mov    0x8(%rbx),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1257 <portal_rfilter+0x97>
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r15
lea    0x10(%rsp),%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    $0x2000,%ecx
call   10d0 <fill_cmd@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x2000,%eax
jl     12af <portal_rfilter+0xef>
mov    0x2d63(%rip),%rax
mov    (%rax),%ebx
lea    0x10(%rsp),%rdi
call   1040 <strlen@plt>
movslq %eax,%rdx
lea    0xd9f(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1090 <syslog@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%ebp
jmp    132e <portal_rfilter+0x16e>
lea    0xdbd(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10a0 <popen@plt>
test   %rax,%rax
je     12e3 <portal_rfilter+0x123>
mov    %rax,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getuid@plt>
test   %rax,%rax
je     12ee <portal_rfilter+0x12e>
mov    %rbx,%rdi
call   1080 <fileno@plt>
mov    %eax,(%r14)
jmp    132e <portal_rfilter+0x16e>
mov    0x2cee(%rip),%rax
mov    (%rax),%ebp
jmp    132e <portal_rfilter+0x16e>
xor    %edi,%edi
call   10e0 <seteuid@plt>
test   %rax,%rax
js     1306 <portal_rfilter+0x146>
xor    %edi,%edi
call   10c0 <setegid@plt>
test   %rax,%rax
jns    12d6 <portal_rfilter+0x116>
mov    0x2ccb(%rip),%rax
mov    (%rax),%ebp
mov    0x2cd2(%rip),%rax
mov    (%rax),%edi
lea    0xd56(%rip),%rsi
xor    %eax,%eax
call   1090 <syslog@plt>
mov    %rbx,%rdi
call   1060 <pclose@plt>
mov    %ebp,%eax
add    $0x2010,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
lea    0xcb1(%rip),%rsi
xor    %eax,%eax
call   1090 <syslog@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.portal_cred = type { i32 }
@__const.portal_rfilter.percent_s = [3 x i8] c"%s\00"
@LOG_ERR = global i32 0
@.str = [55 x i8] c"rfilter: got strip-key of %s, and command start of %s\0A\00"
@LOG_WARNING = global i32 0
@.str.1 = [57 x i8] c"Warning: potential overflow on string! Length was %lu\0A\00"
@ENAMETOOLONG = global i32 0
@.str.2 = [2 x i8] c"r\00"
@errno = global i32 0
@.str.3 = [12 x i8] c"setcred: %m\00"
define i32 @portal_rfilter(%struct.portal_cred* %0, i8* %1, i8** %2, i32* %3) {
%5 = alloca i32
%6 = alloca %struct.portal_cred*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca [8192 x i8]
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca [3 x i8]
store %struct.portal_cred* %0, %struct.portal_cred** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i32* %3, i32** %9
store i32 0, i32* %13
%15 = bitcast [3 x i8]* %14 to i8*
%16 = load %struct.portal_cred*, %struct.portal_cred** %6
%17 = call i32 @lose_credentials(%struct.portal_cred* %16)
store i32 %17, i32* %13
%18 = load i32, i32* %13
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %4
%21 = load i32, i32* %13
store i32 %21, i32* %5
br label %126
22: ; preds = %4
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load i8**, i8*** %8
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = icmp ne i8* %30, null
br i1 %31, label %42, label %32
32: ; preds = %27, %22
%33 = load i32, i32* @LOG_ERR
%34 = load i8**, i8*** %8
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %8
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @syslog(i32 %33, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %36, i8* %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %27
%43 = load i8**, i8*** %8
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %53
47: ; preds = %42
%48 = load i8**, i8*** %8
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = call i32 @strlen(i8* %50)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %47, %42
%54 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%55 = load i8**, i8*** %8
%56 = getelementptr inbounds i8*, i8** %55, i64 3
store i8* %54, i8** %56
br label %57
57: ; preds = %53, %47
%58 = load i8*, i8** %7
store i8* %58, i8** %11
%59 = load i8**, i8*** %8
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = load i8*, i8** %7
%63 = load i8**, i8*** %8
%64 = getelementptr inbounds i8*, i8** %63, i64 1
%65 = load i8*, i8** %64
%66 = call i32 @strlen(i8* %65)
%67 = call i32 @strncmp(i8* %61, i8* %62, i32 %66)
%68 = icmp ne i32 %67, 0
br i1 %68, label %77, label %69
69: ; preds = %57
%70 = load i8**, i8*** %8
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i32 @strlen(i8* %72)
%74 = load i8*, i8** %11
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds i8, i8* %74, i64 %75
store i8* %76, i8** %11
br label %77
77: ; preds = %69, %57
%78 = load i8**, i8*** %8
%79 = getelementptr inbounds i8*, i8** %78, i64 2
%80 = load i8*, i8** %11
%81 = getelementptr inbounds [8192 x i8], [8192 x i8]* %10, i64 0, i64 0
%82 = call i32 @fill_cmd(i8** %79, i8* %80, i8* %81, i32 8192)
%83 = getelementptr inbounds [8192 x i8], [8192 x i8]* %10, i64 0, i64 0
%84 = call i32 @strlen(i8* %83)
%85 = icmp sge i32 %84, 8192
br i1 %85, label %86, label %93
86: ; preds = %77
%87 = load i32, i32* @LOG_WARNING
%88 = getelementptr inbounds [8192 x i8], [8192 x i8]* %10, i64 0, i64 0
%89 = call i32 @strlen(i8* %88)
%90 = sext i32 %89 to i64
%91 = call i32 (i32, i8*, ...) @syslog(i32 %87, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i64 %90)
%92 = load i32, i32* @ENAMETOOLONG
store i32 %92, i32* %5
br label %126
93: ; preds = %77
%94 = getelementptr inbounds [8192 x i8], [8192 x i8]* %10, i64 0, i64 0
%95 = call i32* @popen(i8* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %95, i32** %12
%96 = load i32*, i32** %12
%97 = icmp eq i32* %96, null
br i1 %97, label %98, label %100
98: ; preds = %93
%99 = load i32, i32* @errno
store i32 %99, i32* %5
br label %126
100: ; preds = %93
%101 = call i64 (...) @getuid()
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %116
103: ; preds = %100
%104 = call i64 @seteuid(i32 0)
%105 = icmp slt i64 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %103
%107 = call i64 @setegid(i32 0)
%108 = icmp slt i64 %107, 0
br i1 %108, label %109, label %115
109: ; preds = %106, %103
%110 = load i32, i32* @errno
store i32 %110, i32* %13
%111 = load i32, i32* @LOG_WARNING
%112 = call i32 (i32, i8*, ...) @syslog(i32 %111, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%113 = load i32*, i32** %12
%114 = call i32 @pclose(i32* %113)
store i32* null, i32** %12
br label %115
115: ; preds = %109, %106
br label %116
116: ; preds = %115, %100
%117 = load i32*, i32** %12
%118 = icmp ne i32* %117, null
br i1 %118, label %119, label %124
119: ; preds = %116
%120 = load i32*, i32** %12
%121 = call i32 @fileno(i32* %120)
%122 = load i32*, i32** %9
%123 = getelementptr inbounds i32, i32* %122, i64 0
store i32 %121, i32* %123
br label %124
124: ; preds = %119, %116
%125 = load i32, i32* %13
store i32 %125, i32* %5
br label %126
126: ; preds = %124, %98, %86, %20
%127 = load i32, i32* %5
ret i32 %127
}

LLVM IR (-O2):
%struct.portal_cred = type { i32 }
@__const.portal_rfilter.percent_s = [3 x i8] c"%s\00"
@LOG_ERR = global i32 0
@.str = [55 x i8] c"rfilter: got strip-key of %s, and command start of %s\0A\00"
@LOG_WARNING = global i32 0
@.str.1 = [57 x i8] c"Warning: potential overflow on string! Length was %lu\0A\00"
@ENAMETOOLONG = global i32 0
@.str.2 = [2 x i8] c"r\00"
@errno = global i32 0
@.str.3 = [12 x i8] c"setcred: %m\00"
define i32 @portal_rfilter(%struct.portal_cred* %0, i8* %1, i8** %2, i32* nocapture writeonly %3) {
%5 = alloca [8192 x i8]
%6 = alloca [3 x i8]
%7 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%9 = tail call i32 @lose_credentials(%struct.portal_cred* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %74
11: ; preds = %4
%12 = getelementptr inbounds i8*, i8** %2, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
%15 = getelementptr inbounds i8*, i8** %2, i64 2
%16 = load i8*, i8** %15
br i1 %14, label %19, label %17
17: ; preds = %11
%18 = icmp eq i8* %16, null
br i1 %18, label %19, label %24
19: ; preds = %11, %17
%20 = phi i8* [ null, %17 ], [ %16, %11 ]
%21 = load i32, i32* @LOG_ERR
%22 = tail call i32 (i32, i8*, ...) @syslog(i32 %21, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %20)
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %17
%25 = getelementptr inbounds i8*, i8** %2, i64 3
%26 = load i8*, i8** %25
%27 = icmp eq i8* %26, null
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = tail call i32 @strlen(i8* %26)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28, %24
store i8* %8, i8** %25
br label %32
32: ; preds = %31, %28
%33 = load i8*, i8** %12
%34 = call i32 @strlen(i8* %33)
%35 = call i32 @strncmp(i8* %33, i8* %1, i32 %34)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %42
37: ; preds = %32
%38 = load i8*, i8** %12
%39 = call i32 @strlen(i8* %38)
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %1, i64 %40
br label %42
42: ; preds = %37, %32
%43 = phi i8* [ %1, %32 ], [ %41, %37 ]
%44 = call i32 @fill_cmd(i8** %15, i8* %43, i8* %7, i32 8192)
%45 = call i32 @strlen(i8* %7)
%46 = icmp sgt i32 %45, 8191
br i1 %46, label %47, label %53
47: ; preds = %42
%48 = load i32, i32* @LOG_WARNING
%49 = call i32 @strlen(i8* %7)
%50 = sext i32 %49 to i64
%51 = call i32 (i32, i8*, ...) @syslog(i32 %48, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i64 %50)
%52 = load i32, i32* @ENAMETOOLONG
br label %74
53: ; preds = %42
%54 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = load i32, i32* @errno
br label %74
58: ; preds = %53
%59 = call i64 (...) @getuid()
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %72
61: ; preds = %58
%62 = call i64 @seteuid(i32 0)
%63 = icmp slt i64 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = call i64 @setegid(i32 0)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %61, %64
%68 = load i32, i32* @errno
%69 = load i32, i32* @LOG_WARNING
%70 = call i32 (i32, i8*, ...) @syslog(i32 %69, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%71 = call i32 @pclose(i32* %54)
br label %74
72: ; preds = %64, %58
%73 = call i32 @fileno(i32* %54)
store i32 %73, i32* %3
br label %74
74: ; preds = %67, %72, %4, %56, %47
%75 = phi i32 [ %52, %47 ], [ %57, %56 ], [ %9, %4 ], [ 0, %72 ], [ %68, %67 ]
ret i32 %75
}