#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*/ snprintf(char *, int, char *);
int main() {
  volatile char c = '0';
  volatile int x = 12;
  volatile float f = 1.239;
  volatile char s[] = "34";
  printf("%c %d %.3f %s\n", c, x, f, s);
  char buf[4];
  snprintf(buf, 1000, "qwe");
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
movl   $0xc,-0xc(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x13(%rbp),%rax
mov    0xeb5(%rip),%cl
mov    %cl,0x2(%rax)
mov    0xea9(%rip),%cx
mov    %cx,(%rax)
mov    -0x5(%rbp),%al
movsbl %al,%esi
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    -0x13(%rbp),%rcx
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x17(%rbp),%rdi
mov    $0x3e8,%esi
lea    0xe84(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x17(%rbp),%rsi
lea    0xe70(%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
movb   $0x30,0xf(%rsp)
movl   $0xc,0x18(%rsp)
movl   $0x3f9e978d,0x14(%rsp)
3f
mov    0xeb2(%rip),%al
mov    %al,0x12(%rsp)
movzwl 0xea5(%rip),%eax
mov    %ax,0x10(%rsp)
movsbl 0xf(%rsp),%esi
mov    0x18(%rsp),%edx
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rdi
lea    0x10(%rsp),%rcx
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdx
lea    0x1c(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"34\00"
@.str = [15 x i8] c"%c %d %.3f %s\0A\00"
@.str.1 = [4 x i8] c"qwe\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca [3 x i8]
%5 = alloca [4 x i8]
store volatile i8 48, i8* %1
%6 = bitcast i32* %2 to i8*
store volatile i32 12, i32* %2
%7 = bitcast float* %3 to i8*
store volatile float 0x3FF3D2F1A0000000, float* %3
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%9 = load volatile i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load volatile i32, i32* %2
%12 = load volatile float, float* %3
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, double %13, i8* %8)
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%16 = call i32 @snprintf(i8* %15, i32 1000, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @puts(i8* %15)
ret i32 0
}