#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 */
scalar_t__ strcmp(char const *, char const *);
scalar_t__ strncmp(char *, char const *, int);
int __icheckuser(const char *luser, const char *ruser) {
  if (strncmp("-", luser, 1) == 0)
    return -(strcmp(&luser[1], ruser) == 0);
  if (strcmp("+", luser) == 0)
    return 1;
  return strcmp(ruser, luser) == 0;
}


x86 assembly (clang, -O0):
<__icheckuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1178 <__icheckuser+0x58>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11ba <__icheckuser+0x9a>
mov    -0x10(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119e <__icheckuser+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11ba <__icheckuser+0x9a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__icheckuser>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    $0x1,%ebp
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1172 <__icheckuser+0x52>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1187 <__icheckuser+0x67>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
jmp    1187 <__icheckuser+0x67>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%rax
sbb    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
define i32 @__icheckuser(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strncmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %6, i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8*, i8** %5
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = sub nsw i32 0, %15
store i32 %16, i32* %3
br label %28
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %3
br label %28
22: ; preds = %17
%23 = load i8*, i8** %5
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %23, i8* %24)
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %22, %21, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
define i32 @__icheckuser(i8* %0, i8* %1) {
%3 = tail call i64 @strncmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i64 @strcmp(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = sext i1 %8 to i32
br label %17
10: ; preds = %2
%11 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %1, i8* %0)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %10, %13, %5
%18 = phi i32 [ %9, %5 ], [ %16, %13 ], [ 1, %10 ]
ret i32 %18
}