#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 main() {
  const char foo[] = "hello";
  const int bar = -55;
  const float zip = 12.3456789;
  printf("Some values: %d, \"%s\", %f, '%c', and %d.\n", 13, foo, zip, 'x',
         bar);
  printf("Variable precision: 1: %1f, 2: %2f, 3: %3f\n", zip, zip, zip);
  printf("A percent sign: %%.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xee7(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xee1(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0xffffffc9,-0x10(%rbp)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0xa(%rbp),%rdx
lea    0xec0(%rip),%rdi
mov    $0xd,%esi
movsd  0xea1(%rip),%xmm0
mov    $0x78,%ecx
mov    $0xffffffc9,%r8d
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
movsd  0xe80(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
lea    0xee8(%rip),%rdi
mov    %rsp,%rdx
movsd  0xecf(%rip),%xmm0
mov    $0xd,%esi
mov    $0x78,%ecx
mov    $0xffffffc9,%r8d
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
movsd  0xea9(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.foo = [6 x i8] c"hello\00"
@.str = [42 x i8] c"Some values: %d, \22%s\22, %f, '%c', and %d.\0A\00"
@.str.1 = [44 x i8] c"Variable precision: 1: %1f, 2: %2f, 3: %3f\0A\00"
@.str.2 = [21 x i8] c"A percent sign: %%.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
store i32 -55, i32* %3
store float 0x4028B0FCE0000000, float* %4
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 13, i8* %6, double 0x4028B0FCE0000000, i32 120, i32 -55)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double 0x4028B0FCE0000000, double 0x4028B0FCE0000000, double 0x4028B0FCE0000000)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.foo = [6 x i8] c"hello\00"
@.str = [42 x i8] c"Some values: %d, \22%s\22, %f, '%c', and %d.\0A\00"
@.str.1 = [44 x i8] c"Variable precision: 1: %1f, 2: %2f, 3: %3f\0A\00"
@.str.2 = [21 x i8] c"A percent sign: %%.\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 13, i8* %2, double 0x4028B0FCE0000000, i32 120, i32 -55)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double 0x4028B0FCE0000000, double 0x4028B0FCE0000000, double 0x4028B0FCE0000000)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}