#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 option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
struct option *options_find(struct option *, char const *);
int options_set(struct option *, char const *);
int /*<<< orphan*/ stderr;
int options_try_pair(struct option *ops, const char *name, const char *value) {
  struct option *o;
  if (0 == (o = options_find(ops, name))) {
    fprintf(stderr, "Option '%s' does not exist.\n", name);
    return 0;
  }
  return options_set(o, value);
}


x86 assembly (clang, -O0):
<options_try_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <options_find@plt>
mov    %rax,%rcx
mov    %rcx,-0x28(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1188 <options_try_pair+0x58>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1198 <options_try_pair+0x68>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <options_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_try_pair>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <options_find@plt>
test   %rax,%rax
je     1156 <options_try_pair+0x26>
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <options_set@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.option = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"Option '%s' does not exist.\0A\00"
define i32 @options_try_pair(%struct.option* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.option*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.option*
store %struct.option* %0, %struct.option** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load %struct.option*, %struct.option** %5
%10 = load i8*, i8** %6
%11 = call %struct.option* @options_find(%struct.option* %9, i8* %10)
store %struct.option* %11, %struct.option** %8
%12 = icmp eq %struct.option* null, %11
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 0, i32* %4
br label %21
17: ; preds = %3
%18 = load %struct.option*, %struct.option** %8
%19 = load i8*, i8** %7
%20 = call i32 @options_set(%struct.option* %18, i8* %19)
store i32 %20, i32* %4
br label %21
21: ; preds = %17, %13
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.option = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"Option '%s' does not exist.\0A\00"
define i32 @options_try_pair(%struct.option* %0, i8* %1, i8* %2) {
%4 = tail call %struct.option* @options_find(%struct.option* %0, i8* %1)
%5 = icmp eq %struct.option* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %11
9: ; preds = %3
%10 = tail call i32 @options_set(%struct.option* %4, i8* %2)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ 0, %6 ], [ %10, %9 ]
ret i32 %12
}