#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 */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ smp_sio_float2string(char *, float);
int /*<<< orphan*/ smp_sio_int2string(char *, int);
int /*<<< orphan*/ smp_sio_strcat(char *, char *, char *);
int smp_test_sio_sprinf() {
  int i = 1314;
  float f = 1313.13124;
  char buf[128] = {'\0'};
  smp_sio_int2string(buf, i);
  printf("%s\n", buf);
  memset(buf, '\0', 128);
  smp_sio_float2string(buf, f);
  printf("%s\n", buf);
  memset(buf, '\0', 128);
  smp_sio_strcat(buf, "gggdfv", "sjsbv");
  printf("%s\n", buf);
  return (0);
}


x86 assembly (clang, -O0):
<smp_test_sio_sprinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x522,-0x4(%rbp)
movss  0xe96(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <smp_sio_int2string@plt>
lea    -0x90(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
movss  -0x8(%rbp),%xmm0
call   1060 <smp_sio_float2string@plt>
lea    -0x90(%rbp),%rsi
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xe0c(%rip),%rsi
lea    0xe0c(%rip),%rdx
call   1070 <smp_sio_strcat@plt>
lea    -0x90(%rbp),%rsi
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_sio_sprinf>:
push   %r14
push   %rbx
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x522,%esi
call   1050 <smp_sio_int2string@plt>
lea    0xe69(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
movss  0xe43(%rip),%xmm0
mov    %rbx,%rdi
call   1060 <smp_sio_float2string@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    0xe22(%rip),%rsi
lea    0xe22(%rip),%rdx
mov    %rbx,%rdi
call   1070 <smp_sio_strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"gggdfv\00"
@.str.2 = [6 x i8] c"sjsbv\00"
define i32 @smp_test_sio_sprinf() {
%1 = alloca i32
%2 = alloca float
%3 = alloca [128 x i8]
store i32 1314, i32* %1
store float 0x4094848660000000, float* %2
%4 = bitcast [128 x i8]* %3 to i8*
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %1
%7 = call i32 @smp_sio_int2string(i8* %5, i32 %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i8 signext 0, i32 128)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%13 = load float, float* %2
%14 = call i32 @smp_sio_float2string(i8* %12, float %13)
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i8 signext 0, i32 128)
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%20 = call i32 @smp_sio_strcat(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"gggdfv\00"
@.str.2 = [6 x i8] c"sjsbv\00"
define i32 @smp_test_sio_sprinf() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @smp_sio_int2string(i8* %2, i32 1314)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @memset(i8* %2, i8 signext 0, i32 128)
%6 = call i32 @smp_sio_float2string(i8* %2, float 0x4094848660000000)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @memset(i8* %2, i8 signext 0, i32 128)
%9 = call i32 @smp_sio_strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}