#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*/ free(char *);
char *roadmap_lang_get(char *);
scalar_t__ roadmap_mood_get();
char *roadmap_mood_get_name();
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ ssd_dialog_change_button(char *, char const **, int);
int /*<<< orphan*/ ssd_dialog_change_text(char *, char *);
void on_mood_changed(void) {
  char *icon[2];
  char mood_txt[100];
  icon[0] = (char *)roadmap_mood_get();
  icon[1] = NULL;
  ssd_dialog_change_button(roadmap_lang_get("Mood"), (const char **)&icon[0],
                           1);
  sprintf(mood_txt, "%s: %s", roadmap_lang_get("My mood"),
          roadmap_lang_get(roadmap_mood_get_name()));
  ssd_dialog_change_text("Mood Text", mood_txt);
  free(icon[0]);
}


x86 assembly (clang, -O0):
<on_mood_changed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    $0x0,%al
call   1070 <roadmap_mood_get@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    0xe6b(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
mov    %rax,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1060 <ssd_dialog_change_button@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    0xe4f(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
mov    %rax,-0x88(%rbp)
mov    $0x0,%al
call   1090 <roadmap_mood_get_name@plt>
mov    %rax,%rdi
call   1030 <roadmap_lang_get@plt>
mov    -0x90(%rbp),%rdi
mov    -0x88(%rbp),%rdx
mov    %rax,%rcx
lea    0xe15(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe14(%rip),%rdi
call   1050 <ssd_dialog_change_text@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_mood_changed>:
push   %r14
push   %rbx
sub    $0x78,%rsp
xor    %eax,%eax
call   1070 <roadmap_mood_get@plt>
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe6e(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0x1,%edx
call   1060 <ssd_dialog_change_button@plt>
lea    0xe5e(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1090 <roadmap_mood_get_name@plt>
mov    %rax,%rdi
call   1030 <roadmap_lang_get@plt>
lea    0xe39(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1080 <sprintf@plt>
lea    0xe2e(%rip),%rdi
mov    %r14,%rsi
call   1050 <ssd_dialog_change_text@plt>
mov    (%rsp),%rdi
call   1040 <free@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Mood\00"
@.str.1 = [7 x i8] c"%s: %s\00"
@.str.2 = [8 x i8] c"My mood\00"
@.str.3 = [10 x i8] c"Mood Text\00"
define void @on_mood_changed() {
%1 = alloca [2 x i8*]
%2 = alloca [100 x i8]
%3 = call i64 (...) @roadmap_mood_get()
%4 = inttoptr i64 %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* %4, i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %6
%7 = call i8* @roadmap_lang_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%9 = call i32 @ssd_dialog_change_button(i8* %7, i8** %8, i32 1)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i8* @roadmap_lang_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i8* (...) @roadmap_mood_get_name()
%13 = call i8* @roadmap_lang_get(i8* %12)
%14 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%16 = call i32 @ssd_dialog_change_text(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Mood\00"
@.str.1 = [7 x i8] c"%s: %s\00"
@.str.2 = [8 x i8] c"My mood\00"
@.str.3 = [10 x i8] c"Mood Text\00"
define void @on_mood_changed() {
%1 = alloca [2 x i8*]
%2 = alloca [100 x i8]
%3 = bitcast [2 x i8*]* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i64 (...) @roadmap_mood_get()
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* %6, i8** %7
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %8
%9 = tail call i8* @roadmap_lang_get(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @ssd_dialog_change_button(i8* %9, i8** %7, i32 1)
%11 = call i8* @roadmap_lang_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i8* (...) @roadmap_mood_get_name()
%13 = call i8* @roadmap_lang_get(i8* %12)
%14 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %13)
%15 = call i32 @ssd_dialog_change_text(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%16 = load i8*, i8** %7
%17 = call i32 @free(i8* %16)
ret void
}