#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*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, char, float);
main() {
  int i = 10;
  char ch = 'A';
  float a = 3.14;
  char str[20];
  printf("\n%d %c %f", i, ch, a);
  sprintf(str, "%d %c %f", i, ch, a);
  printf("\n%s", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
movsbl -0x5(%rbp),%edx
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x5(%rbp),%al
movss  -0xc(%rbp),%xmm0
lea    0xe91(%rip),%rsi
movsbl %al,%ecx
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xee0(%rip),%rdi
movsd  0xecc(%rip),%xmm0
mov    $0xa,%esi
mov    $0x41,%edx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
movss  0xeb1(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x41,%ecx
call   1040 <sprintf@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0A%d %c %f\00"
@.str.1 = [9 x i8] c"%d %c %f\00"
@.str.2 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca [20 x i8]
store i32 10, i32* %1
store i8 65, i8* %2
store float 0x40091EB860000000, float* %3
%5 = load i32, i32* %1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, double %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %1
%13 = load i8, i8* %2
%14 = load float, float* %3
%15 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8 signext %13, float %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A%d %c %f\00"
@.str.1 = [9 x i8] c"%d %c %f\00"
@.str.2 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 65, double 0x40091EB860000000)
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 10, i8 signext 65, float 0x40091EB860000000)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}