#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(int, char *);
int /*<<< orphan*/ gui_set_label_color(int, int, int);
int /*<<< orphan*/ midi_clock_is_ext_synced();
void gui_update_clock_source(int source) {
  switch (source) {
  case -1:
    gui_set_label(12, "INT");
    gui_set_label_color(12, 0xffeeeeee, 0xff000000);
    break;
  default:
    gui_set_label(12, "EXT");
    if (midi_clock_is_ext_synced()) {
      gui_set_label_color(12, 0xff00ff00, 0xff000000);
    } else {
      gui_set_label_color(12, 0xff666666, 0xff000000);
    }
    break;
  }
}


x86 assembly (clang, -O0):
<gui_update_clock_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xffffffff,%eax
jne    1176 <gui_update_clock_source+0x46>
jmp    114c <gui_update_clock_source+0x1c>
mov    $0xc,%edi
lea    0xea8(%rip),%rsi
call   1040 <gui_set_label@plt>
mov    $0xc,%edi
mov    $0xffeeeeee,%esi
mov    $0xff000000,%edx
call   1050 <gui_set_label_color@plt>
jmp    11c9 <gui_update_clock_source+0x99>
mov    $0xc,%edi
lea    0xe82(%rip),%rsi
call   1040 <gui_set_label@plt>
mov    $0x0,%al
call   1030 <midi_clock_is_ext_synced@plt>
cmp    $0x0,%eax
je     11b0 <gui_update_clock_source+0x80>
mov    $0xc,%edi
mov    $0xff00ff00,%esi
mov    $0xff000000,%edx
call   1050 <gui_set_label_color@plt>
jmp    11c4 <gui_update_clock_source+0x94>
mov    $0xc,%edi
mov    $0xff666666,%esi
mov    $0xff000000,%edx
call   1050 <gui_set_label_color@plt>
jmp    11c9 <gui_update_clock_source+0x99>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_update_clock_source>:
push   %rax
cmp    $0xffffffff,%edi
je     115f <gui_update_clock_source+0x2f>
lea    0xec7(%rip),%rsi
mov    $0xc,%edi
call   1040 <gui_set_label@plt>
xor    %eax,%eax
call   1030 <midi_clock_is_ext_synced@plt>
test   %eax,%eax
mov    $0xff666666,%eax
mov    $0xff00ff00,%esi
cmove  %eax,%esi
jmp    1175 <gui_update_clock_source+0x45>
lea    0xe9a(%rip),%rsi
mov    $0xc,%edi
call   1040 <gui_set_label@plt>
mov    $0xffeeeeee,%esi
mov    $0xc,%edi
mov    $0xff000000,%edx
pop    %rax
jmp    1050 <gui_set_label_color@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"INT\00"
@.str.1 = [4 x i8] c"EXT\00"
define void @gui_update_clock_source(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 -1, label %4
]
4: ; preds = %1
%5 = call i32 @gui_set_label(i32 12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gui_set_label_color(i32 12, i32 -1118482, i32 -16777216)
br label %16
7: ; preds = %1
%8 = call i32 @gui_set_label(i32 12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @midi_clock_is_ext_synced()
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @gui_set_label_color(i32 12, i32 -16711936, i32 -16777216)
br label %15
13: ; preds = %7
%14 = call i32 @gui_set_label_color(i32 12, i32 -10066330, i32 -16777216)
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"INT\00"
@.str.1 = [4 x i8] c"EXT\00"
define void @gui_update_clock_source(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @gui_set_label(i32 12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = tail call i32 @gui_set_label(i32 12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @midi_clock_is_ext_synced()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 -10066330, i32 -16711936
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ -1118482, %3 ], [ %9, %5 ]
%12 = tail call i32 @gui_set_label_color(i32 12, i32 %11, i32 -16777216)
ret void
}