void toggle_show_format() {
  _Bool show_format = !options_get_bool("ShowFormat");
  options_set_bool("ShowFormat", show_format);
  if (show_format)
    iface_set_status("ShowFormat: yes");
  else
    iface_set_status("ShowFormat: no");
  iface_update_show_format();
}


x86 assembly (clang, -O0):
<toggle_show_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1060 <options_get_bool@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <options_set_bool@plt>
testb  $0x1,-0x1(%rbp)
je     1196 <toggle_show_format+0x56>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <iface_set_status@plt>
jmp    11a4 <toggle_show_format+0x64>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1050 <iface_set_status@plt>
mov    $0x0,%al
call   1030 <iface_update_show_format@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_show_format>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <options_get_bool@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xea7(%rip),%rax
lea    0xeb0(%rip),%rbx
cmove  %rax,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <options_set_bool@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <iface_set_status@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <iface_update_show_format@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ShowFormat\00"
@.str.1 = [16 x i8] c"ShowFormat: yes\00"
@.str.2 = [15 x i8] c"ShowFormat: no\00"
define void @toggle_show_format() {
%1 = alloca i8
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @options_get_bool to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = trunc i8 %6 to i1
%8 = zext i1 %7 to i32
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @options_set_bool to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %1
%11 = trunc i8 %10 to i1
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @iface_set_status to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @iface_set_status to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = call i32 (...) @iface_update_show_format()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ShowFormat\00"
@.str.1 = [16 x i8] c"ShowFormat: yes\00"
@.str.2 = [15 x i8] c"ShowFormat: no\00"
define void @toggle_show_format() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @options_get_bool to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @options_set_bool to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @iface_set_status to i32 (i8*, ...)*)(i8* %5)
%7 = tail call i32 (...) @iface_update_show_format()
ret void
}