#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*/ ds_toggle_boolean(int /*<<< orphan*/, int);
char *snmp_in_toggle_options(char *options) {
  while (*options) {
    switch (*options++) {
    case 'R':
      ds_toggle_boolean(0, 14);
      break;
    case 'b':
      ds_toggle_boolean(0, 15);
      break;
    default:
      return options - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<snmp_in_toggle_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1195 <snmp_in_toggle_options+0x85>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x52,%eax
je     115d <snmp_in_toggle_options+0x4d>
jmp    114c <snmp_in_toggle_options+0x3c>
mov    -0x14(%rbp),%eax
sub    $0x62,%eax
je     116e <snmp_in_toggle_options+0x5e>
jmp    117f <snmp_in_toggle_options+0x6f>
xor    %edi,%edi
mov    $0xe,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1190 <snmp_in_toggle_options+0x80>
xor    %edi,%edi
mov    $0xf,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1190 <snmp_in_toggle_options+0x80>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    119d <snmp_in_toggle_options+0x8d>
jmp    111c <snmp_in_toggle_options+0xc>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_in_toggle_options>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114f <snmp_in_toggle_options+0x3f>
mov    %rdi,%rbx
jmp    1136 <snmp_in_toggle_options+0x26>
nop
lea    0x1(%rbx),%r14
xor    %edi,%edi
call   1030 <ds_toggle_boolean@plt>
movzbl 0x1(%rbx),%eax
mov    %r14,%rbx
test   %al,%al
je     114f <snmp_in_toggle_options+0x3f>
movsbl %al,%eax
mov    $0xe,%esi
cmp    $0x52,%eax
je     1120 <snmp_in_toggle_options+0x10>
cmp    $0x62,%eax
jne    1151 <snmp_in_toggle_options+0x41>
mov    $0xf,%esi
jmp    1120 <snmp_in_toggle_options+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @snmp_in_toggle_options(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
switch i32 %12, label %17 [
i32 82, label %13
i32 98, label %15
]
13: ; preds = %8
%14 = call i32 @ds_toggle_boolean(i32 0, i32 14)
br label %20
15: ; preds = %8
%16 = call i32 @ds_toggle_boolean(i32 0, i32 15)
br label %20
17: ; preds = %8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 -1
store i8* %19, i8** %2
br label %22
20: ; preds = %15, %13
br label %4
21: ; preds = %4
store i8* null, i8** %2
br label %22
22: ; preds = %21, %17
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @snmp_in_toggle_options(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %13, %10 ], [ %2, %1 ]
%6 = phi i8* [ %7, %10 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
switch i32 %8, label %15 [
i32 82, label %10
i32 98, label %9
]
9: ; preds = %4
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 15, %9 ], [ 14, %4 ]
%12 = tail call i32 @ds_toggle_boolean(i32 0, i32 %11)
%13 = load i8, i8* %7
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %10, %1
%16 = phi i8* [ null, %1 ], [ null, %10 ], [ %6, %4 ]
ret i8* %16
}