#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *get_config_fp(char const *, char *);
scalar_t__ init_ad_cond(char *, char *);
scalar_t__ isspace(char);
scalar_t__ strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int);
scalar_t__ strstr(char *, char *);
int get_cond_from_file(const char *path) {
  FILE *conf_fp;
  char line[1024];
  char *p, *end;
  int sec_ad, is_domain;
  if (!path || !path[0])
    return -1;
  sec_ad = is_domain = 0;
  if ((conf_fp = get_config_fp(path, "r")) == NULL)
    return -1;
  while (fgets(line, 1024, conf_fp) != NULL) {
    p = line;
    end = &line[strlen(line) - 1];
    while (isspace(*p))
      p++;
    while (isspace(*(end - 1)))
      end--;
    *end = 0;
    if (*p != '#') {
      if (*p == '[') {
        p++;
        if (strstr(p, "domain") && strchr(p, ']'))
          sec_ad = is_domain = 1;
        else
          is_domain = 0;
      } else if (is_domain) {
        if (!strncasecmp("AD_NAME=", p, 8)) {
          if (init_ad_cond("ad_uri", p + 8))
            return -1;
        } else if (!strncasecmp("AD_USER=", p, 8)) {
          if (init_ad_cond("ad_manager", p + 8))
            return -1;
        } else if (!strncasecmp("AD_PASSWD=", p, 10)) {
          if (init_ad_cond("ad_passwd", p + 10))
            return -1;
        } else if (!strncasecmp("AD_OU=", p, 6)) {
          if (init_ad_cond("ad_org_unitS", p + 6))
            return -1;
        } else if (!strncasecmp("AD_GET_UDIR=", p, 12)) {
          if (!strncasecmp("yes", p + 12, 3))
            init_ad_cond("ad_get_udir", (char *)24);
        } else if (!strncasecmp("AD_GFLAG=", p, 9)) {
          if (!strncasecmp("yes", p + 9, 3))
            init_ad_cond("ad_gflag", (char *)24);
        }
      }
    }
    if (sec_ad == 1 && is_domain == 0)
      break;
  }
  if (!sec_ad)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<get_cond_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a7 <get_cond_from_file+0x27>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11b3 <get_cond_from_file+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
movl   $0x0,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1070 <get_config_fp@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11f1 <get_cond_from_file+0x71>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
jmp    11f6 <get_cond_from_file+0x76>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     15ab <get_cond_from_file+0x42b>
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x420(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x430(%rbp)
mov    -0x428(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     1276 <get_cond_from_file+0xf6>
mov    -0x428(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x428(%rbp)
jmp    1246 <get_cond_from_file+0xc6>
jmp    127b <get_cond_from_file+0xfb>
mov    -0x430(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     12ac <get_cond_from_file+0x12c>
mov    -0x430(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x430(%rbp)
jmp    127b <get_cond_from_file+0xfb>
mov    -0x430(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1587 <get_cond_from_file+0x407>
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    134e <get_cond_from_file+0x1ce>
mov    -0x428(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rdi
lea    0xd04(%rip),%rsi
call   10a0 <strstr@plt>
cmp    $0x0,%rax
je     133f <get_cond_from_file+0x1bf>
mov    -0x428(%rbp),%rdi
mov    $0x5d,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     133f <get_cond_from_file+0x1bf>
movl   $0x1,-0x438(%rbp)
movl   $0x1,-0x434(%rbp)
jmp    1349 <get_cond_from_file+0x1c9>
movl   $0x0,-0x438(%rbp)
jmp    1582 <get_cond_from_file+0x402>
cmpl   $0x0,-0x438(%rbp)
je     157d <get_cond_from_file+0x3fd>
mov    -0x428(%rbp),%rsi
lea    0xc9e(%rip),%rdi
mov    $0x8,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    13ae <get_cond_from_file+0x22e>
mov    -0x428(%rbp),%rsi
add    $0x8,%rsi
lea    0xc82(%rip),%rdi
call   1090 <init_ad_cond@plt>
cmp    $0x0,%rax
je     13a9 <get_cond_from_file+0x229>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
jmp    1578 <get_cond_from_file+0x3f8>
mov    -0x428(%rbp),%rsi
lea    0xc5b(%rip),%rdi
mov    $0x8,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1401 <get_cond_from_file+0x281>
mov    -0x428(%rbp),%rsi
add    $0x8,%rsi
lea    0xc3f(%rip),%rdi
call   1090 <init_ad_cond@plt>
cmp    $0x0,%rax
je     13fc <get_cond_from_file+0x27c>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
jmp    1573 <get_cond_from_file+0x3f3>
mov    -0x428(%rbp),%rsi
lea    0xc1c(%rip),%rdi
mov    $0xa,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1454 <get_cond_from_file+0x2d4>
mov    -0x428(%rbp),%rsi
add    $0xa,%rsi
lea    0xc02(%rip),%rdi
call   1090 <init_ad_cond@plt>
cmp    $0x0,%rax
je     144f <get_cond_from_file+0x2cf>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
jmp    156e <get_cond_from_file+0x3ee>
mov    -0x428(%rbp),%rsi
lea    0xbde(%rip),%rdi
mov    $0x6,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    14a7 <get_cond_from_file+0x327>
mov    -0x428(%rbp),%rsi
add    $0x6,%rsi
lea    0xbc0(%rip),%rdi
call   1090 <init_ad_cond@plt>
cmp    $0x0,%rax
je     14a2 <get_cond_from_file+0x322>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
jmp    1569 <get_cond_from_file+0x3e9>
mov    -0x428(%rbp),%rsi
lea    0xb9f(%rip),%rdi
mov    $0xc,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    1503 <get_cond_from_file+0x383>
mov    -0x428(%rbp),%rsi
add    $0xc,%rsi
lea    0xb87(%rip),%rdi
mov    $0x3,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    14fe <get_cond_from_file+0x37e>
lea    0xb71(%rip),%rdi
mov    $0x18,%esi
call   1090 <init_ad_cond@plt>
jmp    1564 <get_cond_from_file+0x3e4>
mov    -0x428(%rbp),%rsi
lea    0xb60(%rip),%rdi
mov    $0x9,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    155f <get_cond_from_file+0x3df>
mov    -0x428(%rbp),%rsi
add    $0x9,%rsi
lea    0xb2b(%rip),%rdi
mov    $0x3,%edx
call   1080 <strncasecmp@plt>
cmp    $0x0,%eax
jne    155a <get_cond_from_file+0x3da>
lea    0xb2b(%rip),%rdi
mov    $0x18,%esi
call   1090 <init_ad_cond@plt>
jmp    155f <get_cond_from_file+0x3df>
jmp    1564 <get_cond_from_file+0x3e4>
jmp    1569 <get_cond_from_file+0x3e9>
jmp    156e <get_cond_from_file+0x3ee>
jmp    1573 <get_cond_from_file+0x3f3>
jmp    1578 <get_cond_from_file+0x3f8>
jmp    157d <get_cond_from_file+0x3fd>
jmp    1582 <get_cond_from_file+0x402>
jmp    1587 <get_cond_from_file+0x407>
cmpl   $0x1,-0x434(%rbp)
jne    15a6 <get_cond_from_file+0x426>
cmpl   $0x0,-0x438(%rbp)
jne    15a6 <get_cond_from_file+0x426>
jmp    15ab <get_cond_from_file+0x42b>
jmp    11f6 <get_cond_from_file+0x76>
cmpl   $0x0,-0x434(%rbp)
jne    15c4 <get_cond_from_file+0x444>
movl   $0xffffffff,-0x4(%rbp)
jmp    15cb <get_cond_from_file+0x44b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cond_from_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    $0xffffffff,%ebx
test   %rdi,%rdi
je     143a <get_cond_from_file+0x2ba>
cmpb   $0x0,(%rdi)
je     143a <get_cond_from_file+0x2ba>
lea    0xe7a(%rip),%rsi
call   1070 <get_config_fp@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     143a <get_cond_from_file+0x2ba>
xor    %ecx,%ecx
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r14d
mov    %rbx,%rdi
mov    $0x400,%esi
mov    0x8(%rsp),%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1430 <get_cond_from_file+0x2b0>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0xffffffff,%eax
movslq %eax,%rbx
lea    0x15(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl -0x5(%r13),%edi
call   1050 <isspace@plt>
add    $0x1,%r13
test   %rax,%rax
jne    1210 <get_cond_from_file+0x90>
lea    -0x6(%r13),%r12
lea    -0x5(%r13),%r15
lea    0x11(%rsp),%rax
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl -0x2(%rbx),%edi
call   1050 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1240 <get_cond_from_file+0xc0>
movb   $0x0,(%rbx)
mov    (%r12),%al
cmp    $0x23,%al
je     1392 <get_cond_from_file+0x212>
cmp    $0x5b,%al
jne    12b0 <get_cond_from_file+0x130>
mov    %r15,%rdi
lea    0xd91(%rip),%rsi
call   10a0 <strstr@plt>
test   %rax,%rax
je     1390 <get_cond_from_file+0x210>
mov    %r15,%rdi
mov    $0x5d,%esi
call   1040 <strchr@plt>
mov    $0x1,%ecx
mov    $0x1,%ebp
test   %rax,%rax
jne    1395 <get_cond_from_file+0x215>
jmp    1390 <get_cond_from_file+0x210>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %ebp,%ebp
je     1390 <get_cond_from_file+0x210>
lea    0xd48(%rip),%rdi
mov    %r12,%rsi
mov    $0x8,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
je     13b0 <get_cond_from_file+0x230>
lea    0xd3c(%rip),%rdi
mov    %r12,%rsi
mov    $0x8,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
je     13bd <get_cond_from_file+0x23d>
lea    0xd34(%rip),%rdi
mov    %r12,%rsi
mov    $0xa,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
je     13ca <get_cond_from_file+0x24a>
lea    0xd2d(%rip),%rdi
mov    %r12,%rsi
mov    $0x6,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
je     13d7 <get_cond_from_file+0x257>
lea    0xd25(%rip),%rdi
mov    %r12,%rsi
mov    $0xc,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
je     13f5 <get_cond_from_file+0x275>
lea    0xd26(%rip),%rdi
mov    %r12,%rsi
mov    $0x9,%edx
call   1080 <strncasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    1392 <get_cond_from_file+0x212>
add    $0x3,%r13
lea    0xcf5(%rip),%rdi
mov    %r13,%rsi
mov    $0x3,%edx
call   1080 <strncasecmp@plt>
test   %eax,%eax
jne    1392 <get_cond_from_file+0x212>
mov    $0x18,%esi
lea    0xcf2(%rip),%rdi
jmp    1426 <get_cond_from_file+0x2a6>
xchg   %ax,%ax
xor    %ebp,%ebp
mov    %r14d,%ecx
cmp    $0x1,%ecx
lea    0x10(%rsp),%rbx
jne    11d0 <get_cond_from_file+0x50>
test   %ebp,%ebp
jne    11d0 <get_cond_from_file+0x50>
jmp    1438 <get_cond_from_file+0x2b8>
add    $0x2,%r13
lea    0xc55(%rip),%rdi
jmp    13de <get_cond_from_file+0x25e>
add    $0x2,%r13
lea    0xc58(%rip),%rdi
jmp    13de <get_cond_from_file+0x25e>
add    $0x4,%r13
lea    0xc61(%rip),%rdi
jmp    13de <get_cond_from_file+0x25e>
lea    0xc69(%rip),%rdi
mov    %r13,%rsi
call   1090 <init_ad_cond@plt>
mov    $0x1,%ebp
mov    %r14d,%ecx
test   %rax,%rax
je     1395 <get_cond_from_file+0x215>
jmp    144e <get_cond_from_file+0x2ce>
add    $0x6,%r13
lea    0xc61(%rip),%rdi
mov    %r13,%rsi
mov    $0x3,%edx
call   1080 <strncasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
jne    1392 <get_cond_from_file+0x212>
mov    $0x18,%esi
lea    0xc3f(%rip),%rdi
call   1090 <init_ad_cond@plt>
jmp    1392 <get_cond_from_file+0x212>
cmp    $0x1,%r14d
sbb    %ebx,%ebx
jmp    143a <get_cond_from_file+0x2ba>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebx
jmp    143a <get_cond_from_file+0x2ba>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [7 x i8] c"domain\00"
@.str.2 = [9 x i8] c"AD_NAME=\00"
@.str.3 = [7 x i8] c"ad_uri\00"
@.str.4 = [9 x i8] c"AD_USER=\00"
@.str.5 = [11 x i8] c"ad_manager\00"
@.str.6 = [11 x i8] c"AD_PASSWD=\00"
@.str.7 = [10 x i8] c"ad_passwd\00"
@.str.8 = [7 x i8] c"AD_OU=\00"
@.str.9 = [13 x i8] c"ad_org_unitS\00"
@.str.10 = [13 x i8] c"AD_GET_UDIR=\00"
@.str.11 = [4 x i8] c"yes\00"
@.str.12 = [12 x i8] c"ad_get_udir\00"
@.str.13 = [10 x i8] c"AD_GFLAG=\00"
@.str.14 = [9 x i8] c"ad_gflag\00"
define i32 @get_cond_from_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [1024 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %12, %1
store i32 -1, i32* %2
br label %170
18: ; preds = %12
store i32 0, i32* %9
store i32 0, i32* %8
%19 = load i8*, i8** %3
%20 = call i32* @get_config_fp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %20, i32** %4
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %2
br label %170
23: ; preds = %18
br label %24
24: ; preds = %164, %23
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%26 = load i32*, i32** %4
%27 = call i32* @fgets(i8* %25, i32 1024, i32* %26)
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %165
29: ; preds = %24
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
store i8* %30, i8** %6
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%32 = call i32 @strlen(i8* %31)
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %34
store i8* %35, i8** %7
br label %36
36: ; preds = %41, %29
%37 = load i8*, i8** %6
%38 = load i8, i8* %37
%39 = call i64 @isspace(i8 signext %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %6
br label %36
44: ; preds = %36
br label %45
45: ; preds = %51, %44
%46 = load i8*, i8** %7
%47 = getelementptr inbounds i8, i8* %46, i64 -1
%48 = load i8, i8* %47
%49 = call i64 @isspace(i8 signext %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = load i8*, i8** %7
%53 = getelementptr inbounds i8, i8* %52, i32 -1
store i8* %53, i8** %7
br label %45
54: ; preds = %45
%55 = load i8*, i8** %7
store i8 0, i8* %55
%56 = load i8*, i8** %6
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp ne i32 %58, 35
br i1 %59, label %60, label %157
60: ; preds = %54
%61 = load i8*, i8** %6
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 91
br i1 %64, label %65, label %78
65: ; preds = %60
%66 = load i8*, i8** %6
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %6
%68 = load i8*, i8** %6
%69 = call i64 @strstr(i8* %68, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %65
%72 = load i8*, i8** %6
%73 = call i64 @strchr(i8* %72, i8 signext 93)
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %71
store i32 1, i32* %9
store i32 1, i32* %8
br label %77
76: ; preds = %71, %65
store i32 0, i32* %9
br label %77
77: ; preds = %76, %75
br label %156
78: ; preds = %60
%79 = load i32, i32* %9
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %155
81: ; preds = %78
%82 = load i8*, i8** %6
%83 = call i32 @strncasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %82, i32 8)
%84 = icmp ne i32 %83, 0
br i1 %84, label %92, label %85
85: ; preds = %81
%86 = load i8*, i8** %6
%87 = getelementptr inbounds i8, i8* %86, i64 8
%88 = call i64 @init_ad_cond(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %85
store i32 -1, i32* %2
br label %170
91: ; preds = %85
br label %154
92: ; preds = %81
%93 = load i8*, i8** %6
%94 = call i32 @strncasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %93, i32 8)
%95 = icmp ne i32 %94, 0
br i1 %95, label %103, label %96
96: ; preds = %92
%97 = load i8*, i8** %6
%98 = getelementptr inbounds i8, i8* %97, i64 8
%99 = call i64 @init_ad_cond(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %98)
%100 = icmp ne i64 %99, 0
br i1 %100, label %101, label %102
101: ; preds = %96
store i32 -1, i32* %2
br label %170
102: ; preds = %96
br label %153
103: ; preds = %92
%104 = load i8*, i8** %6
%105 = call i32 @strncasecmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %104, i32 10)
%106 = icmp ne i32 %105, 0
br i1 %106, label %114, label %107
107: ; preds = %103
%108 = load i8*, i8** %6
%109 = getelementptr inbounds i8, i8* %108, i64 10
%110 = call i64 @init_ad_cond(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %107
store i32 -1, i32* %2
br label %170
113: ; preds = %107
br label %152
114: ; preds = %103
%115 = load i8*, i8** %6
%116 = call i32 @strncasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %115, i32 6)
%117 = icmp ne i32 %116, 0
br i1 %117, label %125, label %118
118: ; preds = %114
%119 = load i8*, i8** %6
%120 = getelementptr inbounds i8, i8* %119, i64 6
%121 = call i64 @init_ad_cond(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %120)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %124
123: ; preds = %118
store i32 -1, i32* %2
br label %170
124: ; preds = %118
br label %151
125: ; preds = %114
%126 = load i8*, i8** %6
%127 = call i32 @strncasecmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %126, i32 12)
%128 = icmp ne i32 %127, 0
br i1 %128, label %137, label %129
129: ; preds = %125
%130 = load i8*, i8** %6
%131 = getelementptr inbounds i8, i8* %130, i64 12
%132 = call i32 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %131, i32 3)
%133 = icmp ne i32 %132, 0
br i1 %133, label %136, label %134
134: ; preds = %129
%135 = call i64 @init_ad_cond(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* inttoptr (i64 24 to i8*))
br label %136
136: ; preds = %134, %129
br label %150
137: ; preds = %125
%138 = load i8*, i8** %6
%139 = call i32 @strncasecmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %138, i32 9)
%140 = icmp ne i32 %139, 0
br i1 %140, label %149, label %141
141: ; preds = %137
%142 = load i8*, i8** %6
%143 = getelementptr inbounds i8, i8* %142, i64 9
%144 = call i32 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %143, i32 3)
%145 = icmp ne i32 %144, 0
br i1 %145, label %148, label %146
146: ; preds = %141
%147 = call i64 @init_ad_cond(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* inttoptr (i64 24 to i8*))
br label %148
148: ; preds = %146, %141
br label %149
149: ; preds = %148, %137
br label %150
150: ; preds = %149, %136
br label %151
151: ; preds = %150, %124
br label %152
152: ; preds = %151, %113
br label %153
153: ; preds = %152, %102
br label %154
154: ; preds = %153, %91
br label %155
155: ; preds = %154, %78
br label %156
156: ; preds = %155, %77
br label %157
157: ; preds = %156, %54
%158 = load i32, i32* %8
%159 = icmp eq i32 %158, 1
br i1 %159, label %160, label %164
160: ; preds = %157
%161 = load i32, i32* %9
%162 = icmp eq i32 %161, 0
br i1 %162, label %163, label %164
163: ; preds = %160
br label %165
164: ; preds = %160, %157
br label %24
165: ; preds = %163, %24
%166 = load i32, i32* %8
%167 = icmp ne i32 %166, 0
br i1 %167, label %169, label %168
168: ; preds = %165
store i32 -1, i32* %2
br label %170
169: ; preds = %165
store i32 0, i32* %2
br label %170
170: ; preds = %169, %168, %123, %112, %101, %90, %22, %17
%171 = load i32, i32* %2
ret i32 %171
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [7 x i8] c"domain\00"
@.str.2 = [9 x i8] c"AD_NAME=\00"
@.str.3 = [7 x i8] c"ad_uri\00"
@.str.4 = [9 x i8] c"AD_USER=\00"
@.str.5 = [11 x i8] c"ad_manager\00"
@.str.6 = [11 x i8] c"AD_PASSWD=\00"
@.str.7 = [10 x i8] c"ad_passwd\00"
@.str.8 = [7 x i8] c"AD_OU=\00"
@.str.9 = [13 x i8] c"ad_org_unitS\00"
@.str.10 = [13 x i8] c"AD_GET_UDIR=\00"
@.str.11 = [4 x i8] c"yes\00"
@.str.12 = [12 x i8] c"ad_get_udir\00"
@.str.13 = [10 x i8] c"AD_GFLAG=\00"
@.str.14 = [9 x i8] c"ad_gflag\00"
define i32 @get_cond_from_file(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %100, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %100, label %8
8: ; preds = %5
%9 = tail call i32* @get_config_fp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %100, label %11
11: ; preds = %8, %91
%12 = phi i32 [ %92, %91 ], [ 0, %8 ]
%13 = phi i32 [ %93, %91 ], [ 0, %8 ]
%14 = call i32* @fgets(i8* %3, i32 1024, i32* %9)
%15 = icmp eq i32* %14, null
br i1 %15, label %97, label %16
16: ; preds = %11
%17 = call i32 @strlen(i8* %3)
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
br label %20
20: ; preds = %20, %16
%21 = phi i8* [ %3, %16 ], [ %25, %20 ]
%22 = load i8, i8* %21
%23 = call i64 @isspace(i8 signext %22)
%24 = icmp eq i64 %23, 0
%25 = getelementptr inbounds i8, i8* %21, i64 1
br i1 %24, label %26, label %20
26: ; preds = %20
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %19
br label %28
28: ; preds = %26, %28
%29 = phi i8* [ %30, %28 ], [ %27, %26 ]
%30 = getelementptr inbounds i8, i8* %29, i64 -1
%31 = load i8, i8* %30
%32 = call i64 @isspace(i8 signext %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %28
34: ; preds = %28
store i8 0, i8* %29
%35 = load i8, i8* %21
switch i8 %35, label %43 [
i8 35, label %91
i8 91, label %36
]
36: ; preds = %34
%37 = call i64 @strstr(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = call i64 @strchr(i8* %25, i8 signext 93)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %91
42: ; preds = %39, %36
br label %91
43: ; preds = %34
%44 = icmp eq i32 %13, 0
br i1 %44, label %91, label %45
45: ; preds = %43
%46 = call i32 @strncasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %21, i32 8)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = getelementptr inbounds i8, i8* %21, i64 8
%50 = call i64 @init_ad_cond(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %91, label %100
52: ; preds = %45
%53 = call i32 @strncasecmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %21, i32 8)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = getelementptr inbounds i8, i8* %21, i64 8
%57 = call i64 @init_ad_cond(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %91, label %100
59: ; preds = %52
%60 = call i32 @strncasecmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %21, i32 10)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %59
%63 = getelementptr inbounds i8, i8* %21, i64 10
%64 = call i64 @init_ad_cond(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %91, label %100
66: ; preds = %59
%67 = call i32 @strncasecmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %21, i32 6)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = getelementptr inbounds i8, i8* %21, i64 6
%71 = call i64 @init_ad_cond(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %91, label %100
73: ; preds = %66
%74 = call i32 @strncasecmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %21, i32 12)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %82
76: ; preds = %73
%77 = getelementptr inbounds i8, i8* %21, i64 12
%78 = call i32 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %77, i32 3)
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %91
80: ; preds = %76
%81 = call i64 @init_ad_cond(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i8* inttoptr (i64 24 to i8*))
br label %91
82: ; preds = %73
%83 = call i32 @strncasecmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* %21, i32 9)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %82
%86 = getelementptr inbounds i8, i8* %21, i64 9
%87 = call i32 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %86, i32 3)
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %91
89: ; preds = %85
%90 = call i64 @init_ad_cond(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* inttoptr (i64 24 to i8*))
br label %91
91: ; preds = %39, %34, %42, %48, %62, %80, %76, %85, %89, %82, %69, %55, %43
%92 = phi i32 [ %12, %42 ], [ %12, %82 ], [ %12, %85 ], [ %12, %89 ], [ %12, %76 ], [ %12, %80 ], [ %12, %69 ], [ %12, %62 ], [ %12, %55 ], [ %12, %48 ], [ %12, %43 ], [ %12, %34 ], [ 1, %39 ]
%93 = phi i32 [ 0, %42 ], [ 1, %82 ], [ 1, %85 ], [ 1, %89 ], [ 1, %76 ], [ 1, %80 ], [ 1, %69 ], [ 1, %62 ], [ 1, %55 ], [ 1, %48 ], [ 0, %43 ], [ %13, %34 ], [ 1, %39 ]
%94 = icmp eq i32 %92, 1
%95 = icmp eq i32 %93, 0
%96 = select i1 %94, i1 %95, i1 false
br i1 %96, label %100, label %11
97: ; preds = %11
%98 = icmp eq i32 %12, 0
%99 = sext i1 %98 to i32
br label %100
100: ; preds = %91, %69, %62, %55, %48, %97, %8, %1, %5
%101 = phi i32 [ -1, %5 ], [ -1, %1 ], [ -1, %8 ], [ %99, %97 ], [ 0, %91 ], [ -1, %69 ], [ -1, %62 ], [ -1, %55 ], [ -1, %48 ]
ret i32 %101
}