#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 /*<<< orphan*/ add_signal_range(int **, int *, char const *, char const *);
void add_signals(int **signalSet, int *nbSignals, const char *arg) {
  int c = -1;
  const char *e;
  const char *s = e = arg;
  while (0 != c) {
    c = *(e++);
    if (',' == c || 0 == c) {
      add_signal_range(signalSet, nbSignals, s, e);
      s = e;
    }
  }
}


x86 assembly (clang, -O0):
<add_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
je     1192 <add_signals+0x82>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x2c,%eax
cmp    -0x1c(%rbp),%eax
je     1170 <add_signals+0x60>
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    118d <add_signals+0x7d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <add_signal_range@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1137 <add_signals+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_signals>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rdx),%rbx
jmp    114a <add_signals+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
call   1030 <add_signal_range@plt>
mov    %rbx,%rdx
add    $0x1,%rbx
test   %bpl,%bpl
je     115b <add_signals+0x4b>
movzbl -0x1(%rbx),%ebp
cmp    $0x2c,%bpl
je     1130 <add_signals+0x20>
test   %bpl,%bpl
je     1130 <add_signals+0x20>
jmp    1141 <add_signals+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @add_signals(i32** %0, i32* %1, i8* %2) {
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i32** %0, i32*** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
store i32 -1, i32* %7
%10 = load i8*, i8** %6
store i8* %10, i8** %8
store i8* %10, i8** %9
br label %11
11: ; preds = %31, %3
%12 = load i32, i32* %7
%13 = icmp ne i32 0, %12
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = load i8*, i8** %8
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %8
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp eq i32 44, %19
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = icmp eq i32 0, %22
br i1 %23, label %24, label %31
24: ; preds = %21, %14
%25 = load i32**, i32*** %4
%26 = load i32*, i32** %5
%27 = load i8*, i8** %9
%28 = load i8*, i8** %8
%29 = call i32 @add_signal_range(i32** %25, i32* %26, i8* %27, i8* %28)
%30 = load i8*, i8** %8
store i8* %30, i8** %9
br label %31
31: ; preds = %24, %21
br label %11
32: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @add_signals(i32** %0, i32* %1, i8* %2) {
br label %4
4: ; preds = %3, %11
%5 = phi i8* [ %2, %3 ], [ %12, %11 ]
%6 = phi i8* [ %2, %3 ], [ %7, %11 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
switch i8 %8, label %11 [
i8 44, label %9
i8 0, label %9
]
9: ; preds = %4, %4
%10 = tail call i32 @add_signal_range(i32** %0, i32* %1, i8* %5, i8* %7)
br label %11
11: ; preds = %4, %9
%12 = phi i8* [ %7, %9 ], [ %5, %4 ]
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %11
ret void
}