#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 */
typedef int /*<<< orphan*/ new_item_time_text;
typedef int /*<<< orphan*/ item_time_text;

/* Variables and functions */
int /*<<< orphan*/ config_get_item_time(char *, int);
int /*<<< orphan*/ gui_bar_item_update(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
scalar_t__ strcmp(char *, char *);
int gui_bar_item_timer_cb(const void *pointer, void *data,
                          int remaining_calls) {
  static char item_time_text[128] = {'\0'};
  char new_item_time_text[128];
  (void)data;
  (void)remaining_calls;
  config_get_item_time(new_item_time_text, sizeof(new_item_time_text));
  if (strcmp(new_item_time_text, item_time_text) != 0) {
    snprintf(item_time_text, sizeof(item_time_text), "%s", new_item_time_text);
    gui_bar_item_update((char *)pointer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<gui_bar_item_timer_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    $0x80,%esi
call   1030 <config_get_item_time@plt>
lea    -0xa0(%rbp),%rdi
lea    0x2edb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11ac <gui_bar_item_timer_cb+0x6c>
lea    -0xa0(%rbp),%rcx
lea    0x2ebe(%rip),%rdi
mov    $0x80,%esi
lea    0xe62(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gui_bar_item_update@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_bar_item_timer_cb>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <config_get_item_time@plt>
lea    0x2eec(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1194 <gui_bar_item_timer_cb+0x54>
lea    0x2ed8(%rip),%rdi
lea    0xe81(%rip),%rdx
mov    %rsp,%rcx
mov    $0x80,%esi
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1040 <gui_bar_item_update@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@gui_bar_item_timer_cb.item_time_text = internal global [128 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i32 @gui_bar_item_timer_cb(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [128 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%11 = call i32 @config_get_item_time(i8* %10, i32 128)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gui_bar_item_timer_cb.item_time_text, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%17 = call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gui_bar_item_timer_cb.item_time_text, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @gui_bar_item_update(i8* %18)
br label %20
20: ; preds = %15, %3
ret i32 0
}

LLVM IR (-O2):
@gui_bar_item_timer_cb.item_time_text = internal global [128 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i32 @gui_bar_item_timer_cb(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @config_get_item_time(i8* %5, i32 128)
%7 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gui_bar_item_timer_cb.item_time_text, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gui_bar_item_timer_cb.item_time_text, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%11 = call i32 @gui_bar_item_update(i8* %0)
br label %12
12: ; preds = %9, %3
ret i32 0
}