#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 R_OK;
int W_OK;
int X_OK;
int /*<<< orphan*/ cctools_fatal(char *, char const *);
int /*<<< orphan*/ pfs_resolve_add_entry(char const *, char *, int);
char *strchr(char const *, char);
char *xxstrdup(char const *);
void pfs_resolve_manual_config(const char *str) {
  char *e;
  str = xxstrdup(str);
  e = strchr(str, '=');
  if (!e)
    cctools_fatal("badly formed mount string: %s", str);
  *e = 0;
  e++;
  pfs_resolve_add_entry(str, e, R_OK | W_OK | X_OK);
}


x86 assembly (clang, -O0):
<pfs_resolve_manual_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <xxstrdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1186 <pfs_resolve_manual_config+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1050 <cctools_fatal@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e28(%rip),%rax
mov    (%rax),%edx
mov    0x2e37(%rip),%rax
or     (%rax),%edx
mov    0x2e26(%rip),%rax
or     (%rax),%edx
call   1040 <pfs_resolve_add_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfs_resolve_manual_config>:
push   %r14
push   %rbx
push   %rax
call   1060 <xxstrdup@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1170 <pfs_resolve_manual_config+0x30>
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
call   1050 <cctools_fatal@plt>
movb   $0x0,(%rbx)
mov    0x2e56(%rip),%rax
mov    0x2e67(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
add    $0x1,%rbx
mov    0x2e50(%rip),%rax
or     (%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pfs_resolve_add_entry@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"badly formed mount string: %s\00"
@R_OK = global i32 0
@W_OK = global i32 0
@X_OK = global i32 0
define void @pfs_resolve_manual_config(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @xxstrdup(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strchr(i8* %6, i8 signext 61)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @cctools_fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %1
%14 = load i8*, i8** %3
store i8 0, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
%17 = load i8*, i8** %2
%18 = load i8*, i8** %3
%19 = load i32, i32* @R_OK
%20 = load i32, i32* @W_OK
%21 = or i32 %19, %20
%22 = load i32, i32* @X_OK
%23 = or i32 %21, %22
%24 = call i32 @pfs_resolve_add_entry(i8* %17, i8* %18, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"badly formed mount string: %s\00"
@R_OK = global i32 0
@W_OK = global i32 0
@X_OK = global i32 0
define void @pfs_resolve_manual_config(i8* %0) {
%2 = tail call i8* @xxstrdup(i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 61)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @cctools_fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %5, %1
store i8 0, i8* %3
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = load i32, i32* @R_OK
%10 = load i32, i32* @W_OK
%11 = or i32 %10, %9
%12 = load i32, i32* @X_OK
%13 = or i32 %11, %12
%14 = tail call i32 @pfs_resolve_add_entry(i8* %2, i8* %8, i32 %13)
ret void
}