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

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char volatile, int volatile, float volatile,
                          char volatile *);
int main() {
  volatile char c = '0';
  volatile int x = 12;
  volatile float f = 1.239;
  volatile char s[] = "34";
  volatile char fmt[2];
  memcpy((char *)fmt, "%c %d %f %s\n", sizeof(fmt));
  printf((char *)fmt, c, x, f, s);
  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)
lea    -0x15(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
lea    -0x15(%rbp),%rdi
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
lea    -0x13(%rbp),%rcx
movsbl %al,%esi
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    0xec2(%rip),%al
mov    %al,0x12(%rsp)
movzwl 0xeb5(%rip),%eax
mov    %ax,0x10(%rsp)
lea    0xeac(%rip),%rsi
lea    0x1e(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
movsbl 0xf(%rsp),%esi
mov    0x18(%rsp),%edx
movss  0x14(%rsp),%xmm0
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [3 x i8] c"34\00"
@.str = [13 x i8] c"%c %d %f %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 [2 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 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%9 = call i32 @memcpy(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%11 = load volatile i8, i8* %2
%12 = load volatile i32, i32* %3
%13 = load volatile float, float* %4
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%15 = call i32 @printf(i8* %10, i8 signext %11, i32 %12, float %13, i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"34\00"
@.str = [13 x i8] c"%c %d %f %s\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca [3 x i8]
%5 = alloca [2 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 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%10 = call i32 @memcpy(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = load volatile i8, i8* %1
%12 = load volatile i32, i32* %2
%13 = load volatile float, float* %3
%14 = call i32 @printf(i8* %9, i8 signext %11, i32 %12, float %13, i8* %8)
ret i32 0
}