#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 DeviceConfigurationMessage {
  int dummy;
};

/* Variables and functions */
int DeviceConfigurationMessage_write_delimited_to(
    struct DeviceConfigurationMessage *, void *, int);
int write_raw_varint32(int, void *, int);
int DeviceConfigurationMessage_write_with_tag(
    struct DeviceConfigurationMessage *_DeviceConfigurationMessage,
    void *_buffer, int offset, int tag) {
  offset = write_raw_varint32((tag << 3) + 2, _buffer, offset);
  offset = DeviceConfigurationMessage_write_delimited_to(
      _DeviceConfigurationMessage, _buffer, offset);
  return offset;
}


x86 assembly (clang, -O0):
<DeviceConfigurationMessage_write_with_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
shl    $0x3,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <DeviceConfigurationMessage_write_delimited_to@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeviceConfigurationMessage_write_with_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x2(,%rcx,8),%edi
call   1030 <write_raw_varint32@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <DeviceConfigurationMessage_write_delimited_to@plt>

LLVM IR (-O0):
%struct.DeviceConfigurationMessage = type { i32 }
define i32 @DeviceConfigurationMessage_write_with_tag(%struct.DeviceConfigurationMessage* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.DeviceConfigurationMessage*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.DeviceConfigurationMessage* %0, %struct.DeviceConfigurationMessage** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = shl i32 %9, 3
%11 = add nsw i32 %10, 2
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @write_raw_varint32(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %7
%15 = load %struct.DeviceConfigurationMessage*, %struct.DeviceConfigurationMessage** %5
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @DeviceConfigurationMessage_write_delimited_to(%struct.DeviceConfigurationMessage* %15, i8* %16, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
%struct.DeviceConfigurationMessage = type { i32 }
define i32 @DeviceConfigurationMessage_write_with_tag(%struct.DeviceConfigurationMessage* %0, i8* %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 3
%6 = or i32 %5, 2
%7 = tail call i32 @write_raw_varint32(i32 %6, i8* %1, i32 %2)
%8 = tail call i32 @DeviceConfigurationMessage_write_delimited_to(%struct.DeviceConfigurationMessage* %0, i8* %1, i32 %7)
ret i32 %8
}