#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*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, double, char);
int main() {
  int myNum = 53;
  char str[10] = {0};
  char fstr[30] = {0};
  itoa(myNum, str, 10);
  printf("%s\n", str);
  sprintf(fstr, "%i %.2f %c", 67, 89.45, 'r');
  printf("%s\n", fstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x35,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0xa,%edx
call   1060 <itoa@plt>
lea    -0x12(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x43,%edx
movsd  0xe51(%rip),%xmm0
mov    $0x72,%ecx
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x1e(%rsp)
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rbx
mov    $0x35,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1050 <itoa@plt>
lea    0xe99(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rsi
lea    0x10(%rsp),%rbx
movsd  0xe72(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x43,%edx
mov    $0x72,%ecx
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"%i %.2f %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = alloca [30 x i8]
store i32 0, i32* %1
store i32 53, i32* %2
%5 = bitcast [10 x i8]* %3 to i8*
%6 = bitcast [30 x i8]* %4 to i8*
%7 = load i32, i32* %2
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @itoa(i32 %7, i8* %8, i32 10)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%13 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 67, double 8.945000e+01, i8 signext 114)
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"%i %.2f %c\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 53, i8* %3, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 67, double 8.945000e+01, i8 signext 114)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}