#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 /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ strcmp(char const *, char const *);
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int xmlSecAppCmdLineMatchParam(const char *argvParam, const char *paramName,
                               int canHaveNameString) {
  assert(argvParam != NULL);
  assert(paramName != NULL);
  if (canHaveNameString != 0) {
    int len = strlen(paramName);
    if ((strncmp(argvParam, paramName, len) == 0) &&
        ((argvParam[len] == '\0') || (argvParam[len] == ':'))) {
      return (1);
    }
  } else if (strcmp(argvParam, paramName) == 0) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<xmlSecAppCmdLineMatchParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11e2 <xmlSecAppCmdLineMatchParam+0xa2>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11dd <xmlSecAppCmdLineMatchParam+0x9d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11d1 <xmlSecAppCmdLineMatchParam+0x91>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    11dd <xmlSecAppCmdLineMatchParam+0x9d>
movl   $0x1,-0x4(%rbp)
jmp    1211 <xmlSecAppCmdLineMatchParam+0xd1>
jmp    120a <xmlSecAppCmdLineMatchParam+0xca>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <xmlSecAppCmdLineMatchParam+0xc5>
movl   $0x1,-0x4(%rbp)
jmp    1211 <xmlSecAppCmdLineMatchParam+0xd1>
jmp    120a <xmlSecAppCmdLineMatchParam+0xca>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlSecAppCmdLineMatchParam>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1060 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1060 <assert@plt>
test   %ebp,%ebp
je     11a0 <xmlSecAppCmdLineMatchParam+0x60>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11b0 <xmlSecAppCmdLineMatchParam+0x70>
movslq %ebp,%rax
mov    (%r14,%rax,1),%al
cmp    $0x3a,%al
sete   %cl
test   %al,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
jmp    11b2 <xmlSecAppCmdLineMatchParam+0x72>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11b7 <xmlSecAppCmdLineMatchParam+0x77>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x1,%eax
jmp    11b2 <xmlSecAppCmdLineMatchParam+0x72>

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

LLVM IR (-O2):
define i32 @xmlSecAppCmdLineMatchParam(i8* %0, i8* %1, i32 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i8* %1, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i32 %2, 0
br i1 %10, label %23, label %11
11: ; preds = %3
%12 = tail call i32 @strlen(i8* %1)
%13 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = sext i32 %12 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 58
%20 = icmp eq i8 %18, 0
%21 = or i1 %19, %20
%22 = zext i1 %21 to i32
br label %27
23: ; preds = %3
%24 = tail call i64 @strcmp(i8* %0, i8* %1)
%25 = icmp eq i64 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %11, %23
br label %27
27: ; preds = %15, %23, %26
%28 = phi i32 [ 0, %26 ], [ 1, %23 ], [ %22, %15 ]
ret i32 %28
}