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

/* Variables and functions */
int set_dialogwinreactions(int);
int /*<<< orphan*/ strncmp(char *, char *, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ systemlog(int, char *);
int fget_dialogwinreactions(char buff[]) {
  int found_valid = 0;
  int i = 0;
  int dw_reaction_temp = 0;
  systemlog(4, "fget_dialogwinreactions");
  while (buff[i] == ' ' || buff[i] == '\t')
    i++;
  if (!strncmp(buff + i, "dialogwindow.reactions: ", 24)) {
    i += 24;
    while (buff[i] == ' ' || buff[i] == '\t')
      i++;
    if (buff[i] != '\n' && buff[i] != '0' && buff[i + 1] != 'x') {
      dw_reaction_temp = (int)strtol(buff + i, NULL, 10);
    } else if (buff[i] == '0' && buff[i + 1] == 'x') {
      systemlog(1, "ERROR: fget_dialogwinreactions: reading value in hex, is "
                   "still under construction!");
    } else {
      systemlog(1, "ERROR: fget_dialogwinreactions: cant get value from config "
                   "line, dialogwindow.reactions!");
      found_valid = -1;
    }
    if ((found_valid = set_dialogwinreactions(dw_reaction_temp)) == 0) {
      systemlog(1, "ERROR: fget_dialogwinreactions: set_dialogwinreactions: an "
                   "unrecognized problem detected");
      found_valid = -1;
    }
  }
  if (found_valid > 0)
    systemlog(92, "\t[DONE]");
  else
    systemlog(94, "\t[FAILD]");
  return found_valid;
}


x86 assembly (clang, -O0):
<fget_dialogwinreactions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x4,%edi
lea    0xe93(%rip),%rsi
call   1030 <systemlog@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
je     11a1 <fget_dialogwinreactions+0x61>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11b1 <fget_dialogwinreactions+0x71>
jmp    11bf <fget_dialogwinreactions+0x7f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <fget_dialogwinreactions+0x32>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
lea    0xe47(%rip),%rsi
mov    $0x18,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1332 <fget_dialogwinreactions+0x1f2>
mov    -0x10(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x16(%rbp)
je     121c <fget_dialogwinreactions+0xdc>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    122c <fget_dialogwinreactions+0xec>
jmp    123a <fget_dialogwinreactions+0xfa>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <fget_dialogwinreactions+0xad>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     129f <fget_dialogwinreactions+0x15f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     129f <fget_dialogwinreactions+0x15f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x78,%eax
je     129f <fget_dialogwinreactions+0x15f>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,-0x14(%rbp)
jmp    1301 <fget_dialogwinreactions+0x1c1>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    12e4 <fget_dialogwinreactions+0x1a4>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x78,%eax
jne    12e4 <fget_dialogwinreactions+0x1a4>
mov    $0x1,%edi
lea    0xd57(%rip),%rsi
call   1030 <systemlog@plt>
jmp    12fc <fget_dialogwinreactions+0x1bc>
mov    $0x1,%edi
lea    0xd94(%rip),%rsi
call   1030 <systemlog@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1301 <fget_dialogwinreactions+0x1c1>
mov    -0x14(%rbp),%edi
call   1050 <set_dialogwinreactions@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    132d <fget_dialogwinreactions+0x1ed>
mov    $0x1,%edi
lea    0xdbc(%rip),%rsi
call   1030 <systemlog@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1332 <fget_dialogwinreactions+0x1f2>
cmpl   $0x0,-0xc(%rbp)
jle    1352 <fget_dialogwinreactions+0x212>
mov    $0x5c,%edi
lea    0xdee(%rip),%rsi
call   1030 <systemlog@plt>
jmp    1363 <fget_dialogwinreactions+0x223>
mov    $0x5e,%edi
lea    0xde0(%rip),%rsi
call   1030 <systemlog@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_dialogwinreactions>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xf52(%rip),%rsi
mov    $0x4,%edi
call   1030 <systemlog@plt>
xor    %ebp,%ebp
jmp    1164 <fget_dialogwinreactions+0x24>
nopl   0x0(%rax)
add    $0x1,%rbp
movzbl (%rbx,%rbp,1),%eax
cmp    $0x20,%al
je     1160 <fget_dialogwinreactions+0x20>
cmp    $0x9,%al
je     1160 <fget_dialogwinreactions+0x20>
mov    %ebp,%edi
add    %rbx,%rdi
lea    0xf3c(%rip),%rsi
mov    $0x18,%edx
call   1040 <strncmp@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     11a6 <fget_dialogwinreactions+0x66>
lea    0x104a(%rip),%rsi
mov    $0x5e,%edi
call   1030 <systemlog@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0x18,%ebp
lea    0xe50(%rip),%rcx
movzbl (%rbx,%rbp,1),%eax
lea    -0x9(%rax),%edx
cmp    $0x27,%dl
ja     11ce <fget_dialogwinreactions+0x8e>
movzbl %dl,%edx
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
add    $0x1,%rbp
jmp    11b0 <fget_dialogwinreactions+0x70>
lea    0x1(%rbp),%ecx
cmpb   $0x78,(%rbx,%rcx,1)
jne    1248 <fget_dialogwinreactions+0x108>
cmp    $0x30,%al
jne    11f6 <fget_dialogwinreactions+0xb6>
cmpb   $0x78,(%rbx,%rcx,1)
jne    11f6 <fget_dialogwinreactions+0xb6>
lea    0xee9(%rip),%rsi
jmp    11fd <fget_dialogwinreactions+0xbd>
add    $0x1,%ebp
mov    %rbp,%rcx
cmpb   $0x78,(%rbx,%rcx,1)
je     11e1 <fget_dialogwinreactions+0xa1>
lea    0xf27(%rip),%rsi
mov    $0x1,%edi
call   1030 <systemlog@plt>
xor    %edi,%edi
call   1050 <set_dialogwinreactions@plt>
test   %eax,%eax
je     122c <fget_dialogwinreactions+0xec>
mov    %eax,%r14d
jle    118d <fget_dialogwinreactions+0x4d>
lea    0xfb4(%rip),%rsi
mov    $0x5c,%edi
jmp    1199 <fget_dialogwinreactions+0x59>
lea    0xf4a(%rip),%rsi
mov    $0x1,%edi
call   1030 <systemlog@plt>
mov    $0xffffffff,%r14d
jmp    118d <fget_dialogwinreactions+0x4d>
mov    %ebp,%eax
add    %rax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %rax,%rdi
jmp    1209 <fget_dialogwinreactions+0xc9>

LLVM IR (-O0):
@.str = [24 x i8] c"fget_dialogwinreactions\00"
@.str.1 = [25 x i8] c"dialogwindow.reactions: \00"
@.str.2 = [83 x i8] c"ERROR: fget_dialogwinreactions: reading value in hex, is still under construction!\00"
@.str.3 = [89 x i8] c"ERROR: fget_dialogwinreactions: cant get value from config line, dialogwindow.reactions!\00"
@.str.4 = [89 x i8] c"ERROR: fget_dialogwinreactions: set_dialogwinreactions: an unrecognized problem detected\00"
@.str.5 = [8 x i8] c"\09[DONE]\00"
@.str.6 = [9 x i8] c"\09[FAILD]\00"
define i32 @fget_dialogwinreactions(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 @systemlog(i32 4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %25, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %23, label %15
15: ; preds = %7
%16 = load i8*, i8** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br label %23
23: ; preds = %15, %7
%24 = phi i1 [ true, %7 ], [ %22, %15 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %7
28: ; preds = %23
%29 = load i8*, i8** %2
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = call i32 @strncmp(i8* %32, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 24)
%34 = icmp ne i32 %33, 0
br i1 %34, label %120, label %35
35: ; preds = %28
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 24
store i32 %37, i32* %4
br label %38
38: ; preds = %56, %35
%39 = load i8*, i8** %2
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 32
br i1 %45, label %54, label %46
46: ; preds = %38
%47 = load i8*, i8** %2
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 9
br label %54
54: ; preds = %46, %38
%55 = phi i1 [ true, %38 ], [ %53, %46 ]
br i1 %55, label %56, label %59
56: ; preds = %54
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %38
59: ; preds = %54
%60 = load i8*, i8** %2
%61 = load i32, i32* %4
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 10
br i1 %66, label %67, label %91
67: ; preds = %59
%68 = load i8*, i8** %2
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %73, 48
br i1 %74, label %75, label %91
75: ; preds = %67
%76 = load i8*, i8** %2
%77 = load i32, i32* %4
%78 = add nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %76, i64 %79
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp ne i32 %82, 120
br i1 %83, label %84, label %91
84: ; preds = %75
%85 = load i8*, i8** %2
%86 = load i32, i32* %4
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = call i64 @strtol(i8* %88, i32* null, i32 10)
%90 = trunc i64 %89 to i32
store i32 %90, i32* %5
br label %113
91: ; preds = %75, %67, %59
%92 = load i8*, i8** %2
%93 = load i32, i32* %4
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8, i8* %92, i64 %94
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 48
br i1 %98, label %99, label %110
99: ; preds = %91
%100 = load i8*, i8** %2
%101 = load i32, i32* %4
%102 = add nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 120
br i1 %107, label %108, label %110
108: ; preds = %99
%109 = call i32 @systemlog(i32 1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0))
br label %112
110: ; preds = %99, %91
%111 = call i32 @systemlog(i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %112
112: ; preds = %110, %108
br label %113
113: ; preds = %112, %84
%114 = load i32, i32* %5
%115 = call i32 @set_dialogwinreactions(i32 %114)
store i32 %115, i32* %3
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %113
%118 = call i32 @systemlog(i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %119
119: ; preds = %117, %113
br label %120
120: ; preds = %119, %28
%121 = load i32, i32* %3
%122 = icmp sgt i32 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = call i32 @systemlog(i32 92, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %127
125: ; preds = %120
%126 = call i32 @systemlog(i32 94, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %127
127: ; preds = %125, %123
%128 = load i32, i32* %3
ret i32 %128
}

LLVM IR (-O2):
@.str = [24 x i8] c"fget_dialogwinreactions\00"
@.str.1 = [25 x i8] c"dialogwindow.reactions: \00"
@.str.2 = [83 x i8] c"ERROR: fget_dialogwinreactions: reading value in hex, is still under construction!\00"
@.str.3 = [89 x i8] c"ERROR: fget_dialogwinreactions: cant get value from config line, dialogwindow.reactions!\00"
@.str.4 = [89 x i8] c"ERROR: fget_dialogwinreactions: set_dialogwinreactions: an unrecognized problem detected\00"
@.str.5 = [8 x i8] c"\09[DONE]\00"
@.str.6 = [9 x i8] c"\09[FAILD]\00"
define i32 @fget_dialogwinreactions(i8* %0) {
%2 = tail call i32 @systemlog(i32 4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %7, %1
%4 = phi i64 [ %8, %7 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 32, label %7
i8 9, label %7
]
7: ; preds = %3, %3
%8 = add nuw i64 %4, 1
br label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 24)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %58
14: ; preds = %9
%15 = add i64 %4, 24
%16 = and i64 %15, 4294967295
br label %17
17: ; preds = %21, %14
%18 = phi i64 [ %22, %21 ], [ %16, %14 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
switch i8 %20, label %23 [
i8 32, label %21
i8 9, label %21
i8 48, label %36
i8 10, label %46
]
21: ; preds = %17, %17
%22 = add nuw i64 %18, 1
br label %17
23: ; preds = %17
%24 = add i64 %18, 1
%25 = and i64 %24, 4294967295
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 120
br i1 %28, label %34, label %29
29: ; preds = %23
%30 = and i64 %18, 4294967295
%31 = getelementptr inbounds i8, i8* %0, i64 %30
%32 = tail call i64 @strtol(i8* nocapture %31, i32* null, i32 10)
%33 = trunc i64 %32 to i32
br label %48
34: ; preds = %23
%35 = icmp eq i8 %20, 48
br i1 %35, label %39, label %46
36: ; preds = %17
%37 = add i64 %18, 1
%38 = and i64 %37, 4294967295
br label %39
39: ; preds = %36, %34
%40 = phi i64 [ %38, %36 ], [ %25, %34 ]
%41 = getelementptr inbounds i8, i8* %0, i64 %40
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 120
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = tail call i32 @systemlog(i32 1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0))
br label %48
46: ; preds = %17, %39, %34
%47 = tail call i32 @systemlog(i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.3, i64 0, i64 0))
br label %48
48: ; preds = %44, %46, %29
%49 = phi i32 [ %33, %29 ], [ 0, %44 ], [ 0, %46 ]
%50 = tail call i32 @set_dialogwinreactions(i32 %49)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = tail call i32 @systemlog(i32 1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
br label %58
54: ; preds = %48
%55 = icmp sgt i32 %50, 0
br i1 %55, label %56, label %58
56: ; preds = %54
%57 = tail call i32 @systemlog(i32 92, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %61
58: ; preds = %52, %9, %54
%59 = phi i32 [ %50, %54 ], [ -1, %52 ], [ 0, %9 ]
%60 = tail call i32 @systemlog(i32 94, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %61
61: ; preds = %58, %56
%62 = phi i32 [ %59, %58 ], [ %50, %56 ]
ret i32 %62
}