#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 *);
bool isopt(const char *opt1, const char *opt2, const char *user) {
  return (opt1 && (strcmp(opt1, user)) == 0) ||
         (opt2 && (strcmp(opt2, user) == 0));
}


x86 assembly (clang, -O0):
<isopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <isopt+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     117b <isopt+0x6b>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x1a(%rbp)
je     1175 <isopt+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isopt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
test   %rdi,%rdi
je     112c <isopt+0x1c>
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114d <isopt+0x3d>
test   %rbx,%rbx
je     1149 <isopt+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1152 <isopt+0x42>
xor    %eax,%eax
jmp    1152 <isopt+0x42>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isopt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %24, label %14
14: ; preds = %9, %3
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i64 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i64 %20, 0
br label %22
22: ; preds = %17, %14
%23 = phi i1 [ false, %14 ], [ %21, %17 ]
br label %24
24: ; preds = %22, %9
%25 = phi i1 [ true, %9 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isopt(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i64 @strcmp(i8* %0, i8* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5, %3
%9 = icmp eq i8* %1, null
br i1 %9, label %14, label %10
10: ; preds = %8
%11 = tail call i64 @strcmp(i8* %1, i8* %2)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %10, %5
%15 = phi i32 [ 1, %5 ], [ 0, %8 ], [ %13, %10 ]
ret i32 %15
}