#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*/ gui_set_label_color(int, int, int);
void gui_update_live_mode(int mode) {
  int live;
  int kbtrans;
  switch (mode) {
  case 1:
    live = 1;
    kbtrans = 0;
    break;
  case 2:
    live = 0;
    kbtrans = 1;
    break;
  case 0:
  default:
    live = 0;
    kbtrans = 0;
    break;
  }
  if (live) {
    gui_set_label_color(5, 0xff00ffff, 0xff000000);
  } else {
    gui_set_label_color(5, 0xff009999, 0xff000000);
  }
  if (kbtrans) {
    gui_set_label_color(11, 0xffffff00, 0xff000000);
  } else {
    gui_set_label_color(11, 0xff999900, 0xff000000);
  }
}


x86 assembly (clang, -O0):
<gui_update_live_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1176 <gui_update_live_mode+0x66>
jmp    112e <gui_update_live_mode+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1150 <gui_update_live_mode+0x40>
jmp    113f <gui_update_live_mode+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1163 <gui_update_live_mode+0x53>
jmp    117b <gui_update_live_mode+0x6b>
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1189 <gui_update_live_mode+0x79>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    1189 <gui_update_live_mode+0x79>
jmp    117b <gui_update_live_mode+0x6b>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ac <gui_update_live_mode+0x9c>
mov    $0x5,%edi
mov    $0xff00ffff,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    11c0 <gui_update_live_mode+0xb0>
mov    $0x5,%edi
mov    $0xff009999,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
cmpl   $0x0,-0xc(%rbp)
je     11e3 <gui_update_live_mode+0xd3>
mov    $0xb,%edi
mov    $0xffffff00,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    11f7 <gui_update_live_mode+0xe7>
mov    $0xb,%edi
mov    $0xff999900,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_update_live_mode>:
push   %rbx
mov    $0xff009999,%esi
cmp    $0x2,%edi
je     112c <gui_update_live_mode+0x1c>
cmp    $0x1,%edi
jne    1125 <gui_update_live_mode+0x15>
mov    $0xff00ffff,%esi
mov    $0xff999900,%ebx
jmp    1131 <gui_update_live_mode+0x21>
mov    $0xffffff00,%ebx
mov    $0x5,%edi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
mov    $0xb,%edi
mov    %ebx,%esi
mov    $0xff000000,%edx
pop    %rbx
jmp    1030 <gui_set_label_color@plt>

LLVM IR (-O0):
define void @gui_update_live_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %9 [
i32 1, label %6
i32 2, label %7
i32 0, label %8
]
6: ; preds = %1
store i32 1, i32* %3
store i32 0, i32* %4
br label %10
7: ; preds = %1
store i32 0, i32* %3
store i32 1, i32* %4
br label %10
8: ; preds = %1
br label %9
9: ; preds = %1, %8
store i32 0, i32* %3
store i32 0, i32* %4
br label %10
10: ; preds = %9, %7, %6
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @gui_set_label_color(i32 5, i32 -16711681, i32 -16777216)
br label %17
15: ; preds = %10
%16 = call i32 @gui_set_label_color(i32 5, i32 -16737895, i32 -16777216)
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @gui_set_label_color(i32 11, i32 -256, i32 -16777216)
br label %24
22: ; preds = %17
%23 = call i32 @gui_set_label_color(i32 11, i32 -6711040, i32 -16777216)
br label %24
24: ; preds = %22, %20
ret void
}

LLVM IR (-O2):
define void @gui_update_live_mode(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %2
i32 2, label %5
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ -16711681, %2 ], [ -16737895, %1 ]
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -16737895, %1 ]
%7 = phi i32 [ -6711040, %3 ], [ -256, %1 ]
%8 = tail call i32 @gui_set_label_color(i32 5, i32 %6, i32 -16777216)
%9 = tail call i32 @gui_set_label_color(i32 11, i32 %7, i32 -16777216)
ret void
}