#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_genisofs_count_args(struct XorrisO *, int, char **, int *,
                                int /*<<< orphan*/);
int strlen(char *);
int Xorriso_genisofs_strip_dash(struct XorrisO *xorriso, char *arg_in,
                                char **arg_out, int flag) {
  int ret, count;
  char *argv[1];
  *arg_out = arg_in;
  if (strlen(arg_in) < 4)
    return (1);
  if (arg_in[0] != '-' || arg_in[1] != '-' || arg_in[2] == '-')
    return (1);
  argv[0] = arg_in + 1;
  ret = Xorriso_genisofs_count_args(xorriso, 1, argv, &count, 0);
  if (ret > 0)
    *arg_out = arg_in + 1;
  return (1);
}


x86 assembly (clang, -O0):
<Xorriso_genisofs_strip_dash>:
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    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    1160 <Xorriso_genisofs_strip_dash+0x40>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <Xorriso_genisofs_strip_dash+0xc6>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1192 <Xorriso_genisofs_strip_dash+0x72>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    1192 <Xorriso_genisofs_strip_dash+0x72>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x2d,%eax
jne    119e <Xorriso_genisofs_strip_dash+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <Xorriso_genisofs_strip_dash+0xc6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x38(%rbp),%rdx
mov    $0x1,%esi
lea    -0x2c(%rbp),%rcx
xor    %r8d,%r8d
call   1040 <Xorriso_genisofs_count_args@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    11df <Xorriso_genisofs_strip_dash+0xbf>
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_genisofs_strip_dash>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,(%rdx)
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jl     117a <Xorriso_genisofs_strip_dash+0x5a>
cmpb   $0x2d,(%rbx)
jne    117a <Xorriso_genisofs_strip_dash+0x5a>
cmpb   $0x2d,0x1(%rbx)
jne    117a <Xorriso_genisofs_strip_dash+0x5a>
cmpb   $0x2d,0x2(%rbx)
je     117a <Xorriso_genisofs_strip_dash+0x5a>
add    $0x1,%rbx
mov    %rbx,(%rsp)
mov    %rsp,%rdx
lea    0xc(%rsp),%rcx
mov    %r15,%rdi
mov    $0x1,%esi
xor    %r8d,%r8d
call   1040 <Xorriso_genisofs_count_args@plt>
test   %eax,%eax
jle    117a <Xorriso_genisofs_strip_dash+0x5a>
mov    %rbx,(%r14)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_genisofs_strip_dash(%struct.XorrisO* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.XorrisO*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [1 x i8*]
store %struct.XorrisO* %0, %struct.XorrisO** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %8
store i8* %13, i8** %14
%15 = load i8*, i8** %7
%16 = call i32 @strlen(i8* %15)
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 1, i32* %5
br label %52
19: ; preds = %4
%20 = load i8*, i8** %7
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 45
br i1 %24, label %37, label %25
25: ; preds = %19
%26 = load i8*, i8** %7
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 45
br i1 %30, label %37, label %31
31: ; preds = %25
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i64 2
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 45
br i1 %36, label %37, label %38
37: ; preds = %31, %25, %19
store i32 1, i32* %5
br label %52
38: ; preds = %31
%39 = load i8*, i8** %7
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = getelementptr inbounds [1 x i8*], [1 x i8*]* %12, i64 0, i64 0
store i8* %40, i8** %41
%42 = load %struct.XorrisO*, %struct.XorrisO** %6
%43 = getelementptr inbounds [1 x i8*], [1 x i8*]* %12, i64 0, i64 0
%44 = call i32 @Xorriso_genisofs_count_args(%struct.XorrisO* %42, i32 1, i8** %43, i32* %11, i32 0)
store i32 %44, i32* %10
%45 = load i32, i32* %10
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %38
%48 = load i8*, i8** %7
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8**, i8*** %8
store i8* %49, i8** %50
br label %51
51: ; preds = %47, %38
store i32 1, i32* %5
br label %52
52: ; preds = %51, %37, %18
%53 = load i32, i32* %5
ret i32 %53
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_genisofs_strip_dash(%struct.XorrisO* %0, i8* %1, i8** nocapture writeonly %2, i32 %3) {
%5 = alloca i32
%6 = alloca [1 x i8*]
%7 = bitcast i32* %5 to i8*
%8 = bitcast [1 x i8*]* %6 to i8*
store i8* %1, i8** %2
%9 = tail call i32 @strlen(i8* %1)
%10 = icmp slt i32 %9, 4
br i1 %10, label %27, label %11
11: ; preds = %4
%12 = load i8, i8* %1
%13 = icmp eq i8 %12, 45
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %1, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %1, i64 2
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 45
br i1 %21, label %27, label %22
22: ; preds = %18
%23 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
store i8* %15, i8** %23
%24 = call i32 @Xorriso_genisofs_count_args(%struct.XorrisO* %0, i32 1, i8** %23, i32* %5, i32 0)
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i8* %15, i8** %2
br label %27
27: ; preds = %22, %26, %11, %14, %18, %4
ret i32 1
}