#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*/ sysCmd;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ islower(char);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
scalar_t__ strlen(char *);
char toupper(char);
char *mac2if(char *mac) {
  FILE *p;
  char sysCmd[64];
  char buf[256];
  int i = 0;
  while (mac[i] != '\0') {
    if (islower(mac[i])) {
      mac[i] = toupper(mac[i]);
    }
    i++;
  }
  snprintf(sysCmd, sizeof(sysCmd), "wl -i eth1 assoclist | grep %s", mac);
  if ((p = popen(sysCmd, "r")) != NULL) {
    while (fgets(buf, sizeof(buf), p)) {
      if (0 != strlen(buf)) {
        return "radio1";
      }
    }
    pclose(p);
  }
  snprintf(sysCmd, sizeof(sysCmd), "wl -i wl0.1 assoclist | grep %s", mac);
  if ((p = popen(sysCmd, "r")) != NULL) {
    while (fgets(buf, sizeof(buf), p)) {
      if (0 != strlen(buf)) {
        return "guest1";
      }
    }
    pclose(p);
  }
  snprintf(sysCmd, sizeof(sysCmd), "wl -i eth2 assoclist | grep %s", mac);
  if ((p = popen(sysCmd, "r")) != NULL) {
    while (fgets(buf, sizeof(buf), p)) {
      if (0 != strlen(buf)) {
        return "radio2";
      }
    }
    pclose(p);
  }
  snprintf(sysCmd, sizeof(sysCmd), "wl -i wl1.1 assoclist | grep %s", mac);
  if ((p = popen(sysCmd, "r")) != NULL) {
    while (fgets(buf, sizeof(buf), p)) {
      if (0 != strlen(buf)) {
        return "guest2";
      }
    }
    pclose(p);
  }
  return "wired";
}


x86 assembly (clang, -O0):
<mac2if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x164(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x164(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11f7 <mac2if+0x87>
mov    -0x10(%rbp),%rax
movslq -0x164(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     11e3 <mac2if+0x73>
mov    -0x10(%rbp),%rax
movslq -0x164(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <toupper@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x164(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1189 <mac2if+0x19>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xdf5(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     128a <mac2if+0x11a>
jmp    1233 <mac2if+0xc3>
lea    -0x160(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1281 <mac2if+0x111>
lea    -0x160(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     127c <mac2if+0x10c>
lea    0xdae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    144e <mac2if+0x2de>
jmp    1233 <mac2if+0xc3>
mov    -0x18(%rbp),%rdi
call   1060 <pclose@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xd8a(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xd71(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     131d <mac2if+0x1ad>
jmp    12c6 <mac2if+0x156>
lea    -0x160(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1314 <mac2if+0x1a4>
lea    -0x160(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     130f <mac2if+0x19f>
lea    0xd42(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    144e <mac2if+0x2de>
jmp    12c6 <mac2if+0x156>
mov    -0x18(%rbp),%rdi
call   1060 <pclose@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xd1e(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xcde(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     13b0 <mac2if+0x240>
jmp    1359 <mac2if+0x1e9>
lea    -0x160(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     13a7 <mac2if+0x237>
lea    -0x160(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     13a2 <mac2if+0x232>
lea    0xcd5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    144e <mac2if+0x2de>
jmp    1359 <mac2if+0x1e9>
mov    -0x18(%rbp),%rdi
call   1060 <pclose@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xcb1(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xc4b(%rip),%rsi
call   1090 <popen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1443 <mac2if+0x2d3>
jmp    13ec <mac2if+0x27c>
lea    -0x160(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     143a <mac2if+0x2ca>
lea    -0x160(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1435 <mac2if+0x2c5>
lea    0xc69(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    144e <mac2if+0x2de>
jmp    13ec <mac2if+0x27c>
mov    -0x18(%rbp),%rdi
call   1060 <pclose@plt>
lea    0xc52(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac2if>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %rdi,%r15
mov    (%rdi),%al
test   %al,%al
je     11a5 <mac2if+0x45>
mov    %r15,%rbx
jmp    118c <mac2if+0x2c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11a5 <mac2if+0x45>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1180 <mac2if+0x20>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1180 <mac2if+0x20>
lea    0xe54(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15,%rcx
call   1060 <snprintf@plt>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   1080 <popen@plt>
test   %rax,%rax
je     1219 <mac2if+0xb9>
mov    %rax,%rbx
lea    0x40(%rsp),%r12
lea    0xe3f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1211 <mac2if+0xb1>
cmpb   $0x0,0x40(%rsp)
je     11f0 <mac2if+0x90>
jmp    1369 <mac2if+0x209>
mov    %rbx,%rdi
call   1050 <pclose@plt>
lea    0xe08(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15,%rcx
call   1060 <snprintf@plt>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
call   1080 <popen@plt>
test   %rax,%rax
je     1289 <mac2if+0x129>
mov    %rax,%rbx
lea    0x40(%rsp),%r12
lea    0xdf2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1281 <mac2if+0x121>
cmpb   $0x0,0x40(%rsp)
je     1260 <mac2if+0x100>
jmp    1369 <mac2if+0x209>
mov    %rbx,%rdi
call   1050 <pclose@plt>
lea    0xdbf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15,%rcx
call   1060 <snprintf@plt>
lea    0xd75(%rip),%rsi
mov    %rbx,%rdi
call   1080 <popen@plt>
test   %rax,%rax
je     12f6 <mac2if+0x196>
mov    %rax,%rbx
lea    0x40(%rsp),%r12
lea    0xda8(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12ee <mac2if+0x18e>
cmpb   $0x0,0x40(%rsp)
je     12d0 <mac2if+0x170>
jmp    1369 <mac2if+0x209>
mov    %rbx,%rdi
call   1050 <pclose@plt>
lea    0xd78(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15,%rcx
call   1060 <snprintf@plt>
lea    0xd08(%rip),%rsi
mov    %rbx,%rdi
call   1080 <popen@plt>
lea    0xd76(%rip),%r14
test   %rax,%rax
je     1369 <mac2if+0x209>
mov    %rax,%rbx
lea    0x40(%rsp),%r15
lea    0xd5b(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1361 <mac2if+0x201>
cmpb   $0x0,0x40(%rsp)
je     1340 <mac2if+0x1e0>
mov    %r12,%r14
jmp    1369 <mac2if+0x209>
mov    %rbx,%rdi
call   1050 <pclose@plt>
mov    %r14,%rax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"wl -i eth1 assoclist | grep %s\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"radio1\00"
@.str.3 = [32 x i8] c"wl -i wl0.1 assoclist | grep %s\00"
@.str.4 = [7 x i8] c"guest1\00"
@.str.5 = [31 x i8] c"wl -i eth2 assoclist | grep %s\00"
@.str.6 = [7 x i8] c"radio2\00"
@.str.7 = [32 x i8] c"wl -i wl1.1 assoclist | grep %s\00"
@.str.8 = [7 x i8] c"guest2\00"
@.str.9 = [6 x i8] c"wired\00"
define i8* @mac2if(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [64 x i8]
%6 = alloca [256 x i8]
%7 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %7
br label %8
8: ; preds = %35, %1
%9 = load i8*, i8** %3
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %38
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = call i64 @islower(i8 signext %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %16
%25 = load i8*, i8** %3
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = call signext i8 @toupper(i8 signext %29)
%31 = load i8*, i8** %3
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
store i8 %30, i8* %34
br label %35
35: ; preds = %24, %16
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %8
38: ; preds = %8
%39 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%40 = load i8*, i8** %3
%41 = call i32 @snprintf(i8* %39, i32 64, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%43 = call i32* @popen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %43, i32** %4
%44 = icmp ne i32* %43, null
br i1 %44, label %45, label %60
45: ; preds = %38
br label %46
46: ; preds = %56, %45
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%48 = load i32*, i32** %4
%49 = call i64 @fgets(i8* %47, i32 256, i32* %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %57
51: ; preds = %46
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%53 = call i64 @strlen(i8* %52)
%54 = icmp ne i64 0, %53
br i1 %54, label %55, label %56
55: ; preds = %51
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %127
56: ; preds = %51
br label %46
57: ; preds = %46
%58 = load i32*, i32** %4
%59 = call i32 @pclose(i32* %58)
br label %60
60: ; preds = %57, %38
%61 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%62 = load i8*, i8** %3
%63 = call i32 @snprintf(i8* %61, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%64 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%65 = call i32* @popen(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %65, i32** %4
%66 = icmp ne i32* %65, null
br i1 %66, label %67, label %82
67: ; preds = %60
br label %68
68: ; preds = %78, %67
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%70 = load i32*, i32** %4
%71 = call i64 @fgets(i8* %69, i32 256, i32* %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %79
73: ; preds = %68
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%75 = call i64 @strlen(i8* %74)
%76 = icmp ne i64 0, %75
br i1 %76, label %77, label %78
77: ; preds = %73
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %127
78: ; preds = %73
br label %68
79: ; preds = %68
%80 = load i32*, i32** %4
%81 = call i32 @pclose(i32* %80)
br label %82
82: ; preds = %79, %60
%83 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%84 = load i8*, i8** %3
%85 = call i32 @snprintf(i8* %83, i32 64, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %84)
%86 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%87 = call i32* @popen(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %87, i32** %4
%88 = icmp ne i32* %87, null
br i1 %88, label %89, label %104
89: ; preds = %82
br label %90
90: ; preds = %100, %89
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%92 = load i32*, i32** %4
%93 = call i64 @fgets(i8* %91, i32 256, i32* %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %101
95: ; preds = %90
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%97 = call i64 @strlen(i8* %96)
%98 = icmp ne i64 0, %97
br i1 %98, label %99, label %100
99: ; preds = %95
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %127
100: ; preds = %95
br label %90
101: ; preds = %90
%102 = load i32*, i32** %4
%103 = call i32 @pclose(i32* %102)
br label %104
104: ; preds = %101, %82
%105 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%106 = load i8*, i8** %3
%107 = call i32 @snprintf(i8* %105, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %106)
%108 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%109 = call i32* @popen(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %109, i32** %4
%110 = icmp ne i32* %109, null
br i1 %110, label %111, label %126
111: ; preds = %104
br label %112
112: ; preds = %122, %111
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%114 = load i32*, i32** %4
%115 = call i64 @fgets(i8* %113, i32 256, i32* %114)
%116 = icmp ne i64 %115, 0
br i1 %116, label %117, label %123
117: ; preds = %112
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%119 = call i64 @strlen(i8* %118)
%120 = icmp ne i64 0, %119
br i1 %120, label %121, label %122
121: ; preds = %117
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %127
122: ; preds = %117
br label %112
123: ; preds = %112
%124 = load i32*, i32** %4
%125 = call i32 @pclose(i32* %124)
br label %126
126: ; preds = %123, %104
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %127
127: ; preds = %126, %121, %99, %77, %55
%128 = load i8*, i8** %2
ret i8* %128
}

LLVM IR (-O2):
@.str = [31 x i8] c"wl -i eth1 assoclist | grep %s\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"radio1\00"
@.str.3 = [32 x i8] c"wl -i wl0.1 assoclist | grep %s\00"
@.str.4 = [7 x i8] c"guest1\00"
@.str.5 = [31 x i8] c"wl -i eth2 assoclist | grep %s\00"
@.str.6 = [7 x i8] c"radio2\00"
@.str.7 = [32 x i8] c"wl -i wl1.1 assoclist | grep %s\00"
@.str.8 = [7 x i8] c"guest2\00"
@.str.9 = [6 x i8] c"wired\00"
define i8* @mac2if(i8* %0) {
%2 = alloca [64 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %22, label %8
8: ; preds = %1, %17
%9 = phi i64 [ %18, %17 ], [ 0, %1 ]
%10 = phi i8 [ %20, %17 ], [ %6, %1 ]
%11 = phi i8* [ %19, %17 ], [ %0, %1 ]
%12 = tail call i64 @islower(i8 signext %10)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = load i8, i8* %11
%16 = tail call signext i8 @toupper(i8 signext %15)
store i8 %16, i8* %11
br label %17
17: ; preds = %14, %8
%18 = add nuw i64 %9, 1
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %8
22: ; preds = %17, %1
%23 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%24 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i32* %24, null
br i1 %25, label %34, label %26
26: ; preds = %22, %29
%27 = call i64 @fgets(i8* %5, i32 256, i32* %24)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i8, i8* %5
%31 = icmp eq i8 %30, 0
br i1 %31, label %26, label %70
32: ; preds = %26
%33 = call i32 @pclose(i32* %24)
br label %34
34: ; preds = %32, %22
%35 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%36 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %46, label %38
38: ; preds = %34, %41
%39 = call i64 @fgets(i8* %5, i32 256, i32* %36)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i8, i8* %5
%43 = icmp eq i8 %42, 0
br i1 %43, label %38, label %70
44: ; preds = %38
%45 = call i32 @pclose(i32* %36)
br label %46
46: ; preds = %44, %34
%47 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%48 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i32* %48, null
br i1 %49, label %58, label %50
50: ; preds = %46, %53
%51 = call i64 @fgets(i8* %5, i32 256, i32* %48)
%52 = icmp eq i64 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i8, i8* %5
%55 = icmp eq i8 %54, 0
br i1 %55, label %50, label %70
56: ; preds = %50
%57 = call i32 @pclose(i32* %48)
br label %58
58: ; preds = %56, %46
%59 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %0)
%60 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%61 = icmp eq i32* %60, null
br i1 %61, label %70, label %62
62: ; preds = %58, %65
%63 = call i64 @fgets(i8* %5, i32 256, i32* %60)
%64 = icmp eq i64 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = load i8, i8* %5
%67 = icmp eq i8 %66, 0
br i1 %67, label %62, label %70
68: ; preds = %62
%69 = call i32 @pclose(i32* %60)
br label %70
70: ; preds = %29, %41, %53, %65, %58, %68
%71 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %68 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %58 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %65 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %53 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %29 ]
ret i8* %71
}