#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 bedParseRgb(char *);
int /*<<< orphan*/ errAbort(char *, char *);
int sqlUnsigned(char *);
char *strchr(char *, char);
int itemRgbColumn(char *column9) {
  int itemRgb = 0;
  char *comma = strchr(column9, ',');
  if (comma) {
    if (-1 == (itemRgb = bedParseRgb(column9)))
      errAbort("ERROR: expecting r,g,b specification, "
               "found: '%s'",
               column9);
  } else
    itemRgb = sqlUnsigned(column9);
  return itemRgb;
}


x86 assembly (clang, -O0):
<itemRgbColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a0 <itemRgbColumn+0x60>
mov    -0x8(%rbp),%rdi
call   1060 <bedParseRgb@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    119b <itemRgbColumn+0x5b>
mov    -0x8(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1050 <errAbort@plt>
jmp    11ac <itemRgbColumn+0x6c>
mov    -0x8(%rbp),%rdi
call   1030 <sqlUnsigned@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itemRgbColumn>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1162 <itemRgbColumn+0x22>
mov    %rbx,%rdi
call   1060 <bedParseRgb@plt>
cmp    $0xffffffff,%eax
je     116b <itemRgbColumn+0x2b>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sqlUnsigned@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1050 <errAbort@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"ERROR: expecting r,g,b specification, found: '%s'\00"
define i32 @itemRgbColumn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 44)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @bedParseRgb(i8* %10)
store i32 %11, i32* %3
%12 = icmp eq i32 -1, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @errAbort(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %9
br label %20
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = call i32 @sqlUnsigned(i8* %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [50 x i8] c"ERROR: expecting r,g,b specification, found: '%s'\00"
define i32 @itemRgbColumn(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @bedParseRgb(i8* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @errAbort(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
9: ; preds = %1
%10 = tail call i32 @sqlUnsigned(i8* %0)
br label %11
11: ; preds = %4, %7, %9
%12 = phi i32 [ -1, %7 ], [ %5, %4 ], [ %10, %9 ]
ret i32 %12
}