#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 XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_option_not_leaf(struct XorrisO *, char *, int);
int Xorriso_option_not_paths(struct XorrisO *, int, char **, int *, int);
int /*<<< orphan*/ *strchr(char *, char);
int Xorriso_genisofs_hide(struct XorrisO *xorriso, char *whom, char *pattern,
                          int hide_attrs, int flag) {
  int zero = 0, ret;
  char *argv[1];
  if ((hide_attrs & 63) == 0)
    return (2);
  if (strchr(pattern, '/') != NULL) {
    argv[0] = pattern;
    ret = Xorriso_option_not_paths(xorriso, 1, argv, &zero,
                                   4 | ((hide_attrs & 63) << 8));
  } else {
    ret = Xorriso_option_not_leaf(xorriso, pattern, hide_attrs & 63);
  }
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_genisofs_hide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
and    $0x3f,%eax
cmp    $0x0,%eax
jne    116d <Xorriso_genisofs_hide+0x3d>
movl   $0x2,-0x4(%rbp)
jmp    11d7 <Xorriso_genisofs_hide+0xa7>
mov    -0x20(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11bb <Xorriso_genisofs_hide+0x8b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x38(%rbp),%rdx
mov    -0x24(%rbp),%r8d
and    $0x3f,%r8d
shl    $0x8,%r8d
or     $0x4,%r8d
mov    $0x1,%esi
lea    -0x2c(%rbp),%rcx
call   1050 <Xorriso_option_not_paths@plt>
mov    %eax,-0x30(%rbp)
jmp    11d1 <Xorriso_genisofs_hide+0xa1>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
and    $0x3f,%edx
call   1040 <Xorriso_option_not_leaf@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_genisofs_hide>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebx
movl   $0x0,0x4(%rsp)
and    $0x3f,%ebx
je     1187 <Xorriso_genisofs_hide+0x57>
mov    %rdx,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1196 <Xorriso_genisofs_hide+0x66>
mov    %r15,0x8(%rsp)
shl    $0x8,%ebx
or     $0x4,%ebx
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%r8d
call   1050 <Xorriso_option_not_paths@plt>
jmp    118c <Xorriso_genisofs_hide+0x5c>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <Xorriso_option_not_leaf@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_genisofs_hide(%struct.XorrisO* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.XorrisO*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [1 x i8*]
store %struct.XorrisO* %0, %struct.XorrisO** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 0, i32* %12
%15 = load i32, i32* %10
%16 = and i32 %15, 63
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %5
store i32 2, i32* %6
br label %41
19: ; preds = %5
%20 = load i8*, i8** %9
%21 = call i32* @strchr(i8* %20, i8 signext 47)
%22 = icmp ne i32* %21, null
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load i8*, i8** %9
%25 = getelementptr inbounds [1 x i8*], [1 x i8*]* %14, i64 0, i64 0
store i8* %24, i8** %25
%26 = load %struct.XorrisO*, %struct.XorrisO** %7
%27 = getelementptr inbounds [1 x i8*], [1 x i8*]* %14, i64 0, i64 0
%28 = load i32, i32* %10
%29 = and i32 %28, 63
%30 = shl i32 %29, 8
%31 = or i32 4, %30
%32 = call i32 @Xorriso_option_not_paths(%struct.XorrisO* %26, i32 1, i8** %27, i32* %12, i32 %31)
store i32 %32, i32* %13
br label %39
33: ; preds = %19
%34 = load %struct.XorrisO*, %struct.XorrisO** %7
%35 = load i8*, i8** %9
%36 = load i32, i32* %10
%37 = and i32 %36, 63
%38 = call i32 @Xorriso_option_not_leaf(%struct.XorrisO* %34, i8* %35, i32 %37)
store i32 %38, i32* %13
br label %39
39: ; preds = %33, %23
%40 = load i32, i32* %13
store i32 %40, i32* %6
br label %41
41: ; preds = %39, %18
%42 = load i32, i32* %6
ret i32 %42
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_genisofs_hide(%struct.XorrisO* %0, i8* nocapture readnone %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca [1 x i8*]
%8 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%9 = bitcast [1 x i8*]* %7 to i8*
%10 = and i32 %3, 63
%11 = icmp eq i32 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %5
%13 = tail call i32* @strchr(i8* %2, i8 signext 47)
%14 = icmp eq i32* %13, null
br i1 %14, label %20, label %15
15: ; preds = %12
%16 = getelementptr inbounds [1 x i8*], [1 x i8*]* %7, i64 0, i64 0
store i8* %2, i8** %16
%17 = shl nuw nsw i32 %10, 8
%18 = or i32 %17, 4
%19 = call i32 @Xorriso_option_not_paths(%struct.XorrisO* %0, i32 1, i8** %16, i32* %6, i32 %18)
br label %22
20: ; preds = %12
%21 = tail call i32 @Xorriso_option_not_leaf(%struct.XorrisO* %0, i8* %2, i32 %10)
br label %22
22: ; preds = %15, %20, %5
%23 = phi i32 [ 2, %5 ], [ %19, %15 ], [ %21, %20 ]
ret i32 %23
}