#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);
int /*<<< orphan*/ snmp_set_suffix_only(int);
char *snmp_out_toggle_options(char *options) {
  while (*options) {
    switch (*options++) {
    case 'n':
      ds_toggle_boolean(0, 9);
      break;
    case 'e':
      ds_toggle_boolean(0, 8);
      break;
    case 'b':
      ds_toggle_boolean(0, 10);
      break;
    case 'q':
      ds_toggle_boolean(0, 13);
      break;
    case 'f':
      ds_toggle_boolean(0, 12);
      break;
    case 's':
      snmp_set_suffix_only(1);
      break;
    case 'S':
      snmp_set_suffix_only(2);
      break;
    default:
      return options - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<snmp_out_toggle_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11fa <snmp_out_toggle_options+0xda>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
add    $0xffffffad,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x20,%eax
ja     11e4 <snmp_out_toggle_options+0xc4>
mov    -0x18(%rbp),%rax
lea    0xe98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
xor    %edi,%edi
mov    $0xc,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
mov    $0x1,%edi
call   1040 <snmp_set_suffix_only@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
mov    $0x2,%edi
call   1040 <snmp_set_suffix_only@plt>
jmp    11f5 <snmp_out_toggle_options+0xd5>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <snmp_out_toggle_options+0xe2>
jmp    112c <snmp_out_toggle_options+0xc>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_out_toggle_options>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     11b1 <snmp_out_toggle_options+0x91>
mov    %rdi,%rbx
lea    0xec8(%rip),%r14
jmp    1150 <snmp_out_toggle_options+0x30>
mov    $0x2,%edi
call   1040 <snmp_set_suffix_only@plt>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11b1 <snmp_out_toggle_options+0x91>
movsbl %al,%eax
add    $0xffffffad,%eax
cmp    $0x20,%eax
ja     11b3 <snmp_out_toggle_options+0x93>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1144 <snmp_out_toggle_options+0x24>
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1144 <snmp_out_toggle_options+0x24>
xor    %edi,%edi
mov    $0xc,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1144 <snmp_out_toggle_options+0x24>
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1144 <snmp_out_toggle_options+0x24>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <ds_toggle_boolean@plt>
jmp    1144 <snmp_out_toggle_options+0x24>
mov    $0x1,%edi
jmp    113f <snmp_out_toggle_options+0x1f>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @snmp_out_toggle_options(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %30, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %31
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 %27 [
i32 110, label %13
i32 101, label %15
i32 98, label %17
i32 113, label %19
i32 102, label %21
i32 115, label %23
i32 83, label %25
]
13: ; preds = %8
%14 = call i32 @ds_toggle_boolean(i32 0, i32 9)
br label %30
15: ; preds = %8
%16 = call i32 @ds_toggle_boolean(i32 0, i32 8)
br label %30
17: ; preds = %8
%18 = call i32 @ds_toggle_boolean(i32 0, i32 10)
br label %30
19: ; preds = %8
%20 = call i32 @ds_toggle_boolean(i32 0, i32 13)
br label %30
21: ; preds = %8
%22 = call i32 @ds_toggle_boolean(i32 0, i32 12)
br label %30
23: ; preds = %8
%24 = call i32 @snmp_set_suffix_only(i32 1)
br label %30
25: ; preds = %8
%26 = call i32 @snmp_set_suffix_only(i32 2)
br label %30
27: ; preds = %8
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 -1
store i8* %29, i8** %2
br label %32
30: ; preds = %25, %23, %21, %19, %17, %15, %13
br label %4
31: ; preds = %4
store i8* null, i8** %2
br label %32
32: ; preds = %31, %27
%33 = load i8*, i8** %2
ret i8* %33
}

LLVM IR (-O2):
define i8* @snmp_out_toggle_options(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1, %23
%5 = phi i8 [ %24, %23 ], [ %2, %1 ]
%6 = phi i8* [ %7, %23 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
switch i32 %8, label %26 [
i32 110, label %9
i32 101, label %11
i32 98, label %13
i32 113, label %15
i32 102, label %17
i32 115, label %19
i32 83, label %21
]
9: ; preds = %4
%10 = tail call i32 @ds_toggle_boolean(i32 0, i32 9)
br label %23
11: ; preds = %4
%12 = tail call i32 @ds_toggle_boolean(i32 0, i32 8)
br label %23
13: ; preds = %4
%14 = tail call i32 @ds_toggle_boolean(i32 0, i32 10)
br label %23
15: ; preds = %4
%16 = tail call i32 @ds_toggle_boolean(i32 0, i32 13)
br label %23
17: ; preds = %4
%18 = tail call i32 @ds_toggle_boolean(i32 0, i32 12)
br label %23
19: ; preds = %4
%20 = tail call i32 @snmp_set_suffix_only(i32 1)
br label %23
21: ; preds = %4
%22 = tail call i32 @snmp_set_suffix_only(i32 2)
br label %23
23: ; preds = %21, %19, %17, %15, %13, %11, %9
%24 = load i8, i8* %7
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %4
26: ; preds = %4, %23, %1
%27 = phi i8* [ null, %1 ], [ null, %23 ], [ %6, %4 ]
ret i8* %27
}