#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 */
scalar_t__ changeStringSetting(char **, char const *);
int /*<<< orphan*/ deallocateStrings(char **);
char **splitString(char const *, char, int /*<<< orphan*/ *);
int changeListSetting(char ***list, char **setting, const char *value) {
  char **newList = splitString(value, ',', NULL);
  if (newList) {
    if (changeStringSetting(setting, value)) {
      char **oldList = *list;
      *list = newList;
      if (oldList)
        deallocateStrings(oldList);
      return 1;
    }
    deallocateStrings(newList);
  }
  return 0;
}


x86 assembly (clang, -O0):
<changeListSetting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2c,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <splitString@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11bb <changeListSetting+0x8b>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <changeStringSetting@plt>
cmp    $0x0,%rax
je     11b2 <changeListSetting+0x82>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     11a6 <changeListSetting+0x76>
mov    -0x30(%rbp),%rdi
call   1030 <deallocateStrings@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <changeListSetting+0x92>
mov    -0x28(%rbp),%rdi
call   1030 <deallocateStrings@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeListSetting>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%r15
xor    %r14d,%r14d
mov    %rdx,%rdi
mov    $0x2c,%esi
xor    %edx,%edx
call   1040 <splitString@plt>
test   %rax,%rax
je     118d <changeListSetting+0x5d>
mov    %rax,%rbx
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <changeStringSetting@plt>
test   %rax,%rax
je     1182 <changeListSetting+0x52>
mov    (%r15),%rax
mov    %rbx,(%r15)
mov    $0x1,%r14d
mov    %rax,%rbx
test   %rax,%rax
jne    1185 <changeListSetting+0x55>
jmp    118d <changeListSetting+0x5d>
xor    %r14d,%r14d
mov    %rbx,%rdi
call   1030 <deallocateStrings@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @changeListSetting(i8*** %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8***
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
store i8*** %0, i8**** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
%10 = load i8*, i8** %7
%11 = call i8** @splitString(i8* %10, i8 signext 44, i32* null)
store i8** %11, i8*** %8
%12 = load i8**, i8*** %8
%13 = icmp ne i8** %12, null
br i1 %13, label %14, label %33
14: ; preds = %3
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %7
%17 = call i64 @changeStringSetting(i8** %15, i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %14
%20 = load i8***, i8**** %5
%21 = load i8**, i8*** %20
store i8** %21, i8*** %9
%22 = load i8**, i8*** %8
%23 = load i8***, i8**** %5
store i8** %22, i8*** %23
%24 = load i8**, i8*** %9
%25 = icmp ne i8** %24, null
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i8**, i8*** %9
%28 = call i32 @deallocateStrings(i8** %27)
br label %29
29: ; preds = %26, %19
store i32 1, i32* %4
br label %34
30: ; preds = %14
%31 = load i8**, i8*** %8
%32 = call i32 @deallocateStrings(i8** %31)
br label %33
33: ; preds = %30, %3
store i32 0, i32* %4
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @changeListSetting(i8*** nocapture %0, i8** %1, i8* %2) {
%4 = tail call i8** @splitString(i8* %2, i8 signext 44, i32* null)
%5 = icmp eq i8** %4, null
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = tail call i64 @changeStringSetting(i8** %1, i8* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i8**, i8*** %0
store i8** %4, i8*** %0
%11 = icmp eq i8** %10, null
br i1 %11, label %16, label %12
12: ; preds = %6, %9
%13 = phi i8** [ %10, %9 ], [ %4, %6 ]
%14 = phi i32 [ 1, %9 ], [ 0, %6 ]
%15 = tail call i32 @deallocateStrings(i8** %13)
br label %16
16: ; preds = %12, %3, %9
%17 = phi i32 [ 1, %9 ], [ 0, %3 ], [ %14, %12 ]
ret i32 %17
}