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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strstr(char *, char *);
char *strtok(char *, char *);
int get_smart_data(char *disk, char **desc, int num_desc, int *values) {
  FILE *fp;
  char *st_command = "sudo smartctl -a ";
  char cmd[64];
  char buf[8196];
  char strtokBuf[8196];
  char s_b[64];
  int loc;
  char *oc;
  char *pch;
  int i, j;
  if (disk && desc && num_desc != 0) {
    memset(cmd, 0x0, 64);
    sprintf(cmd, "%s%s", st_command, disk);
    fp = popen(cmd, "r");
    if (fp != 0) {
      memset(buf, 0x0, sizeof(buf));
      loc = 0;
      while (fgets(s_b, sizeof(s_b), fp) != NULL) {
        memcpy(buf + loc, s_b, strlen(s_b));
        loc += strlen(s_b);
      }
      fclose(fp);
      if (!strstr(buf, "Permission denied")) {
        for (i = 0; i < num_desc; i++) {
          oc = 0;
          oc = strstr(buf, desc[i]);
          if (oc != 0) {
            memset(strtokBuf, 0x0, sizeof(strtokBuf));
            strcpy(strtokBuf, oc);
            pch = strtok(strtokBuf, " \t\n");
            for (j = 0; j < 8; j++) {
              pch = strtok(NULL, " \t\n");
            }
            sscanf(pch, "%d", &(values[i]));
          } else {
            values[i] = -255;
          }
        }
        return 0;
      } else {
        printf("[ERROR] Permission denied, are you root?\n");
        return -12;
      }
    } else {
      printf("[ERROR] Cannot Open Smartctl. Try install smartmontools and try "
             "again. \n");
      return -11;
    }
  } else {
    return -10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_smart_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4110,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
lea    0xe1f(%rip),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1481 <get_smart_data+0x2c1>
cmpq   $0x0,-0x18(%rbp)
je     1481 <get_smart_data+0x2c1>
cmpl   $0x0,-0x1c(%rbp)
je     1481 <get_smart_data+0x2c1>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
lea    -0x80(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xdea(%rip),%rsi
call   10d0 <sprintf@plt>
lea    -0x80(%rbp),%rdi
lea    0xddf(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1469 <get_smart_data+0x2a9>
lea    -0x2090(%rbp),%rdi
xor    %esi,%esi
mov    $0x2004,%edx
call   1070 <memset@plt>
movl   $0x0,-0x40e4(%rbp)
lea    -0x40e0(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x40,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     12f4 <get_smart_data+0x134>
lea    -0x2090(%rbp),%rax
movslq -0x40e4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x4110(%rbp)
lea    -0x40e0(%rbp),%rax
mov    %rax,-0x4108(%rbp)
lea    -0x40e0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4110(%rbp),%rdi
mov    -0x4108(%rbp),%rsi
mov    %rax,%rdx
call   1090 <memcpy@plt>
lea    -0x40e0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
movslq -0x40e4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x40e4(%rbp)
jmp    1269 <get_smart_data+0xa9>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xd0e(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
jne    1451 <get_smart_data+0x291>
movl   $0x0,-0x40fc(%rbp)
mov    -0x40fc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1445 <get_smart_data+0x285>
movq   $0x0,-0x40f0(%rbp)
lea    -0x2090(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x40fc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x40f0(%rbp)
cmpq   $0x0,-0x40f0(%rbp)
je     141a <get_smart_data+0x25a>
lea    -0x40a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2004,%edx
call   1070 <memset@plt>
lea    -0x40a0(%rbp),%rdi
mov    -0x40f0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x40a0(%rbp),%rdi
lea    0xc89(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x40f8(%rbp)
movl   $0x0,-0x4100(%rbp)
cmpl   $0x8,-0x4100(%rbp)
jge    13f0 <get_smart_data+0x230>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc5b(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x40f8(%rbp)
mov    -0x4100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4100(%rbp)
jmp    13b8 <get_smart_data+0x1f8>
mov    -0x40f8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movslq -0x40fc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xc1f(%rip),%rsi
call   10a0 <sscanf@plt>
jmp    142c <get_smart_data+0x26c>
mov    -0x28(%rbp),%rax
movslq -0x40fc(%rbp),%rcx
movl   $0xffffff01,(%rax,%rcx,4)
jmp    1431 <get_smart_data+0x271>
mov    -0x40fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40fc(%rbp)
jmp    1324 <get_smart_data+0x164>
movl   $0x0,-0x4(%rbp)
jmp    1488 <get_smart_data+0x2c8>
lea    0xbda(%rip),%rdi
call   1060 <printf@plt>
movl   $0xfffffff4,-0x4(%rbp)
jmp    1488 <get_smart_data+0x2c8>
lea    0xbec(%rip),%rdi
call   1060 <printf@plt>
movl   $0xfffffff5,-0x4(%rbp)
jmp    1488 <get_smart_data+0x2c8>
movl   $0xfffffff6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_smart_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40a8,%rsp
mov    %rcx,0x8(%rsp)
mov    $0xfffffff6,%ebx
test   %rdi,%rdi
je     1407 <get_smart_data+0x247>
mov    %rsi,%r12
test   %rsi,%rsi
je     1407 <get_smart_data+0x247>
mov    %edx,%r15d
test   %edx,%edx
je     1407 <get_smart_data+0x247>
mov    %rdi,%rbp
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
lea    0xdf9(%rip),%rsi
lea    0xde0(%rip),%rdx
mov    %rbx,%rdi
mov    %rbp,%rcx
call   10d0 <sprintf@plt>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <popen@plt>
test   %rax,%rax
je     12fe <get_smart_data+0x13e>
mov    %rax,%r13
lea    0x90(%rsp),%rdi
xor    %esi,%esi
mov    $0x2004,%edx
call   1070 <memset@plt>
lea    0x10(%rsp),%rdi
mov    $0x40,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12c7 <get_smart_data+0x107>
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rbp
lea    (%rsp,%rbp,1),%rbx
add    $0x90,%rbx
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1090 <memcpy@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbx
add    %rbp,%rbx
mov    %r14,%rdi
mov    $0x40,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
jne    1280 <get_smart_data+0xc0>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xd43(%rip),%rsi
lea    0x90(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1314 <get_smart_data+0x154>
mov    $0xfffffff4,%ebx
lea    0xd86(%rip),%rdi
call   1040 <puts@plt>
jmp    1407 <get_smart_data+0x247>
mov    $0xfffffff5,%ebx
lea    0xd28(%rip),%rdi
call   1040 <puts@plt>
jmp    1407 <get_smart_data+0x247>
test   %r15d,%r15d
jle    1405 <get_smart_data+0x245>
mov    %r15d,%r15d
shl    $0x2,%r15
xor    %r14d,%r14d
lea    0x20a0(%rsp),%rbp
lea    0xcf5(%rip),%rbx
jmp    135a <get_smart_data+0x19a>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
movl   $0xffffff01,(%rax,%r14,1)
ff
add    $0x4,%r14
cmp    %r14,%r15
je     1405 <get_smart_data+0x245>
mov    (%r12,%r14,2),%rsi
lea    0x90(%rsp),%rdi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1340 <get_smart_data+0x180>
mov    %rax,%r13
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x2004,%edx
call   1070 <memset@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
mov    0x8(%rsp),%rcx
lea    (%rcx,%r14,1),%rdx
mov    %rax,%rdi
lea    0xc34(%rip),%rsi
call   10a0 <sscanf@plt>
jmp    134d <get_smart_data+0x18d>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x40a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"sudo smartctl -a \00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [18 x i8] c"Permission denied\00"
@.str.4 = [4 x i8] c" \09\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [42 x i8] c"[ERROR] Permission denied, are you root?\0A\00"
@.str.7 = [73 x i8] c"[ERROR] Cannot Open Smartctl. Try install smartmontools and try again. \0A\00"
define i32 @get_smart_data(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca [64 x i8]
%13 = alloca [8196 x i8]
%14 = alloca [8196 x i8]
%15 = alloca [64 x i8]
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %11
%21 = load i8*, i8** %6
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %121
23: ; preds = %4
%24 = load i8**, i8*** %7
%25 = icmp ne i8** %24, null
br i1 %25, label %26, label %121
26: ; preds = %23
%27 = load i32, i32* %8
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %121
29: ; preds = %26
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%31 = call i32 @memset(i8* %30, i32 0, i32 64)
%32 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%33 = load i8*, i8** %11
%34 = load i8*, i8** %6
%35 = call i32 @sprintf(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %33, i8* %34)
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%37 = call i32* @popen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %37, i32** %10
%38 = load i32*, i32** %10
%39 = icmp ne i32* %38, null
br i1 %39, label %40, label %119
40: ; preds = %29
%41 = getelementptr inbounds [8196 x i8], [8196 x i8]* %13, i64 0, i64 0
%42 = call i32 @memset(i8* %41, i32 0, i32 8196)
store i32 0, i32* %16
br label %43
43: ; preds = %48, %40
%44 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%45 = load i32*, i32** %10
%46 = call i32* @fgets(i8* %44, i32 64, i32* %45)
%47 = icmp ne i32* %46, null
br i1 %47, label %48, label %63
48: ; preds = %43
%49 = getelementptr inbounds [8196 x i8], [8196 x i8]* %13, i64 0, i64 0
%50 = load i32, i32* %16
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%54 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%55 = call i64 @strlen(i8* %54)
%56 = call i32 @memcpy(i8* %52, i8* %53, i64 %55)
%57 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%58 = call i64 @strlen(i8* %57)
%59 = load i32, i32* %16
%60 = sext i32 %59 to i64
%61 = add nsw i64 %60, %58
%62 = trunc i64 %61 to i32
store i32 %62, i32* %16
br label %43
63: ; preds = %43
%64 = load i32*, i32** %10
%65 = call i32 @fclose(i32* %64)
%66 = getelementptr inbounds [8196 x i8], [8196 x i8]* %13, i64 0, i64 0
%67 = call i8* @strstr(i8* %66, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%68 = icmp ne i8* %67, null
br i1 %68, label %117, label %69
69: ; preds = %63
store i32 0, i32* %19
br label %70
70: ; preds = %113, %69
%71 = load i32, i32* %19
%72 = load i32, i32* %8
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %116
74: ; preds = %70
store i8* null, i8** %17
%75 = getelementptr inbounds [8196 x i8], [8196 x i8]* %13, i64 0, i64 0
%76 = load i8**, i8*** %7
%77 = load i32, i32* %19
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = call i8* @strstr(i8* %75, i8* %80)
store i8* %81, i8** %17
%82 = load i8*, i8** %17
%83 = icmp ne i8* %82, null
br i1 %83, label %84, label %107
84: ; preds = %74
%85 = getelementptr inbounds [8196 x i8], [8196 x i8]* %14, i64 0, i64 0
%86 = call i32 @memset(i8* %85, i32 0, i32 8196)
%87 = getelementptr inbounds [8196 x i8], [8196 x i8]* %14, i64 0, i64 0
%88 = load i8*, i8** %17
%89 = call i32 @strcpy(i8* %87, i8* %88)
%90 = getelementptr inbounds [8196 x i8], [8196 x i8]* %14, i64 0, i64 0
%91 = call i8* @strtok(i8* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i8* %91, i8** %18
store i32 0, i32* %20
br label %92
92: ; preds = %97, %84
%93 = load i32, i32* %20
%94 = icmp slt i32 %93, 8
br i1 %94, label %95, label %100
95: ; preds = %92
%96 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i8* %96, i8** %18
br label %97
97: ; preds = %95
%98 = load i32, i32* %20
%99 = add nsw i32 %98, 1
store i32 %99, i32* %20
br label %92
100: ; preds = %92
%101 = load i8*, i8** %18
%102 = load i32*, i32** %9
%103 = load i32, i32* %19
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %102, i64 %104
%106 = call i32 @sscanf(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %105)
br label %112
107: ; preds = %74
%108 = load i32*, i32** %9
%109 = load i32, i32* %19
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %108, i64 %110
store i32 -255, i32* %111
br label %112
112: ; preds = %107, %100
br label %113
113: ; preds = %112
%114 = load i32, i32* %19
%115 = add nsw i32 %114, 1
store i32 %115, i32* %19
br label %70
116: ; preds = %70
store i32 0, i32* %5
br label %122
117: ; preds = %63
%118 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
store i32 -12, i32* %5
br label %122
119: ; preds = %29
%120 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0))
store i32 -11, i32* %5
br label %122
121: ; preds = %26, %23, %4
store i32 -10, i32* %5
br label %122
122: ; preds = %121, %119, %117, %116
%123 = load i32, i32* %5
ret i32 %123
}

LLVM IR (-O2):
@.str = [18 x i8] c"sudo smartctl -a \00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [18 x i8] c"Permission denied\00"
@.str.4 = [4 x i8] c" \09\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@str = [72 x i8] c"[ERROR] Cannot Open Smartctl. Try install smartmontools and try again. \00"
@str.8 = [41 x i8] c"[ERROR] Permission denied, are you root?\00"
define i32 @get_smart_data(i8* %0, i8** %1, i32 %2, i32* %3) {
%5 = alloca [64 x i8]
%6 = alloca [8196 x i8]
%7 = alloca [8196 x i8]
%8 = alloca [64 x i8]
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [8196 x i8], [8196 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [8196 x i8], [8196 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%13 = icmp ne i8* %0, null
%14 = icmp ne i8** %1, null
%15 = and i1 %13, %14
%16 = icmp ne i32 %2, 0
%17 = and i1 %15, %16
br i1 %17, label %18, label %75
18: ; preds = %4
%19 = call i32 @memset(i8* %9, i32 0, i32 64)
%20 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%21 = call i32* @popen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %71, label %23
23: ; preds = %18
%24 = call i32 @memset(i8* %10, i32 0, i32 8196)
%25 = call i32* @fgets(i8* %12, i32 64, i32* %21)
%26 = icmp eq i32* %25, null
br i1 %26, label %38, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %35, %27 ], [ 0, %23 ]
%29 = shl i64 %28, 32
%30 = ashr exact i64 %29, 32
%31 = getelementptr inbounds [8196 x i8], [8196 x i8]* %6, i64 0, i64 %30
%32 = call i64 @strlen(i8* %12)
%33 = call i32 @memcpy(i8* %31, i8* %12, i64 %32)
%34 = call i64 @strlen(i8* %12)
%35 = add nsw i64 %34, %30
%36 = call i32* @fgets(i8* %12, i32 64, i32* %21)
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %27
38: ; preds = %27, %23
%39 = call i32 @fclose(i32* %21)
%40 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %71
42: ; preds = %38
%43 = icmp sgt i32 %2, 0
br i1 %43, label %44, label %75
44: ; preds = %42
%45 = zext i32 %2 to i64
br label %46
46: ; preds = %44, %68
%47 = phi i64 [ 0, %44 ], [ %69, %68 ]
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = load i8*, i8** %48
%50 = call i8* @strstr(i8* %10, i8* dereferenceable(1) %49)
%51 = icmp eq i8* %50, null
br i1 %51, label %66, label %52
52: ; preds = %46
%53 = call i32 @memset(i8* %11, i32 0, i32 8196)
%54 = call i32 @strcpy(i8* %11, i8* %50)
%55 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%56 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%57 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%58 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%59 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%60 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%61 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%62 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%63 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%64 = getelementptr inbounds i32, i32* %3, i64 %47
%65 = call i32 @sscanf(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %64)
br label %68
66: ; preds = %46
%67 = getelementptr inbounds i32, i32* %3, i64 %47
store i32 -255, i32* %67
br label %68
68: ; preds = %52, %66
%69 = add nuw nsw i64 %47, 1
%70 = icmp eq i64 %69, %45
br i1 %70, label %75, label %46
71: ; preds = %18, %38
%72 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0), %38 ], [ getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0), %18 ]
%73 = phi i32 [ -12, %38 ], [ -11, %18 ]
%74 = call i32 @puts(i8* dereferenceable(1) %72)
br label %75
75: ; preds = %68, %71, %42, %4
%76 = phi i32 [ -10, %4 ], [ 0, %42 ], [ %73, %71 ], [ 0, %68 ]
ret i32 %76
}