#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*/ iface_set_status(char *);
int /*<<< orphan*/ iface_update_show_format();
int /*<<< orphan*/ option_set_int(char *, int);
int /*<<< orphan*/ options_get_int(char *);
void toggle_show_format() {
  int show_format = !options_get_int("ShowFormat");
  option_set_int("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
call   1060 <options_get_int@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1040 <option_set_int@plt>
cmpl   $0x0,-0x4(%rbp)
je     118e <toggle_show_format+0x4e>
lea    0xe87(%rip),%rdi
call   1050 <iface_set_status@plt>
jmp    119a <toggle_show_format+0x5a>
lea    0xe86(%rip),%rdi
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
call   1060 <options_get_int@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xea9(%rip),%rax
lea    0xeb2(%rip),%rbx
cmove  %rax,%rbx
mov    %r14,%rdi
call   1040 <option_set_int@plt>
mov    %rbx,%rdi
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 i32
%2 = call i32 @options_get_int(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 i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @option_set_int(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @iface_set_status(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @iface_set_status(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = 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 @options_get_int(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 @option_set_int(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 @iface_set_status(i8* %5)
%7 = tail call i32 (...) @iface_update_show_format()
ret void
}