#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 */
struct fuse_opt_context {
  int dummy;
};

/* Variables and functions */
int process_gopt(struct fuse_opt_context *, char *, int);
char *strchr(char *, char);
int process_real_option_group(struct fuse_opt_context *ctx, char *opts) {
  char *sep;
  do {
    int res;
    sep = strchr(opts, ',');
    if (sep)
      *sep = '\0';
    res = process_gopt(ctx, opts, 1);
    if (res == -1)
      return -1;
    opts = sep + 1;
  } while (sep);
  return 0;
}


x86 assembly (clang, -O0):
<process_real_option_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1154 <process_real_option_group+0x34>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1040 <process_gopt@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    117f <process_real_option_group+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <process_real_option_group+0x7d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1130 <process_real_option_group+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_real_option_group>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,%r15
test   %rax,%rax
je     1149 <process_real_option_group+0x29>
movb   $0x0,(%r15)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <process_gopt@plt>
lea    0x1(%r15),%rcx
cmp    $0xffffffff,%eax
cmovne %rcx,%rbx
je     116b <process_real_option_group+0x4b>
test   %r15,%r15
jne    1130 <process_real_option_group+0x10>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.fuse_opt_context = type { i32 }
define i32 @process_real_option_group(%struct.fuse_opt_context* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.fuse_opt_context*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store %struct.fuse_opt_context* %0, %struct.fuse_opt_context** %4
store i8* %1, i8** %5
br label %8
8: ; preds = %25, %2
%9 = load i8*, i8** %5
%10 = call i8* @strchr(i8* %9, i8 signext 44)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %6
store i8 0, i8* %14
br label %15
15: ; preds = %13, %8
%16 = load %struct.fuse_opt_context*, %struct.fuse_opt_context** %4
%17 = load i8*, i8** %5
%18 = call i32 @process_gopt(%struct.fuse_opt_context* %16, i8* %17, i32 1)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 -1, i32* %3
br label %29
22: ; preds = %15
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %24, i8** %5
br label %25
25: ; preds = %22
%26 = load i8*, i8** %6
%27 = icmp ne i8* %26, null
br i1 %27, label %8, label %28
28: ; preds = %25
store i32 0, i32* %3
br label %29
29: ; preds = %28, %21
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
%struct.fuse_opt_context = type { i32 }
define i32 @process_real_option_group(%struct.fuse_opt_context* %0, i8* %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %1, %2 ], [ %12, %8 ]
%5 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext 44)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %3
store i8 0, i8* %5
br label %8
8: ; preds = %7, %3
%9 = tail call i32 @process_gopt(%struct.fuse_opt_context* %0, i8* %4, i32 1)
%10 = icmp eq i32 %9, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = select i1 %10, i8* %4, i8* %11
%13 = select i1 %10, i1 true, i1 %6
br i1 %13, label %14, label %3
14: ; preds = %8
%15 = sext i1 %10 to i32
ret i32 %15
}