#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*/ wchar_t;
struct stfl_widget {
  int dummy;
};
struct stfl_kv {
  int dummy;
};

/* Variables and functions */
struct stfl_kv *stfl_widget_setkv_str(struct stfl_widget *,
                                      int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ swprintf(int /*<<< orphan*/ *, int, char *, int);
extern struct stfl_kv *stfl_widget_setkv_int(struct stfl_widget *w,
                                             const wchar_t *key, int value) {
  wchar_t newtext[64];
  swprintf(newtext, 64, L"%d", value);
  return stfl_widget_setkv_str(w, key, newtext);
}


x86 assembly (clang, -O0):
<stfl_widget_setkv_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x40,%esi
lea    0xeb4(%rip),%rdx
call   1030 <swprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x120(%rbp),%rdx
call   1040 <stfl_widget_setkv_str@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stfl_widget_setkv_int>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec5(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x40,%esi
call   1030 <swprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <stfl_widget_setkv_str@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.stfl_kv = type { i32 }
%struct.stfl_widget = type { i32 }
@.str = [3 x i32] [i32 37, i32 100, i32 0]
define %struct.stfl_kv* @stfl_widget_setkv_int(%struct.stfl_widget* %0, i32* %1, i32 %2) {
%4 = alloca %struct.stfl_widget*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [64 x i32]
store %struct.stfl_widget* %0, %struct.stfl_widget** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @swprintf(i32* %8, i32 64, i8* bitcast ([3 x i32]* @.str to i8*), i32 %9)
%11 = load %struct.stfl_widget*, %struct.stfl_widget** %4
%12 = load i32*, i32** %5
%13 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 0, i64 0
%14 = call %struct.stfl_kv* @stfl_widget_setkv_str(%struct.stfl_widget* %11, i32* %12, i32* %13)
ret %struct.stfl_kv* %14
}

LLVM IR (-O2):
%struct.stfl_kv = type { i32 }
%struct.stfl_widget = type { i32 }
@.str = [3 x i32] [i32 37, i32 100, i32 0]
define %struct.stfl_kv* @stfl_widget_setkv_int(%struct.stfl_widget* %0, i32* %1, i32 %2) {
%4 = alloca [64 x i32]
%5 = bitcast [64 x i32]* %4 to i8*
%6 = getelementptr inbounds [64 x i32], [64 x i32]* %4, i64 0, i64 0
%7 = call i32 @swprintf(i32* %6, i32 64, i8* bitcast ([3 x i32]* @.str to i8*), i32 %2)
%8 = call %struct.stfl_kv* @stfl_widget_setkv_str(%struct.stfl_widget* %0, i32* %1, i32* %6)
ret %struct.stfl_kv* %8
}