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

/* Variables and functions */
int /*<<< orphan*/ ascii_wvalue(char *, int, int, unsigned int, unsigned int);
unsigned int message_putbuffer(struct message_data *, int /*<<< orphan*/,
                               char *, unsigned int);
unsigned int message_putvalue(struct message_data *data, int value,
                              unsigned int base, unsigned int padding,
                              unsigned int offset) {
  char num[1024];
  return message_putbuffer(data, ascii_wvalue(num, 1024, value, base, padding),
                           num, offset);
}


x86 assembly (clang, -O0):
<message_putvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x400,%esi
call   1030 <ascii_wvalue@plt>
mov    -0x428(%rbp),%rdi
mov    %eax,%esi
lea    -0x420(%rbp),%rdx
mov    -0x18(%rbp),%ecx
call   1040 <message_putbuffer@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message_putvalue>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %r8d,%ebp
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <ascii_wvalue@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <message_putbuffer@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.message_data = type { i32 }
define i32 @message_putvalue(%struct.message_data* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.message_data*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1024 x i8]
store %struct.message_data* %0, %struct.message_data** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.message_data*, %struct.message_data** %6
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = call i32 @ascii_wvalue(i8* %13, i32 1024, i32 %14, i32 %15, i32 %16)
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%19 = load i32, i32* %10
%20 = call i32 @message_putbuffer(%struct.message_data* %12, i32 %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.message_data = type { i32 }
define i32 @message_putvalue(%struct.message_data* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [1024 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = call i32 @ascii_wvalue(i8* %7, i32 1024, i32 %1, i32 %2, i32 %3)
%9 = call i32 @message_putbuffer(%struct.message_data* %0, i32 %8, i8* %7, i32 %4)
ret i32 %9
}