#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
int process_real_option_group(struct fuse_opt_context *, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
int process_option_group(struct fuse_opt_context *ctx, const char *opts) {
  int res;
  char *copy = strdup(opts);
  if (!copy) {
    fprintf(stderr, "fuse: memory allocation failed\n");
    return -1;
  }
  res = process_real_option_group(ctx, copy);
  free(copy);
  return res;
}


x86 assembly (clang, -O0):
<process_option_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1189 <process_option_group+0x49>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a8 <process_option_group+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <process_real_option_group@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_option_group>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1060 <strdup@plt>
test   %rax,%rax
je     1170 <process_option_group+0x30>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <process_real_option_group@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    118a <process_option_group+0x4a>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.fuse_opt_context = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"fuse: memory allocation failed\0A\00"
define i32 @process_option_group(%struct.fuse_opt_context* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.fuse_opt_context*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.fuse_opt_context* %0, %struct.fuse_opt_context** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %22
15: ; preds = %2
%16 = load %struct.fuse_opt_context*, %struct.fuse_opt_context** %4
%17 = load i8*, i8** %7
%18 = call i32 @process_real_option_group(%struct.fuse_opt_context* %16, i8* %17)
store i32 %18, i32* %6
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %22
22: ; preds = %15, %12
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
%struct.fuse_opt_context = type { i32 }
@stderr = global i32 0
@.str = [32 x i8] c"fuse: memory allocation failed\0A\00"
define i32 @process_option_group(%struct.fuse_opt_context* %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %2
%9 = tail call i32 @process_real_option_group(%struct.fuse_opt_context* %0, i8* %3)
%10 = tail call i32 @free(i8* %3)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %9, %8 ], [ -1, %5 ]
ret i32 %12
}