#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long long);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_repr(char *, int, int /*<<< orphan*/ *);
int sss_val(void *ctx, char *val, int vallen, long long val_expire) {
  FILE *fp = ctx;
  fputs("{\"data\":", fp);
  fwrite_repr(val, vallen, fp);
  fprintf(fp, ",\"expire\":%lld},", val_expire);
  return 0;
}


x86 assembly (clang, -O0):
<sss_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1050 <fwrite_repr@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sss_val>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xeb6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %rbp,%rdx
call   1050 <fwrite_repr@plt>
lea    0xe98(%rip),%rsi
mov    %rbp,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"{\22data\22:\00"
@.str.1 = [17 x i8] c",\22expire\22:%lld},\00"
define i32 @sss_val(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %9
%17 = call i32 @fwrite_repr(i8* %14, i32 %15, i32* %16)
%18 = load i32*, i32** %9
%19 = load i64, i64* %8
%20 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"{\22data\22:\00"
@.str.1 = [17 x i8] c",\22expire\22:%lld},\00"
define i32 @sss_val(i8* %0, i8* %1, i32 %2, i64 %3) {
%5 = bitcast i8* %0 to i32*
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %5)
%7 = tail call i32 @fwrite_repr(i8* %1, i32 %2, i32* %5)
%8 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret i32 0
}