#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 */
scalar_t__ marshal_hex(char *, size_t, size_t, char **, size_t *);
scalar_t__ marshal_string(char *, size_t, char const *, char **, size_t *);
int marshal_row(char *buffer, size_t len, const char *field_name,
                const char *type_name, const void *value, char **nbuffer,
                size_t *nlen) {
  int ret_val = 0;
  char *my_buffer;
  size_t my_len;
  ret_val += marshal_string(buffer, len, field_name, &my_buffer, &my_len);
  ret_val += marshal_string(my_buffer, my_len, "\t", &my_buffer, &my_len);
  ret_val += marshal_string(my_buffer, my_len, type_name, &my_buffer, &my_len);
  ret_val += marshal_string(my_buffer, my_len, "\t", &my_buffer, &my_len);
  ret_val += marshal_hex(my_buffer, my_len, (size_t)value, &my_buffer, &my_len);
  ret_val += marshal_string(my_buffer, my_len, "\n", nbuffer, nlen);
  return ret_val;
}


x86 assembly (clang, -O0):
<marshal_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1030 <marshal_string@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    0xe80(%rip),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1030 <marshal_string@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1030 <marshal_string@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    0xe31(%rip),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1030 <marshal_string@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1040 <marshal_hex@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x30(%rbp),%rcx
mov    0x10(%rbp),%r8
lea    0xddc(%rip),%rdx
call   1030 <marshal_string@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marshal_row>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,%rbp
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%r13
mov    %r14,%rcx
mov    %r13,%r8
call   1030 <marshal_string@plt>
mov    %rax,%r15
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1030 <marshal_string@plt>
mov    %rax,%r12
add    %r15d,%r12d
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1030 <marshal_string@plt>
mov    %rax,%rbp
add    %r12d,%ebp
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1030 <marshal_string@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1040 <marshal_hex@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
lea    0xe1f(%rip),%rdx
mov    0x20(%rsp),%rcx
mov    0x60(%rsp),%r8
call   1030 <marshal_string@plt>
add    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @marshal_row(i8* %0, i64 %1, i8* %2, i8* %3, i8* %4, i8** %5, i64* %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8**
%14 = alloca i64*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i64
store i8* %0, i8** %8
store i64 %1, i64* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8** %5, i8*** %13
store i64* %6, i64** %14
store i32 0, i32* %15
%18 = load i8*, i8** %8
%19 = load i64, i64* %9
%20 = load i8*, i8** %10
%21 = call i64 @marshal_string(i8* %18, i64 %19, i8* %20, i8** %16, i64* %17)
%22 = load i32, i32* %15
%23 = sext i32 %22 to i64
%24 = add nsw i64 %23, %21
%25 = trunc i64 %24 to i32
store i32 %25, i32* %15
%26 = load i8*, i8** %16
%27 = load i64, i64* %17
%28 = call i64 @marshal_string(i8* %26, i64 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %16, i64* %17)
%29 = load i32, i32* %15
%30 = sext i32 %29 to i64
%31 = add nsw i64 %30, %28
%32 = trunc i64 %31 to i32
store i32 %32, i32* %15
%33 = load i8*, i8** %16
%34 = load i64, i64* %17
%35 = load i8*, i8** %11
%36 = call i64 @marshal_string(i8* %33, i64 %34, i8* %35, i8** %16, i64* %17)
%37 = load i32, i32* %15
%38 = sext i32 %37 to i64
%39 = add nsw i64 %38, %36
%40 = trunc i64 %39 to i32
store i32 %40, i32* %15
%41 = load i8*, i8** %16
%42 = load i64, i64* %17
%43 = call i64 @marshal_string(i8* %41, i64 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %16, i64* %17)
%44 = load i32, i32* %15
%45 = sext i32 %44 to i64
%46 = add nsw i64 %45, %43
%47 = trunc i64 %46 to i32
store i32 %47, i32* %15
%48 = load i8*, i8** %16
%49 = load i64, i64* %17
%50 = load i8*, i8** %12
%51 = ptrtoint i8* %50 to i64
%52 = call i64 @marshal_hex(i8* %48, i64 %49, i64 %51, i8** %16, i64* %17)
%53 = load i32, i32* %15
%54 = sext i32 %53 to i64
%55 = add nsw i64 %54, %52
%56 = trunc i64 %55 to i32
store i32 %56, i32* %15
%57 = load i8*, i8** %16
%58 = load i64, i64* %17
%59 = load i8**, i8*** %13
%60 = load i64*, i64** %14
%61 = call i64 @marshal_string(i8* %57, i64 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %59, i64* %60)
%62 = load i32, i32* %15
%63 = sext i32 %62 to i64
%64 = add nsw i64 %63, %61
%65 = trunc i64 %64 to i32
store i32 %65, i32* %15
%66 = load i32, i32* %15
ret i32 %66
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @marshal_row(i8* %0, i64 %1, i8* %2, i8* %3, i8* %4, i8** %5, i64* %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = bitcast i8** %8 to i8*
%11 = bitcast i64* %9 to i8*
%12 = call i64 @marshal_string(i8* %0, i64 %1, i8* %2, i8** %8, i64* %9)
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = call i64 @marshal_string(i8* %13, i64 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8, i64* %9)
%16 = add i64 %15, %12
%17 = load i8*, i8** %8
%18 = load i64, i64* %9
%19 = call i64 @marshal_string(i8* %17, i64 %18, i8* %3, i8** %8, i64* %9)
%20 = add i64 %16, %19
%21 = load i8*, i8** %8
%22 = load i64, i64* %9
%23 = call i64 @marshal_string(i8* %21, i64 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8, i64* %9)
%24 = add i64 %20, %23
%25 = load i8*, i8** %8
%26 = load i64, i64* %9
%27 = ptrtoint i8* %4 to i64
%28 = call i64 @marshal_hex(i8* %25, i64 %26, i64 %27, i8** %8, i64* %9)
%29 = add i64 %24, %28
%30 = load i8*, i8** %8
%31 = load i64, i64* %9
%32 = call i64 @marshal_string(i8* %30, i64 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %5, i64* %6)
%33 = add i64 %29, %32
%34 = trunc i64 %33 to i32
ret i32 %34
}