#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 *);
int arg_is(const char *arg, const char *sarg, const char *larg) {
  if (sarg && (strcmp(arg, sarg) == 0))
    return 1;
  if (larg && (strcmp(arg, larg) == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<arg_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <arg_is+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <arg_is+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1187 <arg_is+0x77>
cmpq   $0x0,-0x20(%rbp)
je     1180 <arg_is+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1180 <arg_is+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1187 <arg_is+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_is>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     112c <arg_is+0x1c>
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1145 <arg_is+0x35>
test   %rbx,%rbx
je     1141 <arg_is+0x31>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1145 <arg_is+0x35>
xor    %eax,%eax
jmp    114a <arg_is+0x3a>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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